@cardenelabs/dragon 0.36.3 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,4 +5,4 @@ function ucs2length(str) {
5
5
  for (const _ of str) length++;
6
6
  return length;
7
7
  }
8
- export const validate = validate10;export default validate10;const schema11 = {"title":"dragon の図の原本","description":"区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。","type":"object","additionalProperties":false,"required":["version","kind","title","boxes","steps"],"properties":{"version":{"description":"形式の版","type":"integer","minimum":1},"kind":{"description":"図の種類","enum":["sequence","architecture"]},"title":{"$ref":"#/definitions/text"},"view":{"description":"見せ方。書かなければ字の大きさで選ぶ。fixed は全体を止めて中だけ動かし、follow は寄って動かし全体図で今どこかを示す","enum":["fixed","follow"]},"regions":{"type":"array","items":{"$ref":"#/definitions/region"}},"boxes":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/box"}},"strip":{"$ref":"#/definitions/strip"},"steps":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/step"}},"sequence":{"$ref":"#/definitions/sequence"}},"if":{"required":["kind"],"properties":{"kind":{"const":"sequence"}}},"then":{"required":["sequence"]},"else":{"not":{"required":["sequence"]}},"definitions":{"text":{"type":"string","minLength":1},"id":{"type":"string","pattern":"^[^\\s\\[\\]「」=:]+$"},"color":{"enum":["blue","amber","green","violet","rose","slate","coin"]},"region":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"note":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"}}},"box":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"sub":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"},"region":{"$ref":"#/definitions/id"}}},"strip":{"type":"object","additionalProperties":false,"required":["title","fields"],"properties":{"title":{"$ref":"#/definitions/text"},"fields":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/text"}}}},"step":{"type":"object","additionalProperties":false,"required":["title","body","events"],"properties":{"title":{"$ref":"#/definitions/text"},"body":{"$ref":"#/definitions/text"},"code":{"$ref":"#/definitions/text"},"events":{"type":"array","items":{"$ref":"#/definitions/event"}}}},"event":{"description":"段の中で起きること。起きる順に並べる","type":"object","required":["type"],"discriminator":{"propertyName":"type"},"oneOf":[{"description":"線。運ぶ物を載せて送る側から受ける側へ走る","type":"object","additionalProperties":false,"required":["type","from","to","carry"],"properties":{"type":{"const":"edge"},"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"},"carry":{"$ref":"#/definitions/carry"},"labelSide":{"description":"線の名前を置く側 (寄せの指示)","enum":["above","below","left","right"]}}},{"description":"箱の中の処理","type":"object","additionalProperties":false,"required":["type","box","label"],"properties":{"type":{"const":"action"},"box":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}},{"description":"箱の下の小さな字の書き換え","type":"object","additionalProperties":false,"required":["type","box","text"],"properties":{"type":{"const":"swap"},"box":{"$ref":"#/definitions/id"},"text":{"$ref":"#/definitions/text"}}},{"description":"中身の帯の欄の値と札","type":"object","additionalProperties":false,"required":["type","field"],"anyOf":[{"required":["value"]},{"required":["tag"]}],"properties":{"type":{"const":"strip"},"field":{"$ref":"#/definitions/text"},"value":{"$ref":"#/definitions/text"},"tag":{"$ref":"#/definitions/text"}}}]},"carry":{"description":"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["envelope","tag","coin","none"]},"text":{"$ref":"#/definitions/text"}},"if":{"required":["kind"],"properties":{"kind":{"const":"tag"}}},"then":{"required":["text"]},"else":{"not":{"required":["text"]}}},"sequence":{"description":"時系列図の種類の欄。生存線を左から並べる順","type":"object","additionalProperties":false,"required":["lifelines"],"properties":{"lifelines":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/id"}}}}}};const schema12 = {"type":"string","minLength":1};const func2 = Object.prototype.hasOwnProperty;const func3 = ucs2length;const schema13 = {"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"note":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"}}};const schema14 = {"type":"string","pattern":"^[^\\s\\[\\]「」=:]+$"};const schema17 = {"enum":["blue","amber","green","violet","rose","slate","coin"]};const pattern0 = new RegExp("^[^\\s\\[\\]「」=:]+$", "u");function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;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.name === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === "id") || (key0 === "name")) || (key0 === "note")) || (key0 === "color")) || (key0 === "icon"))){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.id !== undefined){let data0 = data.id;if(typeof data0 === "string"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === "string"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.note !== undefined){let data2 = data.note;if(typeof data2 === "string"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+"/note",schemaPath:"#/definitions/text/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+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === "blue") || (data3 === "amber")) || (data3 === "green")) || (data3 === "violet")) || (data3 === "rose")) || (data3 === "slate")) || (data3 === "coin"))){const err9 = {instancePath:instancePath+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues: schema17.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === "string"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+"/icon",schemaPath:"#/definitions/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+"/icon",schemaPath:"#/definitions/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++;}validate11.errors = vErrors;return errors === 0;}const schema19 = {"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"sub":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"},"region":{"$ref":"#/definitions/id"}}};function validate13(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;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.name === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "id") || (key0 === "name")) || (key0 === "sub")) || (key0 === "color")) || (key0 === "icon")) || (key0 === "region"))){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.id !== undefined){let data0 = data.id;if(typeof data0 === "string"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === "string"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.sub !== undefined){let data2 = data.sub;if(typeof data2 === "string"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+"/sub",schemaPath:"#/definitions/text/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+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === "blue") || (data3 === "amber")) || (data3 === "green")) || (data3 === "violet")) || (data3 === "rose")) || (data3 === "slate")) || (data3 === "coin"))){const err9 = {instancePath:instancePath+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues: schema17.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === "string"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+"/icon",schemaPath:"#/definitions/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+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.region !== undefined){let data5 = data.region;if(typeof data5 === "string"){if(!pattern0.test(data5)){const err12 = {instancePath:instancePath+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate13.errors = vErrors;return errors === 0;}const schema26 = {"type":"object","additionalProperties":false,"required":["title","fields"],"properties":{"title":{"$ref":"#/definitions/text"},"fields":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/text"}}}};function validate15(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.fields === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "fields"},message:"must have required property '"+"fields"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "title") || (key0 === "fields"))){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.title !== undefined){let data0 = data.title;if(typeof data0 === "string"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fields !== undefined){let data1 = data.fields;if(Array.isArray(data1)){if(data1.length < 1){const err5 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(typeof data2 === "string"){if(func3(data2) < 1){const err6 = {instancePath:instancePath+"/fields/" + i0,schemaPath:"#/definitions/text/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+"/fields/" + i0,schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate15.errors = vErrors;return errors === 0;}const schema29 = {"type":"object","additionalProperties":false,"required":["title","body","events"],"properties":{"title":{"$ref":"#/definitions/text"},"body":{"$ref":"#/definitions/text"},"code":{"$ref":"#/definitions/text"},"events":{"type":"array","items":{"$ref":"#/definitions/event"}}}};const schema33 = {"description":"段の中で起きること。起きる順に並べる","type":"object","required":["type"],"discriminator":{"propertyName":"type"},"oneOf":[{"description":"線。運ぶ物を載せて送る側から受ける側へ走る","type":"object","additionalProperties":false,"required":["type","from","to","carry"],"properties":{"type":{"const":"edge"},"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"},"carry":{"$ref":"#/definitions/carry"},"labelSide":{"description":"線の名前を置く側 (寄せの指示)","enum":["above","below","left","right"]}}},{"description":"箱の中の処理","type":"object","additionalProperties":false,"required":["type","box","label"],"properties":{"type":{"const":"action"},"box":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}},{"description":"箱の下の小さな字の書き換え","type":"object","additionalProperties":false,"required":["type","box","text"],"properties":{"type":{"const":"swap"},"box":{"$ref":"#/definitions/id"},"text":{"$ref":"#/definitions/text"}}},{"description":"中身の帯の欄の値と札","type":"object","additionalProperties":false,"required":["type","field"],"anyOf":[{"required":["value"]},{"required":["tag"]}],"properties":{"type":{"const":"strip"},"field":{"$ref":"#/definitions/text"},"value":{"$ref":"#/definitions/text"},"tag":{"$ref":"#/definitions/text"}}}]};const schema37 = {"description":"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["envelope","tag","coin","none"]},"text":{"$ref":"#/definitions/text"}},"if":{"required":["kind"],"properties":{"kind":{"const":"tag"}}},"then":{"required":["text"]},"else":{"not":{"required":["text"]}}};function validate19(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = "kind")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if("tag" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.text === undefined){const err2 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = "then";}else {const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.text === undefined) && (missing1 = "text")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var valid2 = _errs7 === errors;if(valid2){const err4 = {instancePath,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid0 = _valid0;ifClause0 = "else";}if(!valid0){const err5 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "text"))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.kind !== undefined){let data1 = data.kind;if(!((((data1 === "envelope") || (data1 === "tag")) || (data1 === "coin")) || (data1 === "none"))){const err8 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema37.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === "string"){if(func3(data2) < 1){const err9 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate19.errors = vErrors;return errors === 0;}function validate18(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const tag0 = data.type;if(typeof tag0 == "string"){if(tag0 === "edge"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.from === undefined){const err2 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.to === undefined){const err3 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.carry === undefined){const err4 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "carry"},message:"must have required property '"+"carry"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((key0 === "type") || (key0 === "from")) || (key0 === "to")) || (key0 === "label")) || (key0 === "carry")) || (key0 === "labelSide"))){const err5 = {instancePath,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.type !== undefined){if("edge" !== data.type){const err6 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue: "edge"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.from !== undefined){let data1 = data.from;if(typeof data1 === "string"){if(!pattern0.test(data1)){const err7 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.to !== undefined){let data2 = data.to;if(typeof data2 === "string"){if(!pattern0.test(data2)){const err9 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.label !== undefined){let data3 = data.label;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.carry !== undefined){if(!(validate19(data.carry, {instancePath:instancePath+"/carry",parentData:data,parentDataProperty:"carry",rootData}))){vErrors = vErrors === null ? validate19.errors : vErrors.concat(validate19.errors);errors = vErrors.length;}}if(data.labelSide !== undefined){let data5 = data.labelSide;if(!((((data5 === "above") || (data5 === "below")) || (data5 === "left")) || (data5 === "right"))){const err13 = {instancePath:instancePath+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues: schema33.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else if(tag0 === "action"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err15 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.box === undefined){const err16 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "box"},message:"must have required property '"+"box"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data.label === undefined){const err17 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}for(const key1 in data){if(!(((key1 === "type") || (key1 === "box")) || (key1 === "label"))){const err18 = {instancePath,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.type !== undefined){if("action" !== data.type){const err19 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue: "action"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.box !== undefined){let data7 = data.box;if(typeof data7 === "string"){if(!pattern0.test(data7)){const err20 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.label !== undefined){let data8 = data.label;if(typeof data8 === "string"){if(func3(data8) < 1){const err22 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}}else {const err24 = {instancePath,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else if(tag0 === "swap"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err25 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data.box === undefined){const err26 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "box"},message:"must have required property '"+"box"+"'"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data.text === undefined){const err27 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}for(const key2 in data){if(!(((key2 === "type") || (key2 === "box")) || (key2 === "text"))){const err28 = {instancePath,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.type !== undefined){if("swap" !== data.type){const err29 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue: "swap"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.box !== undefined){let data10 = data.box;if(typeof data10 === "string"){if(!pattern0.test(data10)){const err30 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.text !== undefined){let data11 = data.text;if(typeof data11 === "string"){if(func3(data11) < 1){const err32 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}}else {const err34 = {instancePath,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else if(tag0 === "strip"){const _errs39 = errors;let valid15 = false;const _errs40 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.value === undefined){const err35 = {instancePath,schemaPath:"#/oneOf/3/anyOf/0/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}var _valid0 = _errs40 === errors;valid15 = valid15 || _valid0;if(!valid15){const _errs41 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.tag === undefined){const err36 = {instancePath,schemaPath:"#/oneOf/3/anyOf/1/required",keyword:"required",params:{missingProperty: "tag"},message:"must have required property '"+"tag"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}var _valid0 = _errs41 === errors;valid15 = valid15 || _valid0;}if(!valid15){const err37 = {instancePath,schemaPath:"#/oneOf/3/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {errors = _errs39;if(vErrors !== null){if(_errs39){vErrors.length = _errs39;}else {vErrors = null;}}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err38 = {instancePath,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data.field === undefined){const err39 = {instancePath,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}for(const key3 in data){if(!((((key3 === "type") || (key3 === "field")) || (key3 === "value")) || (key3 === "tag"))){const err40 = {instancePath,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data.type !== undefined){if("strip" !== data.type){const err41 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue: "strip"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data.field !== undefined){let data13 = data.field;if(typeof data13 === "string"){if(func3(data13) < 1){const err42 = {instancePath:instancePath+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data.value !== undefined){let data14 = data.value;if(typeof data14 === "string"){if(func3(data14) < 1){const err44 = {instancePath:instancePath+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.tag !== undefined){let data15 = data.tag;if(typeof data15 === "string"){if(func3(data15) < 1){const err46 = {instancePath:instancePath+"/tag",schemaPath:"#/definitions/text/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+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}}else {const err48 = {instancePath,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}else {const err49 = {instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "type", tagValue: tag0},message:"value of tag \"type\" must be in oneOf"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "tag", tag: "type", tagValue: tag0},message:"tag \"type\" must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}else {const err51 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}validate18.errors = vErrors;return errors === 0;}function validate17(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.body === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "body"},message:"must have required property '"+"body"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.events === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "title") || (key0 === "body")) || (key0 === "code")) || (key0 === "events"))){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.title !== undefined){let data0 = data.title;if(typeof data0 === "string"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/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+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.body !== undefined){let data1 = data.body;if(typeof data1 === "string"){if(func3(data1) < 1){const err6 = {instancePath:instancePath+"/body",schemaPath:"#/definitions/text/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+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.code !== undefined){let data2 = data.code;if(typeof data2 === "string"){if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/code",schemaPath:"#/definitions/text/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+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.events !== undefined){let data3 = data.events;if(Array.isArray(data3)){const len0 = data3.length;for(let i0=0; i0<len0; i0++){if(!(validate18(data3[i0], {instancePath:instancePath+"/events/" + i0,parentData:data3,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate17.errors = vErrors;return errors === 0;}const schema46 = {"description":"時系列図の種類の欄。生存線を左から並べる順","type":"object","additionalProperties":false,"required":["lifelines"],"properties":{"lifelines":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/id"}}}};function validate23(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.lifelines === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lifelines"},message:"must have required property '"+"lifelines"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "lifelines")){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.lifelines !== undefined){let data0 = data.lifelines;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(typeof data1 === "string"){if(!pattern0.test(data1)){const err3 = {instancePath:instancePath+"/lifelines/" + i0,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/lifelines/" + i0,schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath:instancePath+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate23.errors = vErrors;return errors === 0;}function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = "kind")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if("sequence" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.sequence === undefined){const err2 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "sequence"},message:"must have required property '"+"sequence"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = "then";}else {const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.sequence === undefined) && (missing1 = "sequence")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var valid2 = _errs7 === errors;if(valid2){const err4 = {instancePath,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid0 = _valid0;ifClause0 = "else";}if(!valid0){const err5 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.version === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.kind === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.title === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.boxes === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "boxes"},message:"must have required property '"+"boxes"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.steps === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "steps"},message:"must have required property '"+"steps"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key0 in data){if(!(func2.call(schema11.properties, key0))){const err11 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.version !== undefined){let data1 = data.version;if(!(((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err12 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 1 || isNaN(data1)){const err13 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}if(data.kind !== undefined){let data2 = data.kind;if(!((data2 === "sequence") || (data2 === "architecture"))){const err14 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema11.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.title !== undefined){let data3 = data.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err15 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/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+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.view !== undefined){let data4 = data.view;if(!((data4 === "fixed") || (data4 === "follow"))){const err17 = {instancePath:instancePath+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues: schema11.properties.view.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.regions !== undefined){let data5 = data.regions;if(Array.isArray(data5)){const len0 = data5.length;for(let i0=0; i0<len0; i0++){if(!(validate11(data5[i0], {instancePath:instancePath+"/regions/" + i0,parentData:data5,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}}else {const err18 = {instancePath:instancePath+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.boxes !== undefined){let data7 = data.boxes;if(Array.isArray(data7)){if(data7.length < 1){const err19 = {instancePath:instancePath+"/boxes",schemaPath:"#/properties/boxes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}const len1 = data7.length;for(let i1=0; i1<len1; i1++){if(!(validate13(data7[i1], {instancePath:instancePath+"/boxes/" + i1,parentData:data7,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}}else {const err20 = {instancePath:instancePath+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.strip !== undefined){if(!(validate15(data.strip, {instancePath:instancePath+"/strip",parentData:data,parentDataProperty:"strip",rootData}))){vErrors = vErrors === null ? validate15.errors : vErrors.concat(validate15.errors);errors = vErrors.length;}}if(data.steps !== undefined){let data10 = data.steps;if(Array.isArray(data10)){if(data10.length < 1){const err21 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}const len2 = data10.length;for(let i2=0; i2<len2; i2++){if(!(validate17(data10[i2], {instancePath:instancePath+"/steps/" + i2,parentData:data10,parentDataProperty:i2,rootData}))){vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);errors = vErrors.length;}}}else {const err22 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.sequence !== undefined){if(!(validate23(data.sequence, {instancePath:instancePath+"/sequence",parentData:data,parentDataProperty:"sequence",rootData}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}validate10.errors = vErrors;return errors === 0;}
8
+ export const validate = validate10;export default validate10;const schema11 = {"title":"dragon の図の原本","description":"区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。","type":"object","additionalProperties":false,"required":["version","kind","title","boxes","steps"],"properties":{"version":{"description":"形式の版","type":"integer","minimum":1},"kind":{"description":"図の種類","enum":["sequence","architecture","state"]},"title":{"$ref":"#/definitions/text"},"view":{"description":"見せ方。書かなければ字の大きさで選ぶ。fixed は全体を止めて中だけ動かし、follow は寄って動かし全体図で今どこかを示す","enum":["fixed","follow"]},"regions":{"type":"array","items":{"$ref":"#/definitions/region"}},"boxes":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/box"}},"strip":{"$ref":"#/definitions/strip"},"steps":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/step"}},"sequence":{"$ref":"#/definitions/sequence"},"state":{"$ref":"#/definitions/state"}},"if":{"required":["kind"],"properties":{"kind":{"const":"sequence"}}},"then":{"required":["sequence"],"not":{"required":["state"]}},"else":{"not":{"required":["sequence"]},"if":{"required":["kind"],"properties":{"kind":{"const":"state"}}},"then":{"properties":{"boxes":{"items":{"properties":{"id":{"description":"始まりと終わりの印の名前は箱の名札に使えない","not":{"enum":["start","finish"]}}}}}}},"else":{"not":{"required":["state"]}}},"definitions":{"text":{"type":"string","minLength":1},"id":{"type":"string","pattern":"^[^\\s\\[\\]「」=:]+$"},"color":{"enum":["blue","amber","green","violet","rose","slate","coin"]},"region":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"note":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"}}},"box":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"sub":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"},"region":{"$ref":"#/definitions/id"}}},"strip":{"type":"object","additionalProperties":false,"required":["title","fields"],"properties":{"title":{"$ref":"#/definitions/text"},"fields":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/text"}}}},"step":{"type":"object","additionalProperties":false,"required":["title","body","events"],"properties":{"title":{"$ref":"#/definitions/text"},"body":{"$ref":"#/definitions/text"},"code":{"$ref":"#/definitions/text"},"events":{"type":"array","items":{"$ref":"#/definitions/event"}}}},"event":{"description":"段の中で起きること。起きる順に並べる","type":"object","required":["type"],"discriminator":{"propertyName":"type"},"oneOf":[{"description":"線。運ぶ物を載せて送る側から受ける側へ走る","type":"object","additionalProperties":false,"required":["type","from","to","carry"],"properties":{"type":{"const":"edge"},"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"},"carry":{"$ref":"#/definitions/carry"},"labelSide":{"description":"線の名前を置く側 (寄せの指示)","enum":["above","below","left","right"]}}},{"description":"箱の中の処理","type":"object","additionalProperties":false,"required":["type","box","label"],"properties":{"type":{"const":"action"},"box":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}},{"description":"箱の下の小さな字の書き換え","type":"object","additionalProperties":false,"required":["type","box","text"],"properties":{"type":{"const":"swap"},"box":{"$ref":"#/definitions/id"},"text":{"$ref":"#/definitions/text"}}},{"description":"中身の帯の欄の値と札","type":"object","additionalProperties":false,"required":["type","field"],"anyOf":[{"required":["value"]},{"required":["tag"]}],"properties":{"type":{"const":"strip"},"field":{"$ref":"#/definitions/text"},"value":{"$ref":"#/definitions/text"},"tag":{"$ref":"#/definitions/text"}}}]},"carry":{"description":"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["envelope","tag","coin","none"]},"text":{"$ref":"#/definitions/text"}},"if":{"required":["kind"],"properties":{"kind":{"const":"tag"}}},"then":{"required":["text"]},"else":{"not":{"required":["text"]}}},"sequence":{"description":"時系列図の種類の欄。生存線を左から並べる順","type":"object","additionalProperties":false,"required":["lifelines"],"properties":{"lifelines":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/id"}}}},"state":{"description":"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線","type":"object","additionalProperties":false,"required":["paths"],"properties":{"paths":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/path"}}}},"path":{"description":"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない","type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}}}};const schema12 = {"type":"string","minLength":1};const func2 = Object.prototype.hasOwnProperty;const func3 = ucs2length;const schema13 = {"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"note":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"}}};const schema14 = {"type":"string","pattern":"^[^\\s\\[\\]「」=:]+$"};const schema17 = {"enum":["blue","amber","green","violet","rose","slate","coin"]};const pattern0 = new RegExp("^[^\\s\\[\\]「」=:]+$", "u");function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;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.name === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === "id") || (key0 === "name")) || (key0 === "note")) || (key0 === "color")) || (key0 === "icon"))){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.id !== undefined){let data0 = data.id;if(typeof data0 === "string"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === "string"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.note !== undefined){let data2 = data.note;if(typeof data2 === "string"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+"/note",schemaPath:"#/definitions/text/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+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === "blue") || (data3 === "amber")) || (data3 === "green")) || (data3 === "violet")) || (data3 === "rose")) || (data3 === "slate")) || (data3 === "coin"))){const err9 = {instancePath:instancePath+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues: schema17.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === "string"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+"/icon",schemaPath:"#/definitions/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+"/icon",schemaPath:"#/definitions/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++;}validate11.errors = vErrors;return errors === 0;}const schema19 = {"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"$ref":"#/definitions/id"},"name":{"$ref":"#/definitions/text"},"sub":{"$ref":"#/definitions/text"},"color":{"$ref":"#/definitions/color"},"icon":{"$ref":"#/definitions/text"},"region":{"$ref":"#/definitions/id"}}};function validate13(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;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.name === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "id") || (key0 === "name")) || (key0 === "sub")) || (key0 === "color")) || (key0 === "icon")) || (key0 === "region"))){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.id !== undefined){let data0 = data.id;if(typeof data0 === "string"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === "string"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.sub !== undefined){let data2 = data.sub;if(typeof data2 === "string"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+"/sub",schemaPath:"#/definitions/text/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+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === "blue") || (data3 === "amber")) || (data3 === "green")) || (data3 === "violet")) || (data3 === "rose")) || (data3 === "slate")) || (data3 === "coin"))){const err9 = {instancePath:instancePath+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues: schema17.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === "string"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+"/icon",schemaPath:"#/definitions/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+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.region !== undefined){let data5 = data.region;if(typeof data5 === "string"){if(!pattern0.test(data5)){const err12 = {instancePath:instancePath+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate13.errors = vErrors;return errors === 0;}const schema26 = {"type":"object","additionalProperties":false,"required":["title","fields"],"properties":{"title":{"$ref":"#/definitions/text"},"fields":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/text"}}}};function validate15(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.fields === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "fields"},message:"must have required property '"+"fields"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "title") || (key0 === "fields"))){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.title !== undefined){let data0 = data.title;if(typeof data0 === "string"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fields !== undefined){let data1 = data.fields;if(Array.isArray(data1)){if(data1.length < 1){const err5 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(typeof data2 === "string"){if(func3(data2) < 1){const err6 = {instancePath:instancePath+"/fields/" + i0,schemaPath:"#/definitions/text/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+"/fields/" + i0,schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath:instancePath+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate15.errors = vErrors;return errors === 0;}const schema29 = {"type":"object","additionalProperties":false,"required":["title","body","events"],"properties":{"title":{"$ref":"#/definitions/text"},"body":{"$ref":"#/definitions/text"},"code":{"$ref":"#/definitions/text"},"events":{"type":"array","items":{"$ref":"#/definitions/event"}}}};const schema33 = {"description":"段の中で起きること。起きる順に並べる","type":"object","required":["type"],"discriminator":{"propertyName":"type"},"oneOf":[{"description":"線。運ぶ物を載せて送る側から受ける側へ走る","type":"object","additionalProperties":false,"required":["type","from","to","carry"],"properties":{"type":{"const":"edge"},"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"},"carry":{"$ref":"#/definitions/carry"},"labelSide":{"description":"線の名前を置く側 (寄せの指示)","enum":["above","below","left","right"]}}},{"description":"箱の中の処理","type":"object","additionalProperties":false,"required":["type","box","label"],"properties":{"type":{"const":"action"},"box":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}},{"description":"箱の下の小さな字の書き換え","type":"object","additionalProperties":false,"required":["type","box","text"],"properties":{"type":{"const":"swap"},"box":{"$ref":"#/definitions/id"},"text":{"$ref":"#/definitions/text"}}},{"description":"中身の帯の欄の値と札","type":"object","additionalProperties":false,"required":["type","field"],"anyOf":[{"required":["value"]},{"required":["tag"]}],"properties":{"type":{"const":"strip"},"field":{"$ref":"#/definitions/text"},"value":{"$ref":"#/definitions/text"},"tag":{"$ref":"#/definitions/text"}}}]};const schema37 = {"description":"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["envelope","tag","coin","none"]},"text":{"$ref":"#/definitions/text"}},"if":{"required":["kind"],"properties":{"kind":{"const":"tag"}}},"then":{"required":["text"]},"else":{"not":{"required":["text"]}}};function validate19(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = "kind")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if("tag" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.text === undefined){const err2 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = "then";}else {const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.text === undefined) && (missing1 = "text")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var valid2 = _errs7 === errors;if(valid2){const err4 = {instancePath,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid0 = _valid0;ifClause0 = "else";}if(!valid0){const err5 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "text"))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.kind !== undefined){let data1 = data.kind;if(!((((data1 === "envelope") || (data1 === "tag")) || (data1 === "coin")) || (data1 === "none"))){const err8 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema37.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === "string"){if(func3(data2) < 1){const err9 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate19.errors = vErrors;return errors === 0;}function validate18(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const tag0 = data.type;if(typeof tag0 == "string"){if(tag0 === "edge"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.from === undefined){const err2 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.to === undefined){const err3 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.carry === undefined){const err4 = {instancePath,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty: "carry"},message:"must have required property '"+"carry"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((key0 === "type") || (key0 === "from")) || (key0 === "to")) || (key0 === "label")) || (key0 === "carry")) || (key0 === "labelSide"))){const err5 = {instancePath,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.type !== undefined){if("edge" !== data.type){const err6 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue: "edge"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.from !== undefined){let data1 = data.from;if(typeof data1 === "string"){if(!pattern0.test(data1)){const err7 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.to !== undefined){let data2 = data.to;if(typeof data2 === "string"){if(!pattern0.test(data2)){const err9 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.label !== undefined){let data3 = data.label;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.carry !== undefined){if(!(validate19(data.carry, {instancePath:instancePath+"/carry",parentData:data,parentDataProperty:"carry",rootData}))){vErrors = vErrors === null ? validate19.errors : vErrors.concat(validate19.errors);errors = vErrors.length;}}if(data.labelSide !== undefined){let data5 = data.labelSide;if(!((((data5 === "above") || (data5 === "below")) || (data5 === "left")) || (data5 === "right"))){const err13 = {instancePath:instancePath+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues: schema33.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else if(tag0 === "action"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err15 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.box === undefined){const err16 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "box"},message:"must have required property '"+"box"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data.label === undefined){const err17 = {instancePath,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}for(const key1 in data){if(!(((key1 === "type") || (key1 === "box")) || (key1 === "label"))){const err18 = {instancePath,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.type !== undefined){if("action" !== data.type){const err19 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue: "action"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.box !== undefined){let data7 = data.box;if(typeof data7 === "string"){if(!pattern0.test(data7)){const err20 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.label !== undefined){let data8 = data.label;if(typeof data8 === "string"){if(func3(data8) < 1){const err22 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}}else {const err24 = {instancePath,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else if(tag0 === "swap"){if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err25 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data.box === undefined){const err26 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "box"},message:"must have required property '"+"box"+"'"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data.text === undefined){const err27 = {instancePath,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}for(const key2 in data){if(!(((key2 === "type") || (key2 === "box")) || (key2 === "text"))){const err28 = {instancePath,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.type !== undefined){if("swap" !== data.type){const err29 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue: "swap"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.box !== undefined){let data10 = data.box;if(typeof data10 === "string"){if(!pattern0.test(data10)){const err30 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.text !== undefined){let data11 = data.text;if(typeof data11 === "string"){if(func3(data11) < 1){const err32 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}}else {const err34 = {instancePath,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else if(tag0 === "strip"){const _errs39 = errors;let valid15 = false;const _errs40 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.value === undefined){const err35 = {instancePath,schemaPath:"#/oneOf/3/anyOf/0/required",keyword:"required",params:{missingProperty: "value"},message:"must have required property '"+"value"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}var _valid0 = _errs40 === errors;valid15 = valid15 || _valid0;if(!valid15){const _errs41 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.tag === undefined){const err36 = {instancePath,schemaPath:"#/oneOf/3/anyOf/1/required",keyword:"required",params:{missingProperty: "tag"},message:"must have required property '"+"tag"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}var _valid0 = _errs41 === errors;valid15 = valid15 || _valid0;}if(!valid15){const err37 = {instancePath,schemaPath:"#/oneOf/3/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {errors = _errs39;if(vErrors !== null){if(_errs39){vErrors.length = _errs39;}else {vErrors = null;}}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.type === undefined){const err38 = {instancePath,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data.field === undefined){const err39 = {instancePath,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty: "field"},message:"must have required property '"+"field"+"'"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}for(const key3 in data){if(!((((key3 === "type") || (key3 === "field")) || (key3 === "value")) || (key3 === "tag"))){const err40 = {instancePath,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data.type !== undefined){if("strip" !== data.type){const err41 = {instancePath:instancePath+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue: "strip"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data.field !== undefined){let data13 = data.field;if(typeof data13 === "string"){if(func3(data13) < 1){const err42 = {instancePath:instancePath+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data.value !== undefined){let data14 = data.value;if(typeof data14 === "string"){if(func3(data14) < 1){const err44 = {instancePath:instancePath+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.tag !== undefined){let data15 = data.tag;if(typeof data15 === "string"){if(func3(data15) < 1){const err46 = {instancePath:instancePath+"/tag",schemaPath:"#/definitions/text/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+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}}else {const err48 = {instancePath,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}else {const err49 = {instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "mapping", tag: "type", tagValue: tag0},message:"value of tag \"type\" must be in oneOf"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath,schemaPath:"#/discriminator",keyword:"discriminator",params:{error: "tag", tag: "type", tagValue: tag0},message:"tag \"type\" must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}else {const err51 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}validate18.errors = vErrors;return errors === 0;}function validate17(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.body === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "body"},message:"must have required property '"+"body"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.events === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "title") || (key0 === "body")) || (key0 === "code")) || (key0 === "events"))){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.title !== undefined){let data0 = data.title;if(typeof data0 === "string"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/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+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.body !== undefined){let data1 = data.body;if(typeof data1 === "string"){if(func3(data1) < 1){const err6 = {instancePath:instancePath+"/body",schemaPath:"#/definitions/text/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+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.code !== undefined){let data2 = data.code;if(typeof data2 === "string"){if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/code",schemaPath:"#/definitions/text/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+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.events !== undefined){let data3 = data.events;if(Array.isArray(data3)){const len0 = data3.length;for(let i0=0; i0<len0; i0++){if(!(validate18(data3[i0], {instancePath:instancePath+"/events/" + i0,parentData:data3,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate17.errors = vErrors;return errors === 0;}const schema46 = {"description":"時系列図の種類の欄。生存線を左から並べる順","type":"object","additionalProperties":false,"required":["lifelines"],"properties":{"lifelines":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/id"}}}};function validate23(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.lifelines === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lifelines"},message:"must have required property '"+"lifelines"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "lifelines")){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.lifelines !== undefined){let data0 = data.lifelines;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(typeof data1 === "string"){if(!pattern0.test(data1)){const err3 = {instancePath:instancePath+"/lifelines/" + i0,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/lifelines/" + i0,schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath:instancePath+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate23.errors = vErrors;return errors === 0;}const schema48 = {"description":"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線","type":"object","additionalProperties":false,"required":["paths"],"properties":{"paths":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/path"}}}};const schema49 = {"description":"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない","type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"#/definitions/id"},"to":{"$ref":"#/definitions/id"},"label":{"$ref":"#/definitions/text"}}};function validate26(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === "from") || (key0 === "to")) || (key0 === "label"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(typeof data0 === "string"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 === "string"){if(!pattern0.test(data1)){const err5 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\[\\]「」=:]+$"},message:"must match pattern \""+"^[^\\s\\[\\]「」=:]+$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.label !== undefined){let data2 = data.label;if(typeof data2 === "string"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+"/label",schemaPath:"#/definitions/text/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+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate26.errors = vErrors;return errors === 0;}function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.paths === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "paths"},message:"must have required property '"+"paths"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "paths")){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.paths !== undefined){let data0 = data.paths;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+"/paths",schemaPath:"#/properties/paths/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate26(data0[i0], {instancePath:instancePath+"/paths/" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+"/paths",schemaPath:"#/properties/paths/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate25.errors = vErrors;return errors === 0;}function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = "kind")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if("sequence" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;const _errs5 = errors;const _errs6 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.state === undefined) && (missing1 = "state")){const err2 = {};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var valid2 = _errs6 === errors;if(valid2){const err3 = {instancePath,schemaPath:"#/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.sequence === undefined){const err4 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "sequence"},message:"must have required property '"+"sequence"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = "then";}else {const _errs7 = errors;const _errs8 = errors;const _errs9 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing2;if((data.sequence === undefined) && (missing2 = "sequence")){const err5 = {};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}var valid3 = _errs9 === errors;if(valid3){const err6 = {instancePath,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs10 = errors;let valid4 = true;const _errs11 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing3;if((data.kind === undefined) && (missing3 = "kind")){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {if(data.kind !== undefined){if("state" !== data.kind){const err8 = {};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}}var _valid1 = _errs11 === errors;errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}let ifClause1;if(_valid1){const _errs13 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.boxes !== undefined){let data2 = data.boxes;if(Array.isArray(data2)){const len0 = data2.length;for(let i0=0; i0<len0; i0++){let data3 = data2[i0];if(data3 && typeof data3 == "object" && !Array.isArray(data3)){if(data3.id !== undefined){let data4 = data3.id;const _errs17 = errors;const _errs18 = errors;if(!((data4 === "start") || (data4 === "finish"))){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid10 = _errs18 === errors;if(valid10){const err10 = {instancePath:instancePath+"/boxes/" + i0+"/id",schemaPath:"#/else/then/properties/boxes/items/properties/id/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {errors = _errs17;if(vErrors !== null){if(_errs17){vErrors.length = _errs17;}else {vErrors = null;}}}}}}}}}var _valid1 = _errs13 === errors;valid4 = _valid1;ifClause1 = "then";}else {const _errs19 = errors;const _errs20 = errors;const _errs21 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing4;if((data.state === undefined) && (missing4 = "state")){const err11 = {};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}var valid11 = _errs21 === errors;if(valid11){const err12 = {instancePath,schemaPath:"#/else/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs20;if(vErrors !== null){if(_errs20){vErrors.length = _errs20;}else {vErrors = null;}}}var _valid1 = _errs19 === errors;valid4 = _valid1;ifClause1 = "else";}if(!valid4){const err13 = {instancePath,schemaPath:"#/else/if",keyword:"if",params:{failingKeyword: ifClause1},message:"must match \""+ifClause1+"\" schema"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid0 = _errs7 === errors;valid0 = _valid0;ifClause0 = "else";}if(!valid0){const err14 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.version === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.kind === undefined){const err16 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data.title === undefined){const err17 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(data.boxes === undefined){const err18 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "boxes"},message:"must have required property '"+"boxes"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data.steps === undefined){const err19 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "steps"},message:"must have required property '"+"steps"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}for(const key0 in data){if(!(func2.call(schema11.properties, key0))){const err20 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.version !== undefined){let data5 = data.version;if(!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))){const err21 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if((typeof data5 == "number") && (isFinite(data5))){if(data5 < 1 || isNaN(data5)){const err22 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}if(data.kind !== undefined){let data6 = data.kind;if(!(((data6 === "sequence") || (data6 === "architecture")) || (data6 === "state"))){const err23 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema11.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.title !== undefined){let data7 = data.title;if(typeof data7 === "string"){if(func3(data7) < 1){const err24 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.view !== undefined){let data8 = data.view;if(!((data8 === "fixed") || (data8 === "follow"))){const err26 = {instancePath:instancePath+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues: schema11.properties.view.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.regions !== undefined){let data9 = data.regions;if(Array.isArray(data9)){const len1 = data9.length;for(let i1=0; i1<len1; i1++){if(!(validate11(data9[i1], {instancePath:instancePath+"/regions/" + i1,parentData:data9,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}}else {const err27 = {instancePath:instancePath+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.boxes !== undefined){let data11 = data.boxes;if(Array.isArray(data11)){if(data11.length < 1){const err28 = {instancePath:instancePath+"/boxes",schemaPath:"#/properties/boxes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}const len2 = data11.length;for(let i2=0; i2<len2; i2++){if(!(validate13(data11[i2], {instancePath:instancePath+"/boxes/" + i2,parentData:data11,parentDataProperty:i2,rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}}else {const err29 = {instancePath:instancePath+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.strip !== undefined){if(!(validate15(data.strip, {instancePath:instancePath+"/strip",parentData:data,parentDataProperty:"strip",rootData}))){vErrors = vErrors === null ? validate15.errors : vErrors.concat(validate15.errors);errors = vErrors.length;}}if(data.steps !== undefined){let data14 = data.steps;if(Array.isArray(data14)){if(data14.length < 1){const err30 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}const len3 = data14.length;for(let i3=0; i3<len3; i3++){if(!(validate17(data14[i3], {instancePath:instancePath+"/steps/" + i3,parentData:data14,parentDataProperty:i3,rootData}))){vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);errors = vErrors.length;}}}else {const err31 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.sequence !== undefined){if(!(validate23(data.sequence, {instancePath:instancePath+"/sequence",parentData:data,parentDataProperty:"sequence",rootData}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}if(data.state !== undefined){if(!(validate25(data.state, {instancePath:instancePath+"/state",parentData:data,parentDataProperty:"state",rootData}))){vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);errors = vErrors.length;}}}else {const err32 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}validate10.errors = vErrors;return errors === 0;}
package/src/timeline.ts CHANGED
@@ -5,9 +5,12 @@
5
5
  * 運ぶ物は主役 (封筒と札は 1 つ、硬貨は別の 1 つ) ごとに途切れず見え続ける。着いた後は
6
6
  * 次の同じ主役が出発するまで着いた先に留まり、次が無ければ終わりまで留まる。
7
7
  * 線の名前はその段の間だけ出し、同じ段に何本あっても同時に見えるのは 2 つまでにする。
8
+ * 状態遷移図では、段が終わった後も線の名前を最後の段まで薄く残す (#3171)。薄い名前は 2 つまでの数に入れない。
9
+ * 状態遷移図では、主役の運ぶ物が乗っている状態を光らせ、運ぶ物が出た状態には少し後に済んだ印を出す (#3163)。
8
10
  */
9
11
  import { MOTION } from "./look/values";
10
12
  import type { Diagram } from "./schema";
13
+ import { STATE_ENDS } from "./words";
11
14
 
12
15
  /** 秒で表した、見えている間。`end` の時刻は含まない。 */
13
16
  export interface Span {
@@ -34,6 +37,8 @@ export interface CarrierTime extends Span {
34
37
  export interface LabelTime extends Span {
35
38
  step: number;
36
39
  event: number;
40
+ /** 状態遷移図だけが持つ。段が終わった後に薄く残す間 */
41
+ after?: Span;
37
42
  }
38
43
 
39
44
  /** 処理、箱の字の書き換え、中身の帯の値が起きる時刻。 */
@@ -43,6 +48,13 @@ export interface EventTime {
43
48
  at: number;
44
49
  }
45
50
 
51
+ /** 状態遷移図の状態ごとの、光っている間と、済んだ印が出る時刻。運ぶ物が出ていない状態は `done` を持たない */
52
+ export interface StateTime {
53
+ box: string;
54
+ lit: Span[];
55
+ done?: number;
56
+ }
57
+
46
58
  export interface Timeline {
47
59
  /** 1 周の長さ */
48
60
  total: number;
@@ -56,6 +68,8 @@ export interface Timeline {
56
68
  events: EventTime[];
57
69
  /** 段ごとの止め絵の時刻。その段で起きることが全部見えている */
58
70
  stills: number[];
71
+ /** 状態遷移図だけが持つ */
72
+ states?: StateTime[];
59
73
  }
60
74
 
61
75
  interface Planned {
@@ -126,6 +140,7 @@ export function buildTimeline(diagram: Diagram): Timeline {
126
140
  const later = named[k + 2];
127
141
  if (later) label.end = Math.min(label.end, later.start);
128
142
  });
143
+ if (diagram.kind === "state") for (const label of named) label.after = { start: label.end, end: last };
129
144
  labels.push(...named);
130
145
  for (const event of p.events) events.push({ step: s, event: event.event, at: span.start + event.at });
131
146
  });
@@ -151,6 +166,7 @@ export function buildTimeline(diagram: Diagram): Timeline {
151
166
  });
152
167
  }
153
168
  carriers.sort((x, y) => x.depart - y.depart);
169
+ const states = diagram.kind === "state" ? stateTimes(diagram, edges, last) : undefined;
154
170
 
155
171
  return {
156
172
  total,
@@ -162,5 +178,36 @@ export function buildTimeline(diagram: Diagram): Timeline {
162
178
  badges: steps.map((span, s) => ({ step: s, appears: span.start })),
163
179
  events,
164
180
  stills: steps.map((span) => span.end - MOTION.still),
181
+ ...(states ? { states } : {}),
182
+ };
183
+ }
184
+
185
+ const isEnd = (id: string): boolean => (STATE_ENDS as readonly string[]).includes(id);
186
+
187
+ /**
188
+ * 状態遷移図の状態が光る間。段の線を引き終えて状態へ着いた時から、その状態を出る線を引き始めるまで光り、
189
+ * 出た少し後に済んだ印を出す。同じ状態へ戻る線では光ったまま、最後に着いた状態は終わりまで光る。
190
+ * 物が状態を移るのは線を辿った時なので、運ぶ物の種類 (硬貨や、運ばない線) を問わず全ての線で数える。
191
+ */
192
+ function stateTimes(diagram: Diagram, edges: EdgeTime[], last: number): StateTime[] {
193
+ const times = new Map<string, StateTime>();
194
+ const of = (box: string): StateTime => {
195
+ const found = times.get(box) ?? { box, lit: [] };
196
+ times.set(box, found);
197
+ return found;
165
198
  };
199
+ let on: { box: string; since: number } | undefined;
200
+ for (const edge of edges) {
201
+ const event = diagram.steps[edge.step]?.events[edge.event];
202
+ if (event?.type !== "edge" || event.from === event.to) continue;
203
+ if (on) {
204
+ const left = of(on.box);
205
+ left.lit.push({ start: on.since, end: edge.start });
206
+ if (on.box === event.from && left.done === undefined) left.done = edge.start + MOTION.done;
207
+ on = undefined;
208
+ }
209
+ if (!isEnd(event.to)) on = { box: event.to, since: edge.drawn };
210
+ }
211
+ if (on) of(on.box).lit.push({ start: on.since, end: last });
212
+ return [...times.values()];
166
213
  }
package/src/words.ts CHANGED
@@ -16,7 +16,14 @@ export type NotationLang = "ja" | "en";
16
16
  const keys = <K extends string>(table: Record<K, true>): K[] => Object.keys(table) as K[];
17
17
 
18
18
  /** 図の種類。最初の行の頭の語 */
19
- export const KINDS = keys<Diagram["kind"]>({ sequence: true, architecture: true });
19
+ export const KINDS = keys<Diagram["kind"]>({ sequence: true, architecture: true, state: true });
20
+
21
+ /**
22
+ * 状態遷移図の始まりと終わりの印の名前 (#3163)。線の送る側に `start`、受ける側に `finish` を書き、
23
+ * 状態遷移図では箱の名札に使えない。時系列図と構成図では、宣言して使う普通の名札
24
+ */
25
+ export const STATE_ENDS = ["start", "finish"] as const;
26
+ export type StateEnd = (typeof STATE_ENDS)[number];
20
27
 
21
28
  /** 最初の行より後の行の頭の語。線の行だけは箱の名札から始まる */
22
29
  export const HEADS = ["group", "end", "box", "strip", "step", "say", "code", "act", "note", "set"] as const;