@elyx-code/project-logic-tree 0.0.56 → 0.0.57

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.
Files changed (22) hide show
  1. package/dist/index.js +13746 -13755
  2. package/dist/index.umd.cjs +134 -134
  3. package/dist/tree/state/argument-declaration/validation/validation-schema.d.ts +8 -8
  4. package/dist/tree/state/break-statement/validation/validation-schema.d.ts +32 -32
  5. package/dist/tree/state/condition/validation/validation-schema.d.ts +48 -48
  6. package/dist/tree/state/continue-statement/validation/validation-schema.d.ts +32 -32
  7. package/dist/tree/state/function-call/validation/validation-schema.d.ts +56 -56
  8. package/dist/tree/state/global-event/validation/validation-schema.d.ts +8 -8
  9. package/dist/tree/state/input-map/validation/validation-schema.d.ts +64 -64
  10. package/dist/tree/state/internal-call/validation/validation-schema.d.ts +56 -56
  11. package/dist/tree/state/loop/validation/validation-schema.d.ts +48 -48
  12. package/dist/tree/state/operation/validation/validation-schema.d.ts +56 -56
  13. package/dist/tree/state/output-map/validation/validation-schema.d.ts +72 -72
  14. package/dist/tree/state/project/project.d.ts +6 -0
  15. package/dist/tree/state/return-declaration/validation/validation-schema.d.ts +16 -16
  16. package/dist/tree/state/return-statement/validation/validation-schema.d.ts +32 -32
  17. package/dist/tree/state/search/validation/validation-schema.d.ts +48 -48
  18. package/dist/tree/state/variable-declaration/validation/validation-schema.d.ts +64 -64
  19. package/dist/tree/state/variable-instance/validation/validation-schema.d.ts +64 -64
  20. package/dist/tree/utils/index.d.ts +1 -1
  21. package/dist/tree/utils/uuid.d.ts +1 -7
  22. package/package.json +1 -1
@@ -1,75 +1,81 @@
1
- (function(d,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(d=typeof globalThis<"u"?globalThis:d||self,r(d["@elyx-code/project-logic-tree"]={}))})(this,function(d){"use strict";var h3=Object.defineProperty;var f3=(d,r,w)=>r in d?h3(d,r,{enumerable:!0,configurable:!0,writable:!0,value:w}):d[r]=w;var l=(d,r,w)=>(f3(d,typeof r!="symbol"?r+"":r,w),w);var r=(n=>(n.CustomEntity="custom-entity",n.BuiltInBaseEntity="built-in-base-entity",n.Project="project",n.InstalledProject="installed-project",n.GlobalEvent="global-event",n.DataType="data-type",n.FunctionCall="function-call",n.FunctionDeclaration="function-declaration",n.ActionDescriptor="action-descriptor",n.ValueDescriptor="value-descriptor",n.ArgumentDeclaration="argument-declaration",n.InputMap="input-map",n.ReturnStatement="return-statement",n.BreakStatement="break-statement",n.ContinueStatement="continue-statement",n.ReturnDeclaration="return-declaration",n.OutputMap="output-map",n.PrimitiveEntity="primitive-entity",n.PrimitiveValue="primitive-value",n.Property="property",n.Operation="operation",n.Condition="condition",n.VariableDeclaration="variable-declaration",n.VariableInstance="variable-instance",n.Search="search",n.Loop="loop",n.InternalCall="internal-call",n.GenericReference="generic-reference",n))(r||{}),w=(n=>(n.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",n.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",n.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",n.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",n.EXECUTION="BUILT_IN_EXECUTION_ENTITY",n.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",n))(w||{}),Ue=(n=>(n.CurrentDateAndTime="current-date-and-time",n.Unique="unique",n.Random="random",n))(Ue||{}),vt=(n=>(n.DeletePersistedEntity="base-delete-persisted-entity",n.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",n.AbortExecution="base-abort-execution",n))(vt||{}),V=(n=>(n.Fixed="fixed",n.None="none",n.Dynamic="dynamic",n))(V||{}),O=(n=>(n.FixedArguments="fixed-arguments",n.FixedReturns="fixed-returns",n.ReturnedError="returned-error",n.OngoingProcessExecution="ongoing-process-execution",n))(O||{}),g=(n=>(n.EntityTemplate="entity-template",n.ActionDescriptor="action-descriptor",n.String="string",n.Number="number",n.Boolean="boolean",n.Null="null",n.Enum="enum",n.JSON="json",n.Date="date",n.UUID="uuid",n.File="file",n))(g||{}),at=(n=>(n.Addition="addition",n.Substraction="substraction",n.Multiplication="multiplication",n.Division="division",n.Remainder="remainder",n.Exponentiation="exponentiation",n))(at||{}),ve=(n=>(n.Join="string-join",n.Split="stringSsplit",n.DeleteLast="string-delete-last",n.DeleteFirst="string-delete-first",n.DeleteIndex="string-delete-index",n.AddIndex="string-add-index",n.ReplaceFirst="string-replace-first",n.ReplaceLast="string-replace-last",n.ReplaceIndex="string-replace-index",n.ReplaceSingleMatch="string-replace-single-match",n.ReplaceAllMatches="string-replace-all-matches",n.GetIndex="string-get-index",n.GetFirst="string-get-first",n.GetLast="string-get-last",n.Append="string-append",n.Prepend="string-prepend",n))(ve||{}),j=(n=>(n.Join="list-join",n.Split="list-split",n.DeleteLast="list-delete-last",n.DeleteFirst="list-delete-first",n.DeleteIndex="list-delete-index",n.AddIndex="list-add-index",n.ReplaceFirst="list-replace-first",n.ReplaceLast="list-replace-last",n.ReplaceIndex="list-replace-index",n.ReplaceSingleMatch="list-replace-single-match",n.ReplaceAllMatches="list-replace-all-matches",n.GetIndex="list-get-index",n.GetFirst="list-get-first",n.GetLast="list-get-last",n.Append="list-append",n.Prepend="list-prepend",n))(j||{}),Ie=(n=>(n.Parallel="parallel",n.Sequential="sequential",n.Wait="wait",n))(Ie||{}),Ze=(n=>(n.CreateNewInstance="create-new-instance",n.Validate="validate",n))(Ze||{}),Ye=(n=>(n.HttpRequest="base-http-request",n))(Ye||{}),Ae=(n=>(n.Equal="equal",n.NotEqual="not-equal",n.And="and",n.Or="or",n.LessThan="less-than",n.MoreThan="more-than",n.LessThanOrEqual="less-than-or-equal",n.MoreThanOrEqual="more-than-or-equal",n))(Ae||{}),Ct=(n=>(n.Empty="empty",n.NotEmpty="not-empty",n))(Ct||{}),je=(n=>(n.ManualFlow="manual-flow-loop",n.Counted="counted-loop",n.List="list-loop",n.ObjectKeys="object-keys-loop",n.ObjectValues="object-values-loop",n.String="string-loop",n))(je||{}),qe=(n=>(n.OrDataTypeGroup="or-data-type-group",n.AndDataTypeGroup="and-data-type-group",n.DynamicArgumentTypes="dynamic-argument-types",n.DynamicReturnTypes="dynamic-return-types",n))(qe||{}),Kt=(n=>(n.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",n))(Kt||{}),_d=(n=>(n.Error="error",n.Task="task",n))(_d||{});const Fn=[r.VariableDeclaration,r.VariableInstance,r.InputMap,r.ReturnDeclaration],Se=[r.VariableDeclaration,r.VariableInstance,r.ArgumentDeclaration,r.OutputMap],Md=[...Fn,...Se],Fe=[r.VariableDeclaration,r.VariableInstance],Ar=[r.GlobalEvent],Ne=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.InternalCall,r.Loop],Eo=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.Loop],$e=[r.FunctionDeclaration,...Ar],En=[...Ne,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],Ro=[...Eo,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],en=[...Ne,...$e],Nd=[...Eo,...$e],zv=[...En,...$e],Zv=[...Ro,...$e],st=[...$e,r.Loop],Oe=[r.ReturnStatement,r.BreakStatement,r.ContinueStatement],Xv=[r.CustomEntity,r.BuiltInBaseEntity,r.Project,r.InstalledProject,r.GlobalEvent,r.DataType,r.FunctionCall,r.FunctionDeclaration,r.ActionDescriptor,r.ValueDescriptor,r.ArgumentDeclaration,r.InputMap,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.ReturnDeclaration,r.OutputMap,r.PrimitiveEntity,r.PrimitiveValue,r.Property,r.Operation,r.Condition,r.VariableDeclaration,r.VariableInstance,r.Search,r.Loop,r.InternalCall],bo=[r.CustomEntity,r.GlobalEvent,r.FunctionDeclaration,r.FunctionCall,r.VariableDeclaration,r.VariableInstance,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.InstalledProject,r.Loop,r.Search],$d=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor],Sr=[r.BuiltInBaseEntity,r.PrimitiveEntity],Qv=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.GlobalEvent,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor,r.InputMap,r.OutputMap,r.FunctionCall,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.VariableInstance,r.PrimitiveValue,r.InternalCall],F={type:r.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:g.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},xn={type:r.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:g.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ce={type:r.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:g.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Xe={type:r.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Vd={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:r.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:r.DataType},Ld={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:r.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:r.Property},Gd={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.JSON,autogeneration:null,value:[],valueAsType:null,parent:Vd},parent:Ld},Fd={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:r.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:r.PrimitiveEntity},xd={required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Gd,description:"Options for the enum. Each option is a text value.",parent:Fd},Rn={type:r.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:g.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[xd],methods:[]},Or={type:r.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:g.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ta={type:r.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:g.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[F],properties:[],methods:[]},go={type:r.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Ud=(n=>(n.FirstInputNumber="number-addition-first-number-argument-declaration",n.SecondInputNumber="number-addition-second-number-argument-declaration",n))(Ud||{}),jd=(n=>(n.ResultNumber="number-addition-result-number-return-delaration",n.Error="number-addition-error-return-delaration",n))(jd||{});const kd={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:r.ValueDescriptor},qd={id:"number-addition-first-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kd},Jd={type:r.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:r.ValueDescriptor},Wd={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Jd},Hd={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:r.ValueDescriptor},Yd={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Hd},zd={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:at.Addition,entityType:r.ActionDescriptor},vo={id:"number-addition-first-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:qd,required:!0,parentRelationType:O.FixedArguments,index:0,parent:zd},Zd={type:r.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:at.Addition,entityType:r.ActionDescriptor},Io={id:"number-addition-second-number-argument-declaration",type:r.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:Wd,required:!0,parentRelationType:O.FixedArguments,index:1,parent:Zd},Xd={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:at.Addition,entityType:r.ActionDescriptor},Po={parentRelationType:O.FixedReturns,id:"number-addition-result-number-return-delaration",type:r.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:Yd,required:!0,index:0,parent:Xd},Qd={type:r.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:at.Addition,entityType:r.ActionDescriptor},Kd={parentRelationType:O.FixedReturns,id:"number-addition-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Qd},Ea={id:at.Addition,type:r.ActionDescriptor,description:"Add two numbers together",version:1,name:at.Addition,fixedArguments:[vo,Io],error:Kd,fixedReturns:[Po],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},eu={[at.Addition]:Ea};var tu=(n=>(n.FirstInputString="join-string-first-string-argument-declaration",n.SecondInputString="join-string-second-string-argument-declaration",n))(tu||{}),nu=(n=>(n.ResultString="join-string-result-string-return-delaration",n.Error="join-string-error-return-delaration",n))(nu||{});const ru={type:r.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:r.ValueDescriptor},iu={id:"join-string-first-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ru},au={type:r.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:r.ValueDescriptor},su={id:"join-string-second-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:au},ou={type:r.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:r.ValueDescriptor},lu={id:"join-string-result-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ou},cu={type:r.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},Ra={id:"join-string-first-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:iu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:cu},du={type:r.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},ba={id:"join-string-second-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:su,parentRelationType:O.FixedArguments,required:!0,index:1,parent:du},uu={type:r.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},yi={parentRelationType:O.FixedReturns,id:"join-string-result-string-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:lu,required:!0,index:0,parent:uu},pu={type:r.GenericReference,id:"join-string-operation-error-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},yu={parentRelationType:O.FixedReturns,id:"join-string-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:pu},hi={id:ve.Join,type:r.ActionDescriptor,version:1,name:ve.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Ra,ba],fixedReturns:[yi],error:yu,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},hu={[ve.Join]:hi};var fu=(n=>(n.FirstInputList="join-list-first-list-argument-declaration",n.SecondInputList="join-list-second-list-argument-declaration",n))(fu||{}),mu=(n=>(n.ResultList="join-list-result-list-return-delaration",n.Error="join-list-error-return-delaration",n))(mu||{});const Tu={type:r.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:r.ValueDescriptor},Eu={id:"join-list-first-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Tu},Ru={type:r.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:r.ValueDescriptor},bu={id:"join-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ru},gu={type:r.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:r.ValueDescriptor},vu={id:"join-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:gu},Iu={type:r.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Pu={id:"join-list-first-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",dataType:Eu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Iu},Du={type:r.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Au={id:"join-list-second-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",dataType:bu,parentRelationType:O.FixedArguments,required:!0,index:1,parent:Du},Su={type:r.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Ou={parentRelationType:O.FixedReturns,id:"join-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:vu,required:!0,index:0,parent:Su},Cu={type:r.GenericReference,id:"join-list-operation-error-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Bu={parentRelationType:O.FixedReturns,id:"join-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Cu},Do={id:j.Join,type:r.ActionDescriptor,version:1,name:j.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[Pu,Au],error:Bu,fixedReturns:[Ou],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var wu=(n=>(n.InputList="list-to-split-argument-declaration",n.SplitIndex="split-list-index-argument-declaration",n))(wu||{}),_u=(n=>(n.FirstOutputList="split-list-first-output-list-return-delaration",n.SecondOutputList="split-list-second-output-list-return-delaration",n.Error="split-list-error-return-delaration",n))(_u||{});const Mu={type:r.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:r.ValueDescriptor},Nu={id:"split-list-operation-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Mu},$u={type:r.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:r.ValueDescriptor},Vu={id:"split-list-operation-split-index-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$u},Ao={type:r.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:r.ValueDescriptor},Lu={id:"split-list-operation-first-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ao},Gu={type:r.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Fu={id:"list-to-split-argument-declaration",type:r.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:Nu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Gu},xu={type:r.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Uu={id:"split-list-index-argument-declaration",type:r.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",dataType:Vu,parentRelationType:O.FixedArguments,required:!0,index:1,parent:xu},ju={type:r.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},ku={parentRelationType:O.FixedReturns,id:"split-list-first-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:Lu,required:!0,index:0,parent:ju},qu={id:"split-list-operation-second-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ao},Ju={type:r.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Wu={parentRelationType:O.FixedReturns,id:"split-list-second-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:qu,required:!0,index:0,parent:Ju},Hu={type:r.GenericReference,id:"split-list-operation-error-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Yu={parentRelationType:O.FixedReturns,id:"split-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Hu},So={id:j.Split,type:r.ActionDescriptor,version:1,name:j.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",fixedArguments:[Fu,Uu],fixedReturns:[ku,Wu],error:Yu,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var zu=(n=>(n.InputList="get-last-in-list-input-list-argument-declaration",n))(zu||{}),Zu=(n=>(n.OutputElement="get-last-in-list-output-element-return-delaration",n.Error="get-last-in-list-error-return-delaration",n))(Zu||{});const Xu={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:r.ValueDescriptor},Qu={id:"get-last-in-list-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Xu},Ku={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:r.ValueDescriptor},ep={id:"get-last-in-list-output-element-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ku},tp={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},np={id:"get-last-in-list-input-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:Qu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:tp},rp={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},ip={parentRelationType:O.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:r.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:ep,required:!0,index:0,parent:rp},ap={type:r.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},sp={parentRelationType:O.FixedReturns,id:"get-last-in-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ap},Oo={id:j.GetLast,type:r.ActionDescriptor,version:1,name:j.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[np],fixedReturns:[ip],error:sp,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var op=(n=>(n.List="append-to-list-lsit-argument-declaration",n.ElementToAppend="append-to-list-element-to-append-argument-declaration",n))(op||{}),lp=(n=>(n.ResultList="append-to-list-result-list-return-delaration",n.Error="append-to-list-error-return-delaration",n))(lp||{});const cp={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:r.ValueDescriptor},dp={id:"append-to-list-lsit-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:cp},up={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:r.ValueDescriptor},pp={id:"append-to-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:up},yp={type:r.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:r.ValueDescriptor},hp={id:"append-to-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:yp},fp={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},Co={id:"append-to-list-lsit-argument-declaration",type:r.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:dp,parentRelationType:O.FixedArguments,required:!0,index:0,parent:fp},mp={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},Bo={id:"append-to-list-element-to-append-argument-declaration",type:r.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:pp,parentRelationType:O.FixedArguments,required:!0,index:1,parent:mp},Tp={type:r.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},Ep={parentRelationType:O.FixedReturns,id:"append-to-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:hp,required:!0,index:0,parent:Tp},Rp={type:r.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},bp={parentRelationType:O.FixedReturns,id:"append-to-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Rp},ga={id:j.Append,type:r.ActionDescriptor,version:1,name:j.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[Co,Bo],error:bp,fixedReturns:[Ep],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},gp={[j.Join]:Do,[j.Split]:So,[j.GetLast]:Oo,[j.Append]:ga};var vp=(n=>(n.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",n))(vp||{}),Ip=(n=>(n.ListOfExecutionResults="parallel-execution-result-return-delaration",n.Error="parallel-execution-error-return-delaration",n))(Ip||{});const Pp={id:"parallel-execution-list-of-functions-blueprint-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Dp={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},Ap={id:"parallel-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Pp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Dp},Sp={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:r.ValueDescriptor},Op={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Sp},Cp={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ie.Parallel,entityType:r.ActionDescriptor},wo={id:"parallel-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Ap,required:!0,index:0,parent:Cp,parentRelationType:O.FixedArguments},Bp={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ie.Parallel,entityType:r.ActionDescriptor},_o={id:"parallel-execution-result-return-delaration",type:r.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Op,required:!0,index:0,parent:Bp,parentRelationType:O.FixedReturns},wp={type:r.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ie.Parallel,entityType:r.ActionDescriptor},_p={id:"parallel-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:wp,parentRelationType:O.ReturnedError},$t={id:Ie.Parallel,type:r.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ie.Parallel,fixedArguments:[wo],fixedReturns:[_o],argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:_p,parent:null};var Mp=(n=>(n.MillisecondsNumber="wait-milliseconds-number-argument-declaration",n))(Mp||{}),Np=(n=>(n.Error="wait-operation-error-return-delaration",n))(Np||{});const $p={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:r.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},Vp={id:"wait-milliseconds-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$p},Lp={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:r.ActionDescriptor,entityId:Ie.Wait},Un={id:"wait-milliseconds-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:Vp,required:!0,index:0,parent:Lp,parentRelationType:O.FixedArguments},Gp={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ie.Wait,entityType:r.ActionDescriptor},Fp={id:"wait-operation-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Gp,parentRelationType:O.ReturnedError},ot={id:Ie.Wait,type:r.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ie.Wait,fixedArguments:[Un],fixedReturns:[],error:Fp,argumentsType:V.Fixed,returnsType:V.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var xp=(n=>(n.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",n))(xp||{}),Up=(n=>(n.ListOfExecutionResults="sequential-execution-result-return-delaration",n.Error="sequential-execution-error-return-delaration",n))(Up||{});const jp={id:"sequential-execution-list-of-functions-blueprint-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},kp={type:r.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},qp={id:"sequential-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:jp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:kp},Jp={type:r.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:r.ValueDescriptor},Wp={id:"sequential-execution-list-of-execution-results-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Jp},Hp={type:r.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},Mo={id:"sequential-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:qp,required:!0,index:0,parent:Hp,parentRelationType:O.FixedArguments},Yp={type:r.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},No={id:"sequential-execution-result-return-delaration",type:r.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Wp,required:!0,index:0,parent:Yp,parentRelationType:O.FixedReturns},zp={type:r.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},Zp={id:"sequential-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:zp,parentRelationType:O.ReturnedError},tn={id:Ie.Sequential,type:r.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ie.Sequential,fixedArguments:[Mo],fixedReturns:[No],error:Zp,returnsType:V.Fixed,argumentsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Xp={[Ie.Parallel]:$t,[Ie.Wait]:ot,[Ie.Sequential]:tn};var Qp=(n=>(n.EntityToInstanciate="entity-to-instanciate-argument-declaration",n))(Qp||{}),Kp=(n=>(n.Error="create-new-instance-error-return-delaration",n))(Kp||{});const ey={type:r.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},ty={id:"entity-to-instanciate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ey},ny={type:r.GenericReference,id:"create-new-instance-operation-ref",entityType:r.ActionDescriptor,entityId:Ze.CreateNewInstance},ry={id:"entity-to-instanciate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:ty,required:!0,parentRelationType:O.FixedArguments,index:0,parent:ny},iy={type:r.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Ze.CreateNewInstance,entityType:r.ActionDescriptor},ay={parentRelationType:O.FixedReturns,id:"create-new-instance-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:iy,required:!0,index:0},sy={type:r.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Ze.CreateNewInstance,entityType:r.ActionDescriptor},oy={parentRelationType:O.FixedReturns,id:"create-new-instance-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:sy},Cr={id:Ze.CreateNewInstance,type:r.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Ze.CreateNewInstance,fixedArguments:[ry],fixedReturns:[ay],error:oy,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var ly=(n=>(n.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",n.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",n))(ly||{}),cy=(n=>(n.Error="validate-data-error-return-delaration",n.OutputEntity="validate-data-output-entity-declaration",n))(cy||{});const dy={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},uy={id:"validate-data-operation-data-to-validate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:dy},py={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ze.Validate},yy={id:"validate-data-operation-data-to-validate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:uy,required:!0,parentRelationType:O.FixedArguments,index:0,parent:py},hy={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},fy={id:"validate-data-operation-entity-to-match-type-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:hy},my={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ze.Validate},Ty={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:fy,required:!0,index:0,parentRelationType:O.FixedArguments,parent:my},Ey={type:r.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Ze.Validate,entityType:r.ActionDescriptor},Ry={id:"validate-data-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:Ey,required:!0,index:0,parentRelationType:O.FixedReturns},by={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ze.Validate,entityType:r.ActionDescriptor},gy={id:"validate-data-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:by,parentRelationType:O.ReturnedError},jn={id:Ze.Validate,type:r.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Ze.Validate,fixedArguments:[Ty,yy],fixedReturns:[Ry],error:gy,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},vy={[Ze.CreateNewInstance]:Cr,[Ze.Validate]:jn};var $o=(n=>(n.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",n))($o||{});const Ve={[r.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[r.BuiltInBaseEntity]:{[w.KEY_VALUE_PARAM]:{id:w.KEY_VALUE_PARAM},[w.HTTP_ENDPOINT]:{id:w.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[w.PERSISTED_ENTITY]:{id:w.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[w.RELATIONAL_DATABASE]:{id:w.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id"}},[w.CRON_JOB]:{id:w.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[r.Operation]:{[ve.Join]:{id:ve.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[Ye.HttpRequest]:{id:Ye.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[r.Loop]:{[je.List]:{id:je.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[je.ManualFlow]:{id:je.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}}},[r.Condition]:{[Ae.MoreThanOrEqual]:{id:Ae.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[Ct.NotEmpty]:{id:Ct.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[r.GlobalEvent]:{[Kt.PROJECT_PUBLICATION_COMPLETED]:{id:Kt.PROJECT_PUBLICATION_COMPLETED}}},Je=Ve[r.Operation]["base-http-request"],Iy={type:r.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:r.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},Py={id:"http-request-url-default-value-id",type:r.PrimitiveValue,version:1,value:"https://some-url.com",name:g.String,valueAsType:null,parent:Iy,autogeneration:null},Dy={type:r.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Je.inputs.url,entityType:r.ValueDescriptor},Ay={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:Py,constant:!1,parent:Dy},Sy={type:r.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Je.inputs.query,entityType:r.ValueDescriptor},Oy={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Sy},Cy={type:r.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:r.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},By={id:"http-request-method-default-value-id",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,valueAsType:null,parent:Cy,autogeneration:null},wy={type:r.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Je.inputs.method,entityType:r.ValueDescriptor},_y={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:By,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:wy},My={type:r.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Je.inputs.headers,entityType:r.ValueDescriptor},Ny={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:My},$y={type:r.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Je.inputs.body,entityType:r.ValueDescriptor},Vy={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$y},Ly={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Je.outputs.code},Gy={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ly},Fy={type:r.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:r.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},xy={type:r.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:r.ValueDescriptor,entityId:Je.outputs.headers},Uy={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:g.JSON,parent:Fy,valueAsType:null,autogeneration:null},constant:!1,parent:xy},jy={type:r.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:r.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},ky={type:r.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:r.ValueDescriptor,entityId:Je.outputs.body},qy={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:g.JSON,parent:jy,valueAsType:null,autogeneration:null},constant:!1,parent:ky},Jy={type:r.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},va={id:Je.inputs.method,type:r.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",dataType:_y,required:!1,index:0,parentRelationType:O.FixedArguments,parent:Jy},Wy={type:r.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Ia={id:Je.inputs.url,type:r.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:Ay,required:!1,index:1,parentRelationType:O.FixedArguments,parent:Wy},Hy={type:r.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Vo={id:Je.inputs.query,type:r.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",dataType:Oy,required:!1,index:2,parentRelationType:O.FixedArguments,parent:Hy},Yy={type:r.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Pa={id:Je.inputs.headers,type:r.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",dataType:Ny,required:!1,index:3,parent:Yy,parentRelationType:O.FixedArguments},zy={type:r.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Da={id:Je.inputs.body,type:r.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:Vy,required:!1,index:4,parentRelationType:O.FixedArguments,parent:zy},Zy={type:r.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Lo={id:Je.outputs.code,type:r.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",dataType:Gy,required:!0,index:0,parentRelationType:O.FixedReturns,parent:Zy},Xy={type:r.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Aa={parentRelationType:O.FixedReturns,id:Je.outputs.headers,type:r.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",dataType:Uy,required:!0,index:1,parent:Xy},Qy={type:r.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},fi={parentRelationType:O.FixedReturns,id:Je.outputs.body,type:r.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:qy,required:!0,index:2,parent:Qy},Ky={type:r.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},eh={type:r.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:r.ValueDescriptor,entityId:Je.outputs.error},th={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:eh},Go={parentRelationType:O.ReturnedError,id:Je.outputs.error,type:r.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:th,required:!0,index:0,parent:Ky},mi={type:r.ActionDescriptor,id:Ye.HttpRequest,name:Ye.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,fixedArguments:[va,Ia,Vo,Pa,Da],fixedReturns:[Lo,Aa,fi],argumentsType:V.Fixed,returnsType:V.Fixed,error:Go,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},nh={[Ye.HttpRequest]:mi},Kv={...hu,...eu,...gp,...Xp,...vy,...nh},rh=Ve[r.Loop]["list-loop"],ih={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:r.GenericReference,entityId:je.List,entityType:r.ActionDescriptor},ah={id:rh.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:ih,parentRelationType:O.FixedReturns},sh={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:r.ArgumentDeclaration},oh={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:sh},lh={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:je.List,entityType:r.ActionDescriptor},ch={id:rh.inputs.list,type:r.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:oh,index:0,parent:lh,parentRelationType:O.FixedArguments},kn={id:je.List,type:r.ActionDescriptor,version:1,name:je.List,description:"Iterates over a list of entities",fixedArguments:[ch],fixedReturns:[ah],error:null,argumentsType:V.Fixed,returnsType:V.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},eI=Ve[r.Loop]["list-loop"],dh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:r.ReturnDeclaration},uh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:dh},ph={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:r.GenericReference,entityId:je.ManualFlow,entityType:r.ActionDescriptor},yh={id:eI.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:uh,required:!0,index:1,parentRelationType:O.FixedReturns,parent:ph},Fo={id:je.ManualFlow,type:r.ActionDescriptor,version:1,name:je.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[yh],argumentsType:V.None,returnsType:V.Fixed,error:null,parent:null},Sa=Ve[r.BuiltInBaseEntity][w.KEY_VALUE_PARAM],tI={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:r.DataType},hh={id:"key-value-param-built-in-base-entity-name-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:r.Property},nI={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:null,parent:hh},fh={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:r.GenericReference,entityId:Sa.id,entityType:r.BuiltInBaseEntity},mh={required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:nI,description:"The name of the path parameter",parent:fh},rI={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:r.DataType},Th={id:"key-value-param-built-in-base-entity-value-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:r.Property},iI={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:null,parent:Th},Eh={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:r.GenericReference,entityId:Sa.id,entityType:r.BuiltInBaseEntity},Rh={required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:iI,description:"The value of the path parameter",parent:Eh},Oa={id:Sa.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Sa.id,type:r.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[mh,Rh],abstractMethods:[],methods:[],extends:[]},Ti=Ve[r.BuiltInBaseEntity][w.HTTP_ENDPOINT].properties,bh={id:"endpointBuiltInCorsPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},gh={id:"endpointBuiltInCorsPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:Ti.cors},vh={id:"endpointBuiltInCorsPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:["*"],parent:bh,autogeneration:null,valueAsType:null},parent:gh},Ih={id:"endpointBuiltInBaseEntityRef",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Ph={required:!0,id:Ti.cors,name:"Allowed origins",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:vh,description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:Ih},Dh={id:"endpointBuiltInPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Ah={id:"endpointBuiltInPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:Ti.path},Sh={id:"endpointBuiltInPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.String,value:"/",parent:Dh,autogeneration:null,valueAsType:null},parent:Ah},Oh={id:"endpointBuiltInBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},xo={required:!0,id:Ti.path,name:"Path",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:Sh,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Oh},Ch={id:"endpointBuiltInMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Bh={id:"endpointBuiltInMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"endpointBuiltInMethodProperty"},wh={id:"endpointBuiltInMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:Ch,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Bh},_h={id:"endpointBuiltInBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Uo={required:!0,id:Ti.method,name:"Method",version:1,type:r.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:wh,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:_h},Mh={id:"endpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestHeadersVariableDataType"},Nh={id:"endpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},$h={id:"endpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:Mh,autogeneration:null,valueAsType:null},parent:Nh},Vh={id:"endpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},Lh={id:"endpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:Vh},Gh={id:"endpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Fh={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},xh={id:"endpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:Oa,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:[],parent:Gh,autogeneration:null,valueAsType:null},parent:Fh},Uh={id:"endpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointPathParamsVariableDataType"},jh={id:"endpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},kh={id:"endpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Oa,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:[],parent:Uh,autogeneration:null,valueAsType:null},parent:jh},qh={id:"endpointReachedTriggerActionDescriptorRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Jh={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ValueDescriptor,name:"Request headers",dataType:$h,required:!0,index:0,parentRelationType:O.FixedArguments,parent:qh},Wh={id:"endpointReachedTriggerActionDescriptorRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Hh={id:"endpointPathParamsArgumentDeclaration",type:r.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:kh,required:!0,index:1,parentRelationType:O.FixedArguments,parent:Wh},Yh={id:"endpointReachedTriggerActionDescriptorRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},zh={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:r.ValueDescriptor,name:"Request query params",dataType:xh,required:!0,index:2,parentRelationType:O.FixedArguments,parent:Yh},Zh={id:"endpointReachedTriggerActionDescriptorRefFour",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Xh={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ValueDescriptor,name:"Request body",dataType:Lh,index:3,required:!0,parentRelationType:O.FixedArguments,parent:Zh},Qh={id:"endpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},Kh={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Qh},ef={id:"endpointReturnStatementRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},tf={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:r.ValueDescriptor,name:"Response code",dataType:Kh,required:!0,index:0,parentRelationType:O.FixedReturns,parent:ef},nf={id:"endpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointResponseHeadersDataType"},rf={id:"endpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},af={id:"endpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:nf,autogeneration:null,valueAsType:null},parent:rf},sf={id:"endpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},of={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ValueDescriptor,name:"Response headers",dataType:af,required:!1,index:1,parentRelationType:O.FixedReturns,parent:sf},lf={id:"endpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},cf={id:"endpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:lf},df={id:"endpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},uf={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ValueDescriptor,name:"Response body",dataType:cf,required:!1,index:2,parentRelationType:O.FixedReturns,parent:df},pf={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},jo={id:"endpointReachedTriggerActionDescriptor",type:r.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:V.Fixed,dynamicArgumentTypes:null,fixedArguments:[Jh,Hh,zh,Xh],returnsType:V.Fixed,fixedReturns:[tf,of,uf],error:null,dynamicReturnTypes:null,parent:pf},Ca={id:w.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:w.HTTP_ENDPOINT,type:r.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Ph,xo,Uo],abstractMethods:[jo],extends:[],methods:[]},jt=Ve[r.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,yf={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},hf={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:jt.properties.identifier,entityType:r.Property},aI={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:yf,autogeneration:{type:Ue.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:hf},Br={id:"relational-database-built-in-base-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Ba={required:!0,id:jt.properties.identifier,name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:aI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Br},sI={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:r.DataType},ff={id:"relational-database-built-in-base-entity-username-property-ref-id",type:r.GenericReference,entityId:jt.properties.username,entityType:r.Property},oI={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:r.DataType},autogeneration:null,valueAsType:null},parent:ff},wa={required:!0,id:jt.properties.username,name:"Username",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:oI,description:"The username that will be used to connect to the database.",parent:Br},lI={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:r.DataType},mf={id:"relational-database-built-in-base-entity-password-property-ref-id",type:r.GenericReference,entityId:jt.properties.password,entityType:r.Property},cI={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:mf},_a={required:!0,id:jt.properties.password,name:"Password",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:cI,description:"The password that will be used to connect to the database.",parent:Br},Tf={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:r.DataType},Ef={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:r.GenericReference,entityId:jt.properties.minSize,entityType:r.Property},dI={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:Tf,autogeneration:null,valueAsType:null},parent:Ef},Ma={required:!0,id:jt.properties.minSize,name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:dI,description:"The minimum size of the database in GB.",parent:Br},Rf={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:r.DataType},bf={id:"relational-database-built-in-base-entity-default-property-ref-id",type:r.GenericReference,entityId:jt.properties.default,entityType:r.Property},uI={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:xn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.Boolean,value:!1,parent:Rf,autogeneration:null,valueAsType:null},parent:bf},gf={required:!0,id:jt.properties.default,name:"Default",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:uI,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Br},bn={id:w.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:w.RELATIONAL_DATABASE,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Ba,wa,_a,Ma,gf],abstractMethods:[],methods:[],extends:[]},vf={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:vt.DeletePersistedEntity},ko={type:r.FunctionDeclaration,id:vt.DeletePersistedEntity,name:vt.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:vf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},If={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:vt.SoftDeletePersistedEntity},Pf={type:r.FunctionDeclaration,id:vt.SoftDeletePersistedEntity,name:vt.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:If,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},Df=Ve[r.BuiltInBaseEntity][w.PERSISTED_ENTITY].properties,pI={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:r.DataType},Af={id:"persisted-built-in-base-entity-database-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:r.Property},yI={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:bn,asType:!1,defaultValue:null,parent:Af},Sf={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Ei={required:!0,id:Df.database,name:"Database",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:yI,description:"The database that the entity belongs to.",parent:Sf},Of={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},Cf={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:r.Property},hI={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ta,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.UUID,value:null,parent:Of,autogeneration:{type:Ue.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Cf},Bf={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},wf={required:!0,id:Df.identifier,name:"Identifier",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:hI,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:Bf},fI={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:r.DataType},_f={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:r.Property},Mf={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:null,asType:!1,defaultValue:null,parent:_f},Nf={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},$f={required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Mf,description:"The date and time when the entity was deleted.",parent:Nf},mI={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:r.DataType},Vf={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:r.Property},Lf={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Vf},Gf={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Ff={required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Lf,description:"The date and time when the entity was created.",parent:Gf},TI={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:r.DataType},xf={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:r.Property},Uf={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:xf},jf={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},kf={required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:r.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:Uf,description:"The date and time when the entity was last updated.",parent:jf},Be={id:w.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:w.PERSISTED_ENTITY,type:r.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[Ei,wf,$f,Ff,kf],methods:[ko,Pf],extends:[]},qf={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},qo={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:r.ActionDescriptor,argumentsType:V.None,returnsType:V.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:qf},Jf=Ve[r.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,EI={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:r.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:r.DataType},Wf={id:"cron-job-built-in-base-entity-expression-property-ref",type:r.GenericReference,entityId:Jf.properties.expression,entityType:r.Property},RI={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:Wf},Hf={id:"cron-job-built-in-base-entity-ref",type:r.GenericReference,entityId:w.CRON_JOB,entityType:r.BuiltInBaseEntity},Yf={required:!0,id:Jf.properties.expression,name:"Cron expression",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:RI,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:Hf},Jo={id:w.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:w.CRON_JOB,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Yf],methods:[],abstractMethods:[qo],extends:[]},zf={type:r.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:r.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Wo={id:"execution-built-in-entity-abort-method-id",type:r.FunctionDeclaration,version:1,name:vt.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:zf},Ho={id:w.EXECUTION,type:r.BuiltInBaseEntity,version:1,name:w.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[Wo],abstractMethods:[]},bI=Ve[r.Condition]["not-empty"],Zf={type:r.GenericReference,id:"not-empty-condition-ref",entityType:r.ActionDescriptor,entityId:Ct.NotEmpty},Xf={id:bI.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:Zf},qn={type:r.ActionDescriptor,id:Ct.NotEmpty,version:1,name:Ct.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[Xf],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},Qf={[Ct.NotEmpty]:qn},Kf=Ve[r.Condition]["more-than-or-equal"],em={type:r.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ae.MoreThanOrEqual},tm={id:Kf.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:em},nm={type:r.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ae.MoreThanOrEqual},rm={id:Kf.inputs.rightHand,type:r.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:1,parent:nm},wr={type:r.ActionDescriptor,id:Ae.MoreThanOrEqual,version:1,name:Ae.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[tm,rm],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.Fixed,returnsType:V.None,error:null},im={[Ae.MoreThanOrEqual]:wr},gI={...Qf,...im},Na={type:r.ActionDescriptor,id:Kt.PROJECT_PUBLICATION_COMPLETED,version:1,name:Kt.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:V.None,returnsType:V.None,error:null},vI={[Kt.PROJECT_PUBLICATION_COMPLETED]:Na},Yo=Ve[r.ValueDescriptor][$o.ActionOngoingProcessOutputValue],am={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Yo.id},sm={id:Yo.dataType.id,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ho,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:am},zo={id:Yo.id,type:r.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:sm,required:!0,index:0,parent:null,parentRelationType:O.OngoingProcessExecution};var Y;(function(n){n.assertEqual=a=>a;function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),o={};for(const u of s)o[u]=a[u];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},n.find=(a,s)=>{for(const o of a)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function i(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(Y||(Y={}));var Zo;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Zo||(Zo={}));const _=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gn=n=>{switch(typeof n){case"undefined":return _.undefined;case"string":return _.string;case"number":return isNaN(n)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(n)?_.array:n===null?_.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?_.promise:typeof Map<"u"&&n instanceof Map?_.map:typeof Set<"u"&&n instanceof Set?_.set:typeof Date<"u"&&n instanceof Date?_.date:_.object;default:return _.unknown}},P=Y.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),II=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)i._errors.push(t(o));else{let u=i,p=0;for(;p<o.path.length;){const h=o.path[p];p===o.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(o))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return a(this),i}static assert(e){if(!(e instanceof ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):i.push(e(a));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}ft.create=n=>new ft(n);const _r=(n,e)=>{let t;switch(n.code){case P.invalid_type:n.received===_.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case P.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,Y.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:t=`Unrecognized key(s) in object: ${Y.joinValues(n.keys,", ")}`;break;case P.invalid_union:t="Invalid input";break;case P.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Y.joinValues(n.options)}`;break;case P.invalid_enum_value:t=`Invalid enum value. Expected ${Y.joinValues(n.options)}, received '${n.received}'`;break;case P.invalid_arguments:t="Invalid function arguments";break;case P.invalid_return_type:t="Invalid function return type";break;case P.invalid_date:t="Invalid date";break;case P.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:Y.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case P.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case P.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case P.custom:t="Invalid input";break;case P.invalid_intersection_types:t="Intersection results could not be merged";break;case P.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case P.not_finite:t="Number must be finite";break;default:t=e.defaultError,Y.assertNever(n)}return{message:t}};let om=_r;function PI(n){om=n}function $a(){return om}const Va=n=>{const{data:e,path:t,errorMaps:i,issueData:a}=n,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let u="";const p=i.filter(h=>!!h).slice().reverse();for(const h of p)u=h(o,{data:e,defaultError:u}).message;return{...a,path:s,message:u}},DI=[];function B(n,e){const t=$a(),i=Va({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===_r?void 0:_r].filter(a=>!!a)});n.common.issues.push(i)}class Qe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const a of t){if(a.status==="aborted")return U;a.status==="dirty"&&e.dirty(),i.push(a.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const a of t){const s=await a.key,o=await a.value;i.push({key:s,value:o})}return Qe.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return U;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const U=Object.freeze({status:"aborted"}),Mr=n=>({status:"dirty",value:n}),lt=n=>({status:"valid",value:n}),Xo=n=>n.status==="aborted",Qo=n=>n.status==="dirty",Ri=n=>n.status==="valid",bi=n=>typeof Promise<"u"&&n instanceof Promise;function La(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function lm(n,e,t,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(n,t):a?a.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var $;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})($||($={}));var gi,vi;class kt{constructor(e,t,i,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cm=(n,e)=>{if(Ri(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ft(n.common.issues);return this._error=t,this._error}}};function k(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:a}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,u)=>{var p,h;const{message:m}=n;return o.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:o.code!=="invalid_type"?{message:u.defaultError}:{message:(h=m??t)!==null&&h!==void 0?h:u.defaultError}},description:a}}class W{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return gn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qe,ctx:{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(bi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const a={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return cm(a,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gn(e)},a=this._parse({data:e,path:i.path,parent:i}),s=await(bi(a)?a:Promise.resolve(a));return cm(i,s)}refine(e,t){const i=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),u=()=>s.addIssue({code:P.custom,...i(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(u(),!1)):o?!0:(u(),!1)})}refinement(e,t){return this._refinement((i,a)=>e(i)?!0:(a.addIssue(typeof t=="function"?t(i,a):t),!1))}_refinement(e){return new Gt({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Jt.create(this,this._def)}nullable(){return Dn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lt.create(this,this._def)}promise(){return Lr.create(this,this._def)}or(e){return Ai.create([this,e],this._def)}and(e){return Si.create(this,e,this._def)}transform(e){return new Gt({...k(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new _i({...k(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new tl({typeName:x.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Mi({...k(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ni.create(this,e)}readonly(){return $i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const AI=/^c[^\s-]{8,}$/i,SI=/^[0-9a-z]+$/,OI=/^[0-9A-HJKMNP-TV-Z]{26}$/,CI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BI=/^[a-z0-9_-]{21}$/i,wI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_I=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,MI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ko;const NI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$I=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,VI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",LI=new RegExp(`^${dm}$`);function um(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function GI(n){return new RegExp(`^${um(n)}$`)}function pm(n){let e=`${dm}T${um(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function FI(n,e){return!!((e==="v4"||!e)&&NI.test(n)||(e==="v6"||!e)&&$I.test(n))}class Vt extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.string,received:s.parsedType}),U}const i=new Qe;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,u=e.data.length<s.value;(o||u)&&(a=this._getOrReturnCtx(e,a),o?B(a,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&B(a,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")_I.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"email",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ko||(Ko=new RegExp(MI,"u")),Ko.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"emoji",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")CI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"uuid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")BI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"nanoid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")AI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")SI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid2",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")OI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ulid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),B(a,{validation:"url",code:P.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"regex",code:P.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?pm(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?LI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?GI(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?wI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"duration",code:P.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?FI(e.data,s.version)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ip",code:P.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?VI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"base64",code:P.invalid_string,message:s.message}),i.dirty()):Y.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(a=>e.test(a),{validation:t,code:P.invalid_string,...$.errToObj(i)})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...$.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...$.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...$.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...$.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Vt.create=n=>{var e;return new Vt({checks:[],typeName:x.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};function xI(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=t>i?t:i,s=parseInt(n.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class vn extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.number,received:s.parsedType}),U}let i;const a=new Qe;for(const s of this._def.checks)s.kind==="int"?Y.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:P.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?xI(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_finite,message:s.message}),a.dirty()):Y.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,i,a){return new vn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:$.toString(a)}]})}_addCheck(e){return new vn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:$.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Y.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}vn.create=n=>new vn({checks:[],typeName:x.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class In extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==_.bigint){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.bigint,received:s.parsedType}),U}let i;const a=new Qe;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):Y.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$.toString(t))}setLimit(e,t,i,a){return new In({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:$.toString(a)}]})}_addCheck(e){return new In({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}In.create=n=>{var e;return new In({checks:[],typeName:x.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};class Ii extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.boolean,received:i.parsedType}),U}return lt(e.data)}}Ii.create=n=>new Ii({typeName:x.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class Jn extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.date,received:s.parsedType}),U}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_date}),U}const i=new Qe;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Y.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Jn.create=n=>new Jn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:x.ZodDate,...k(n)});class Ga extends W{_parse(e){if(this._getType(e)!==_.symbol){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.symbol,received:i.parsedType}),U}return lt(e.data)}}Ga.create=n=>new Ga({typeName:x.ZodSymbol,...k(n)});class Pi extends W{_parse(e){if(this._getType(e)!==_.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.undefined,received:i.parsedType}),U}return lt(e.data)}}Pi.create=n=>new Pi({typeName:x.ZodUndefined,...k(n)});class Di extends W{_parse(e){if(this._getType(e)!==_.null){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.null,received:i.parsedType}),U}return lt(e.data)}}Di.create=n=>new Di({typeName:x.ZodNull,...k(n)});class Nr extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}}Nr.create=n=>new Nr({typeName:x.ZodAny,...k(n)});class Wn extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}}Wn.create=n=>new Wn({typeName:x.ZodUnknown,...k(n)});class nn extends W{_parse(e){const t=this._getOrReturnCtx(e);return B(t,{code:P.invalid_type,expected:_.never,received:t.parsedType}),U}}nn.create=n=>new nn({typeName:x.ZodNever,...k(n)});class Fa extends W{_parse(e){if(this._getType(e)!==_.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.void,received:i.parsedType}),U}return lt(e.data)}}Fa.create=n=>new Fa({typeName:x.ZodVoid,...k(n)});class Lt extends W{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==_.array)return B(t,{code:P.invalid_type,expected:_.array,received:t.parsedType}),U;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,u=t.data.length<a.exactLength.value;(o||u)&&(B(t,{code:o?P.too_big:P.too_small,minimum:u?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(B(t,{code:P.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(B(t,{code:P.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((o,u)=>a.type._parseAsync(new kt(t,o,t.path,u)))).then(o=>Qe.mergeArray(i,o));const s=[...t.data].map((o,u)=>a.type._parseSync(new kt(t,o,t.path,u)));return Qe.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new Lt({...this._def,minLength:{value:e,message:$.toString(t)}})}max(e,t){return new Lt({...this._def,maxLength:{value:e,message:$.toString(t)}})}length(e,t){return new Lt({...this._def,exactLength:{value:e,message:$.toString(t)}})}nonempty(e){return this.min(1,e)}}Lt.create=(n,e)=>new Lt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...k(e)});function $r(n){if(n instanceof we){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Jt.create($r(i))}return new we({...n._def,shape:()=>e})}else return n instanceof Lt?new Lt({...n._def,type:$r(n.element)}):n instanceof Jt?Jt.create($r(n.unwrap())):n instanceof Dn?Dn.create($r(n.unwrap())):n instanceof qt?qt.create(n.items.map(e=>$r(e))):n}class we extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Y.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==_.object){const h=this._getOrReturnCtx(e);return B(h,{code:P.invalid_type,expected:_.object,received:h.parsedType}),U}const{status:i,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof nn&&this._def.unknownKeys==="strip"))for(const h in a.data)o.includes(h)||u.push(h);const p=[];for(const h of o){const m=s[h],T=a.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new kt(a,T,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof nn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(h==="strict")u.length>0&&(B(a,{code:P.unrecognized_keys,keys:u}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of u){const T=a.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new kt(a,T,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const T=await m.key,b=await m.value;h.push({key:T,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>Qe.mergeObjectSync(i,h)):Qe.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return $.errToObj,new we({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var a,s,o,u;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,i).message)!==null&&o!==void 0?o:i.defaultError;return t.code==="unrecognized_keys"?{message:(u=$.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new we({...this._def,unknownKeys:"strip"})}passthrough(){return new we({...this._def,unknownKeys:"passthrough"})}extend(e){return new we({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new we({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new we({...this._def,catchall:e})}pick(e){const t={};return Y.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new we({...this._def,shape:()=>t})}omit(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new we({...this._def,shape:()=>t})}deepPartial(){return $r(this)}partial(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];e&&!e[i]?t[i]=a:t[i]=a.optional()}),new we({...this._def,shape:()=>t})}required(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Jt;)s=s._def.innerType;t[i]=s}}),new we({...this._def,shape:()=>t})}keyof(){return ym(Y.objectKeys(this.shape))}}we.create=(n,e)=>new we({shape:()=>n,unknownKeys:"strip",catchall:nn.create(),typeName:x.ZodObject,...k(e)}),we.strictCreate=(n,e)=>new we({shape:()=>n,unknownKeys:"strict",catchall:nn.create(),typeName:x.ZodObject,...k(e)}),we.lazycreate=(n,e)=>new we({shape:n,unknownKeys:"strip",catchall:nn.create(),typeName:x.ZodObject,...k(e)});class Ai extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function a(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const o=s.map(u=>new ft(u.ctx.common.issues));return B(t,{code:P.invalid_union,unionErrors:o}),U}if(t.common.async)return Promise.all(i.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of i){const h={...t,common:{...t.common,issues:[]},parent:null},m=p._parseSync({data:t.data,path:t.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const u=o.map(p=>new ft(p));return B(t,{code:P.invalid_union,unionErrors:u}),U}}get options(){return this._def.options}}Ai.create=(n,e)=>new Ai({options:n,typeName:x.ZodUnion,...k(e)});const rn=n=>n instanceof Ci?rn(n.schema):n instanceof Gt?rn(n.innerType()):n instanceof Bi?[n.value]:n instanceof Pn?n.options:n instanceof wi?Y.objectValues(n.enum):n instanceof _i?rn(n._def.innerType):n instanceof Pi?[void 0]:n instanceof Di?[null]:n instanceof Jt?[void 0,...rn(n.unwrap())]:n instanceof Dn?[null,...rn(n.unwrap())]:n instanceof tl||n instanceof $i?rn(n.unwrap()):n instanceof Mi?rn(n._def.innerType):[];class xa extends W{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.object)return B(t,{code:P.invalid_type,expected:_.object,received:t.parsedType}),U;const i=this.discriminator,a=t.data[i],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(B(t,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const a=new Map;for(const s of t){const o=rn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of o){if(a.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);a.set(u,s)}}return new xa({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...k(i)})}}function el(n,e){const t=gn(n),i=gn(e);if(n===e)return{valid:!0,data:n};if(t===_.object&&i===_.object){const a=Y.objectKeys(e),s=Y.objectKeys(n).filter(u=>a.indexOf(u)!==-1),o={...n,...e};for(const u of s){const p=el(n[u],e[u]);if(!p.valid)return{valid:!1};o[u]=p.data}return{valid:!0,data:o}}else if(t===_.array&&i===_.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<n.length;s++){const o=n[s],u=e[s],p=el(o,u);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===_.date&&i===_.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Si extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=(s,o)=>{if(Xo(s)||Xo(o))return U;const u=el(s.value,o.value);return u.valid?((Qo(s)||Qo(o))&&t.dirty(),{status:t.value,value:u.data}):(B(i,{code:P.invalid_intersection_types}),U)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Si.create=(n,e,t)=>new Si({left:n,right:e,typeName:x.ZodIntersection,...k(t)});class qt extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.array)return B(i,{code:P.invalid_type,expected:_.array,received:i.parsedType}),U;if(i.data.length<this._def.items.length)return B(i,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new kt(i,o,i.path,u)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Qe.mergeArray(t,o)):Qe.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new qt({...this._def,rest:e})}}qt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qt({items:n,typeName:x.ZodTuple,rest:null,...k(e)})};class Oi extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.object)return B(i,{code:P.invalid_type,expected:_.object,received:i.parsedType}),U;const a=[],s=this._def.keyType,o=this._def.valueType;for(const u in i.data)a.push({key:s._parse(new kt(i,u,i.path,u)),value:o._parse(new kt(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?Qe.mergeObjectAsync(t,a):Qe.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof W?new Oi({keyType:e,valueType:t,typeName:x.ZodRecord,...k(i)}):new Oi({keyType:Vt.create(),valueType:e,typeName:x.ZodRecord,...k(t)})}}class Ua extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.map)return B(i,{code:P.invalid_type,expected:_.map,received:i.parsedType}),U;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([u,p],h)=>({key:a._parse(new kt(i,u,i.path,[h,"key"])),value:s._parse(new kt(i,p,i.path,[h,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of o){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return U;(h.status==="dirty"||m.status==="dirty")&&t.dirty(),u.set(h.value,m.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const p of o){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return U;(h.status==="dirty"||m.status==="dirty")&&t.dirty(),u.set(h.value,m.value)}return{status:t.value,value:u}}}}Ua.create=(n,e,t)=>new Ua({valueType:e,keyType:n,typeName:x.ZodMap,...k(t)});class Hn extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.set)return B(i,{code:P.invalid_type,expected:_.set,received:i.parsedType}),U;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(B(i,{code:P.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(B(i,{code:P.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const h=new Set;for(const m of p){if(m.status==="aborted")return U;m.status==="dirty"&&t.dirty(),h.add(m.value)}return{status:t.value,value:h}}const u=[...i.data.values()].map((p,h)=>s._parse(new kt(i,p,i.path,h)));return i.common.async?Promise.all(u).then(p=>o(p)):o(u)}min(e,t){return new Hn({...this._def,minSize:{value:e,message:$.toString(t)}})}max(e,t){return new Hn({...this._def,maxSize:{value:e,message:$.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Hn.create=(n,e)=>new Hn({valueType:n,minSize:null,maxSize:null,typeName:x.ZodSet,...k(e)});class Vr extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.function)return B(t,{code:P.invalid_type,expected:_.function,received:t.parsedType}),U;function i(u,p){return Va({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$a(),_r].filter(h=>!!h),issueData:{code:P.invalid_arguments,argumentsError:p}})}function a(u,p){return Va({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$a(),_r].filter(h=>!!h),issueData:{code:P.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Lr){const u=this;return lt(async function(...p){const h=new ft([]),m=await u._def.args.parseAsync(p,s).catch(I=>{throw h.addIssue(i(p,I)),h}),T=await Reflect.apply(o,this,m);return await u._def.returns._def.type.parseAsync(T,s).catch(I=>{throw h.addIssue(a(T,I)),h})})}else{const u=this;return lt(function(...p){const h=u._def.args.safeParse(p,s);if(!h.success)throw new ft([i(p,h.error)]);const m=Reflect.apply(o,this,h.data),T=u._def.returns.safeParse(m,s);if(!T.success)throw new ft([a(m,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Vr({...this._def,args:qt.create(e).rest(Wn.create())})}returns(e){return new Vr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Vr({args:e||qt.create([]).rest(Wn.create()),returns:t||Wn.create(),typeName:x.ZodFunction,...k(i)})}}class Ci extends W{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ci.create=(n,e)=>new Ci({getter:n,typeName:x.ZodLazy,...k(e)});class Bi extends W{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return B(t,{received:t.data,code:P.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:e.data}}get value(){return this._def.value}}Bi.create=(n,e)=>new Bi({value:n,typeName:x.ZodLiteral,...k(e)});function ym(n,e){return new Pn({values:n,typeName:x.ZodEnum,...k(e)})}class Pn extends W{constructor(){super(...arguments),gi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{expected:Y.joinValues(i),received:t.parsedType,code:P.invalid_type}),U}if(La(this,gi,"f")||lm(this,gi,new Set(this._def.values),"f"),!La(this,gi,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{received:t.data,code:P.invalid_enum_value,options:i}),U}return lt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Pn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Pn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}gi=new WeakMap,Pn.create=ym;class wi extends W{constructor(){super(...arguments),vi.set(this,void 0)}_parse(e){const t=Y.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==_.string&&i.parsedType!==_.number){const a=Y.objectValues(t);return B(i,{expected:Y.joinValues(a),received:i.parsedType,code:P.invalid_type}),U}if(La(this,vi,"f")||lm(this,vi,new Set(Y.getValidEnumValues(this._def.values)),"f"),!La(this,vi,"f").has(e.data)){const a=Y.objectValues(t);return B(i,{received:i.data,code:P.invalid_enum_value,options:a}),U}return lt(e.data)}get enum(){return this._def.values}}vi=new WeakMap,wi.create=(n,e)=>new wi({values:n,typeName:x.ZodNativeEnum,...k(e)});class Lr extends W{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return B(t,{code:P.invalid_type,expected:_.promise,received:t.parsedType}),U;const i=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return lt(i.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Lr.create=(n,e)=>new Lr({type:n,typeName:x.ZodPromise,...k(e)});class Gt extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{B(i,o),o.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async u=>{if(t.value==="aborted")return U;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?U:p.status==="dirty"||t.value==="dirty"?Mr(p.value):p});{if(t.value==="aborted")return U;const u=this._def.schema._parseSync({data:o,path:i.path,parent:i});return u.status==="aborted"?U:u.status==="dirty"||t.value==="dirty"?Mr(u.value):u}}if(a.type==="refinement"){const o=u=>{const p=a.refinement(u,s);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?U:(u.status==="dirty"&&t.dirty(),o(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?U:(u.status==="dirty"&&t.dirty(),o(u.value).then(()=>({status:t.value,value:u.value}))))}if(a.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Ri(o))return o;const u=a.transform(o.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Ri(o)?Promise.resolve(a.transform(o.value,s)).then(u=>({status:t.value,value:u})):o);Y.assertNever(a)}}Gt.create=(n,e,t)=>new Gt({schema:n,typeName:x.ZodEffects,effect:e,...k(t)}),Gt.createWithPreprocess=(n,e,t)=>new Gt({schema:e,effect:{type:"preprocess",transform:n},typeName:x.ZodEffects,...k(t)});class Jt extends W{_parse(e){return this._getType(e)===_.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Jt.create=(n,e)=>new Jt({innerType:n,typeName:x.ZodOptional,...k(e)});class Dn extends W{_parse(e){return this._getType(e)===_.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dn.create=(n,e)=>new Dn({innerType:n,typeName:x.ZodNullable,...k(e)});class _i extends W{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===_.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_i.create=(n,e)=>new _i({innerType:n,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Mi extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return bi(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Mi.create=(n,e)=>new Mi({innerType:n,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class ja extends W{_parse(e){if(this._getType(e)!==_.nan){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.nan,received:i.parsedType}),U}return{status:"valid",value:e.data}}}ja.create=n=>new ja({typeName:x.ZodNaN,...k(n)});const UI=Symbol("zod_brand");class tl extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ni extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?U:s.status==="dirty"?(t.dirty(),Mr(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?U:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(e,t){return new Ni({in:e,out:t,typeName:x.ZodPipeline})}}class $i extends W{_parse(e){const t=this._def.innerType._parse(e),i=a=>(Ri(a)&&(a.value=Object.freeze(a.value)),a);return bi(t)?t.then(a=>i(a)):i(t)}unwrap(){return this._def.innerType}}$i.create=(n,e)=>new $i({innerType:n,typeName:x.ZodReadonly,...k(e)});function hm(n,e={},t){return n?Nr.create().superRefine((i,a)=>{var s,o;if(!n(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(o=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,h=typeof u=="string"?{message:u}:u;a.addIssue({code:"custom",...h,fatal:p})}}):Nr.create()}const jI={object:we.lazycreate};var x;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(x||(x={}));const kI=(n,e={message:`Input not instance of ${n.name}`})=>hm(t=>t instanceof n,e),ka=Vt.create,nl=vn.create,qI=ja.create,JI=In.create,rl=Ii.create,fm=Jn.create,WI=Ga.create,HI=Pi.create,mm=Di.create,YI=Nr.create,qa=Wn.create,zI=nn.create,ZI=Fa.create,XI=Lt.create,Tm=we.create,QI=we.strictCreate,KI=Ai.create,eP=xa.create,tP=Si.create,nP=qt.create,Em=Oi.create,rP=Ua.create,iP=Hn.create,aP=Vr.create,sP=Ci.create,oP=Bi.create,Rm=Pn.create,lP=wi.create,cP=Lr.create,bm=Gt.create,dP=Jt.create,uP=Dn.create,pP=Gt.createWithPreprocess,yP=Ni.create;var c=Object.freeze({__proto__:null,defaultErrorMap:_r,setErrorMap:PI,getErrorMap:$a,makeIssue:Va,EMPTY_PATH:DI,addIssueToContext:B,ParseStatus:Qe,INVALID:U,DIRTY:Mr,OK:lt,isAborted:Xo,isDirty:Qo,isValid:Ri,isAsync:bi,get util(){return Y},get objectUtil(){return Zo},ZodParsedType:_,getParsedType:gn,ZodType:W,datetimeRegex:pm,ZodString:Vt,ZodNumber:vn,ZodBigInt:In,ZodBoolean:Ii,ZodDate:Jn,ZodSymbol:Ga,ZodUndefined:Pi,ZodNull:Di,ZodAny:Nr,ZodUnknown:Wn,ZodNever:nn,ZodVoid:Fa,ZodArray:Lt,ZodObject:we,ZodUnion:Ai,ZodDiscriminatedUnion:xa,ZodIntersection:Si,ZodTuple:qt,ZodRecord:Oi,ZodMap:Ua,ZodSet:Hn,ZodFunction:Vr,ZodLazy:Ci,ZodLiteral:Bi,ZodEnum:Pn,ZodNativeEnum:wi,ZodPromise:Lr,ZodEffects:Gt,ZodTransformer:Gt,ZodOptional:Jt,ZodNullable:Dn,ZodDefault:_i,ZodCatch:Mi,ZodNaN:ja,BRAND:UI,ZodBranded:tl,ZodPipeline:Ni,ZodReadonly:$i,custom:hm,Schema:W,ZodSchema:W,late:jI,get ZodFirstPartyTypeKind(){return x},coerce:{string:n=>Vt.create({...n,coerce:!0}),number:n=>vn.create({...n,coerce:!0}),boolean:n=>Ii.create({...n,coerce:!0}),bigint:n=>In.create({...n,coerce:!0}),date:n=>Jn.create({...n,coerce:!0})},any:YI,array:XI,bigint:JI,boolean:rl,date:fm,discriminatedUnion:eP,effect:bm,enum:Rm,function:aP,instanceof:kI,intersection:tP,lazy:sP,literal:oP,map:rP,nan:qI,nativeEnum:lP,never:zI,null:mm,nullable:uP,number:nl,object:Tm,oboolean:()=>rl().optional(),onumber:()=>nl().optional(),optional:dP,ostring:()=>ka().optional(),pipeline:yP,preprocess:pP,promise:cP,record:Em,set:iP,strictObject:QI,string:ka,symbol:WI,transformer:bm,tuple:nP,undefined:HI,union:KI,unknown:qa,void:ZI,NEVER:U,ZodIssueCode:P,quotelessJson:II,ZodError:ft});function gm(n){var a,s,o;if(!(n!=null&&n.dataType))return qa();const e=n.dataType.isNullable||!1,t=n.dataType.isList||!1;let i=qa();if(((a=n.dataType.entity)==null?void 0:a.type)===r.PrimitiveEntity)switch(n.dataType.entity.name){case g.String:i=ka();break;case g.JSON:i=Em(qa());break;case g.Number:i=nl();break;case g.Boolean:i=rl();break;case g.Date:i=fm();break;case g.Enum:{const u=n.dataType.options||[];if(u.length===0)throw new Error(`Enum property ${n.name} has no options`);i=Rm(u);break}case g.Null:i=mm();break;case g.UUID:i=ka().uuid();break}else if(((s=n.dataType.entity)==null?void 0:s.type)===r.CustomEntity)i=vm(n.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=n.dataType.entity)==null?void 0:o.type}`);return e&&(i=i.nullable()),t&&(i=i.array()),i}function vm(n){const e=Tm({});for(const t of n.properties){const i=gm(t);e.shape[t.name]=i}return e}function Im(n){const e=n.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function Pm(n){const e=n.rangeEnd;return new Date(Math.random()*e.getTime())}function Dm(n){const e=n.rangeStart,t=n.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Am(n){return n.rangeStart&&n.rangeEnd?Dm(n):n.rangeStart?Im(n):n.rangeEnd?Pm(n):new Date}function hP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sm={},Ja={},Wa={};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.default=mP;let Ha;const fP=new Uint8Array(16);function mP(){if(!Ha&&(Ha=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ha))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ha(fP)}var An={},Yn={},Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=void 0;var TP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ya.default=TP,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=void 0;var EP=RP(Ya);function RP(n){return n&&n.__esModule?n:{default:n}}function bP(n){return typeof n=="string"&&EP.default.test(n)}var gP=bP;Yn.default=gP,Object.defineProperty(An,"__esModule",{value:!0}),An.default=void 0,An.unsafeStringify=Om;var vP=IP(Yn);function IP(n){return n&&n.__esModule?n:{default:n}}const ze=[];for(let n=0;n<256;++n)ze.push((n+256).toString(16).slice(1));function Om(n,e=0){return ze[n[e+0]]+ze[n[e+1]]+ze[n[e+2]]+ze[n[e+3]]+"-"+ze[n[e+4]]+ze[n[e+5]]+"-"+ze[n[e+6]]+ze[n[e+7]]+"-"+ze[n[e+8]]+ze[n[e+9]]+"-"+ze[n[e+10]]+ze[n[e+11]]+ze[n[e+12]]+ze[n[e+13]]+ze[n[e+14]]+ze[n[e+15]]}function PP(n,e=0){const t=Om(n,e);if(!(0,vP.default)(t))throw TypeError("Stringified UUID is invalid");return t}var DP=PP;An.default=DP,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.default=void 0;var AP=OP(Wa),SP=An;function OP(n){return n&&n.__esModule?n:{default:n}}let Cm,il,al=0,sl=0;function CP(n,e,t){let i=e&&t||0;const a=e||new Array(16);n=n||{};let s=n.node||Cm,o=n.clockseq!==void 0?n.clockseq:il;if(s==null||o==null){const b=n.random||(n.rng||AP.default)();s==null&&(s=Cm=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=il=(b[6]<<8|b[7])&16383)}let u=n.msecs!==void 0?n.msecs:Date.now(),p=n.nsecs!==void 0?n.nsecs:sl+1;const h=u-al+(p-sl)/1e4;if(h<0&&n.clockseq===void 0&&(o=o+1&16383),(h<0||u>al)&&n.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");al=u,sl=p,il=o,u+=122192928e5;const m=((u&268435455)*1e4+p)%4294967296;a[i++]=m>>>24&255,a[i++]=m>>>16&255,a[i++]=m>>>8&255,a[i++]=m&255;const T=u/4294967296*1e4&268435455;a[i++]=T>>>8&255,a[i++]=T&255,a[i++]=T>>>24&15|16,a[i++]=T>>>16&255,a[i++]=o>>>8|128,a[i++]=o&255;for(let b=0;b<6;++b)a[i+b]=s[b];return e||(0,SP.unsafeStringify)(a)}var BP=CP;Ja.default=BP;var za={},Sn={},Vi={};Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var wP=_P(Yn);function _P(n){return n&&n.__esModule?n:{default:n}}function MP(n){if(!(0,wP.default)(n))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var NP=MP;Vi.default=NP,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.URL=Sn.DNS=void 0,Sn.default=FP;var $P=An,VP=LP(Vi);function LP(n){return n&&n.__esModule?n:{default:n}}function GP(n){n=unescape(encodeURIComponent(n));const e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}const Bm="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Sn.DNS=Bm;const wm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Sn.URL=wm;function FP(n,e,t){function i(a,s,o,u){var p;if(typeof a=="string"&&(a=GP(a)),typeof s=="string"&&(s=(0,VP.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let h=new Uint8Array(16+a.length);if(h.set(s),h.set(a,s.length),h=t(h),h[6]=h[6]&15|e,h[8]=h[8]&63|128,o){u=u||0;for(let m=0;m<16;++m)o[u+m]=h[m];return o}return(0,$P.unsafeStringify)(h)}try{i.name=n}catch{}return i.DNS=Bm,i.URL=wm,i}var Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=void 0;function xP(n){if(typeof n=="string"){const e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return UP(jP(kP(n),n.length*8))}function UP(n){const e=[],t=n.length*32,i="0123456789abcdef";for(let a=0;a<t;a+=8){const s=n[a>>5]>>>a%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(s&15),16);e.push(o)}return e}function _m(n){return(n+64>>>9<<4)+14+1}function jP(n,e){n[e>>5]|=128<<e%32,n[_m(e)-1]=e;let t=1732584193,i=-271733879,a=-1732584194,s=271733878;for(let o=0;o<n.length;o+=16){const u=t,p=i,h=a,m=s;t=Ke(t,i,a,s,n[o],7,-680876936),s=Ke(s,t,i,a,n[o+1],12,-389564586),a=Ke(a,s,t,i,n[o+2],17,606105819),i=Ke(i,a,s,t,n[o+3],22,-1044525330),t=Ke(t,i,a,s,n[o+4],7,-176418897),s=Ke(s,t,i,a,n[o+5],12,1200080426),a=Ke(a,s,t,i,n[o+6],17,-1473231341),i=Ke(i,a,s,t,n[o+7],22,-45705983),t=Ke(t,i,a,s,n[o+8],7,1770035416),s=Ke(s,t,i,a,n[o+9],12,-1958414417),a=Ke(a,s,t,i,n[o+10],17,-42063),i=Ke(i,a,s,t,n[o+11],22,-1990404162),t=Ke(t,i,a,s,n[o+12],7,1804603682),s=Ke(s,t,i,a,n[o+13],12,-40341101),a=Ke(a,s,t,i,n[o+14],17,-1502002290),i=Ke(i,a,s,t,n[o+15],22,1236535329),t=et(t,i,a,s,n[o+1],5,-165796510),s=et(s,t,i,a,n[o+6],9,-1069501632),a=et(a,s,t,i,n[o+11],14,643717713),i=et(i,a,s,t,n[o],20,-373897302),t=et(t,i,a,s,n[o+5],5,-701558691),s=et(s,t,i,a,n[o+10],9,38016083),a=et(a,s,t,i,n[o+15],14,-660478335),i=et(i,a,s,t,n[o+4],20,-405537848),t=et(t,i,a,s,n[o+9],5,568446438),s=et(s,t,i,a,n[o+14],9,-1019803690),a=et(a,s,t,i,n[o+3],14,-187363961),i=et(i,a,s,t,n[o+8],20,1163531501),t=et(t,i,a,s,n[o+13],5,-1444681467),s=et(s,t,i,a,n[o+2],9,-51403784),a=et(a,s,t,i,n[o+7],14,1735328473),i=et(i,a,s,t,n[o+12],20,-1926607734),t=tt(t,i,a,s,n[o+5],4,-378558),s=tt(s,t,i,a,n[o+8],11,-2022574463),a=tt(a,s,t,i,n[o+11],16,1839030562),i=tt(i,a,s,t,n[o+14],23,-35309556),t=tt(t,i,a,s,n[o+1],4,-1530992060),s=tt(s,t,i,a,n[o+4],11,1272893353),a=tt(a,s,t,i,n[o+7],16,-155497632),i=tt(i,a,s,t,n[o+10],23,-1094730640),t=tt(t,i,a,s,n[o+13],4,681279174),s=tt(s,t,i,a,n[o],11,-358537222),a=tt(a,s,t,i,n[o+3],16,-722521979),i=tt(i,a,s,t,n[o+6],23,76029189),t=tt(t,i,a,s,n[o+9],4,-640364487),s=tt(s,t,i,a,n[o+12],11,-421815835),a=tt(a,s,t,i,n[o+15],16,530742520),i=tt(i,a,s,t,n[o+2],23,-995338651),t=nt(t,i,a,s,n[o],6,-198630844),s=nt(s,t,i,a,n[o+7],10,1126891415),a=nt(a,s,t,i,n[o+14],15,-1416354905),i=nt(i,a,s,t,n[o+5],21,-57434055),t=nt(t,i,a,s,n[o+12],6,1700485571),s=nt(s,t,i,a,n[o+3],10,-1894986606),a=nt(a,s,t,i,n[o+10],15,-1051523),i=nt(i,a,s,t,n[o+1],21,-2054922799),t=nt(t,i,a,s,n[o+8],6,1873313359),s=nt(s,t,i,a,n[o+15],10,-30611744),a=nt(a,s,t,i,n[o+6],15,-1560198380),i=nt(i,a,s,t,n[o+13],21,1309151649),t=nt(t,i,a,s,n[o+4],6,-145523070),s=nt(s,t,i,a,n[o+11],10,-1120210379),a=nt(a,s,t,i,n[o+2],15,718787259),i=nt(i,a,s,t,n[o+9],21,-343485551),t=On(t,u),i=On(i,p),a=On(a,h),s=On(s,m)}return[t,i,a,s]}function kP(n){if(n.length===0)return[];const e=n.length*8,t=new Uint32Array(_m(e));for(let i=0;i<e;i+=8)t[i>>5]|=(n[i/8]&255)<<i%32;return t}function On(n,e){const t=(n&65535)+(e&65535);return(n>>16)+(e>>16)+(t>>16)<<16|t&65535}function qP(n,e){return n<<e|n>>>32-e}function Xa(n,e,t,i,a,s){return On(qP(On(On(e,n),On(i,s)),a),t)}function Ke(n,e,t,i,a,s,o){return Xa(e&t|~e&i,n,e,a,s,o)}function et(n,e,t,i,a,s,o){return Xa(e&i|t&~i,n,e,a,s,o)}function tt(n,e,t,i,a,s,o){return Xa(e^t^i,n,e,a,s,o)}function nt(n,e,t,i,a,s,o){return Xa(t^(e|~i),n,e,a,s,o)}var JP=xP;Za.default=JP,Object.defineProperty(za,"__esModule",{value:!0}),za.default=void 0;var WP=Mm(Sn),HP=Mm(Za);function Mm(n){return n&&n.__esModule?n:{default:n}}var YP=(0,WP.default)("v3",48,HP.default);za.default=YP;var Qa={},Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=void 0;var zP={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Ka.default=zP,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.default=void 0;var Nm=$m(Ka),ZP=$m(Wa),XP=An;function $m(n){return n&&n.__esModule?n:{default:n}}function QP(n,e,t){if(Nm.default.randomUUID&&!e&&!n)return Nm.default.randomUUID();n=n||{};const i=n.random||(n.rng||ZP.default)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=i[a];return e}return(0,XP.unsafeStringify)(i)}var KP=QP;Qa.default=KP;var es={},ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0;function eD(n,e,t,i){switch(n){case 0:return e&t^~e&i;case 1:return e^t^i;case 2:return e&t^e&i^t&i;case 3:return e^t^i}}function ol(n,e){return n<<e|n>>>32-e}function tD(n){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){const o=unescape(encodeURIComponent(n));n=[];for(let u=0;u<o.length;++u)n.push(o.charCodeAt(u))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);const i=n.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let o=0;o<a;++o){const u=new Uint32Array(16);for(let p=0;p<16;++p)u[p]=n[o*64+p*4]<<24|n[o*64+p*4+1]<<16|n[o*64+p*4+2]<<8|n[o*64+p*4+3];s[o]=u}s[a-1][14]=(n.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(n.length-1)*8&4294967295;for(let o=0;o<a;++o){const u=new Uint32Array(80);for(let I=0;I<16;++I)u[I]=s[o][I];for(let I=16;I<80;++I)u[I]=ol(u[I-3]^u[I-8]^u[I-14]^u[I-16],1);let p=t[0],h=t[1],m=t[2],T=t[3],b=t[4];for(let I=0;I<80;++I){const C=Math.floor(I/20),L=ol(p,5)+eD(C,h,m,T)+b+e[C]+u[I]>>>0;b=T,T=m,m=ol(h,30)>>>0,h=p,p=L}t[0]=t[0]+p>>>0,t[1]=t[1]+h>>>0,t[2]=t[2]+m>>>0,t[3]=t[3]+T>>>0,t[4]=t[4]+b>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var nD=tD;ts.default=nD,Object.defineProperty(es,"__esModule",{value:!0}),es.default=void 0;var rD=Vm(Sn),iD=Vm(ts);function Vm(n){return n&&n.__esModule?n:{default:n}}var aD=(0,rD.default)("v5",80,iD.default);es.default=aD;var ns={};Object.defineProperty(ns,"__esModule",{value:!0}),ns.default=void 0;var sD="00000000-0000-0000-0000-000000000000";ns.default=sD;var rs={};Object.defineProperty(rs,"__esModule",{value:!0}),rs.default=void 0;var oD=lD(Yn);function lD(n){return n&&n.__esModule?n:{default:n}}function cD(n){if(!(0,oD.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var dD=cD;rs.default=dD,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return o.default}});var e=m(Ja),t=m(za),i=m(Qa),a=m(es),s=m(ns),o=m(rs),u=m(Yn),p=m(An),h=m(Vi);function m(T){return T&&T.__esModule?T:{default:T}}}(Sm);function ll(n,e){if(!n||!e||!n.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=n,this.dstAlphabet=e}ll.prototype.convert=function(n){var e,t,i,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,u=n.length,p=typeof n=="string"?"":[];if(!this.isValid(n))throw new Error('Number "'+n+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return n;for(e=0;e<u;e++)a[e]=this.srcAlphabet.indexOf(n[e]);do{for(t=0,i=0,e=0;e<u;e++)t=t*s+a[e],t>=o?(a[i++]=parseInt(t/o,10),t=t%o):i>0&&(a[i++]=0);u=i,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(i!==0);return p},ll.prototype.isValid=function(n){for(var e=0;e<n.length;++e)if(this.srcAlphabet.indexOf(n[e])===-1)return!1;return!0};var uD=ll,pD=uD;function Li(n,e){var t=new pD(n,e);return function(i){return t.convert(i)}}Li.BIN="01",Li.OCT="01234567",Li.DEC="0123456789",Li.HEX="0123456789abcdef";var yD=Li;const{v4:cl,validate:hD}=Sm,is=yD,dl={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},fD={consistentLength:!0};let ul;const Lm=(n,e,t)=>{const i=e(n.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?i:i.padStart(t.shortIdLength,t.paddingChar)},Gm=(n,e)=>{const i=e(n).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[i[1],i[2],i[3],i[4],i[5]].join("-")},mD=n=>Math.ceil(Math.log(2**128)/Math.log(n));var TD=(()=>{const n=(e,t)=>{const i=e||dl.flickrBase58,a={...fD,...t};if([...new Set(Array.from(i))].length!==i.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=mD(i.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:i[0]},u=is(is.HEX,i),p=is(i,is.HEX),h=()=>Lm(cl(),u,o),T={alphabet:i,fromUUID:b=>Lm(b,u,o),maxLength:s,generate:h,new:h,toUUID:b=>Gm(b,p),uuid:cl,validate:(b,I=!1)=>{if(!b||typeof b!="string")return!1;const C=a.consistentLength?b.length===s:b.length<=s,L=b.split("").every(J=>i.includes(J));return I===!1?C&&L:C&&L&&hD(Gm(b,p))}};return Object.freeze(T),T};return n.constants=dl,n.uuid=cl,n.generate=()=>(ul||(ul=n(dl.flickrBase58).generate),ul()),n})();const pl=hP(TD),ED=pl();function Fm(){return ED.uuid()}function xm(n){return n.rangeStart+Math.random()}function Um(n){const e=n.rangeEnd;return Math.random()*e}function jm(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random()*(t-e)+e}function km(n){return n.rangeStart&&n.rangeEnd?jm(n):n.rangeStart?xm(n):n.rangeEnd?Um(n):Math.random()}function qm(n){const e=n.rangeStart;return Math.random().toString(36).substring(e)}function Jm(n){const e=n.rangeEnd;return Math.random().toString(36).substring(0,e)}function Wm(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random().toString(36).substring(e,t)}function Hm(n){return n.rangeStart&&n.rangeEnd?Wm(n):n.rangeStart?qm(n):n.rangeEnd?Jm(n):Math.random().toString(36)}function Ym(n){return Math.random()>=.5}function RD(n){if(!n||!n.autogeneration)return null;switch(n.autogeneration.type){case Ue.CurrentDateAndTime:if(n.name===g.Date)return new Date;case Ue.Random:{if(n.name===g.Date)return Am(n.autogeneration);if(n.name===g.Number)return km(n.autogeneration);if(n.name===g.String)return Hm(n.autogeneration);if(n.name===g.Boolean)return Ym(n.autogeneration)}case Ue.Unique:if(n.name===g.UUID)return Fm();default:throw new Error(`Generating a ${n.autogeneration.type} value for a ${n.name} is not supported`)}}const q="e7eb5382-3d99-44fd-972a-b8b1e819f6be",yl="global-user-variable-id",zm="last-executed-timestamp-variable-id",bD={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},gD={id:"alternative-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:r.Property},vD={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:bD,autogeneration:{type:Ue.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:gD},as={id:"alternative-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},ID={required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:Ba,static:!0,index:0,dataType:vD,description:"The name of the main database inside of the server instance where the data will be stored.",parent:as};r.GenericReference,r.DataType;const PD={id:"alternative-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:r.Property},DD={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:PD},AD={required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:wa,static:!0,index:1,dataType:DD,description:"The username that will be used to connect to the database.",parent:as};r.GenericReference,r.DataType;const SD={id:"alternative-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:r.Property},OD={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:SD},CD={required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:_a,static:!0,index:2,dataType:OD,description:"The password that will be used to connect to the database.",parent:as},BD={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},wD={id:"alternative-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:r.Property},_D={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:BD,autogeneration:null,valueAsType:null},parent:wD},MD={required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:Ma,static:!0,index:3,dataType:_D,description:"The minimum size of the database in GB.",parent:as},ND={id:"alternative-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},Zm={id:"alternative-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[ID,AD,CD,MD],methods:[],abstractMethods:[],extends:[],implements:[bn],x:0,y:0,parent:ND},$D={id:"animal-prototype-database-property-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-id",entityType:r.Property},VD={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:r.DataType},LD={id:"animal-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:bn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:Zm,autogeneration:null,parent:VD},parent:$D},GD={id:"animal-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},FD={required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:Ei,static:!0,index:0,dataType:LD,description:"The database that the entity belongs to.",parent:GD},xD={type:r.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:r.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},UD={id:"c1930577-9e79-48a6-8905-be24611015c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xD},jD={type:r.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},kD={required:!0,type:r.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:UD,abstract:!1,parent:jD},qD={type:r.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:r.Project,entityId:q},JD={type:r.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[FD,kD],methods:[],extends:[],implements:[Be],x:0,y:0,parent:qD},WD={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},HD={id:"default-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:r.Property},YD={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:WD,autogeneration:{type:Ue.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:HD},ss={id:"default-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},zD={required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:Ba,static:!0,index:0,dataType:YD,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ss};r.GenericReference,r.DataType;const ZD={id:"default-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:r.Property},XD={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:ZD},QD={required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:wa,static:!0,index:1,dataType:XD,description:"The username that will be used to connect to the database.",parent:ss};r.GenericReference,r.DataType;const KD={id:"default-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:r.Property},eA={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:KD},tA={required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:_a,static:!0,index:2,dataType:eA,description:"The password that will be used to connect to the database.",parent:ss},nA={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},rA={id:"default-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:r.Property},iA={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:nA,autogeneration:null,valueAsType:null},parent:rA},aA={required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:Ma,static:!0,index:3,dataType:iA,description:"The minimum size of the database in GB.",parent:ss},sA={id:"default-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},hl={id:"default-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[zD,QD,tA,aA],methods:[],abstractMethods:[],extends:[],implements:[bn],x:0,y:0,parent:sA},oA={id:"user-prototype-database-property-data-type-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:r.DataType},lA={id:"user-prototype-database-property-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-id",entityType:r.Property},cA={id:"user-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:bn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:hl,autogeneration:null,parent:oA},parent:lA},dA={id:"user-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},uA={required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:Ei,static:!0,index:0,dataType:cA,description:"The database that the entity belongs to.",parent:dA},pA={type:r.GenericReference,id:"user-prototype-parent-ref-id",entityType:r.Project,entityId:q},fl={type:r.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Be],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[uA],methods:[],x:0,y:0,parent:pA},yA={type:r.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:r.Property,entityId:"person-date-of-birth-property-id"},hA={id:"person-date-of-birth-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Or,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:yA},fA={type:r.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},mA={required:!0,type:r.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,dataType:hA,abstract:!1,parent:fA},TA={type:r.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:r.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},EA={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:TA},RA={type:r.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},bA={required:!0,type:r.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,dataType:EA,abstract:!1,parent:RA},gA={type:r.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:r.Project,entityId:q},ct={type:r.CustomEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[bA,mA],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[fl],x:0,y:0,parent:gA},vA={type:r.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},IA={type:r.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:r.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},PA={type:r.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},DA={type:r.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:r.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},AA={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DA},ml={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:r.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:AA,readsValue:PA,required:!0,index:0,parent:IA},SA={type:r.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},OA={type:r.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},Xm={type:r.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[ml],calledByError:[],calledByEntry:[SA],calledBySuccess:[],throws:null,x:0,y:0,parent:OA},CA={type:r.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},BA={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CA},Qm={id:"500dee3a-3435-4453-9699-0d053f646523",type:r.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:BA,required:!0,writesValues:[ml],index:0,parent:vA},wA={type:r.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Km={type:r.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[Qm],calls:[Xm],returnStatements:[Xm],index:0,collapsed:!1,private:!1,x:0,y:0,parent:wA},_A={type:r.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:r.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},MA={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_A},NA={type:r.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:r.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},$A={type:r.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},VA={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:r.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:MA,readsValue:NA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:$A},LA={type:r.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},GA={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:r.OutputMap,version:1,declaration:ml,writesValues:[VA],index:0,parent:LA},FA={type:r.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},xA={type:r.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},UA={type:r.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},jA={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UA},kA={type:r.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},qA={type:r.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},JA={type:r.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},WA={type:r.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},eT={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:r.InputMap,version:1,declaration:Qm,name:null,description:null,readsValue:WA,dynamicArguments:[],defaultValue:null,index:0,parent:JA},HA={type:r.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:jA,readsValue:kA,writesValues:[eT],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:qA},YA={type:r.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:Km,inputs:[eT],outputs:[GA],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[FA],calledBySuccess:[],parent:xA,error:null,x:0,y:0},zA={type:r.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},ZA={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zA},XA={type:r.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},QA={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:r.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:ZA,required:!0,index:0,writesValues:[HA],parent:XA},KA={type:r.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},eS={type:r.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[QA],collapsed:!0,returnStatements:[],calls:[YA],private:!1,index:0,implements:null,x:0,y:0,parent:KA},tS={type:r.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:r.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},nS={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tS},rS={type:r.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},tT={required:!0,type:r.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:nS,abstract:!1,parent:rS},iS={type:r.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:r.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},aS={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:iS},sS={type:r.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},nT={required:!0,type:r.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:aS,implements:null,static:!1,private:!0,abstract:!1,parent:sS},oS={type:r.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:r.Project,entityId:q},Gr={type:r.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[tT,nT],methods:[Km,eS],extends:[],implements:[Be],x:0,y:0,parent:oS},Gi="bitcoin-api-response-id",rT="time-property-id",iT="disclamer-property-id",aT="chart-name-property-id",sT="bpi-property-id",os="bpi-entity-id",oT="usd-property-id",lT="gbp-property-id",cT="eur-property-id",Fr="currency-entity-id",dT="currency-code-property-id",uT="currency-symbol-property-id",pT="currency-rate-property-id",yT="currency-description-property-id",hT="currency-rate-number-property-id",lS={type:r.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:r.Property,entityId:dT},cS={id:"code-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:lS},dS={type:r.GenericReference,id:"code-property-parent-ref-id",entityType:r.CustomEntity,entityId:Fr},uS={required:!0,type:r.Property,id:dT,version:1,name:"code",description:null,dataType:cS,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:dS},pS={type:r.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:r.Property,entityId:uT},yS={id:"symbol-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:pS},hS={type:r.GenericReference,id:"symbol-property-parent-ref-id",entityType:r.CustomEntity,entityId:Fr},fS={required:!0,type:r.Property,id:uT,version:1,name:"symbol",description:null,index:0,dataType:yS,implements:null,static:!1,private:!1,abstract:!1,parent:hS},mS={type:r.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:r.Property,entityId:pT},TS={id:"rate-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:mS},ES={type:r.GenericReference,id:"rate-property-parent-ref-id",entityType:r.CustomEntity,entityId:Fr},RS={required:!0,type:r.Property,id:pT,version:1,name:"rate",description:null,index:0,dataType:TS,implements:null,static:!1,private:!1,abstract:!1,parent:ES},bS={type:r.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:r.Property,entityId:yT},gS={id:"description-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:bS},vS={type:r.GenericReference,id:"description-property-parent-ref-id",entityType:r.CustomEntity,entityId:Fr},IS={required:!0,type:r.Property,id:yT,version:1,name:"description",description:null,dataType:gS,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:vS},PS={type:r.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:r.Property,entityId:hT},DS={id:"rate-number-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PS},AS={type:r.GenericReference,id:"rate-number-property-parent-ref-id",entityType:r.CustomEntity,entityId:Fr},SS={required:!0,type:r.Property,id:hT,version:1,name:"rate_float",description:null,dataType:DS,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:AS},OS={type:r.GenericReference,id:"currency-prototype-parent-ref-id",entityType:r.Project,entityId:q},ls={type:r.CustomEntity,id:Fr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[uS,fS,RS,IS,SS],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:OS},CS={type:r.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:r.Property,entityId:oT},BS={id:"usd-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ls,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CS},wS={type:r.GenericReference,id:"usd-property-parent-ref-id",entityType:r.CustomEntity,entityId:os},_S={required:!0,id:oT,type:r.Property,version:1,name:"USD",description:null,index:0,dataType:BS,implements:null,static:!1,private:!1,abstract:!1,parent:wS},MS={type:r.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:r.Property,entityId:lT},NS={id:"gbp-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ls,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MS},$S={type:r.GenericReference,id:"gbp-property-parent-ref-id",entityType:r.CustomEntity,entityId:os},VS={required:!0,id:lT,type:r.Property,version:1,name:"GBP",description:null,index:0,dataType:NS,implements:null,static:!1,private:!1,abstract:!1,parent:$S},LS={type:r.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:r.Property,entityId:cT},GS={id:"eur-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ls,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LS},FS={type:r.GenericReference,id:"eur-property-parent-ref-id",entityType:r.CustomEntity,entityId:os},xS={required:!0,id:cT,type:r.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:GS,private:!1,abstract:!1,parent:FS},US={type:r.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:r.Project,entityId:q},fT={type:r.CustomEntity,id:os,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[_S,VS,xS],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:US},jS={type:r.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:r.Property,entityId:rT},kS={id:"time-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:go,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jS},qS={type:r.GenericReference,id:"time-property-parent-ref-id",entityType:r.CustomEntity,entityId:Gi},JS={required:!0,type:r.Property,id:rT,version:1,name:"time",description:null,index:0,dataType:kS,implements:null,static:!1,private:!1,abstract:!1,parent:qS},WS={type:r.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:r.Property,entityId:iT},HS={id:"disclamer-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WS},YS={type:r.GenericReference,id:"disclamer-property-parent-ref-id",entityType:r.CustomEntity,entityId:Gi},zS={required:!0,type:r.Property,id:iT,version:1,name:"disclamer",description:null,index:0,dataType:HS,implements:null,static:!1,private:!1,abstract:!1,parent:YS},ZS={type:r.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:r.Property,entityId:aT},XS={id:"chart-name-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZS},QS={type:r.GenericReference,id:"chart-name-property-parent-ref-id",entityType:r.CustomEntity,entityId:Gi},KS={required:!0,type:r.Property,id:aT,version:1,name:"chartName",description:null,index:0,dataType:XS,implements:null,static:!1,private:!1,abstract:!1,parent:QS},eO={type:r.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:r.Property,entityId:sT},tO={id:"bpi-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:fT,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eO},nO={type:r.GenericReference,id:"bpi-property-parent-ref-id",entityType:r.CustomEntity,entityId:Gi},rO={required:!0,type:r.Property,id:sT,version:1,name:"bpi",description:null,implements:null,index:0,dataType:tO,static:!1,private:!1,abstract:!1,parent:nO},iO={type:r.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:r.Project,entityId:q},mT={type:r.CustomEntity,id:Gi,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[JS,zS,KS,rO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:iO},aO={type:r.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},sO={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aO},oO={type:r.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:r.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},lO={type:r.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:r.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},cO={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:lO},dO={type:r.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},TT={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:cO,readsValue:dO,required:!0,index:0,parent:oO},uO={type:r.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},pO={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:r.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:sO,writesValues:[TT],required:!0,index:0,parent:uO},yO={type:r.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},hO={type:r.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},fO={type:r.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},ET={type:r.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[TT],calledByError:[],calledByEntry:[hO],calledBySuccess:[],throws:null,x:0,y:0,parent:fO},mO={type:r.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[pO],calls:[ET],index:0,collapsed:!1,implements:null,returnStatements:[ET],private:!1,x:0,y:0,parent:yO},TO={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},EO={type:r.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},RO={type:r.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:r.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},bO={type:r.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},gO={type:r.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:r.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},vO={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:xn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gO},Tl={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:r.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:vO,readsValue:bO,required:!0,index:0,parent:RO},RT={type:r.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[Tl],calledByError:[],calledByEntry:[],calledBySuccess:[TO],throws:null,x:0,y:0,parent:EO},IO={type:r.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},PO={type:r.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},bT={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Vo,name:null,description:null,dynamicArguments:[],readsValue:PO,defaultValue:null,parent:IO,index:2},DO={type:r.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},AO={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:xn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DO},SO={type:r.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},OO={type:r.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:r.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},CO={type:r.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:r.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},gT={type:r.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",dataType:AO,readsValue:OO,writesValues:[Tl],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[CO],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:SO},BO={type:r.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:r.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},wO={type:r.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},_O={type:r.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:Ia,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:g.String,valueAsType:null,parent:BO,autogeneration:null},index:1,dynamicArguments:[],parent:wO},MO={type:r.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},NO={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:r.OutputMap,version:1,declaration:fi,index:2,writesValues:[gT],parent:MO},$O={type:r.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},VO={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:r.InputMap,version:1,declaration:va,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:$O},LO={type:r.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},GO={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:r.InputMap,version:1,name:null,description:null,declaration:Pa,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:LO},FO={type:r.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},xO={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:r.InputMap,version:1,declaration:Da,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:FO},UO={type:r.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},jO={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:r.OutputMap,version:1,declaration:Aa,index:1,writesValues:[],parent:UO},kO={type:r.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},qO={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:r.OutputMap,version:1,declaration:fi,index:0,writesValues:[],parent:kO},JO={type:r.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},WO={type:r.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},HO={type:r.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},YO={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},zO={type:r.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:r.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},ZO={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zO},XO={type:r.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:r.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},vT={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:r.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:ZO,required:!0,readsValue:null,index:0,parent:XO},QO={type:r.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[YO],throws:vT,x:0,y:0,parent:HO},KO={type:r.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},eC={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:r.OutputMap,declaration:Go,version:1,writesValues:[vT],index:0,parent:KO},tC={type:r.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:mi,inputs:[VO,_O,bT,GO,xO],outputs:[qO,jO,NO],process:null,calledByError:[],calledByEntry:[JO],calledBySuccess:[],successCalls:[RT,gT],errorCalls:[QO],error:eC,dynamicArguments:[],x:0,y:0,parent:WO},nC={type:r.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:r.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},rC={type:r.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},iC={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Ra,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"?name=",name:g.String,parent:nC,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:rC},aC={type:r.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},sC={type:r.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},oC={type:r.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},lC={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oC},cC={type:r.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:r.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},dC={type:r.GenericReference,id:"assembled-query-string-called-by-ref",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},IT={type:r.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",dataType:lC,readsValue:cC,writesValues:[bT],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[dC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:sC},uC={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:r.OutputMap,version:1,writesValues:[IT],declaration:yi,index:0,parent:aC},pC={type:r.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},yC={type:r.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},hC={type:r.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:r.ArgumentDeclaration},fC={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},PT={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:r.InputMap,declaration:ba,name:null,description:null,readsValue:hC,dynamicArguments:[],defaultValue:null,index:1,parent:fC},mC={type:r.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:hi,version:1,inputs:[iC,PT],outputs:[uC],process:null,calledByError:[],calledByEntry:[pC],calledBySuccess:[],dynamicArguments:[],successCalls:[IT],errorCalls:[],error:null,x:0,y:0,parent:yC},TC={type:r.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:r.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},EC={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:TC},RC={type:r.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},DT={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:r.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:EC,required:!1,writesValues:[PT],index:0,parent:RC},bC={type:r.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:r.Project,entityId:q},AT={type:r.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[DT],calls:[mC,tC],returnStatements:[RT],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:bC},gC={type:r.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},vC={type:r.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},IC={type:r.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},PC={type:r.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},ST={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:r.InputMap,declaration:DT,name:null,description:null,readsValue:IC,dynamicArguments:[],defaultValue:null,index:0,parent:PC},DC={type:r.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},AC={type:r.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:r.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},SC={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:xn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AC},OC={type:r.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:r.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},CC={type:r.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},BC={type:r.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},OT={type:r.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:SC,readsValue:OC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[BC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:CC},wC={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.OutputMap,version:1,declaration:Tl,writesValues:[OT],index:0,parent:DC},_C={type:r.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:AT,inputs:[ST],outputs:[wC],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[gC],successCalls:[OT],errorCalls:[],error:null,x:0,y:0,parent:vC},MC={type:r.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},NC={type:r.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},$C={type:r.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},VC={type:r.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},CT={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:r.InputMap,declaration:qn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:$C,defaultValue:null,index:0,parent:VC},LC={type:r.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:qn,inputs:[CT],calledByError:[],calledByEntry:[MC],calledBySuccess:[],successCalls:[_C],errorCalls:[],x:0,y:0,parent:NC},GC={type:r.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},FC={type:r.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:r.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},xC={id:"d64152ea-831f-4426-9506-a39bfa170513",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Gr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FC},UC={type:r.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},jC={type:r.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},kC={type:r.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},BT={type:r.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",dataType:xC,readsValue:jC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[kC],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:UC},qC={type:r.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},JC={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Gr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qC},WC={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:r.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:JC,required:!0,index:1,writesValues:[BT],parent:GC},HC={type:r.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},YC={type:r.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},zC={type:r.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},ZC={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zC},XC={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:r.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:ZC,required:!0,index:0,writesValues:[CT,ST],parent:YC},QC={type:r.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[XC,WC],calls:[LC,BT],index:1,private:!1,implements:null,x:0,y:0,parent:HC},KC={type:r.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},eB={type:r.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-manager-property-id"},tB={id:"employee-manager-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:KC,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:eB},nB={type:r.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},rB={required:!0,type:r.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:tB,abstract:!1,parent:nB},iB={type:r.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-start-date-property-id"},aB={id:"employee-start-date-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Or,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:iB},sB={type:r.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},oB={required:!0,type:r.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,implements:null,dataType:aB,abstract:!1,parent:sB},lB={type:r.GenericReference,id:"employee-department-property-ref-id",entityType:r.Property,entityId:"employee-department-property-id"},cB={id:"employee-department-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rn,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:lB},dB={type:r.GenericReference,id:"employee-department-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},uB={required:!0,type:r.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,implements:null,static:!1,private:!1,dataType:cB,abstract:!1,parent:dB},pB={type:r.GenericReference,id:"employee-prototype-parent-ref-id",entityType:r.Project,entityId:q},It={type:r.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[uB,oB,rB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[ct],x:0,y:0,parent:pB},yB={type:r.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:r.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},hB={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yB},fB={type:r.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},mB={required:!0,type:r.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:hB,abstract:!1,parent:fB},TB={type:r.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:r.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},EB={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Gr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:TB},RB={type:r.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},El={required:!0,type:r.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,dataType:EB,abstract:!1,parent:RB},bB={type:r.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:r.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},gB={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:bB},vB={type:r.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},IB={required:!0,type:r.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,dataType:gB,private:!0,abstract:!1,parent:vB},PB={type:r.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:r.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},DB={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PB},AB={type:r.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},SB={required:!0,type:r.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:DB,implements:null,private:!0,static:!1,abstract:!1,parent:AB},OB={type:r.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:r.Project,entityId:q},mt={type:r.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[mB,El,IB,SB],static:!1,abstract:!1,abstractMethods:[],methods:[mO,QC],extends:[],implements:[Be],x:0,y:0,parent:OB},CB={type:r.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:r.Project,entityId:q},Rl={type:r.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:CB};r.GenericReference,r.DataType;const BB={id:"cron-job-entity-expression-property-ref-id",type:r.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:r.Property},wB={id:"cron-job-entity-expression-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:BB},_B={id:"cron-job-entity-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},MB={required:!0,id:"cron-job-entity-expression-property-id",type:r.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:wB,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:_B},NB={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:r.GenericReference,entityId:"show-popup-func-decl-id",entityType:r.FunctionDeclaration},$B={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:r.FunctionDeclaration},VB={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:r.FunctionCall,declaration:Rl,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[NB],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:$B},LB={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},GB={id:"cron-job-entity-trigger-func-decl-id",version:1,type:r.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:qo,calls:[VB],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:LB},FB={id:"cron-job-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},xB={id:"cron-job-entity-id",version:1,type:r.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[MB],static:!0,abstract:!1,abstractMethods:[],extends:[Jo],implements:[],methods:[GB],x:0,y:0,parent:FB},UB={type:r.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:r.Project,entityId:q},jB={type:r.CustomEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[Ca],x:0,y:0,parent:UB},wT="f558fbf8-67de-4545-9804-6ae621e0b2d4",kB={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},qB={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},JB={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:kB,autogeneration:null,valueAsType:null},parent:qB},WB={id:"getCompanyByIdEndpointReachedEntityEventRef",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},HB={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},YB={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},zB={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:HB,autogeneration:null,valueAsType:null},parent:YB},ZB={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:zB,required:!0,index:0,parent:WB},XB={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},QB={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:r.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],dataType:JB,required:!0,index:1,parent:XB},KB={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},ew={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},tw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},nw={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:F,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:ew,autogeneration:null,valueAsType:null},parent:tw},rw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:r.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:nw,required:!0,index:2,parent:KB},iw={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},aw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},sw={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:aw},ow={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:sw,index:3,required:!0,parent:iw},lw={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},cw={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:lw},dw={id:"getCompanyByIdEndpointReturnStatementRef",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},uw={isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:r.ReturnDeclaration,name:"Response code",dataType:cw,readsValue:null,required:!0,index:0,parent:dw},pw={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},yw={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},hw={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:pw,autogeneration:null,valueAsType:null},parent:yw},fw={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},mw={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ReturnDeclaration,name:"Response headers",dataType:hw,readsValue:null,required:!0,index:1,parent:fw},Tw={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},Ew={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:Tw},Rw={id:"getCompanyByIdEndpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},bw={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ReturnDeclaration,name:"Response body",dataType:Ew,readsValue:null,required:!0,index:2,parent:Rw},gw={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:r.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:r.FunctionDeclaration},vw={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},Iw={id:"getCompanyByIdEndpointReturnStatement",type:r.ReturnStatement,version:1,outputs:[uw,mw,bw],calledByError:[],calledByEntry:[gw],calledBySuccess:[],throws:null,x:0,y:0,parent:vw},Pw={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:wT},Dw={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:r.FunctionDeclaration,inputs:[ZB,QB,rw,ow],returnStatements:[Iw],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:jo,index:0,private:!1,x:0,y:0,parent:Pw},Aw={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},Sw={id:"getCompanyByIdEndpointPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointPathProperty"},Ow={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.String,value:"/company/{id}",parent:Aw,valueAsType:null,autogeneration:null},parent:Sw},Cw={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Bw={required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:xo,dataType:Ow,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Cw},ww={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},_w={id:"getCompanyByIdEndpointMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointMethodProperty"},Mw={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Rn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:ww,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:_w},Nw={id:"getCompanyByIdEndpointBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},$w={required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:Uo,index:0,dataType:Mw,description:null,parent:Nw},Vw={type:r.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:r.Project,entityId:q},Lw={type:r.CustomEntity,id:wT,version:1,name:"Get given company data by id",description:null,properties:[Bw,$w],methods:[Dw],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[Ca],x:0,y:0,parent:Vw},Gw={id:"product-prototype-database-property-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-id",entityType:r.Property},Fw={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:r.DataType},xw={id:"product-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:bn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:hl,autogeneration:null,parent:Fw},parent:Gw},Uw={id:"product-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},jw={required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:Ei,static:!0,index:0,dataType:xw,description:"The database that the entity belongs to.",parent:Uw},kw={type:r.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:r.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},qw={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kw},Jw={type:r.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:r.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},Ww={required:!0,type:r.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,dataType:qw,abstract:!1,parent:Jw},Hw={type:r.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:r.Project,entityId:q},Yw={type:r.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Be],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[jw,Ww],methods:[],x:0,y:0,parent:Hw},Fi="project-loaded-event-id",Wt="get-bitcoin-price-http-call-operation-id",_T="get-bitcoin-price-http-call-response-body-id",cs="validate-bitcoin-price-response-operation-ids",zw={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:_T},Zw={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:r.Operation,entityId:cs},MT={id:"validate-bitcoin-data-to-validate-input-map-id",type:r.InputMap,version:1,declaration:jn.fixedArguments[1],name:null,description:null,readsValue:zw,defaultValue:null,dynamicArguments:[],index:0,parent:Zw},Xw={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},Qw={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:r.Operation,entityId:cs},Kw={id:"validate-bitcoin-type-to-match-input-map-id",type:r.InputMap,version:1,declaration:jn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:r.PrimitiveValue,version:1,name:g.EntityTemplate,valueAsType:mT,value:null,parent:Xw,autogeneration:null},dynamicArguments:[],index:0,parent:Qw},e_={type:r.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:r.Operation,entityId:cs},t_={id:"validate-bitcoin-validated-entity-output-map-id",type:r.OutputMap,version:1,declaration:jn.fixedReturns[0],writesValues:[],index:0,parent:e_},n_={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:r.GlobalEvent,entityId:Fi},r_={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:r.Operation,entityId:Wt},i_={type:r.Operation,id:cs,version:1,declaration:jn,inputs:[Kw,MT],outputs:[t_],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[r_],parent:n_},a_={type:r.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:r.FunctionCall,entityId:Wt},s_={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:r.InputMap,declaration:va,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:a_},o_={type:r.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:r.FunctionCall,entityId:Wt},l_={type:r.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:r.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},c_={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:r.InputMap,declaration:Ia,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:g.String,parent:l_,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:o_},d_={type:r.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:r.FunctionCall,entityId:Wt},u_={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:r.InputMap,declaration:Pa,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:d_},p_={type:r.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:r.FunctionCall,entityId:Wt},y_={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:r.InputMap,declaration:Da,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:p_},h_={type:r.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:r.FunctionCall,entityId:Wt},f_={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:r.OutputMap,declaration:Aa,writesValues:[],index:1,parent:h_},m_={type:r.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:r.FunctionCall,entityId:Wt},T_={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:r.OutputMap,declaration:Lo,writesValues:[],index:0,parent:m_},E_={type:r.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:r.FunctionCall,entityId:Wt},R_={id:_T,type:r.OutputMap,version:1,declaration:fi,writesValues:[MT],index:2,parent:E_},b_={type:r.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:r.FunctionDeclaration,entityId:Wt},g_={type:r.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:r.GlobalEvent,entityId:Fi},v_={type:r.Operation,id:Wt,version:1,declaration:mi,inputs:[s_,c_,u_,y_],outputs:[T_,f_,R_],process:null,parent:g_,calledByError:[],calledByEntry:[b_],calledBySuccess:[],dynamicArguments:[],successCalls:[i_],errorCalls:[],error:null,x:0,y:0},I_={type:r.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:r.GlobalEvent,entityId:Fi},P_={type:r.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:r.GlobalEvent,entityId:Fi},D_={process:null,type:r.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Rl,inputs:[],outputs:[],calledByError:[],calledByEntry:[I_],calledBySuccess:[],parent:P_,successCalls:[],errorCalls:[],error:null,x:0,y:0},A_={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:r.GenericReference,entityType:r.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},S_={type:r.GlobalEvent,id:Fi,version:1,name:Kt.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:Na,parent:A_,inputs:[],calls:[D_,v_],x:0,y:0},Bt="abort-execution-func-declaration-id",xi="abort-execution-func-exec-var-declaration-id",ds="abort-execution-func-small-wait-op-id",bl="abort-execution-func-long-wait-op-id",NT="abort-execution-func-long-wait-process-output-id",$T="abort-execution-func-exec-var-instance-write-id",VT="abort-execution-func-long-wait-return-stmt-id",LT="abort-execution-func-small-wait-return-stmt-id",O_="abort-execution-func-exec-var-instance-abort-call-id",gl="abort-execution-func-exec-var-instance-abort-internal-call-id",GT="abort-execution-func-exec-second-wait-op-id",C_={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},B_={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},w_={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:B_},constant:!1,parent:C_},__={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:LT},M_={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:w_,readsValue:null,required:!0,index:0,parent:__},N_={type:r.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:ds},$_={type:r.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},FT={type:r.ReturnStatement,id:LT,version:1,outputs:[M_],calledByError:[],calledByEntry:[],calledBySuccess:[N_],throws:null,x:0,y:0,parent:$_},V_={type:r.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"second-wait-argument-map-id"},L_={type:r.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:GT},G_={id:"second-wait-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:V_},index:0,parent:L_},F_={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},x_={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.InternalCall,entityId:gl},U_={id:GT,type:r.Operation,version:1,declaration:ot,inputs:[G_],dynamicArguments:[],outputs:[],process:null,successCalls:[FT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[x_],error:null,parent:F_},j_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:r.VariableInstance,entityId:$T},k_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:r.Operation,entityId:ds},q_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},J_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:xi},W_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:r.InternalCall,entityId:gl},H_={id:O_,type:r.VariableInstance,version:1,declaration:J_,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[W_],parent:q_},xT={id:gl,type:r.InternalCall,version:1,inputs:[],outputs:[],declaration:Wo,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[j_,k_],successCalls:[U_],errorCalls:[],error:null,index:0,parent:H_},Y_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},z_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:xi},Z_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:Bt},X_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:xi},Q_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:r.OutputMap,entityId:NT},vl={id:$T,type:r.VariableInstance,version:1,declaration:X_,inputs:[],outputs:[],calledByError:[],calledByEntry:[Z_],calledBySuccess:[z_],successCalls:[xT],errorCalls:[],x:0,y:0,readsValue:Q_,writesValues:[],internalCalls:[],parent:Y_},K_={type:r.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:xi};r.GenericReference,r.DataType;const eM={id:"abort-exec-func-var-decl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Ho,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:K_,defaultValue:null},tM={type:r.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},nM={type:r.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},rM={id:xi,type:r.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:eM,inputs:[],outputs:[],calledByError:[],calledByEntry:[nM],calledBySuccess:[],successCalls:[vl],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:tM},iM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},aM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},sM={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:aM},constant:!1,parent:iM},oM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:VT},lM={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:sM,readsValue:null,required:!0,index:0,parent:oM},cM={type:r.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:bl},dM={type:r.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},UT={type:r.ReturnStatement,id:VT,version:1,outputs:[lM],calledByError:[],calledByEntry:[],calledBySuccess:[cM],throws:null,x:0,y:0,parent:dM},uM={type:r.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"long-argument-map-id"},jT={type:r.GenericReference,id:"long-argument-map-parent-ref-id",entityType:r.Operation,entityId:bl},pM={id:"long-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:r.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:g.Number,parent:uM},index:0,parent:jT},yM={type:r.GenericReference,id:"long-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},hM={type:r.GenericReference,id:"long-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},fM={id:NT,type:r.OutputMap,version:1,declaration:zo,writesValues:[vl],index:0,parent:jT},mM={id:bl,type:r.Operation,version:1,declaration:ot,inputs:[pM],dynamicArguments:[],outputs:[],process:fM,successCalls:[UT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[hM],calledBySuccess:[],error:null,parent:yM},TM={type:r.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"small-wait-argument-map-id"},EM={type:r.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:ds},RM={id:"small-wait-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:g.Number,parent:TM},index:0,parent:EM},bM={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},gM={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},vM={id:ds,type:r.Operation,version:1,declaration:ot,inputs:[RM],dynamicArguments:[],outputs:[],process:null,successCalls:[xT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[gM],calledBySuccess:[],error:null,parent:bM},IM={type:r.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:r.Project,entityId:q},kT={id:"abort-execution-func-decl-id",type:r.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[UT,FT],calls:[vM,rM,vl,mM],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:IM},PM={type:r.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:r.Project,entityId:q},DM={id:"call-execution-abort-func-id",type:r.FunctionCall,version:1,declaration:kT,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:PM},Il="manual-hello-world-loop-func-decl-id",qT="manual-hello-world-loop-func-return-statement-id",an="manual-hello-world-loop-id",Ui="manual-hello-world-loop-body-id",JT="manual-hello-world-loop-break-statement-id",us="manual-hello-world-loop-current-iteration-number-output-map-id",Pl="manual-hello-world-loop-previous-iterations-results-output-map-id",Dl="assembled-hello-world-text-output-id",WT="assembled-hello-world-list-output-id",ji="iteration-number-is-equal-or-greater-than-10-condition-id",ps="join-hello-world-and-number-operation-id",ys="append-string-to-list-operation-id",HT="hello-world-loop-output-map-id",AM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:r.ReturnStatement,entityId:qT},SM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:r.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},OM={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SM},CM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:r.OutputMap,entityId:HT},YT={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:r.ReturnDeclaration,name:"Results",description:null,dataType:OM,readsValue:CM,required:!0,index:0,parent:AM},BM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:r.Loop,entityId:an},wM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:r.FunctionDeclaration,entityId:Il},zT={type:r.ReturnStatement,id:qT,version:1,outputs:[YT],calledByError:[],calledByEntry:[],calledBySuccess:[BM],parent:wM,throws:null,x:0,y:0},_M={type:r.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:r.BreakStatement,entityId:JT},MM={type:r.GenericReference,id:"hello-world-loop-break-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-break-statement-output-id"},NM={id:"hello-world-loop-break-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MM},$M={type:r.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:Dl},Al={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:NM,readsValue:$M,required:!0,index:0,parent:_M},VM={type:r.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:r.Condition,entityId:ji},LM={type:r.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:r.Loop,entityId:an},ZT={type:r.BreakStatement,id:JT,version:1,outputs:[Al],calledByError:[],calledByEntry:[],calledBySuccess:[VM],parent:LM,throws:null,x:0,y:0},GM={type:r.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:r.ContinueStatement,entityId:"hello-world-loop-continue-statement"},FM={type:r.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},xM={id:"hello-world-loop-continue-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FM},UM={type:r.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:Dl},XT={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:xM,readsValue:UM,required:!0,index:0,parent:GM},jM={type:r.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:r.Condition,entityId:ji},kM={type:r.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:r.Loop,entityId:an},QT={type:r.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[XT],calledBySuccess:[],calledByError:[jM],calledByEntry:[],parent:kM,throws:null,x:0,y:0};r.GenericReference,r.InputMap;const qM={type:r.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:r.Operation,entityId:ys},JM={type:r.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Pl},KT={id:"append-string-to-list-base-string-map-id",type:r.InputMap,version:1,declaration:Co,name:null,description:null,readsValue:JM,defaultValue:null,dynamicArguments:[],index:0,parent:qM},WM={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:ys},HM={id:WT,type:r.OutputMap,version:1,writesValues:[Al],declaration:yi,index:0,parent:WM},YM={type:r.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:r.Condition,entityId:ji},zM={type:r.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:WT},ZM={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:ys},eE={id:"latest-string-to-add-input-map-id",version:1,type:r.InputMap,declaration:Bo,name:null,description:null,readsValue:zM,dynamicArguments:[],defaultValue:null,index:1,parent:ZM},XM={type:r.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:r.FunctionDeclaration,entityId:an},QM={type:r.Operation,id:ys,declaration:ga,version:1,inputs:[KT,eE],outputs:[HM],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[YM],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:XM},KM={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Ui},eN={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:r.Loop,entityId:an},tN={type:r.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:us},tE={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:r.Condition,entityId:ji},nN={id:"current-iteration-number-to-check-map-id",version:1,type:r.InputMap,declaration:wr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:tN,index:1,defaultValue:null,parent:tE},rN={type:r.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"max-num-iterations-value-map-id"},iN={id:"max-num-iterations-value-map-id",version:1,type:r.InputMap,declaration:wr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:10,autogeneration:null,valueAsType:null,parent:rN},parent:tE},aN={type:r.Condition,id:ji,version:1,declaration:wr,inputs:[iN,nN],calledByError:[],calledByEntry:[KM],calledBySuccess:[],successCalls:[ZT,QM],errorCalls:[QT],x:0,y:0,parent:eN},sN={type:r.GenericReference,id:"base-string-map-ref-id",entityType:r.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},oN={type:r.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:r.Operation,entityId:ps},lN={id:"join-hello-world-and-number-base-string-map-id",type:r.InputMap,version:1,declaration:Ra,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"Hello world ",name:g.String,parent:sN,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:oN},cN={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:ps},dN={id:Dl,type:r.OutputMap,version:1,writesValues:[eE,XT],declaration:yi,index:0,parent:cN},uN={type:r.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Ui},pN={type:r.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:us},yN={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:ps},nE={id:"current-iteration-number-input-map-id",version:1,type:r.InputMap,declaration:ba,name:null,description:null,readsValue:pN,dynamicArguments:[],defaultValue:null,index:1,parent:yN},hN={type:r.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:r.FunctionDeclaration,entityId:an},fN={type:r.Operation,id:ps,declaration:hi,version:1,inputs:[lN,nE],outputs:[dN],process:null,calledByError:[],calledByEntry:[uN],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:hN},mN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:Pl,entityType:r.ArgumentDeclaration},TN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:mN},EN={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:r.GenericReference,entityId:Ui,entityType:r.FunctionDeclaration},RN={id:Pl,type:r.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:TN,writesValues:[KT],index:1,parent:EN},bN={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:r.GenericReference,entityId:Ui,entityType:r.FunctionDeclaration},gN={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:us,entityType:r.ArgumentDeclaration};r.DataType;const vN={id:us,type:r.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[nE],index:0,parent:bN},IN={id:"manual-flow-loop-body-parent-ref-id",type:r.GenericReference,entityId:an,entityType:r.Loop},PN={id:Ui,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[vN,RN],calls:[aN,fN],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:IN},DN={type:r.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:r.Loop,entityId:an},AN={type:r.OutputMap,id:HT,version:1,declaration:Al,writesValues:[YT],index:0,parent:DN},SN={id:"manual-hello-world-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},ON={id:"manual-hello-world-loop-called-by-ref-id",type:r.GenericReference,entityId:Il,entityType:r.FunctionDeclaration},CN={id:an,type:r.Loop,version:1,declaration:Fo,inputs:[],outputs:[AN],body:PN,successCalls:[zT],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[ON],calledBySuccess:[],breakStatements:[ZT],continueStatements:[QT],x:0,y:0,parent:SN},BN={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},rE={type:r.FunctionDeclaration,id:Il,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[CN],returnStatements:[zT],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:BN},wN={type:r.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:r.Project,entityId:q},_N={id:"call-hello-world-loop-id",type:r.FunctionCall,version:1,declaration:rE,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:wN},sn="company-dto-function-declaration-id",Sl="company-dto-func-declaration-argument-dcl-id",Ht="company-dto-function-company-variable-id",Cn="company-dto-function-company-dto-variable-id",xr="iterate-over-employee-list-loop-id",iE="iterate-over-employee-list-loop-employee-dto-output-map-id",Ol="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",ki="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",aE="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",MN="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",sE="iterate-over-employee-list-continue-statement-id",hs="iterate-over-employee-list-loop-body-id",oE="company-dto-func-declaration-return-statement-id",lE="company-dto-func-declaration-return-decl-id",cE="company-dto-func-declaration-company-variable-id-output-map-id",dE="company-dto-func-declaration-company-variable-employess-output-map-id",uE="company-dto-func-declaration-company-variable-name-output-map-id",NN="company-dto-func-declaration-company-dto-variable-input-map-id",$N="company-dto-func-declaration-company-dto-variable-employess-input-map-id",VN="company-dto-func-declaration-company-dto-variable-name-input-map-id",fs="company-dto-func-declaration-owner-variable-id",LN="company-dto-func-declaration-company-dto-variable-owner-input-map-id",pE="company-dto-func-declaration-company-variable-owner-output-map-id",yE="company-dto-func-declaration-owner-variable-id-output-map-id",ms="company-dto-func-declaration-bank-account-variable-id",GN="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",hE="company-dto-func-declaration-company-variable-bank-account-output-map-id",fE="company-dto-func-declaration-bank-account-variable-id-output-map-id",FN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:lE},xN={id:"company-dto-func-returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FN},UN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:oE},jN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:Cn},mE={isError:!1,id:lE,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:xN,readsValue:jN,required:!0,index:0,parent:UN},kN={type:r.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:Cn},qN={type:r.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},Cl={type:r.ReturnStatement,id:oE,version:1,outputs:[mE],calledByError:[],calledByEntry:[],calledBySuccess:[kN],throws:null,x:0,y:0,parent:qN},JN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:yE},WN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Cn},TE={id:LN,type:r.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:JN,parent:WN},HN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:fE},YN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Cn},EE={id:GN,type:r.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:HN,parent:YN},zN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:uE},ZN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Cn},RE={id:VN,type:r.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:zN,parent:ZN},XN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:iE},QN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Cn},bE={id:$N,type:r.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:XN,parent:QN},KN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:cE},e0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Cn},gE={id:NN,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:KN,parent:e0},t0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},n0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:ms},r0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:r.VariableDeclaration,entityId:fs},i0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:r.VariableDeclaration,entityId:xr},Bl={id:Cn,type:r.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[n0,r0,i0],successCalls:[Cl],errorCalls:[],readsValue:null,writesValues:[mE],inputs:[gE,RE,EE,TE,bE],outputs:[],internalCalls:[],parent:t0,x:0,y:0},zn="employee-dto-func-declaration-id",wl="employee-dto-func-declaration-argument-dcl-id",vE="employee-dto-func-declaration-return-statement-id",IE="employee-dto-func-declaration-return-decl-id",Zn="employee-dto-func-declaration-employee-variable-id",Xn="employee-dto-func-declaration-employee-dto-variable-id",Ts="employee-dto-func-declaration-manager-variable-id",PE="employee-dto-func-declaration-employee-variable-id-output-map-id",DE="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",AE="employee-dto-func-declaration-employee-variable-department-output-map-id",SE="employee-dto-func-declaration-employee-variable-manager-output-map-id",OE="employee-dto-func-declaration-manager-variable-id-output-map-id",a0="employee-dto-func-declaration-employee-dto-variable-input-map-id",s0="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",o0="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",l0="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",c0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:IE},d0={id:"employee-dto-func-returned-employee-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:c0},u0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:vE},p0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:Xn},CE={isError:!1,id:IE,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:d0,readsValue:p0,required:!0,index:0,parent:u0},y0={type:r.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:Xn},h0={type:r.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:zn},_l={type:r.ReturnStatement,id:vE,version:1,outputs:[CE],calledByError:[],calledByEntry:[],calledBySuccess:[y0],throws:null,x:0,y:0,parent:h0},f0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:OE},m0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Xn},BE={id:l0,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:f0,parent:m0},T0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:AE},E0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Xn},wE={id:o0,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:T0,parent:E0},R0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:DE},b0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Xn},_E={id:s0,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:R0,parent:b0},g0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:PE},v0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Xn},ME={id:a0,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:g0,parent:v0},I0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:zn},P0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:Ts},D0={id:Xn,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[P0],successCalls:[_l],errorCalls:[],readsValue:null,writesValues:[CE],inputs:[ME,_E,wE,BE],outputs:[],internalCalls:[],parent:I0,x:0,y:0},A0={type:r.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ts},S0={id:OE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[BE],parent:A0},O0={type:r.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ts},C0={id:"employee-dto-func-manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:O0,defaultValue:null},B0={type:r.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:SE},w0={type:r.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:zn};r.GenericReference,r.VariableDeclaration;const NE={id:Ts,type:r.VariableDeclaration,version:1,name:"Manager",dataType:C0,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[D0],errorCalls:[],readsValue:B0,writesValues:[],inputs:[],outputs:[S0],internalCalls:[],parent:w0,x:0,y:0},_0={type:r.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},M0={id:SE,type:r.OutputMap,version:1,declaration:It.properties[2],index:3,writesValues:[NE],parent:_0},N0={type:r.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},$0={id:AE,type:r.OutputMap,version:1,declaration:It.properties[0],index:2,writesValues:[wE],parent:N0},V0={type:r.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},L0={id:DE,type:r.OutputMap,version:1,declaration:ct.properties[1],index:1,writesValues:[_E],parent:V0},G0={type:r.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},F0={id:PE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[ME],parent:G0},x0={type:r.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},U0={id:"employee-dto-func-employee-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:x0,defaultValue:null},j0={type:r.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:zn},k0={type:r.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:wl},q0={type:r.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:zn},$E={id:Zn,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:U0,description:"A variable holding a company employee",calledByError:[],calledByEntry:[q0],calledBySuccess:[],successCalls:[NE],errorCalls:[],readsValue:k0,writesValues:[],inputs:[],outputs:[F0,L0,$0,M0],internalCalls:[],parent:j0,x:0,y:0},J0={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:wl,entityType:r.ArgumentDeclaration},W0={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:It,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:J0,defaultValue:null},H0={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:zn,entityType:r.FunctionDeclaration},Y0={type:r.ArgumentDeclaration,id:wl,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:W0,index:0,writesValues:[$E],parent:H0},z0={type:r.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},Ml={type:r.FunctionDeclaration,id:zn,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[Y0],calls:[$E],implements:null,returnStatements:[_l],collapsed:!1,private:!1,x:0,y:0,parent:z0},Z0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:aE,entityType:r.ReturnDeclaration},X0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:It,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:Z0},Q0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:r.GenericReference,entityId:ki,entityType:r.OutputMap},K0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:r.GenericReference,entityId:sE,entityType:r.ContinueStatement},VE={isError:!1,id:aE,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:Q0,dataType:X0,required:!0,index:0,parent:K0},e1={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:r.GenericReference,entityId:ki,entityType:r.FunctionCall},t1={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:r.GenericReference,entityId:xr,entityType:r.Loop},LE={id:sE,type:r.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[e1],outputs:[VE],throws:null,x:0,y:0,parent:t1},n1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:ki,entityType:r.FunctionCall},r1={id:MN,type:r.OutputMap,version:1,declaration:_l.outputs[0],writesValues:[VE],index:0,parent:n1},i1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:r.GenericReference,entityId:Ol,entityType:r.ArgumentDeclaration},a1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:r.GenericReference,entityId:ki,entityType:r.FunctionCall},GE={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:Ml.inputs[0],readsValue:i1,index:0,defaultValue:null,dynamicArguments:[],parent:a1},s1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:r.GenericReference,entityId:hs,entityType:r.FunctionDeclaration},o1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:r.GenericReference,entityId:hs,entityType:r.FunctionDeclaration},l1={id:ki,type:r.FunctionCall,version:1,declaration:Ml,inputs:[GE],process:null,outputs:[r1],calledByError:[],calledByEntry:[s1],calledBySuccess:[],successCalls:[LE],errorCalls:[],error:null,x:0,y:0,parent:o1},c1={type:r.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Ol,entityType:r.ArgumentDeclaration},d1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:It,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:c1},u1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:hs,entityType:r.FunctionDeclaration},p1={id:Ol,type:r.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:d1,required:!0,index:0,writesValues:[GE],parent:u1},y1={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:xr,entityType:r.Loop},h1={id:hs,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[p1],calls:[l1],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:y1},f1={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:xr,entityType:r.Loop},m1={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:r.GenericReference,entityId:dE,entityType:r.OutputMap},FE={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:kn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:m1,index:0,parent:f1},T1={id:"iterate-over-employee-list-loop-parent-ref-id",type:r.GenericReference,entityId:sn,entityType:r.FunctionDeclaration},E1={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:xr,entityType:r.Loop},R1={id:iE,type:r.OutputMap,version:1,declaration:kn.fixedReturns[0],writesValues:[bE],index:0,parent:E1},b1={type:r.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:r.VariableDeclaration,entityId:Ht},g1={id:xr,type:r.Loop,version:1,declaration:kn,inputs:[FE],successCalls:[Bl],errorCalls:[],outputs:[R1],body:h1,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[b1],breakStatements:[],continueStatements:[LE],error:null,x:0,y:0,parent:T1},v1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:ms},I1={id:fE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[EE],parent:v1},P1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ms},D1={id:"company-dto-func-bank-account-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:P1,defaultValue:null},A1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:hE},S1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn};r.GenericReference,r.VariableDeclaration;const xE={id:ms,type:r.VariableDeclaration,version:1,name:"Bank account",dataType:D1,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Bl],errorCalls:[],readsValue:A1,writesValues:[],inputs:[],outputs:[I1],internalCalls:[],parent:S1,x:0,y:0},O1={type:r.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:fs},C1={id:yE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[TE],parent:O1},B1={type:r.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:fs},w1={id:"company-dto-func-owner-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:B1,defaultValue:null},_1={type:r.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:pE},M1={type:r.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn};r.GenericReference,r.VariableDeclaration;const UE={id:fs,type:r.VariableDeclaration,version:1,name:"Owner",dataType:w1,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Bl],errorCalls:[],readsValue:_1,writesValues:[],inputs:[],outputs:[C1],internalCalls:[],parent:M1,x:0,y:0},N1={type:r.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},$1={id:pE,type:r.OutputMap,version:1,declaration:mt.properties[2],index:4,writesValues:[UE],parent:N1},V1={type:r.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},L1={id:hE,type:r.OutputMap,version:1,declaration:mt.properties[2],index:3,writesValues:[xE],parent:V1},G1={type:r.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},F1={id:uE,type:r.OutputMap,version:1,declaration:mt.properties[0],index:2,writesValues:[RE],parent:G1},x1={type:r.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},U1={id:dE,type:r.OutputMap,version:1,declaration:mt.properties[3],index:1,writesValues:[FE],parent:x1},j1={type:r.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},k1={id:cE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[gE],parent:j1},q1={type:r.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},J1={id:"company-dto-func-company-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:q1,defaultValue:null},W1={type:r.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},H1={type:r.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Sl},Y1={type:r.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:sn},jE={id:Ht,type:r.VariableDeclaration,version:1,name:"Company",dataType:J1,description:"A variable holding a company",calledByError:[],calledByEntry:[Y1],calledBySuccess:[],successCalls:[xE,UE,g1],errorCalls:[],readsValue:H1,writesValues:[],inputs:[],outputs:[k1,U1,F1,L1,$1],internalCalls:[],parent:W1,x:0,y:0},z1={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:Sl,entityType:r.ArgumentDeclaration},Z1={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:z1,defaultValue:null},X1={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:sn,entityType:r.FunctionDeclaration},Q1={type:r.ArgumentDeclaration,id:Sl,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:Z1,index:0,writesValues:[jE],parent:X1},K1={type:r.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},Nl={type:r.FunctionDeclaration,id:sn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[Q1],calls:[jE],implements:null,index:null,returnStatements:[Cl],collapsed:!1,private:!1,x:0,y:0,parent:K1},qi="exec-in-parallel-operation-call-id",Ji="exec-sequentially-operation-call-id",dt="concurrency-and-wait-function-declaration-id",kE="concurrency-and-wait-return-statement-id",qE="concurrency-and-wait-return-declaration-id",$l="exec-in-parallel-argument-map-id",JE="exec-sequentially-argument-map-id",Vl="wait-for-2-seconds-operation-id",WE="wait-for-2-seconds-argument-map-id",Ll="map-company-dto-function-call-id",HE="map-company-dto-function-call-company-dto-output-map-id",Wi="company-dto-variable-one-id",Gl="company-dto-variable-one-instance-id",e$="company-dto-variable-two-id",t$={type:r.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:qE},n$={id:"returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:t$},r$={type:r.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:kE},i$={type:r.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:Wi},YE={isError:!1,id:qE,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:n$,readsValue:i$,required:!0,index:0,parent:r$},a$={type:r.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:Vl},s$={type:r.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},zE={type:r.ReturnStatement,id:kE,version:1,outputs:[YE],calledByError:[],calledByEntry:[],calledBySuccess:[a$],throws:null,x:0,y:0,parent:s$},o$={type:r.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:r.VariableInstance,entityId:Gl},l$={type:r.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:r.VariableInstance,entityId:Gl},c$={type:r.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},ZE={id:e$,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[o$],internalCalls:[],writesValues:[YE],readsValue:l$,x:0,y:0,parent:c$},d$={type:r.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:r.VariableDeclaration,entityId:Wi},u$={type:r.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:Wi},p$={type:r.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},y$={type:r.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:Wi},XE={id:Gl,type:r.VariableInstance,version:1,declaration:y$,inputs:[],outputs:[],successCalls:[ZE],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[d$],internalCalls:[],writesValues:[ZE],readsValue:u$,x:0,y:0,parent:p$},h$={type:r.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:r.FunctionCall,entityId:Ll},f$={type:r.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:r.OutputMap,entityId:HE},m$={type:r.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},QE={id:Wi,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[XE],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[h$],internalCalls:[],writesValues:[XE],readsValue:f$,x:0,y:0,parent:m$},KE={type:r.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:r.FunctionCall,entityId:Ll},T$={id:"map-company-dto-function-call-company-input-map-id",type:r.InputMap,version:1,declaration:Nl.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:KE},E$={id:HE,type:r.OutputMap,version:1,declaration:Cl.outputs[0],writesValues:[QE],index:0,parent:KE},R$={id:"map-company-dto-function-call-called-by-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:dt},b$={id:"map-company-dto-function-call-parent-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:dt},g$={id:Ll,type:r.FunctionCall,version:1,declaration:Nl,successCalls:[QE],process:null,errorCalls:[],inputs:[T$],outputs:[E$],calledByError:[],calledByEntry:[R$],calledBySuccess:[],parent:b$,x:0,y:0,error:null},v$={type:r.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:zm},I$={type:r.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:r.DataType,entityId:"last-timestamp-variable-datatype-id"},P$={id:"last-timestamp-variable-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Or,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:v$,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,name:g.Date,value:null,autogeneration:{type:Ue.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:I$,valueAsType:null}},D$={type:r.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:r.Project,entityId:q},Fl={id:zm,type:r.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:P$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:D$},A$={type:r.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:WE},S$={type:r.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:r.Operation,entityId:Vl},O$={id:WE,type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:A$},index:0,parent:S$},C$={type:r.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},B$={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Ji},w$={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:qi},eR={id:Vl,type:r.Operation,version:1,declaration:$t,inputs:[O$],dynamicArguments:[],outputs:[],process:null,successCalls:[zE],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[B$,w$],calledBySuccess:[],error:null,parent:C$},_$={type:r.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"wait-for-random-amount-input-map-id"},M$={type:r.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:r.Operation,entityId:"wait-for-random-amount-id"},N$={id:"wait-for-random-amount-input-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:r.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:Ue.Random,rangeStart:1e3,rangeEnd:4e3},name:g.Number,parent:_$},index:0,parent:M$},$$={type:r.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:r.Project,entityId:q},Ur={id:"wait-for-random-amount-id",type:r.Operation,version:1,declaration:$t,inputs:[N$],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:$$},tR="list-of-functions-variable-id",V$={type:r.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:tR},L$={id:"list-of-functions-variable-action-descriptor-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:V.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:V.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},G$={type:r.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:r.DataType,entityId:"list-of-functions-variable-data-type-id"},F$={id:"list-of-functions-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:L$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.ActionDescriptor,value:null,valueAsType:[Ur,Ur,Ur,Ur,Ur],autogeneration:null,parent:G$},constant:!1,parent:V$},x$={type:r.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt};r.GenericReference,r.InputMap;const U$={type:r.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:r.InputMap,entityId:JE},j$={type:r.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:r.InputMap,entityId:$l},nR={id:tR,type:r.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:F$,parent:x$,readsValue:null,writesValues:[U$,j$],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},k$={type:r.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:r.Operation,entityId:qi},q$={type:r.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},J$={type:r.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-in-parallel-return-map-id"},W$={type:r.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:r.Operation,entityId:qi},rR={id:"exec-in-parallel-result-variable-id",type:r.VariableInstance,version:1,declaration:Fl,readsValue:J$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[W$],successCalls:[],errorCalls:[],internalCalls:[],parent:q$,x:0,y:0},H$={id:"exec-in-parallel-return-map-id",type:r.OutputMap,version:1,declaration:_o,writesValues:[rR],index:0,parent:k$},Y$={type:r.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:r.Operation,entityId:qi},z$={id:$l,type:r.InputMap,version:1,declaration:wo,name:null,description:null,dynamicArguments:[],readsValue:nR,defaultValue:null,index:0,parent:Y$},Z$={type:r.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},X$={type:r.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:dt},Q$={process:null,id:qi,type:r.Operation,version:1,declaration:$t,inputs:[z$],dynamicArguments:[],outputs:[H$],successCalls:[eR,rR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[X$],calledBySuccess:[],error:null,parent:Z$},K$={type:r.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:r.Operation,entityId:Ji},eV={type:r.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},tV={type:r.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-sequentially-return-map-id"},nV={type:r.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:r.Operation,entityId:Ji},iR={id:"exec-sequentially-result-variable-id",type:r.VariableInstance,version:1,declaration:Fl,readsValue:tV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[nV],successCalls:[],errorCalls:[],internalCalls:[],parent:eV,x:0,y:0},rV={id:"exec-sequentially-return-map-id",type:r.OutputMap,version:1,declaration:No,writesValues:[iR],index:0,parent:K$},iV={type:r.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:r.Operation,entityId:Ji},aV={id:JE,type:r.InputMap,version:1,declaration:Mo,name:null,description:null,dynamicArguments:[],readsValue:nR,defaultValue:null,index:0,parent:iV},sV={type:r.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},oV={type:r.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:dt},lV={id:Ji,type:r.Operation,version:1,declaration:tn,inputs:[aV],process:null,dynamicArguments:[],outputs:[rV],successCalls:[eR,iR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[oV],calledBySuccess:[],error:null,parent:sV},cV={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},dV={type:r.FunctionDeclaration,id:dt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[lV,Q$,g$],returnStatements:[zE],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:cV},uV={type:r.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:r.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},pV={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uV},yV={type:r.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:r.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},hV={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:pV,readsValue:null,required:!0,index:0,parent:yV},fV={type:r.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},mV={type:r.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},aR={type:r.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[hV],calledByError:[],calledByEntry:[mV],calledBySuccess:[],throws:null,x:0,y:0,parent:fV},TV={type:r.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:r.Project,entityId:q},EV={type:r.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[aR],index:null,implements:null,returnStatements:[aR],collapsed:!1,private:!1,x:0,y:0,parent:TV},xl="get-current-date-and-time-func-decl-id",sR="get-current-date-and-time-return-statement-id",oR="get-current-date-and-time-return-declaration-id",lR="get-current-date-and-time-return-declaration-data-type-id",RV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:r.DataType,entityId:lR},bV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:oR},gV={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:lR,version:1,entity:Or,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.Date,valueAsType:null,autogeneration:{type:Ue.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:RV},constant:!1,parent:bV},vV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:r.ReturnStatement,entityId:sR};r.ReturnDeclaration;const IV={type:r.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:xl},PV={type:r.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:xl};r.ReturnStatement;const DV={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},AV={type:r.FunctionDeclaration,id:xl,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:DV},cR="do-math-return-statement-id",dR="do-math-return-declaration-id",SV={type:r.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:r.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},OV={id:"do-math-func-var-to-return-one-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SV},CV={type:r.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},BV={type:r.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:r.ReturnDeclaration,entityId:dR},wV={type:r.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:OV,readsValue:null,writesValues:[BV],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:CV},_V={type:r.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:r.ReturnStatement,entityId:cR},MV={type:r.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:r.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},NV={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MV},$V={isError:!1,id:dR,version:1,type:r.ReturnDeclaration,name:"Result",description:null,dataType:NV,readsValue:wV,required:!0,index:0,parent:_V},VV={type:r.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},LV={type:r.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},uR={type:r.ReturnStatement,id:cR,version:1,outputs:[$V],calledByError:[],calledByEntry:[],calledBySuccess:[VV],parent:LV,throws:null,x:0,y:0},GV={type:r.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:r.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},FV={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:GV},xV={type:r.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},UV={type:r.GenericReference,id:"do-math-func-return-one-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},jV={type:r.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},pR={type:r.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:FV,description:null,readsValue:jV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[UV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:xV},kV={type:r.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},qV={type:r.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},JV={type:r.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:r.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},WV={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:JV},HV={type:r.GenericReference,id:"do-math-func-return-two-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},yR={type:r.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[HV],successCalls:[],errorCalls:[],dataType:WV,readsValue:qV,writesValues:[],internalCalls:[],parent:kV,x:0,y:0},hR={type:r.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},YV={type:r.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},zV={type:r.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},ZV={type:r.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:r.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},fR={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:r.InputMap,declaration:vo,name:null,description:null,dynamicArguments:[],readsValue:ZV,defaultValue:null,index:0,parent:zV},XV={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:r.OutputMap,version:1,declaration:Po,writesValues:[pR,yR],index:0,parent:YV},QV={type:r.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},KV={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:r.GenericReference,entityType:r.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},mR={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:r.InputMap,declaration:Io,name:null,description:null,dynamicArguments:[],readsValue:KV,defaultValue:null,index:1,parent:QV},eL={type:r.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Ea,version:1,inputs:[fR,mR],dynamicArguments:[],outputs:[XV],calledByError:[],calledByEntry:[hR],calledBySuccess:[],process:null,successCalls:[uR,pR,yR],errorCalls:[],parent:hR,error:null,x:0,y:0},tL={type:r.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:r.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},nL={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:r.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:r.ArgumentDeclaration},TR={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:r.PrimitiveValue,version:1,value:1,name:g.Number,parent:tL,valueAsType:null,autogeneration:null},constant:!1,parent:nL},rL={type:r.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:r.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},iL={type:r.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},aL={type:r.GenericReference,id:"do-math-func-var-called-by-ref",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},ER={type:r.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:TR,inputs:[],outputs:[],calledByError:[],calledByEntry:[aL],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:rL,writesValues:[mR],internalCalls:[],x:0,y:0,parent:iL},sL={entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:r.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},oL={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:r.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:TR,writesValues:[ER],required:!0,index:1,parent:sL},lL={type:r.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:r.Project,entityId:q},cL={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},dL={type:r.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:r.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},uL={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:r.ArgumentDeclaration},pL={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:r.PrimitiveValue,version:1,value:5,name:g.Number,parent:dL,valueAsType:null,autogeneration:null},constant:!1,parent:uL},yL={id:"d8895765-f705-457e-85fa-25d130926769",type:r.ArgumentDeclaration,version:1,name:"N",dataType:pL,description:"The number to add",writesValues:[fR],required:!0,index:0,parent:cL},hL={type:r.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[yL,oL],calls:[eL,ER],implements:null,index:null,collapsed:!1,returnStatements:[uR],private:!1,x:0,y:0,parent:lL},Pt="replace-bank-account-in-company-func-declaration-id",Ul="company-entity-to-modify-arg-declaration-id",fL="account-number-to-create-arg-decl-id",jr="company-variable-id",kr="search-person-by-id-id",RR="new-bank-account-owner-arg-decl-id",bR="search-person-by-id-output-declaration-id",jl="search-person-by-id-output-entity-map-id",Es="person-not-empty-condition-id",Rs="create-new-bank-account-instance-operation-id",gR="create-new-bank-account-instance-operation-output-entity-map-id",vR="company-bank-account-output-map-id",IR="old-bank-account-var-declaration-id",PR="company-variable-instance-id",mL="delete-bank-account-internal-call-id",TL={type:r.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},EL={type:r.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:r.InternalCall,entityId:mL},RL={type:r.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:jr},bL={type:r.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:r.VariableInstance,entityId:PR},gL={type:r.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:gR},DR={type:r.InputMap,id:"bank-account-input-map-id",version:1,readsValue:gL,declaration:El,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:bL},vL={type:r.VariableInstance,id:PR,version:1,declaration:RL,inputs:[DR],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[EL],successCalls:[],errorCalls:[],internalCalls:[],parent:TL,readsValue:null,writesValues:[],x:0,y:0},IL={type:r.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},PL={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:Gr,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:IL},DL={type:r.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:vR},AL={type:r.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},SL={type:r.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:jr},OL={type:r.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:r.Operation,entityId:Rs},CL={type:r.GenericReference,id:"delete-bank-account-internal-call-parent-ref-id",entityType:r.VariableDeclaration,entityId:IR},AR={process:null,type:r.InternalCall,id:"delete-bank-account-internal-call-id",version:1,declaration:ko,index:0,successCalls:[vL],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[OL],parent:CL},SR={type:r.VariableDeclaration,id:IR,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:PL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[SL],successCalls:[],internalCalls:[AR],errorCalls:[],parent:AL,readsValue:DL,writesValues:[],x:0,y:0},BL={type:r.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},wL={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:BL},_L={type:r.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Ul},ML={type:r.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},NL={type:r.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},$L={type:r.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},VL={id:vR,version:1,type:r.OutputMap,declaration:El,index:0,parent:$L,writesValues:[SR]},OR={type:r.VariableDeclaration,id:jr,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:wL,inputs:[],outputs:[VL],calledByError:[],calledByEntry:[NL],calledBySuccess:[],successCalls:[SR],errorCalls:[],parent:ML,internalCalls:[],readsValue:_L,writesValues:[],x:0,y:0},LL={type:r.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},GL={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.OutputMap,entityId:jl},CR={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:r.InputMap,declaration:nT,name:null,description:null,dynamicArguments:[],readsValue:GL,index:1,defaultValue:null,parent:LL},FL={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:fL},xL={type:r.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},BR={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:r.InputMap,declaration:tT,name:null,description:null,dynamicArguments:[],readsValue:FL,defaultValue:null,index:0,parent:xL},UL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:r.Operation,entityId:Rs},jL={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:r.InputMap,declaration:Cr.fixedArguments[0],name:null,description:null,dynamicArguments:[BR,CR],index:0,readsValue:null,defaultValue:{type:r.PrimitiveValue,name:g.EntityTemplate,value:null,valueAsType:Gr,autogeneration:null},parent:UL},kL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:r.Operation,entityId:Rs},qL={id:gR,version:1,type:r.OutputMap,declaration:Cr.fixedReturns[0],index:0,writesValues:[DR],parent:kL},JL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:r.Condition,entityId:Es},WL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},HL={process:null,id:Rs,type:r.Operation,version:1,declaration:Cr,inputs:[jL],dynamicArguments:[],error:null,outputs:[qL],successCalls:[AR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[JL],parent:WL,x:0,y:0},YL={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:r.DataType},zL={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:r.ReturnDeclaration};r.DataType,r.PrimitiveValue,g.String;const ZL={id:"person-not-found-thrown-error-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:r.ReturnStatement},XL={isError:!0,id:"person-not-found-thrown-error-id",type:r.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:ZL,required:!0,index:0,readsValue:null},QL={id:"person-not-found-error-return-statement-called-by-ref-id",type:r.GenericReference,entityId:Es,entityType:r.Condition},KL={id:"person-not-found-error-return-statement-parent-ref-id",type:r.GenericReference,entityId:Pt,entityType:r.FunctionDeclaration},eG={id:"person-not-found-error-return-statement-id",type:r.ReturnStatement,version:1,throws:XL,outputs:[],calledBySuccess:[],calledByError:[QL],calledByEntry:[],x:0,y:0,parent:KL},tG={type:r.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:r.Search,entityId:kr},nG={type:r.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},rG={type:r.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:jl},iG={type:r.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:r.Condition,entityId:Es},wR={id:"person-entity-to-check-map-id",version:1,type:r.InputMap,declaration:qn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:rG,index:0,defaultValue:null,parent:iG},aG={type:r.Condition,id:Es,version:1,declaration:qn,inputs:[wR],calledByError:[],calledByEntry:[],calledBySuccess:[tG],successCalls:[HL],errorCalls:[eG],x:0,y:0,parent:nG},sG={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:r.ReturnDeclaration,entityId:bR},oG={id:"search-person-by-id-output-entity-declaration-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:ct,defaultValue:null,parent:sG},lG={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:r.Search,entityId:kr},_R={isError:!1,id:bR,type:r.ReturnDeclaration,version:1,dataType:oG,name:"Found person",description:"The person entity that was found",parent:lG,required:!0,index:0,readsValue:null},cG={type:r.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:r.Search,entityId:kr},dG={type:r.OutputMap,id:jl,version:1,declaration:_R,parent:cG,writesValues:[wR,CR],index:0},uG={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:r.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:r.ArgumentDeclaration};r.DataType;const pG={type:r.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:r.Search,entityId:kr},MR={id:"search-person-by-id-input-declaration-id",type:r.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:pG,writesValues:[]},yG={type:r.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:r.Search,entityId:kr},hG={id:"search-person-by-id-input-map-reads-value-ref-id",type:r.GenericReference,entityId:RR,entityType:r.ArgumentDeclaration},NR={type:r.InputMap,id:"search-person-by-id-input-map",version:1,declaration:MR,name:null,description:null,readsValue:hG,defaultValue:null,parent:yG,dynamicArguments:[],index:0},fG={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},mG={type:r.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},TG={type:r.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},EG={type:r.Search,id:kr,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:fG,inputsDeclarations:[MR],inputs:[NR],outputsDeclarations:[_R],outputs:[dG],calledByError:[],calledByEntry:[TG],calledBySuccess:[],error:null,successCalls:[aG],errorCalls:[],parent:mG,x:0,y:0};r.GenericReference,r.DataType;const RG={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:r.ArgumentDeclaration},bG={id:"account-number-to-create-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:RG},gG={entityType:r.FunctionDeclaration,entityId:Pt,type:r.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},vG={id:"account-number-to-create-arg-decl-id",type:r.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:bG,writesValues:[BR],required:!0,index:1,parent:gG};r.GenericReference,r.DataType;const IG={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:r.ArgumentDeclaration},PG={id:"new-bank-account-owner-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ta,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:IG},DG={entityType:r.FunctionDeclaration,entityId:Pt,type:r.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},AG={id:RR,type:r.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",dataType:PG,writesValues:[NR],required:!1,index:1,parent:DG},SG={type:r.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:r.Project,entityId:q},OG={type:r.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:r.FunctionDeclaration,entityId:Pt};r.GenericReference,r.DataType;const CG={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:Ul,entityType:r.ArgumentDeclaration},BG={id:"company-entity-to-modify-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:CG},wG={id:Ul,type:r.ArgumentDeclaration,version:1,name:"Company",dataType:BG,description:"The company to replace the bank account for",writesValues:[OR],required:!0,index:0,parent:OG},_G={type:r.FunctionDeclaration,id:Pt,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[wG,vG,AG],index:null,implements:null,calls:[EG,OR],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:SG},MG={type:r.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},NG={type:r.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:MG,x:0,y:0},$G={type:r.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:r.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},VG={type:r.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},LG={type:r.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[NG],events:[],implements:VG,parent:$G,x:0,y:0},kl="iterate-over-list-loop-id",$R="iterate-over-list-loop-body-id",VR="iterate-over-list-loop-body-current-iteration-argument-declaration-id",GG={type:r.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:VR,entityType:r.ArgumentDeclaration},FG={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:GG},xG={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:$R,entityType:r.FunctionDeclaration},UG={id:VR,type:r.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:FG,required:!0,index:0,writesValues:[],parent:xG},jG={id:"iterate-over-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:kl,entityType:r.Loop},kG={id:$R,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[UG],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:jG},qG={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:kl,entityType:r.Loop},JG={id:"iterate-over-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:kn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:qG},WG={id:"iterate-over-list-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},HG={id:kl,type:r.Loop,version:1,declaration:kn,inputs:[JG],successCalls:[],errorCalls:[],outputs:[],process:null,body:kG,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:WG};var ql=(n=>(n.EQ="eq",n.NEQ="neq",n.GT="gt",n.GTE="gte",n.LT="lt",n.LTE="lte",n.LIKE="like",n.ILIKE="ilike",n))(ql||{}),LR=(n=>(n.COUNT="count",n.SUM="sum",n.AVG="avg",n.MIN="min",n.MAX="max",n))(LR||{});const YG={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:LR.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:ql.NEQ,value:null}]},where:[{name:"employee_count",operation:ql.GT,value:1}]},zG={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},ZG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},GR={isError:!1,id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:r.ReturnDeclaration,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,readsValue:null,required:!0,index:0,parent:ZG},XG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},QG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:r.OutputMap,version:1,declaration:GR,writesValues:[],index:0,parent:XG},KG={id:"find-companies-with-multiple-employees-and-bank-account",type:r.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[GR],inputs:[],outputs:[QG],query:YG,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:zG},qr="random-company-employee-test-variable-id",Jl="manager-global-variable-id",FR="global-user-instance-id",Jr="employee-mapped-dto-variable-id",xR="random-employee-id-output-map-id",UR="random-employee-birth-date-output-map-id",jR="random-employee-department-output-map-id",kR="random-employee-manager-output-map-id",qR="manager-global-id-output-map-id",JR="global-user-instance-id-output-map-id",eF="employee-mapped-dto-requester-id-input-map-id",tF="employee-mapped-dto-id-input-map-id",nF="employee-mapped-dto-birth-date-input-map-id",rF="employee-mapped-dto-department-input-map-id",iF="employee-mapped-dto-manager-input-map-id",aF={type:r.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:qR},sF={type:r.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jr},WR={id:iF,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:aF,parent:sF},oF={type:r.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:jR},lF={type:r.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jr},HR={id:rF,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:oF,parent:lF},cF={type:r.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:UR},dF={type:r.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jr},YR={id:nF,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:cF,parent:dF},uF={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:xR},pF={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jr},zR={id:tF,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:uF,parent:pF},yF={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:JR},hF={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jr},ZR={id:eF,type:r.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:yF,parent:hF},fF={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jl},mF={id:qR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[WR],parent:fF},TF={type:r.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Jl},EF={id:"manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:TF,defaultValue:null},RF={type:r.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:kR},bF={type:r.GenericReference,id:"manager-variable-parent-ref-id",entityType:r.Project,entityId:q},XR={id:Jl,type:r.VariableDeclaration,version:1,name:"Manager",dataType:EF,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:RF,writesValues:[],inputs:[],outputs:[mF],internalCalls:[],parent:bF,x:0,y:0},gF={type:r.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:qr},vF={id:kR,type:r.OutputMap,version:1,declaration:It.properties[2],index:3,writesValues:[XR],parent:gF},IF={type:r.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:qr},PF={id:jR,type:r.OutputMap,version:1,declaration:It.properties[0],index:2,writesValues:[HR],parent:IF},DF={type:r.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:qr},AF={id:UR,type:r.OutputMap,version:1,declaration:ct.properties[1],index:1,writesValues:[YR],parent:DF},SF={type:r.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:qr},OF={id:xR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[zR],parent:SF},CF={type:r.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:qr},BF={id:"random-company-employee-test-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:CF,defaultValue:null},wF={type:r.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:r.Project,entityId:q},_F={id:qr,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:BF,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[OF,AF,PF,vF],internalCalls:[],parent:wF,x:0,y:0},MF={type:r.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:r.Project,entityId:q},NF={id:Jr,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[ZR,zR,YR,HR,WR],outputs:[],internalCalls:[],parent:MF,x:0,y:0},$F={type:r.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:r.VariableDeclaration,entityId:yl},VF={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:fl,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:$F,defaultValue:null},LF={type:r.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:r.Project,entityId:q},QR={id:yl,type:r.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:VF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:LF},GF={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableInstance,entityId:FR},FF={id:JR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[ZR],parent:GF},xF={type:r.GenericReference,id:"global-user-instance-parent-ref-id",entityType:r.Project,entityId:q},UF={id:FR,type:r.VariableInstance,version:1,declaration:QR,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[FF],internalCalls:[],parent:xF,x:0,y:0},jF={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:yl},kF={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:r.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},qF={id:"is-test-environment-variable-dcl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:xn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:jF,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:g.Boolean,version:1,value:null,type:r.PrimitiveValue,autogeneration:{type:Ue.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:kF}},JF={type:r.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:r.Project,entityId:q},KR={id:"is-test-environment-variable-dcl-id",type:r.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:qF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:JF},WF={type:r.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:r.Project,entityId:q},HF={id:"is-test-environment-variable-instance-id",type:r.VariableInstance,version:1,declaration:KR,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:WF,x:0,y:0},eb={type:r.Project,id:q,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[LG],entities:[hl,fl,ct,Yw,It,ls,fT,mT,Gr,jB,mt,Lw,Zm,JD,xB],functions:[dV,kT,Ml,EV,AV,rE,Nl,Rl,_G,AT,hL],events:[S_],variableDeclarations:[KR,QR,Fl,_F,XR,NF],variableInstances:[HF,UF],conditions:[],operations:[Ur],functionCalls:[DM,_N],loops:[HG],searches:[KG]};function bs(n){return n.charAt(0).toUpperCase()+n.slice(1)}function tb(n){return n.charAt(0).toLowerCase()+n.slice(1)}var f=(n=>(n.Error="error",n.Warning="warning",n))(f||{}),v=(n=>(n.InvalidObjectStructure="invalid-object-structure",n.NameNotUniqueInScope="name-not-unique-in-scope",n.EmptyName="empty-name",n.MissingCaller="missing-caller",n.PropertyOverwrite="property-overwrite",n.MethodOverwrite="method-overwrite",n.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",n.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",n.UnreachableEntity="unreachable-entity",n))(v||{}),y=(n=>(n.RootReference="root-reference",n.ReferencedEntityNotFound="referenced-entity-not-found",n.EntityIdNotUnique="entity-id-not-unique",n.BuiltInEntityGenerated="built-in-entity-generated",n.BuiltInEntityUpdated="built-in-entity-updated",n.BuiltInEntityDeleted="built-in-entity-deleted",n.UnknownEntityType="unknown-entity-type",n.MissingTypeProperty="missing-type-property",n.MissingIdProperty="missing-id-property",n.BuiltInEntityParent="built-in-entity-parent",n.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",n.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",n.RecommendedImplementOperationAction="recommended-implement-operation-action",n.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",n.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",n.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",n.RecommendedImplementConditionAction="recommended-implement-condition-action",n.InvalidReferenceObjectStructure="invalid-reference-object-structure",n.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",n.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",n.InvalidParentReference="invalid-parent-reference",n.InvalidImplementsReference="invalid-implements-reference",n.InvalidExtendsReference="invalid-extends-reference",n.InvalidGenerationActionPayload="invalid-generation-action-payload",n.InvalidReference="invalid-reference",n.InvalidInternalCallParentDeclarationRelation="invalid-internal-call-parent-declaration-relation",n.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",n.InvalidUpdateEntityOperation="invalid-update-entity-operation",n.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",n.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",n.UnrecognizedProperty="unrecognized-property",n.SelfReference="self-reference",n.DuplicateReference="duplicate-reference",n.CallerWithIncompatibleScope="caller-with-incompatible-scope",n.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",n.InvalidInputMapDeclaration="invalid-input-map-declaration",n.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",n.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",n.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",n.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",n.OutputOverwrite="output-overwrite",n.InputOverwrite="input-overwrite",n.IncompatibleScope="incompatible-scope",n.InvalidParentUpdate="invalid-parent-update",n.NonInteractiveEntityReferenced="non-interactive-entity-referenced",n.InvalidParentRelationType="invalid-parent-relation-type",n))(y||{}),M=(n=>(n.ScopeWithoutLogic="scope-without-logic",n.ExtendingAbstractEntity="extending-abstract-entity",n.ImplementingNonAbstractEntity="implementing-non-abstract-entity",n.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",n.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",n.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",n.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",n.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",n.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",n.IncorrectEntityImplementation="incorrect-entity-implementation",n.IncorrectMethodImplementation="incorrect-method-implementation",n.IncorrectPropertyImplementation="incorrect-property-implementation",n.PropertyImplementsNonAbstact="property-implements-non-abstract",n.NonStaticPropertyImplementsStatic="non-static-property-implements-static",n.StaticPropertyImplementsNonStatic="static-property-implements-non-static",n.PropertyImplementsIncompatibleType="property-implements-incompatible-type",n.MissingPropertyImplementation="missing-property-implementation",n.MissingMethodImplementation="missing-method-implementation",n.NoProperties="no-properties",n.ReadingFromIncompatibleType="reading-from-incompatible-type",n.WritingToIncompatibleType="writing-to-incompatible-type",n.InvalidPropertiesCombination="invalid-properties-combination",n.DisconnectedCallableEntity="disconnected-callable-entity",n))(M||{});class E{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in v?new Qn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class Qn{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");l(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new Qn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function YF(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function H(n){const e=n.entity.errors.find(i=>i.id===n.id);return e?{new:!1,error:e}:{new:!0,error:new Qn(n)}}function zF(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function Z(n,e){const t=[];return e.forEach(i=>{const a=n.find(s=>s.id===i.id);a?t.push(a):t.push(i)}),t}function ZF(n){return n instanceof Error&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)}var XF=class extends Error{constructor(e,t){super(e,t);l(this,"name");l(this,"details");this.name="ZodValidationError",this.details=QF(t)}toString(){return this.message}};function QF(n){if(n){const e=n.cause;if(ZF(e))return e.issues}return[]}var KF="; ",nb="Validation error",e4=": ",t4=", or ";function n4(n,e,t){return e!==null?n.length>0?[e,n].join(t):e:n.length>0?n:nb}var r4=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function i4(n){return n.length===1?n[0].toString():n.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+a4(t)+'"]';if(!r4.test(t))return e+'["'+t+'"]';const i=e.length===0?"":".";return e+i+t},"")}function a4(n){return n.replace(/"/g,'\\"')}function s4(n){return n.length!==0}function gs(n){const{issue:e,issueSeparator:t,unionSeparator:i,includePath:a}=n;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const u=o.issues.map(p=>gs({issue:p,issueSeparator:t,unionSeparator:i,includePath:a})).join(t);return s.includes(u)||s.push(u),s},[]).join(i);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>gs({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>gs({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(a&&s4(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${i4(e.path)}"`}return e.message}function o4(n,e={}){const{issueSeparator:t=KF,unionSeparator:i=t4,prefixSeparator:a=e4,prefix:s=nb,includePath:o=!0}=e,u=gs({issue:n,issueSeparator:t,unionSeparator:i,includePath:o}),p=n4(u,s,a);return new XF(p,{cause:new ft([n])})}var rb="1.13.7",ib=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},vs=Array.prototype,Wl=Object.prototype,ab=typeof Symbol<"u"?Symbol.prototype:null,l4=vs.push,Hi=vs.slice,Yi=Wl.toString,c4=Wl.hasOwnProperty,sb=typeof ArrayBuffer<"u",d4=typeof DataView<"u",u4=Array.isArray,ob=Object.keys,lb=Object.create,cb=sb&&ArrayBuffer.isView,p4=isNaN,y4=isFinite,db=!{toString:null}.propertyIsEnumerable("toString"),ub=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],h4=Math.pow(2,53)-1;function Tt(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),i=Array(t),a=0;a<t;a++)i[a]=arguments[a+e];switch(e){case 0:return n.call(this,i);case 1:return n.call(this,arguments[0],i);case 2:return n.call(this,arguments[0],arguments[1],i)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=i,n.apply(this,s)}}function Bn(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function f4(n){return n===null}function pb(n){return n===void 0}function yb(n){return n===!0||n===!1||Yi.call(n)==="[object Boolean]"}function m4(n){return!!(n&&n.nodeType===1)}function rt(n){var e="[object "+n+"]";return function(t){return Yi.call(t)===e}}const Hl=rt("String"),hb=rt("Number"),T4=rt("Date"),E4=rt("RegExp"),R4=rt("Error"),fb=rt("Symbol"),mb=rt("ArrayBuffer");var Tb=rt("Function"),b4=ib.document&&ib.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof b4!="function"&&(Tb=function(n){return typeof n=="function"||!1});const ut=Tb,Eb=rt("Object");var Rb=d4&&(!/\[native code\]/.test(String(DataView))||Eb(new DataView(new ArrayBuffer(8)))),Yl=typeof Map<"u"&&Eb(new Map),g4=rt("DataView");function v4(n){return n!=null&&ut(n.getInt8)&&mb(n.buffer)}const Is=Rb?v4:g4,Kn=u4||rt("Array");function wn(n,e){return n!=null&&c4.call(n,e)}var zl=rt("Arguments");(function(){zl(arguments)||(zl=function(n){return wn(n,"callee")})})();const Zl=zl;function I4(n){return!fb(n)&&y4(n)&&!isNaN(parseFloat(n))}function bb(n){return hb(n)&&p4(n)}function gb(n){return function(){return n}}function vb(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=h4}}function Ib(n){return function(e){return e==null?void 0:e[n]}}const Ps=Ib("byteLength"),P4=vb(Ps);var D4=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function A4(n){return cb?cb(n)&&!Is(n):P4(n)&&D4.test(Yi.call(n))}const Pb=sb?A4:gb(!1),Et=Ib("length");function S4(n){for(var e={},t=n.length,i=0;i<t;++i)e[n[i]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,n.push(a)}}}function Db(n,e){e=S4(e);var t=ub.length,i=n.constructor,a=ut(i)&&i.prototype||Wl,s="constructor";for(wn(n,s)&&!e.contains(s)&&e.push(s);t--;)s=ub[t],s in n&&n[s]!==a[s]&&!e.contains(s)&&e.push(s)}function We(n){if(!Bn(n))return[];if(ob)return ob(n);var e=[];for(var t in n)wn(n,t)&&e.push(t);return db&&Db(n,e),e}function zi(n){if(n==null)return!0;var e=Et(n);return typeof e=="number"&&(Kn(n)||Hl(n)||Zl(n))?e===0:Et(We(n))===0}function Ab(n,e){var t=We(e),i=t.length;if(n==null)return!i;for(var a=Object(n),s=0;s<i;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function X(n){if(n instanceof X)return n;if(!(this instanceof X))return new X(n);this._wrapped=n}X.VERSION=rb,X.prototype.value=function(){return this._wrapped},X.prototype.valueOf=X.prototype.toJSON=X.prototype.value,X.prototype.toString=function(){return String(this._wrapped)};function Sb(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,Ps(n))}var Ob="[object DataView]";function Xl(n,e,t,i){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var a=typeof n;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:Cb(n,e,t,i)}function Cb(n,e,t,i){n instanceof X&&(n=n._wrapped),e instanceof X&&(e=e._wrapped);var a=Yi.call(n);if(a!==Yi.call(e))return!1;if(Rb&&a=="[object Object]"&&Is(n)){if(!Is(e))return!1;a=Ob}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return ab.valueOf.call(n)===ab.valueOf.call(e);case"[object ArrayBuffer]":case Ob:return Cb(Sb(n),Sb(e),t,i)}var s=a==="[object Array]";if(!s&&Pb(n)){var o=Ps(n);if(o!==Ps(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof n!="object"||typeof e!="object")return!1;var u=n.constructor,p=e.constructor;if(u!==p&&!(ut(u)&&u instanceof u&&ut(p)&&p instanceof p)&&"constructor"in n&&"constructor"in e)return!1}t=t||[],i=i||[];for(var h=t.length;h--;)if(t[h]===n)return i[h]===e;if(t.push(n),i.push(e),s){if(h=n.length,h!==e.length)return!1;for(;h--;)if(!Xl(n[h],e[h],t,i))return!1}else{var m=We(n),T;if(h=m.length,We(e).length!==h)return!1;for(;h--;)if(T=m[h],!(wn(e,T)&&Xl(n[T],e[T],t,i)))return!1}return t.pop(),i.pop(),!0}function O4(n,e){return Xl(n,e)}function Zi(n){if(!Bn(n))return[];var e=[];for(var t in n)e.push(t);return db&&Db(n,e),e}function Ql(n){var e=Et(n);return function(t){if(t==null)return!1;var i=Zi(t);if(Et(i))return!1;for(var a=0;a<e;a++)if(!ut(t[n[a]]))return!1;return n!==_b||!ut(t[Kl])}}var Kl="forEach",Bb="has",ec=["clear","delete"],wb=["get",Bb,"set"],C4=ec.concat(Kl,wb),_b=ec.concat(wb),B4=["add"].concat(ec,Kl,Bb);const w4=Yl?Ql(C4):rt("Map"),_4=Yl?Ql(_b):rt("WeakMap"),M4=Yl?Ql(B4):rt("Set"),N4=rt("WeakSet");function Wr(n){for(var e=We(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=n[e[a]];return i}function $4(n){for(var e=We(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=[e[a],n[e[a]]];return i}function Mb(n){for(var e={},t=We(n),i=0,a=t.length;i<a;i++)e[n[t[i]]]=t[i];return e}function tc(n){var e=[];for(var t in n)ut(n[t])&&e.push(t);return e.sort()}function nc(n,e){return function(t){var i=arguments.length;if(e&&(t=Object(t)),i<2||t==null)return t;for(var a=1;a<i;a++)for(var s=arguments[a],o=n(s),u=o.length,p=0;p<u;p++){var h=o[p];(!e||t[h]===void 0)&&(t[h]=s[h])}return t}}const Nb=nc(Zi),Ds=nc(We),$b=nc(Zi,!0);function V4(){return function(){}}function Vb(n){if(!Bn(n))return{};if(lb)return lb(n);var e=V4();e.prototype=n;var t=new e;return e.prototype=null,t}function L4(n,e){var t=Vb(n);return e&&Ds(t,e),t}function G4(n){return Bn(n)?Kn(n)?n.slice():Nb({},n):n}function F4(n,e){return e(n),n}function Lb(n){return Kn(n)?n:[n]}X.toPath=Lb;function Xi(n){return X.toPath(n)}function rc(n,e){for(var t=e.length,i=0;i<t;i++){if(n==null)return;n=n[e[i]]}return t?n:void 0}function Gb(n,e,t){var i=rc(n,Xi(e));return pb(i)?t:i}function x4(n,e){e=Xi(e);for(var t=e.length,i=0;i<t;i++){var a=e[i];if(!wn(n,a))return!1;n=n[a]}return!!t}function ic(n){return n}function Qi(n){return n=Ds({},n),function(e){return Ab(e,n)}}function ac(n){return n=Xi(n),function(e){return rc(e,n)}}function Ki(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(i){return n.call(e,i)};case 3:return function(i,a,s){return n.call(e,i,a,s)};case 4:return function(i,a,s,o){return n.call(e,i,a,s,o)}}return function(){return n.apply(e,arguments)}}function Fb(n,e,t){return n==null?ic:ut(n)?Ki(n,e,t):Bn(n)&&!Kn(n)?Qi(n):ac(n)}function sc(n,e){return Fb(n,e,1/0)}X.iteratee=sc;function Rt(n,e,t){return X.iteratee!==sc?X.iteratee(n,e):Fb(n,e,t)}function U4(n,e,t){e=Rt(e,t);for(var i=We(n),a=i.length,s={},o=0;o<a;o++){var u=i[o];s[u]=e(n[u],u,n)}return s}function xb(){}function j4(n){return n==null?xb:function(e){return Gb(n,e)}}function k4(n,e,t){var i=Array(Math.max(0,n));e=Ki(e,t,1);for(var a=0;a<n;a++)i[a]=e(a);return i}function oc(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const ea=Date.now||function(){return new Date().getTime()};function Ub(n){var e=function(s){return n[s]},t="(?:"+We(n).join("|")+")",i=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,i.test(s)?s.replace(a,e):s}}const jb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},q4=Ub(jb),J4=Mb(jb),W4=Ub(J4),H4=X.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var lc=/(.)^/,Y4={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z4=/\\|'|\r|\n|\u2028|\u2029/g;function Z4(n){return"\\"+Y4[n]}var X4=/^\s*(\w|\$)+\s*$/;function Q4(n,e,t){!e&&t&&(e=t),e=$b({},e,X.templateSettings);var i=RegExp([(e.escape||lc).source,(e.interpolate||lc).source,(e.evaluate||lc).source].join("|")+"|$","g"),a=0,s="__p+='";n.replace(i,function(h,m,T,b,I){return s+=n.slice(a,I).replace(z4,Z4),a=I+h.length,m?s+=`'+
1
+ (function(d,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(d=typeof globalThis<"u"?globalThis:d||self,r(d["@elyx-code/project-logic-tree"]={}))})(this,function(d){"use strict";var u3=Object.defineProperty;var p3=(d,r,w)=>r in d?u3(d,r,{enumerable:!0,configurable:!0,writable:!0,value:w}):d[r]=w;var l=(d,r,w)=>(p3(d,typeof r!="symbol"?r+"":r,w),w);var r=(n=>(n.CustomEntity="custom-entity",n.BuiltInBaseEntity="built-in-base-entity",n.Project="project",n.InstalledProject="installed-project",n.GlobalEvent="global-event",n.DataType="data-type",n.FunctionCall="function-call",n.FunctionDeclaration="function-declaration",n.ActionDescriptor="action-descriptor",n.ValueDescriptor="value-descriptor",n.ArgumentDeclaration="argument-declaration",n.InputMap="input-map",n.ReturnStatement="return-statement",n.BreakStatement="break-statement",n.ContinueStatement="continue-statement",n.ReturnDeclaration="return-declaration",n.OutputMap="output-map",n.PrimitiveEntity="primitive-entity",n.PrimitiveValue="primitive-value",n.Property="property",n.Operation="operation",n.Condition="condition",n.VariableDeclaration="variable-declaration",n.VariableInstance="variable-instance",n.Search="search",n.Loop="loop",n.InternalCall="internal-call",n.GenericReference="generic-reference",n))(r||{}),w=(n=>(n.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",n.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",n.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",n.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",n.EXECUTION="BUILT_IN_EXECUTION_ENTITY",n.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",n))(w||{}),xe=(n=>(n.CurrentDateAndTime="current-date-and-time",n.Unique="unique",n.Random="random",n))(xe||{}),vt=(n=>(n.DeletePersistedEntity="base-delete-persisted-entity",n.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",n.AbortExecution="base-abort-execution",n))(vt||{}),L=(n=>(n.Fixed="fixed",n.None="none",n.Dynamic="dynamic",n))(L||{}),O=(n=>(n.FixedArguments="fixed-arguments",n.FixedReturns="fixed-returns",n.ReturnedError="returned-error",n.OngoingProcessExecution="ongoing-process-execution",n))(O||{}),g=(n=>(n.EntityTemplate="entity-template",n.ActionDescriptor="action-descriptor",n.String="string",n.Number="number",n.Boolean="boolean",n.Null="null",n.Enum="enum",n.JSON="json",n.Date="date",n.UUID="uuid",n.File="file",n))(g||{}),at=(n=>(n.Addition="addition",n.Substraction="substraction",n.Multiplication="multiplication",n.Division="division",n.Remainder="remainder",n.Exponentiation="exponentiation",n))(at||{}),ve=(n=>(n.Join="string-join",n.Split="stringSsplit",n.DeleteLast="string-delete-last",n.DeleteFirst="string-delete-first",n.DeleteIndex="string-delete-index",n.AddIndex="string-add-index",n.ReplaceFirst="string-replace-first",n.ReplaceLast="string-replace-last",n.ReplaceIndex="string-replace-index",n.ReplaceSingleMatch="string-replace-single-match",n.ReplaceAllMatches="string-replace-all-matches",n.GetIndex="string-get-index",n.GetFirst="string-get-first",n.GetLast="string-get-last",n.Append="string-append",n.Prepend="string-prepend",n))(ve||{}),j=(n=>(n.Join="list-join",n.Split="list-split",n.DeleteLast="list-delete-last",n.DeleteFirst="list-delete-first",n.DeleteIndex="list-delete-index",n.AddIndex="list-add-index",n.ReplaceFirst="list-replace-first",n.ReplaceLast="list-replace-last",n.ReplaceIndex="list-replace-index",n.ReplaceSingleMatch="list-replace-single-match",n.ReplaceAllMatches="list-replace-all-matches",n.GetIndex="list-get-index",n.GetFirst="list-get-first",n.GetLast="list-get-last",n.Append="list-append",n.Prepend="list-prepend",n))(j||{}),Ie=(n=>(n.Parallel="parallel",n.Sequential="sequential",n.Wait="wait",n))(Ie||{}),Ze=(n=>(n.CreateNewInstance="create-new-instance",n.Validate="validate",n))(Ze||{}),Ye=(n=>(n.HttpRequest="base-http-request",n))(Ye||{}),Ae=(n=>(n.Equal="equal",n.NotEqual="not-equal",n.And="and",n.Or="or",n.LessThan="less-than",n.MoreThan="more-than",n.LessThanOrEqual="less-than-or-equal",n.MoreThanOrEqual="more-than-or-equal",n))(Ae||{}),Ct=(n=>(n.Empty="empty",n.NotEmpty="not-empty",n))(Ct||{}),je=(n=>(n.ManualFlow="manual-flow-loop",n.Counted="counted-loop",n.List="list-loop",n.ObjectKeys="object-keys-loop",n.ObjectValues="object-values-loop",n.String="string-loop",n))(je||{}),qe=(n=>(n.OrDataTypeGroup="or-data-type-group",n.AndDataTypeGroup="and-data-type-group",n.DynamicArgumentTypes="dynamic-argument-types",n.DynamicReturnTypes="dynamic-return-types",n))(qe||{}),Kt=(n=>(n.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",n))(Kt||{}),Od=(n=>(n.Error="error",n.Task="task",n))(Od||{});const Gn=[r.VariableDeclaration,r.VariableInstance,r.InputMap,r.ReturnDeclaration],Se=[r.VariableDeclaration,r.VariableInstance,r.ArgumentDeclaration,r.OutputMap],Cd=[...Gn,...Se],Fe=[r.VariableDeclaration,r.VariableInstance],Pr=[r.GlobalEvent],Ne=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.InternalCall,r.Loop],fo=[r.Operation,r.FunctionCall,r.Condition,r.Search,r.VariableDeclaration,r.VariableInstance,r.Loop],$e=[r.FunctionDeclaration,...Pr],Tn=[...Ne,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],mo=[...fo,r.ReturnStatement,r.BreakStatement,r.ContinueStatement],en=[...Ne,...$e],Bd=[...fo,...$e],Wv=[...Tn,...$e],Hv=[...mo,...$e],st=[...$e,r.Loop],Oe=[r.ReturnStatement,r.BreakStatement,r.ContinueStatement],Yv=[r.CustomEntity,r.BuiltInBaseEntity,r.Project,r.InstalledProject,r.GlobalEvent,r.DataType,r.FunctionCall,r.FunctionDeclaration,r.ActionDescriptor,r.ValueDescriptor,r.ArgumentDeclaration,r.InputMap,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.ReturnDeclaration,r.OutputMap,r.PrimitiveEntity,r.PrimitiveValue,r.Property,r.Operation,r.Condition,r.VariableDeclaration,r.VariableInstance,r.Search,r.Loop,r.InternalCall],To=[r.CustomEntity,r.GlobalEvent,r.FunctionDeclaration,r.FunctionCall,r.VariableDeclaration,r.VariableInstance,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.InstalledProject,r.Loop,r.Search],wd=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor],Dr=[r.BuiltInBaseEntity,r.PrimitiveEntity],zv=[r.CustomEntity,r.FunctionDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.Property,r.VariableDeclaration,r.GlobalEvent,r.Search,r.Project,r.InstalledProject,r.ActionDescriptor,r.ValueDescriptor,r.InputMap,r.OutputMap,r.FunctionCall,r.Operation,r.Condition,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.VariableInstance,r.PrimitiveValue,r.InternalCall],F={type:r.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:g.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Fn={type:r.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:g.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ce={type:r.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:g.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Xe={type:r.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},_d={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:r.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:r.DataType},Md={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:r.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:r.Property},Nd={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.JSON,autogeneration:null,value:[],valueAsType:null,parent:_d},parent:Md},$d={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:r.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:r.PrimitiveEntity},Vd={required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Nd,description:"Options for the enum. Each option is a text value.",parent:$d},En={type:r.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:g.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Vd],methods:[]},Ar={type:r.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:g.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},fa={type:r.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:g.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[F],properties:[],methods:[]},Eo={type:r.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:g.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Ld=(n=>(n.FirstInputNumber="number-addition-first-number-argument-declaration",n.SecondInputNumber="number-addition-second-number-argument-declaration",n))(Ld||{}),Gd=(n=>(n.ResultNumber="number-addition-result-number-return-delaration",n.Error="number-addition-error-return-delaration",n))(Gd||{});const Fd={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:r.ValueDescriptor},Ud={id:"number-addition-first-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Fd},xd={type:r.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:r.ValueDescriptor},jd={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xd},kd={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:r.ValueDescriptor},qd={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kd},Jd={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:at.Addition,entityType:r.ActionDescriptor},Ro={id:"number-addition-first-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:Ud,required:!0,parentRelationType:O.FixedArguments,index:0,parent:Jd},Wd={type:r.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:at.Addition,entityType:r.ActionDescriptor},bo={id:"number-addition-second-number-argument-declaration",type:r.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:jd,required:!0,parentRelationType:O.FixedArguments,index:1,parent:Wd},Hd={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:at.Addition,entityType:r.ActionDescriptor},go={parentRelationType:O.FixedReturns,id:"number-addition-result-number-return-delaration",type:r.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:qd,required:!0,index:0,parent:Hd},Yd={type:r.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:at.Addition,entityType:r.ActionDescriptor},zd={parentRelationType:O.FixedReturns,id:"number-addition-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Yd},ma={id:at.Addition,type:r.ActionDescriptor,description:"Add two numbers together",version:1,name:at.Addition,fixedArguments:[Ro,bo],error:zd,fixedReturns:[go],argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Zd={[at.Addition]:ma};var Xd=(n=>(n.FirstInputString="join-string-first-string-argument-declaration",n.SecondInputString="join-string-second-string-argument-declaration",n))(Xd||{}),Qd=(n=>(n.ResultString="join-string-result-string-return-delaration",n.Error="join-string-error-return-delaration",n))(Qd||{});const Kd={type:r.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:r.ValueDescriptor},eu={id:"join-string-first-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Kd},tu={type:r.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:r.ValueDescriptor},nu={id:"join-string-second-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tu},ru={type:r.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:r.ValueDescriptor},iu={id:"join-string-result-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ru},au={type:r.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},Ta={id:"join-string-first-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:eu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:au},su={type:r.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},Ea={id:"join-string-second-string-argument-declaration",type:r.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:nu,parentRelationType:O.FixedArguments,required:!0,index:1,parent:su},ou={type:r.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},ui={parentRelationType:O.FixedReturns,id:"join-string-result-string-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:iu,required:!0,index:0,parent:ou},lu={type:r.GenericReference,id:"join-string-operation-error-parent-ref",entityId:ve.Join,entityType:r.ActionDescriptor},cu={parentRelationType:O.FixedReturns,id:"join-string-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:lu},pi={id:ve.Join,type:r.ActionDescriptor,version:1,name:ve.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Ta,Ea],fixedReturns:[ui],error:cu,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},du={[ve.Join]:pi};var uu=(n=>(n.FirstInputList="join-list-first-list-argument-declaration",n.SecondInputList="join-list-second-list-argument-declaration",n))(uu||{}),pu=(n=>(n.ResultList="join-list-result-list-return-delaration",n.Error="join-list-error-return-delaration",n))(pu||{});const yu={type:r.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:r.ValueDescriptor},hu={id:"join-list-first-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:yu},fu={type:r.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:r.ValueDescriptor},mu={id:"join-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fu},Tu={type:r.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:r.ValueDescriptor},Eu={id:"join-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Tu},Ru={type:r.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},bu={id:"join-list-first-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",dataType:hu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Ru},gu={type:r.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},vu={id:"join-list-second-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",dataType:mu,parentRelationType:O.FixedArguments,required:!0,index:1,parent:gu},Iu={type:r.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Pu={parentRelationType:O.FixedReturns,id:"join-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Eu,required:!0,index:0,parent:Iu},Du={type:r.GenericReference,id:"join-list-operation-error-parent-ref",entityId:j.Join,entityType:r.ActionDescriptor},Au={parentRelationType:O.FixedReturns,id:"join-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Du},vo={id:j.Join,type:r.ActionDescriptor,version:1,name:j.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[bu,vu],error:Au,fixedReturns:[Pu],argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Su=(n=>(n.InputList="list-to-split-argument-declaration",n.SplitIndex="split-list-index-argument-declaration",n))(Su||{}),Ou=(n=>(n.FirstOutputList="split-list-first-output-list-return-delaration",n.SecondOutputList="split-list-second-output-list-return-delaration",n.Error="split-list-error-return-delaration",n))(Ou||{});const Cu={type:r.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:r.ValueDescriptor},Bu={id:"split-list-operation-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Cu},wu={type:r.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:r.ValueDescriptor},_u={id:"split-list-operation-split-index-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:wu},Io={type:r.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:r.ValueDescriptor},Mu={id:"split-list-operation-first-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Io},Nu={type:r.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},$u={id:"list-to-split-argument-declaration",type:r.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:Bu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Nu},Vu={type:r.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Lu={id:"split-list-index-argument-declaration",type:r.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",dataType:_u,parentRelationType:O.FixedArguments,required:!0,index:1,parent:Vu},Gu={type:r.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},Fu={parentRelationType:O.FixedReturns,id:"split-list-first-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:Mu,required:!0,index:0,parent:Gu},Uu={id:"split-list-operation-second-output-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Io},xu={type:r.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},ju={parentRelationType:O.FixedReturns,id:"split-list-second-output-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:Uu,required:!0,index:0,parent:xu},ku={type:r.GenericReference,id:"split-list-operation-error-parent-ref",entityId:j.Split,entityType:r.ActionDescriptor},qu={parentRelationType:O.FixedReturns,id:"split-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ku},Po={id:j.Split,type:r.ActionDescriptor,version:1,name:j.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",fixedArguments:[$u,Lu],fixedReturns:[Fu,ju],error:qu,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Ju=(n=>(n.InputList="get-last-in-list-input-list-argument-declaration",n))(Ju||{}),Wu=(n=>(n.OutputElement="get-last-in-list-output-element-return-delaration",n.Error="get-last-in-list-error-return-delaration",n))(Wu||{});const Hu={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:r.ValueDescriptor},Yu={id:"get-last-in-list-input-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Hu},zu={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:r.ValueDescriptor},Zu={id:"get-last-in-list-output-element-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:zu},Xu={type:r.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},Qu={id:"get-last-in-list-input-list-argument-declaration",type:r.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:Yu,parentRelationType:O.FixedArguments,required:!0,index:0,parent:Xu},Ku={type:r.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},ep={parentRelationType:O.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:r.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:Zu,required:!0,index:0,parent:Ku},tp={type:r.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:j.GetLast,entityType:r.ActionDescriptor},np={parentRelationType:O.FixedReturns,id:"get-last-in-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:tp},Do={id:j.GetLast,type:r.ActionDescriptor,version:1,name:j.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[Qu],fixedReturns:[ep],error:np,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var rp=(n=>(n.List="append-to-list-lsit-argument-declaration",n.ElementToAppend="append-to-list-element-to-append-argument-declaration",n))(rp||{}),ip=(n=>(n.ResultList="append-to-list-result-list-return-delaration",n.Error="append-to-list-error-return-delaration",n))(ip||{});const ap={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:r.ValueDescriptor},sp={id:"append-to-list-lsit-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ap},op={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:r.ValueDescriptor},lp={id:"append-to-list-second-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:op},cp={type:r.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:r.ValueDescriptor},dp={id:"append-to-list-result-list-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:cp},up={type:r.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},Ao={id:"append-to-list-lsit-argument-declaration",type:r.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:sp,parentRelationType:O.FixedArguments,required:!0,index:0,parent:up},pp={type:r.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},So={id:"append-to-list-element-to-append-argument-declaration",type:r.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:lp,parentRelationType:O.FixedArguments,required:!0,index:1,parent:pp},yp={type:r.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},hp={parentRelationType:O.FixedReturns,id:"append-to-list-result-list-return-delaration",type:r.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:dp,required:!0,index:0,parent:yp},fp={type:r.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:j.Append,entityType:r.ActionDescriptor},mp={parentRelationType:O.FixedReturns,id:"append-to-list-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:fp},Ra={id:j.Append,type:r.ActionDescriptor,version:1,name:j.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[Ao,So],error:mp,fixedReturns:[hp],argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Tp={[j.Join]:vo,[j.Split]:Po,[j.GetLast]:Do,[j.Append]:Ra};var Ep=(n=>(n.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",n))(Ep||{}),Rp=(n=>(n.ListOfExecutionResults="parallel-execution-result-return-delaration",n.Error="parallel-execution-error-return-delaration",n))(Rp||{});const bp={id:"parallel-execution-list-of-functions-blueprint-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:L.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:L.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},gp={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},vp={id:"parallel-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:gp},Ip={type:r.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:r.ValueDescriptor},Pp={id:"b761acec-0755-4582-a68b-76267038bbe1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ip},Dp={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ie.Parallel,entityType:r.ActionDescriptor},Oo={id:"parallel-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:vp,required:!0,index:0,parent:Dp,parentRelationType:O.FixedArguments},Ap={type:r.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ie.Parallel,entityType:r.ActionDescriptor},Co={id:"parallel-execution-result-return-delaration",type:r.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Pp,required:!0,index:0,parent:Ap,parentRelationType:O.FixedReturns},Sp={type:r.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ie.Parallel,entityType:r.ActionDescriptor},Op={id:"parallel-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Sp,parentRelationType:O.ReturnedError},$t={id:Ie.Parallel,type:r.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ie.Parallel,fixedArguments:[Oo],fixedReturns:[Co],argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Op,parent:null};var Cp=(n=>(n.MillisecondsNumber="wait-milliseconds-number-argument-declaration",n))(Cp||{}),Bp=(n=>(n.Error="wait-operation-error-return-delaration",n))(Bp||{});const wp={type:r.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:r.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},_p={id:"wait-milliseconds-number-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:wp},Mp={type:r.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:r.ActionDescriptor,entityId:Ie.Wait},Un={id:"wait-milliseconds-number-argument-declaration",type:r.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:_p,required:!0,index:0,parent:Mp,parentRelationType:O.FixedArguments},Np={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ie.Wait,entityType:r.ActionDescriptor},$p={id:"wait-operation-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Np,parentRelationType:O.ReturnedError},ot={id:Ie.Wait,type:r.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ie.Wait,fixedArguments:[Un],fixedReturns:[],error:$p,argumentsType:L.Fixed,returnsType:L.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Vp=(n=>(n.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",n))(Vp||{}),Lp=(n=>(n.ListOfExecutionResults="sequential-execution-result-return-delaration",n.Error="sequential-execution-error-return-delaration",n))(Lp||{});const Gp={id:"sequential-execution-list-of-functions-blueprint-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:L.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:L.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Fp={type:r.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:r.ValueDescriptor},Up={id:"sequential-execution-list-of-functions-argument-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Gp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Fp},xp={type:r.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:r.ValueDescriptor},jp={id:"sequential-execution-list-of-execution-results-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:xp},kp={type:r.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},Bo={id:"sequential-execution-list-of-functions-argument-declaration",type:r.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Up,required:!0,index:0,parent:kp,parentRelationType:O.FixedArguments},qp={type:r.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},wo={id:"sequential-execution-result-return-delaration",type:r.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:jp,required:!0,index:0,parent:qp,parentRelationType:O.FixedReturns},Jp={type:r.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ie.Sequential,entityType:r.ActionDescriptor},Wp={id:"sequential-execution-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Jp,parentRelationType:O.ReturnedError},tn={id:Ie.Sequential,type:r.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ie.Sequential,fixedArguments:[Bo],fixedReturns:[wo],error:Wp,returnsType:L.Fixed,argumentsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Hp={[Ie.Parallel]:$t,[Ie.Wait]:ot,[Ie.Sequential]:tn};var Yp=(n=>(n.EntityToInstanciate="entity-to-instanciate-argument-declaration",n))(Yp||{}),zp=(n=>(n.Error="create-new-instance-error-return-delaration",n))(zp||{});const Zp={type:r.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},Xp={id:"entity-to-instanciate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zp},Qp={type:r.GenericReference,id:"create-new-instance-operation-ref",entityType:r.ActionDescriptor,entityId:Ze.CreateNewInstance},Kp={id:"entity-to-instanciate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:Xp,required:!0,parentRelationType:O.FixedArguments,index:0,parent:Qp},ey={type:r.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Ze.CreateNewInstance,entityType:r.ActionDescriptor},ty={parentRelationType:O.FixedReturns,id:"create-new-instance-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:ey,required:!0,index:0},ny={type:r.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Ze.CreateNewInstance,entityType:r.ActionDescriptor},ry={parentRelationType:O.FixedReturns,id:"create-new-instance-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ny},Sr={id:Ze.CreateNewInstance,type:r.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Ze.CreateNewInstance,fixedArguments:[Kp],fixedReturns:[ty],error:ry,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var iy=(n=>(n.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",n.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",n))(iy||{}),ay=(n=>(n.Error="validate-data-error-return-delaration",n.OutputEntity="validate-data-output-entity-declaration",n))(ay||{});const sy={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},oy={id:"validate-data-operation-data-to-validate-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sy},ly={type:r.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ze.Validate},cy={id:"validate-data-operation-data-to-validate-argument-declaration",type:r.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:oy,required:!0,parentRelationType:O.FixedArguments,index:0,parent:ly},dy={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:r.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},uy={id:"validate-data-operation-entity-to-match-type-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:dy},py={type:r.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ze.Validate},yy={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:r.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:uy,required:!0,index:0,parentRelationType:O.FixedArguments,parent:py},hy={type:r.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Ze.Validate,entityType:r.ActionDescriptor},fy={id:"validate-data-output-entity-declaration",type:r.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:hy,required:!0,index:0,parentRelationType:O.FixedReturns},my={type:r.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ze.Validate,entityType:r.ActionDescriptor},Ty={id:"validate-data-error-return-delaration",type:r.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:my,parentRelationType:O.ReturnedError},xn={id:Ze.Validate,type:r.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Ze.Validate,fixedArguments:[yy,cy],fixedReturns:[fy],error:Ty,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ey={[Ze.CreateNewInstance]:Sr,[Ze.Validate]:xn};var _o=(n=>(n.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",n))(_o||{});const Ve={[r.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[r.BuiltInBaseEntity]:{[w.KEY_VALUE_PARAM]:{id:w.KEY_VALUE_PARAM},[w.HTTP_ENDPOINT]:{id:w.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[w.PERSISTED_ENTITY]:{id:w.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[w.RELATIONAL_DATABASE]:{id:w.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id"}},[w.CRON_JOB]:{id:w.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[r.Operation]:{[ve.Join]:{id:ve.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[Ye.HttpRequest]:{id:Ye.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[r.Loop]:{[je.List]:{id:je.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[je.ManualFlow]:{id:je.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}}},[r.Condition]:{[Ae.MoreThanOrEqual]:{id:Ae.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[Ct.NotEmpty]:{id:Ct.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[r.GlobalEvent]:{[Kt.PROJECT_PUBLICATION_COMPLETED]:{id:Kt.PROJECT_PUBLICATION_COMPLETED}}},Je=Ve[r.Operation]["base-http-request"],Ry={type:r.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:r.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},by={id:"http-request-url-default-value-id",type:r.PrimitiveValue,version:1,value:"https://some-url.com",name:g.String,valueAsType:null,parent:Ry,autogeneration:null},gy={type:r.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Je.inputs.url,entityType:r.ValueDescriptor},vy={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:by,constant:!1,parent:gy},Iy={type:r.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Je.inputs.query,entityType:r.ValueDescriptor},Py={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Iy},Dy={type:r.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:r.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},Ay={id:"http-request-method-default-value-id",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,valueAsType:null,parent:Dy,autogeneration:null},Sy={type:r.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Je.inputs.method,entityType:r.ValueDescriptor},Oy={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:En,isList:!1,asType:!1,isNullable:!1,defaultValue:Ay,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:Sy},Cy={type:r.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Je.inputs.headers,entityType:r.ValueDescriptor},By={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Cy},wy={type:r.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Je.inputs.body,entityType:r.ValueDescriptor},_y={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:wy},My={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Je.outputs.code},Ny={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:My},$y={type:r.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:r.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},Vy={type:r.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:r.ValueDescriptor,entityId:Je.outputs.headers},Ly={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:g.JSON,parent:$y,valueAsType:null,autogeneration:null},constant:!1,parent:Vy},Gy={type:r.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:r.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},Fy={type:r.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:r.ValueDescriptor,entityId:Je.outputs.body},Uy={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:r.PrimitiveValue,version:1,value:{},name:g.JSON,parent:Gy,valueAsType:null,autogeneration:null},constant:!1,parent:Fy},xy={type:r.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},ba={id:Je.inputs.method,type:r.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",dataType:Oy,required:!1,index:0,parentRelationType:O.FixedArguments,parent:xy},jy={type:r.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},ga={id:Je.inputs.url,type:r.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:vy,required:!1,index:1,parentRelationType:O.FixedArguments,parent:jy},ky={type:r.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Mo={id:Je.inputs.query,type:r.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",dataType:Py,required:!1,index:2,parentRelationType:O.FixedArguments,parent:ky},qy={type:r.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},va={id:Je.inputs.headers,type:r.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",dataType:By,required:!1,index:3,parent:qy,parentRelationType:O.FixedArguments},Jy={type:r.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Ia={id:Je.inputs.body,type:r.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:_y,required:!1,index:4,parentRelationType:O.FixedArguments,parent:Jy},Wy={type:r.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},No={id:Je.outputs.code,type:r.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",dataType:Ny,required:!0,index:0,parentRelationType:O.FixedReturns,parent:Wy},Hy={type:r.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Pa={parentRelationType:O.FixedReturns,id:Je.outputs.headers,type:r.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",dataType:Ly,required:!0,index:1,parent:Hy},Yy={type:r.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},yi={parentRelationType:O.FixedReturns,id:Je.outputs.body,type:r.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:Uy,required:!0,index:2,parent:Yy},zy={type:r.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:r.ActionDescriptor,entityId:Ye.HttpRequest},Zy={type:r.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:r.ValueDescriptor,entityId:Je.outputs.error},Xy={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:Zy},$o={parentRelationType:O.ReturnedError,id:Je.outputs.error,type:r.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:Xy,required:!0,index:0,parent:zy},hi={type:r.ActionDescriptor,id:Ye.HttpRequest,name:Ye.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,fixedArguments:[ba,ga,Mo,va,Ia],fixedReturns:[No,Pa,yi],argumentsType:L.Fixed,returnsType:L.Fixed,error:$o,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Qy={[Ye.HttpRequest]:hi},Zv={...du,...Zd,...Tp,...Hp,...Ey,...Qy},Ky=Ve[r.Loop]["list-loop"],eh={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:r.GenericReference,entityId:je.List,entityType:r.ActionDescriptor},th={id:Ky.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:eh,parentRelationType:O.FixedReturns},nh={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:r.ArgumentDeclaration},rh={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:nh},ih={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:je.List,entityType:r.ActionDescriptor},ah={id:Ky.inputs.list,type:r.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:rh,index:0,parent:ih,parentRelationType:O.FixedArguments},jn={id:je.List,type:r.ActionDescriptor,version:1,name:je.List,description:"Iterates over a list of entities",fixedArguments:[ah],fixedReturns:[th],error:null,argumentsType:L.Fixed,returnsType:L.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Xv=Ve[r.Loop]["list-loop"],sh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:r.ReturnDeclaration},oh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:sh},lh={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:r.GenericReference,entityId:je.ManualFlow,entityType:r.ActionDescriptor},ch={id:Xv.outputs.results,type:r.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:oh,required:!0,index:1,parentRelationType:O.FixedReturns,parent:lh},Vo={id:je.ManualFlow,type:r.ActionDescriptor,version:1,name:je.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[ch],argumentsType:L.None,returnsType:L.Fixed,error:null,parent:null},Da=Ve[r.BuiltInBaseEntity][w.KEY_VALUE_PARAM],Qv={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:r.DataType},dh={id:"key-value-param-built-in-base-entity-name-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:r.Property},Kv={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:null,parent:dh},uh={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:r.GenericReference,entityId:Da.id,entityType:r.BuiltInBaseEntity},ph={required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Kv,description:"The name of the path parameter",parent:uh},eI={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:r.DataType},yh={id:"key-value-param-built-in-base-entity-value-property-ref",type:r.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:r.Property},tI={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:null,parent:yh},hh={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:r.GenericReference,entityId:Da.id,entityType:r.BuiltInBaseEntity},fh={required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:tI,description:"The value of the path parameter",parent:hh},Aa={id:Da.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Da.id,type:r.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[ph,fh],abstractMethods:[],methods:[],extends:[]},fi=Ve[r.BuiltInBaseEntity][w.HTTP_ENDPOINT].properties,mh={id:"endpointBuiltInCorsPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},Th={id:"endpointBuiltInCorsPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:fi.cors},Eh={id:"endpointBuiltInCorsPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:["*"],parent:mh,autogeneration:null,valueAsType:null},parent:Th},Rh={id:"endpointBuiltInBaseEntityRef",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},bh={required:!0,id:fi.cors,name:"Allowed origins",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Eh,description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:Rh},gh={id:"endpointBuiltInPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInPathPropertyDataType"},vh={id:"endpointBuiltInPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:fi.path},Ih={id:"endpointBuiltInPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.String,value:"/",parent:gh,autogeneration:null,valueAsType:null},parent:vh},Ph={id:"endpointBuiltInBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Lo={required:!0,id:fi.path,name:"Path",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:Ih,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Ph},Dh={id:"endpointBuiltInMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Ah={id:"endpointBuiltInMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"endpointBuiltInMethodProperty"},Sh={id:"endpointBuiltInMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:En,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:Dh,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Ah},Oh={id:"endpointBuiltInBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Go={required:!0,id:fi.method,name:"Method",version:1,type:r.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Sh,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Oh},Ch={id:"endpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestHeadersVariableDataType"},Bh={id:"endpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},wh={id:"endpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:Ch,autogeneration:null,valueAsType:null},parent:Bh},_h={id:"endpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},Mh={id:"endpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:_h},Nh={id:"endpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},$h={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Vh={id:"endpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:Aa,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:[],parent:Nh,autogeneration:null,valueAsType:null},parent:$h},Lh={id:"endpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointPathParamsVariableDataType"},Gh={id:"endpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},Fh={id:"endpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Aa,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:[],parent:Lh,autogeneration:null,valueAsType:null},parent:Gh},Uh={id:"endpointReachedTriggerActionDescriptorRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},xh={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ValueDescriptor,name:"Request headers",dataType:wh,required:!0,index:0,parentRelationType:O.FixedArguments,parent:Uh},jh={id:"endpointReachedTriggerActionDescriptorRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},kh={id:"endpointPathParamsArgumentDeclaration",type:r.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:Fh,required:!0,index:1,parentRelationType:O.FixedArguments,parent:jh},qh={id:"endpointReachedTriggerActionDescriptorRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Jh={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:r.ValueDescriptor,name:"Request query params",dataType:Vh,required:!0,index:2,parentRelationType:O.FixedArguments,parent:qh},Wh={id:"endpointReachedTriggerActionDescriptorRefFour",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Hh={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ValueDescriptor,name:"Request body",dataType:Mh,index:3,required:!0,parentRelationType:O.FixedArguments,parent:Wh},Yh={id:"endpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},zh={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Yh},Zh={id:"endpointReturnStatementRef",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},Xh={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:r.ValueDescriptor,name:"Response code",dataType:zh,required:!0,index:0,parentRelationType:O.FixedReturns,parent:Zh},Qh={id:"endpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"endpointResponseHeadersDataType"},Kh={id:"endpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},ef={id:"endpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:Qh,autogeneration:null,valueAsType:null},parent:Kh},tf={id:"endpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},nf={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ValueDescriptor,name:"Response headers",dataType:ef,required:!1,index:1,parentRelationType:O.FixedReturns,parent:tf},rf={id:"endpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},af={id:"endpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:rf},sf={id:"endpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ActionDescriptor,entityId:"endpointReturnStatement"},of={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ValueDescriptor,name:"Response body",dataType:af,required:!1,index:2,parentRelationType:O.FixedReturns,parent:sf},lf={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Fo={id:"endpointReachedTriggerActionDescriptor",type:r.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:L.Fixed,dynamicArgumentTypes:null,fixedArguments:[xh,kh,Jh,Hh],returnsType:L.Fixed,fixedReturns:[Xh,nf,of],error:null,dynamicReturnTypes:null,parent:lf},Sa={id:w.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:w.HTTP_ENDPOINT,type:r.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[bh,Lo,Go],abstractMethods:[Fo],extends:[],methods:[]},jt=Ve[r.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,cf={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},df={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:jt.properties.identifier,entityType:r.Property},nI={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:cf,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:df},Or={id:"relational-database-built-in-base-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Oa={required:!0,id:jt.properties.identifier,name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:nI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Or},rI={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:r.DataType},uf={id:"relational-database-built-in-base-entity-username-property-ref-id",type:r.GenericReference,entityId:jt.properties.username,entityType:r.Property},iI={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:r.DataType},autogeneration:null,valueAsType:null},parent:uf},Ca={required:!0,id:jt.properties.username,name:"Username",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:iI,description:"The username that will be used to connect to the database.",parent:Or},aI={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:r.DataType},pf={id:"relational-database-built-in-base-entity-password-property-ref-id",type:r.GenericReference,entityId:jt.properties.password,entityType:r.Property},sI={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:pf},Ba={required:!0,id:jt.properties.password,name:"Password",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:sI,description:"The password that will be used to connect to the database.",parent:Or},yf={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:r.DataType},hf={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:r.GenericReference,entityId:jt.properties.minSize,entityType:r.Property},oI={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:yf,autogeneration:null,valueAsType:null},parent:hf},wa={required:!0,id:jt.properties.minSize,name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:oI,description:"The minimum size of the database in GB.",parent:Or},ff={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:r.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:r.DataType},mf={id:"relational-database-built-in-base-entity-default-property-ref-id",type:r.GenericReference,entityId:jt.properties.default,entityType:r.Property},lI={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Fn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:r.PrimitiveValue,version:1,name:g.Boolean,value:!1,parent:ff,autogeneration:null,valueAsType:null},parent:mf},Tf={required:!0,id:jt.properties.default,name:"Default",version:1,type:r.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:lI,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Or},Rn={id:w.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:w.RELATIONAL_DATABASE,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Oa,Ca,Ba,wa,Tf],abstractMethods:[],methods:[],extends:[]},Ef={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:vt.DeletePersistedEntity},Uo={type:r.FunctionDeclaration,id:vt.DeletePersistedEntity,name:vt.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:Ef,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},Rf={type:r.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:r.BuiltInBaseEntity,id:vt.SoftDeletePersistedEntity},bf={type:r.FunctionDeclaration,id:vt.SoftDeletePersistedEntity,name:vt.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:Rf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},gf=Ve[r.BuiltInBaseEntity][w.PERSISTED_ENTITY].properties,cI={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:r.DataType},vf={id:"persisted-built-in-base-entity-database-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:r.Property},dI={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Rn,asType:!1,defaultValue:null,parent:vf},If={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},mi={required:!0,id:gf.database,name:"Database",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:dI,description:"The database that the entity belongs to.",parent:If},Pf={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:r.DataType},Df={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:r.Property},uI={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:fa,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.UUID,value:null,parent:Pf,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Df},Af={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Sf={required:!0,id:gf.identifier,name:"Identifier",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:uI,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:Af},pI={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:r.DataType},Of={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:r.Property},Cf={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Of},Bf={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},wf={required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Cf,description:"The date and time when the entity was deleted.",parent:Bf},yI={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:r.DataType},_f={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:r.Property},Mf={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:_f},Nf={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},$f={required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:r.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Mf,description:"The date and time when the entity was created.",parent:Nf},hI={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:r.DataType},Vf={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:r.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:r.Property},Lf={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:Vf},Gf={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},Ff={required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:r.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:Lf,description:"The date and time when the entity was last updated.",parent:Gf},Be={id:w.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:w.PERSISTED_ENTITY,type:r.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[mi,Sf,wf,$f,Ff],methods:[Uo,bf],extends:[]},Uf={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},xo={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:r.ActionDescriptor,argumentsType:L.None,returnsType:L.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:Uf},xf=Ve[r.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,fI={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:r.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:r.DataType},jf={id:"cron-job-built-in-base-entity-expression-property-ref",type:r.GenericReference,entityId:xf.properties.expression,entityType:r.Property},mI={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:jf},kf={id:"cron-job-built-in-base-entity-ref",type:r.GenericReference,entityId:w.CRON_JOB,entityType:r.BuiltInBaseEntity},qf={required:!0,id:xf.properties.expression,name:"Cron expression",version:1,type:r.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:mI,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:kf},jo={id:w.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:w.CRON_JOB,type:r.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[qf],methods:[],abstractMethods:[xo],extends:[]},Jf={type:r.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:r.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},ko={id:"execution-built-in-entity-abort-method-id",type:r.FunctionDeclaration,version:1,name:vt.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:Jf},qo={id:w.EXECUTION,type:r.BuiltInBaseEntity,version:1,name:w.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[ko],abstractMethods:[]},TI=Ve[r.Condition]["not-empty"],Wf={type:r.GenericReference,id:"not-empty-condition-ref",entityType:r.ActionDescriptor,entityId:Ct.NotEmpty},Hf={id:TI.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:Wf},kn={type:r.ActionDescriptor,id:Ct.NotEmpty,version:1,name:Ct.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[Hf],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:L.Fixed,returnsType:L.None,error:null},Yf={[Ct.NotEmpty]:kn},zf=Ve[r.Condition]["more-than-or-equal"],Zf={type:r.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ae.MoreThanOrEqual},Xf={id:zf.inputs.leftHand,type:r.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:0,parent:Zf},Qf={type:r.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:r.ActionDescriptor,entityId:Ae.MoreThanOrEqual},Kf={id:zf.inputs.rightHand,type:r.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:O.FixedArguments,index:1,parent:Qf},Cr={type:r.ActionDescriptor,id:Ae.MoreThanOrEqual,version:1,name:Ae.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[Xf,Kf],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:L.Fixed,returnsType:L.None,error:null},em={[Ae.MoreThanOrEqual]:Cr},EI={...Yf,...em},_a={type:r.ActionDescriptor,id:Kt.PROJECT_PUBLICATION_COMPLETED,version:1,name:Kt.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:L.None,returnsType:L.None,error:null},RI={[Kt.PROJECT_PUBLICATION_COMPLETED]:_a},Jo=Ve[r.ValueDescriptor][_o.ActionOngoingProcessOutputValue],tm={type:r.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:r.ValueDescriptor,entityId:Jo.id},nm={id:Jo.dataType.id,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:qo,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tm},Wo={id:Jo.id,type:r.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:nm,required:!0,index:0,parent:null,parentRelationType:O.OngoingProcessExecution};var Y;(function(n){n.assertEqual=a=>a;function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),o={};for(const u of s)o[u]=a[u];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},n.find=(a,s)=>{for(const o of a)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function i(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(Y||(Y={}));var Ho;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Ho||(Ho={}));const _=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bn=n=>{switch(typeof n){case"undefined":return _.undefined;case"string":return _.string;case"number":return isNaN(n)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(n)?_.array:n===null?_.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?_.promise:typeof Map<"u"&&n instanceof Map?_.map:typeof Set<"u"&&n instanceof Set?_.set:typeof Date<"u"&&n instanceof Date?_.date:_.object;default:return _.unknown}},P=Y.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),bI=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)i._errors.push(t(o));else{let u=i,p=0;for(;p<o.path.length;){const h=o.path[p];p===o.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(o))):u[h]=u[h]||{_errors:[]},u=u[h],p++}}};return a(this),i}static assert(e){if(!(e instanceof ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):i.push(e(a));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}ft.create=n=>new ft(n);const Br=(n,e)=>{let t;switch(n.code){case P.invalid_type:n.received===_.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case P.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,Y.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:t=`Unrecognized key(s) in object: ${Y.joinValues(n.keys,", ")}`;break;case P.invalid_union:t="Invalid input";break;case P.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Y.joinValues(n.options)}`;break;case P.invalid_enum_value:t=`Invalid enum value. Expected ${Y.joinValues(n.options)}, received '${n.received}'`;break;case P.invalid_arguments:t="Invalid function arguments";break;case P.invalid_return_type:t="Invalid function return type";break;case P.invalid_date:t="Invalid date";break;case P.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:Y.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case P.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case P.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case P.custom:t="Invalid input";break;case P.invalid_intersection_types:t="Intersection results could not be merged";break;case P.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case P.not_finite:t="Number must be finite";break;default:t=e.defaultError,Y.assertNever(n)}return{message:t}};let rm=Br;function gI(n){rm=n}function Ma(){return rm}const Na=n=>{const{data:e,path:t,errorMaps:i,issueData:a}=n,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let u="";const p=i.filter(h=>!!h).slice().reverse();for(const h of p)u=h(o,{data:e,defaultError:u}).message;return{...a,path:s,message:u}},vI=[];function B(n,e){const t=Ma(),i=Na({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Br?void 0:Br].filter(a=>!!a)});n.common.issues.push(i)}class Qe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const a of t){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),i.push(a.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const a of t){const s=await a.key,o=await a.value;i.push({key:s,value:o})}return Qe.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return x;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const x=Object.freeze({status:"aborted"}),wr=n=>({status:"dirty",value:n}),lt=n=>({status:"valid",value:n}),Yo=n=>n.status==="aborted",zo=n=>n.status==="dirty",Ti=n=>n.status==="valid",Ei=n=>typeof Promise<"u"&&n instanceof Promise;function $a(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function im(n,e,t,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(n,t):a?a.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var V;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(V||(V={}));var Ri,bi;class kt{constructor(e,t,i,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const am=(n,e)=>{if(Ti(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ft(n.common.issues);return this._error=t,this._error}}};function k(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:a}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,u)=>{var p,h;const{message:m}=n;return o.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:o.code!=="invalid_type"?{message:u.defaultError}:{message:(h=m??t)!==null&&h!==void 0?h:u.defaultError}},description:a}}class W{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return bn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qe,ctx:{common:e.parent.common,data:e.data,parsedType:bn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ei(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const a={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return am(a,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bn(e)},a=this._parse({data:e,path:i.path,parent:i}),s=await(Ei(a)?a:Promise.resolve(a));return am(i,s)}refine(e,t){const i=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),u=()=>s.addIssue({code:P.custom,...i(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(u(),!1)):o?!0:(u(),!1)})}refinement(e,t){return this._refinement((i,a)=>e(i)?!0:(a.addIssue(typeof t=="function"?t(i,a):t),!1))}_refinement(e){return new Gt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Jt.create(this,this._def)}nullable(){return Pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lt.create(this,this._def)}promise(){return $r.create(this,this._def)}or(e){return Pi.create([this,e],this._def)}and(e){return Di.create(this,e,this._def)}transform(e){return new Gt({...k(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Bi({...k(this._def),innerType:this,defaultValue:t,typeName:U.ZodDefault})}brand(){return new Qo({typeName:U.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new wi({...k(this._def),innerType:this,catchValue:t,typeName:U.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return _i.create(this,e)}readonly(){return Mi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const II=/^c[^\s-]{8,}$/i,PI=/^[0-9a-z]+$/,DI=/^[0-9A-HJKMNP-TV-Z]{26}$/,AI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,SI=/^[a-z0-9_-]{21}$/i,OI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,CI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zo;const wI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_I=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,MI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",NI=new RegExp(`^${sm}$`);function om(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function $I(n){return new RegExp(`^${om(n)}$`)}function lm(n){let e=`${sm}T${om(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function VI(n,e){return!!((e==="v4"||!e)&&wI.test(n)||(e==="v6"||!e)&&_I.test(n))}class Vt extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.string,received:s.parsedType}),x}const i=new Qe;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,u=e.data.length<s.value;(o||u)&&(a=this._getOrReturnCtx(e,a),o?B(a,{code:P.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&B(a,{code:P.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")CI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"email",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Zo||(Zo=new RegExp(BI,"u")),Zo.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"emoji",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")AI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"uuid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")SI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"nanoid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")II.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")PI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"cuid2",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")DI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ulid",code:P.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),B(a,{validation:"url",code:P.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"regex",code:P.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?lm(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?NI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?$I(s).test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{code:P.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?OI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"duration",code:P.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?VI(e.data,s.version)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"ip",code:P.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?MI.test(e.data)||(a=this._getOrReturnCtx(e,a),B(a,{validation:"base64",code:P.invalid_string,message:s.message}),i.dirty()):Y.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(a=>e.test(a),{validation:t,code:P.invalid_string,...V.errToObj(i)})}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...V.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...V.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...V.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Vt.create=n=>{var e;return new Vt({checks:[],typeName:U.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};function LI(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=t>i?t:i,s=parseInt(n.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class gn extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.number,received:s.parsedType}),x}let i;const a=new Qe;for(const s of this._def.checks)s.kind==="int"?Y.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:P.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?LI(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_finite,message:s.message}),a.dirty()):Y.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,i,a){return new gn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:V.toString(a)}]})}_addCheck(e){return new gn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Y.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}gn.create=n=>new gn({checks:[],typeName:U.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class vn extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==_.bigint){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.bigint,received:s.parsedType}),x}let i;const a=new Qe;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:P.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):Y.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,V.toString(t))}gt(e,t){return this.setLimit("min",e,!1,V.toString(t))}lte(e,t){return this.setLimit("max",e,!0,V.toString(t))}lt(e,t){return this.setLimit("max",e,!1,V.toString(t))}setLimit(e,t,i,a){return new vn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:V.toString(a)}]})}_addCheck(e){return new vn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}vn.create=n=>{var e;return new vn({checks:[],typeName:U.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...k(n)})};class gi extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.boolean,received:i.parsedType}),x}return lt(e.data)}}gi.create=n=>new gi({typeName:U.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...k(n)});class qn extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_type,expected:_.date,received:s.parsedType}),x}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return B(s,{code:P.invalid_date}),x}const i=new Qe;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),B(a,{code:P.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Y.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}qn.create=n=>new qn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:U.ZodDate,...k(n)});class Va extends W{_parse(e){if(this._getType(e)!==_.symbol){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.symbol,received:i.parsedType}),x}return lt(e.data)}}Va.create=n=>new Va({typeName:U.ZodSymbol,...k(n)});class vi extends W{_parse(e){if(this._getType(e)!==_.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.undefined,received:i.parsedType}),x}return lt(e.data)}}vi.create=n=>new vi({typeName:U.ZodUndefined,...k(n)});class Ii extends W{_parse(e){if(this._getType(e)!==_.null){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.null,received:i.parsedType}),x}return lt(e.data)}}Ii.create=n=>new Ii({typeName:U.ZodNull,...k(n)});class _r extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}}_r.create=n=>new _r({typeName:U.ZodAny,...k(n)});class Jn extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}}Jn.create=n=>new Jn({typeName:U.ZodUnknown,...k(n)});class nn extends W{_parse(e){const t=this._getOrReturnCtx(e);return B(t,{code:P.invalid_type,expected:_.never,received:t.parsedType}),x}}nn.create=n=>new nn({typeName:U.ZodNever,...k(n)});class La extends W{_parse(e){if(this._getType(e)!==_.undefined){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.void,received:i.parsedType}),x}return lt(e.data)}}La.create=n=>new La({typeName:U.ZodVoid,...k(n)});class Lt extends W{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==_.array)return B(t,{code:P.invalid_type,expected:_.array,received:t.parsedType}),x;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,u=t.data.length<a.exactLength.value;(o||u)&&(B(t,{code:o?P.too_big:P.too_small,minimum:u?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(B(t,{code:P.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(B(t,{code:P.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((o,u)=>a.type._parseAsync(new kt(t,o,t.path,u)))).then(o=>Qe.mergeArray(i,o));const s=[...t.data].map((o,u)=>a.type._parseSync(new kt(t,o,t.path,u)));return Qe.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new Lt({...this._def,minLength:{value:e,message:V.toString(t)}})}max(e,t){return new Lt({...this._def,maxLength:{value:e,message:V.toString(t)}})}length(e,t){return new Lt({...this._def,exactLength:{value:e,message:V.toString(t)}})}nonempty(e){return this.min(1,e)}}Lt.create=(n,e)=>new Lt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...k(e)});function Mr(n){if(n instanceof we){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Jt.create(Mr(i))}return new we({...n._def,shape:()=>e})}else return n instanceof Lt?new Lt({...n._def,type:Mr(n.element)}):n instanceof Jt?Jt.create(Mr(n.unwrap())):n instanceof Pn?Pn.create(Mr(n.unwrap())):n instanceof qt?qt.create(n.items.map(e=>Mr(e))):n}class we extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Y.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==_.object){const h=this._getOrReturnCtx(e);return B(h,{code:P.invalid_type,expected:_.object,received:h.parsedType}),x}const{status:i,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),u=[];if(!(this._def.catchall instanceof nn&&this._def.unknownKeys==="strip"))for(const h in a.data)o.includes(h)||u.push(h);const p=[];for(const h of o){const m=s[h],T=a.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new kt(a,T,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof nn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(h==="strict")u.length>0&&(B(a,{code:P.unrecognized_keys,keys:u}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of u){const T=a.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new kt(a,T,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const T=await m.key,b=await m.value;h.push({key:T,value:b,alwaysSet:m.alwaysSet})}return h}).then(h=>Qe.mergeObjectSync(i,h)):Qe.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new we({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var a,s,o,u;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,i).message)!==null&&o!==void 0?o:i.defaultError;return t.code==="unrecognized_keys"?{message:(u=V.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new we({...this._def,unknownKeys:"strip"})}passthrough(){return new we({...this._def,unknownKeys:"passthrough"})}extend(e){return new we({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new we({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:U.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new we({...this._def,catchall:e})}pick(e){const t={};return Y.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new we({...this._def,shape:()=>t})}omit(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new we({...this._def,shape:()=>t})}deepPartial(){return Mr(this)}partial(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];e&&!e[i]?t[i]=a:t[i]=a.optional()}),new we({...this._def,shape:()=>t})}required(e){const t={};return Y.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Jt;)s=s._def.innerType;t[i]=s}}),new we({...this._def,shape:()=>t})}keyof(){return cm(Y.objectKeys(this.shape))}}we.create=(n,e)=>new we({shape:()=>n,unknownKeys:"strip",catchall:nn.create(),typeName:U.ZodObject,...k(e)}),we.strictCreate=(n,e)=>new we({shape:()=>n,unknownKeys:"strict",catchall:nn.create(),typeName:U.ZodObject,...k(e)}),we.lazycreate=(n,e)=>new we({shape:n,unknownKeys:"strip",catchall:nn.create(),typeName:U.ZodObject,...k(e)});class Pi extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function a(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;const o=s.map(u=>new ft(u.ctx.common.issues));return B(t,{code:P.invalid_union,unionErrors:o}),x}if(t.common.async)return Promise.all(i.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of i){const h={...t,common:{...t.common,issues:[]},parent:null},m=p._parseSync({data:t.data,path:t.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const u=o.map(p=>new ft(p));return B(t,{code:P.invalid_union,unionErrors:u}),x}}get options(){return this._def.options}}Pi.create=(n,e)=>new Pi({options:n,typeName:U.ZodUnion,...k(e)});const rn=n=>n instanceof Si?rn(n.schema):n instanceof Gt?rn(n.innerType()):n instanceof Oi?[n.value]:n instanceof In?n.options:n instanceof Ci?Y.objectValues(n.enum):n instanceof Bi?rn(n._def.innerType):n instanceof vi?[void 0]:n instanceof Ii?[null]:n instanceof Jt?[void 0,...rn(n.unwrap())]:n instanceof Pn?[null,...rn(n.unwrap())]:n instanceof Qo||n instanceof Mi?rn(n.unwrap()):n instanceof wi?rn(n._def.innerType):[];class Ga extends W{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.object)return B(t,{code:P.invalid_type,expected:_.object,received:t.parsedType}),x;const i=this.discriminator,a=t.data[i],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(B(t,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const a=new Map;for(const s of t){const o=rn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of o){if(a.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);a.set(u,s)}}return new Ga({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...k(i)})}}function Xo(n,e){const t=bn(n),i=bn(e);if(n===e)return{valid:!0,data:n};if(t===_.object&&i===_.object){const a=Y.objectKeys(e),s=Y.objectKeys(n).filter(u=>a.indexOf(u)!==-1),o={...n,...e};for(const u of s){const p=Xo(n[u],e[u]);if(!p.valid)return{valid:!1};o[u]=p.data}return{valid:!0,data:o}}else if(t===_.array&&i===_.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<n.length;s++){const o=n[s],u=e[s],p=Xo(o,u);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===_.date&&i===_.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Di extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=(s,o)=>{if(Yo(s)||Yo(o))return x;const u=Xo(s.value,o.value);return u.valid?((zo(s)||zo(o))&&t.dirty(),{status:t.value,value:u.data}):(B(i,{code:P.invalid_intersection_types}),x)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Di.create=(n,e,t)=>new Di({left:n,right:e,typeName:U.ZodIntersection,...k(t)});class qt extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.array)return B(i,{code:P.invalid_type,expected:_.array,received:i.parsedType}),x;if(i.data.length<this._def.items.length)return B(i,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new kt(i,o,i.path,u)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Qe.mergeArray(t,o)):Qe.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new qt({...this._def,rest:e})}}qt.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qt({items:n,typeName:U.ZodTuple,rest:null,...k(e)})};class Ai extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.object)return B(i,{code:P.invalid_type,expected:_.object,received:i.parsedType}),x;const a=[],s=this._def.keyType,o=this._def.valueType;for(const u in i.data)a.push({key:s._parse(new kt(i,u,i.path,u)),value:o._parse(new kt(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?Qe.mergeObjectAsync(t,a):Qe.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof W?new Ai({keyType:e,valueType:t,typeName:U.ZodRecord,...k(i)}):new Ai({keyType:Vt.create(),valueType:e,typeName:U.ZodRecord,...k(t)})}}class Fa extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.map)return B(i,{code:P.invalid_type,expected:_.map,received:i.parsedType}),x;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([u,p],h)=>({key:a._parse(new kt(i,u,i.path,[h,"key"])),value:s._parse(new kt(i,p,i.path,[h,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of o){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return x;(h.status==="dirty"||m.status==="dirty")&&t.dirty(),u.set(h.value,m.value)}return{status:t.value,value:u}})}else{const u=new Map;for(const p of o){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return x;(h.status==="dirty"||m.status==="dirty")&&t.dirty(),u.set(h.value,m.value)}return{status:t.value,value:u}}}}Fa.create=(n,e,t)=>new Fa({valueType:e,keyType:n,typeName:U.ZodMap,...k(t)});class Wn extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==_.set)return B(i,{code:P.invalid_type,expected:_.set,received:i.parsedType}),x;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(B(i,{code:P.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(B(i,{code:P.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const h=new Set;for(const m of p){if(m.status==="aborted")return x;m.status==="dirty"&&t.dirty(),h.add(m.value)}return{status:t.value,value:h}}const u=[...i.data.values()].map((p,h)=>s._parse(new kt(i,p,i.path,h)));return i.common.async?Promise.all(u).then(p=>o(p)):o(u)}min(e,t){return new Wn({...this._def,minSize:{value:e,message:V.toString(t)}})}max(e,t){return new Wn({...this._def,maxSize:{value:e,message:V.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Wn.create=(n,e)=>new Wn({valueType:n,minSize:null,maxSize:null,typeName:U.ZodSet,...k(e)});class Nr extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.function)return B(t,{code:P.invalid_type,expected:_.function,received:t.parsedType}),x;function i(u,p){return Na({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ma(),Br].filter(h=>!!h),issueData:{code:P.invalid_arguments,argumentsError:p}})}function a(u,p){return Na({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ma(),Br].filter(h=>!!h),issueData:{code:P.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof $r){const u=this;return lt(async function(...p){const h=new ft([]),m=await u._def.args.parseAsync(p,s).catch(I=>{throw h.addIssue(i(p,I)),h}),T=await Reflect.apply(o,this,m);return await u._def.returns._def.type.parseAsync(T,s).catch(I=>{throw h.addIssue(a(T,I)),h})})}else{const u=this;return lt(function(...p){const h=u._def.args.safeParse(p,s);if(!h.success)throw new ft([i(p,h.error)]);const m=Reflect.apply(o,this,h.data),T=u._def.returns.safeParse(m,s);if(!T.success)throw new ft([a(m,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Nr({...this._def,args:qt.create(e).rest(Jn.create())})}returns(e){return new Nr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Nr({args:e||qt.create([]).rest(Jn.create()),returns:t||Jn.create(),typeName:U.ZodFunction,...k(i)})}}class Si extends W{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Si.create=(n,e)=>new Si({getter:n,typeName:U.ZodLazy,...k(e)});class Oi extends W{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return B(t,{received:t.data,code:P.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}Oi.create=(n,e)=>new Oi({value:n,typeName:U.ZodLiteral,...k(e)});function cm(n,e){return new In({values:n,typeName:U.ZodEnum,...k(e)})}class In extends W{constructor(){super(...arguments),Ri.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{expected:Y.joinValues(i),received:t.parsedType,code:P.invalid_type}),x}if($a(this,Ri,"f")||im(this,Ri,new Set(this._def.values),"f"),!$a(this,Ri,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return B(t,{received:t.data,code:P.invalid_enum_value,options:i}),x}return lt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return In.create(e,{...this._def,...t})}exclude(e,t=this._def){return In.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Ri=new WeakMap,In.create=cm;class Ci extends W{constructor(){super(...arguments),bi.set(this,void 0)}_parse(e){const t=Y.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==_.string&&i.parsedType!==_.number){const a=Y.objectValues(t);return B(i,{expected:Y.joinValues(a),received:i.parsedType,code:P.invalid_type}),x}if($a(this,bi,"f")||im(this,bi,new Set(Y.getValidEnumValues(this._def.values)),"f"),!$a(this,bi,"f").has(e.data)){const a=Y.objectValues(t);return B(i,{received:i.data,code:P.invalid_enum_value,options:a}),x}return lt(e.data)}get enum(){return this._def.values}}bi=new WeakMap,Ci.create=(n,e)=>new Ci({values:n,typeName:U.ZodNativeEnum,...k(e)});class $r extends W{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return B(t,{code:P.invalid_type,expected:_.promise,received:t.parsedType}),x;const i=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return lt(i.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}$r.create=(n,e)=>new $r({type:n,typeName:U.ZodPromise,...k(e)});class Gt extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{B(i,o),o.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async u=>{if(t.value==="aborted")return x;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?x:p.status==="dirty"||t.value==="dirty"?wr(p.value):p});{if(t.value==="aborted")return x;const u=this._def.schema._parseSync({data:o,path:i.path,parent:i});return u.status==="aborted"?x:u.status==="dirty"||t.value==="dirty"?wr(u.value):u}}if(a.type==="refinement"){const o=u=>{const p=a.refinement(u,s);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?x:(u.status==="dirty"&&t.dirty(),o(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?x:(u.status==="dirty"&&t.dirty(),o(u.value).then(()=>({status:t.value,value:u.value}))))}if(a.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Ti(o))return o;const u=a.transform(o.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Ti(o)?Promise.resolve(a.transform(o.value,s)).then(u=>({status:t.value,value:u})):o);Y.assertNever(a)}}Gt.create=(n,e,t)=>new Gt({schema:n,typeName:U.ZodEffects,effect:e,...k(t)}),Gt.createWithPreprocess=(n,e,t)=>new Gt({schema:e,effect:{type:"preprocess",transform:n},typeName:U.ZodEffects,...k(t)});class Jt extends W{_parse(e){return this._getType(e)===_.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Jt.create=(n,e)=>new Jt({innerType:n,typeName:U.ZodOptional,...k(e)});class Pn extends W{_parse(e){return this._getType(e)===_.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pn.create=(n,e)=>new Pn({innerType:n,typeName:U.ZodNullable,...k(e)});class Bi extends W{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===_.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Bi.create=(n,e)=>new Bi({innerType:n,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class wi extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ei(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}wi.create=(n,e)=>new wi({innerType:n,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Ua extends W{_parse(e){if(this._getType(e)!==_.nan){const i=this._getOrReturnCtx(e);return B(i,{code:P.invalid_type,expected:_.nan,received:i.parsedType}),x}return{status:"valid",value:e.data}}}Ua.create=n=>new Ua({typeName:U.ZodNaN,...k(n)});const GI=Symbol("zod_brand");class Qo extends W{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class _i extends W{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?x:s.status==="dirty"?(t.dirty(),wr(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?x:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(e,t){return new _i({in:e,out:t,typeName:U.ZodPipeline})}}class Mi extends W{_parse(e){const t=this._def.innerType._parse(e),i=a=>(Ti(a)&&(a.value=Object.freeze(a.value)),a);return Ei(t)?t.then(a=>i(a)):i(t)}unwrap(){return this._def.innerType}}Mi.create=(n,e)=>new Mi({innerType:n,typeName:U.ZodReadonly,...k(e)});function dm(n,e={},t){return n?_r.create().superRefine((i,a)=>{var s,o;if(!n(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(o=(s=u.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,h=typeof u=="string"?{message:u}:u;a.addIssue({code:"custom",...h,fatal:p})}}):_r.create()}const FI={object:we.lazycreate};var U;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(U||(U={}));const UI=(n,e={message:`Input not instance of ${n.name}`})=>dm(t=>t instanceof n,e),xa=Vt.create,Ko=gn.create,xI=Ua.create,jI=vn.create,el=gi.create,um=qn.create,kI=Va.create,qI=vi.create,pm=Ii.create,JI=_r.create,ja=Jn.create,WI=nn.create,HI=La.create,YI=Lt.create,ym=we.create,zI=we.strictCreate,ZI=Pi.create,XI=Ga.create,QI=Di.create,KI=qt.create,hm=Ai.create,eP=Fa.create,tP=Wn.create,nP=Nr.create,rP=Si.create,iP=Oi.create,fm=In.create,aP=Ci.create,sP=$r.create,mm=Gt.create,oP=Jt.create,lP=Pn.create,cP=Gt.createWithPreprocess,dP=_i.create;var c=Object.freeze({__proto__:null,defaultErrorMap:Br,setErrorMap:gI,getErrorMap:Ma,makeIssue:Na,EMPTY_PATH:vI,addIssueToContext:B,ParseStatus:Qe,INVALID:x,DIRTY:wr,OK:lt,isAborted:Yo,isDirty:zo,isValid:Ti,isAsync:Ei,get util(){return Y},get objectUtil(){return Ho},ZodParsedType:_,getParsedType:bn,ZodType:W,datetimeRegex:lm,ZodString:Vt,ZodNumber:gn,ZodBigInt:vn,ZodBoolean:gi,ZodDate:qn,ZodSymbol:Va,ZodUndefined:vi,ZodNull:Ii,ZodAny:_r,ZodUnknown:Jn,ZodNever:nn,ZodVoid:La,ZodArray:Lt,ZodObject:we,ZodUnion:Pi,ZodDiscriminatedUnion:Ga,ZodIntersection:Di,ZodTuple:qt,ZodRecord:Ai,ZodMap:Fa,ZodSet:Wn,ZodFunction:Nr,ZodLazy:Si,ZodLiteral:Oi,ZodEnum:In,ZodNativeEnum:Ci,ZodPromise:$r,ZodEffects:Gt,ZodTransformer:Gt,ZodOptional:Jt,ZodNullable:Pn,ZodDefault:Bi,ZodCatch:wi,ZodNaN:Ua,BRAND:GI,ZodBranded:Qo,ZodPipeline:_i,ZodReadonly:Mi,custom:dm,Schema:W,ZodSchema:W,late:FI,get ZodFirstPartyTypeKind(){return U},coerce:{string:n=>Vt.create({...n,coerce:!0}),number:n=>gn.create({...n,coerce:!0}),boolean:n=>gi.create({...n,coerce:!0}),bigint:n=>vn.create({...n,coerce:!0}),date:n=>qn.create({...n,coerce:!0})},any:JI,array:YI,bigint:jI,boolean:el,date:um,discriminatedUnion:XI,effect:mm,enum:fm,function:nP,instanceof:UI,intersection:QI,lazy:rP,literal:iP,map:eP,nan:xI,nativeEnum:aP,never:WI,null:pm,nullable:lP,number:Ko,object:ym,oboolean:()=>el().optional(),onumber:()=>Ko().optional(),optional:oP,ostring:()=>xa().optional(),pipeline:dP,preprocess:cP,promise:sP,record:hm,set:tP,strictObject:zI,string:xa,symbol:kI,transformer:mm,tuple:KI,undefined:qI,union:ZI,unknown:ja,void:HI,NEVER:x,ZodIssueCode:P,quotelessJson:bI,ZodError:ft});function Tm(n){var a,s,o;if(!(n!=null&&n.dataType))return ja();const e=n.dataType.isNullable||!1,t=n.dataType.isList||!1;let i=ja();if(((a=n.dataType.entity)==null?void 0:a.type)===r.PrimitiveEntity)switch(n.dataType.entity.name){case g.String:i=xa();break;case g.JSON:i=hm(ja());break;case g.Number:i=Ko();break;case g.Boolean:i=el();break;case g.Date:i=um();break;case g.Enum:{const u=n.dataType.options||[];if(u.length===0)throw new Error(`Enum property ${n.name} has no options`);i=fm(u);break}case g.Null:i=pm();break;case g.UUID:i=xa().uuid();break}else if(((s=n.dataType.entity)==null?void 0:s.type)===r.CustomEntity)i=Em(n.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=n.dataType.entity)==null?void 0:o.type}`);return e&&(i=i.nullable()),t&&(i=i.array()),i}function Em(n){const e=ym({});for(const t of n.properties){const i=Tm(t);e.shape[t.name]=i}return e}function Rm(n){const e=n.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function bm(n){const e=n.rangeEnd;return new Date(Math.random()*e.getTime())}function gm(n){const e=n.rangeStart,t=n.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function vm(n){return n.rangeStart&&n.rangeEnd?gm(n):n.rangeStart?Rm(n):n.rangeEnd?bm(n):new Date}function uP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Im={},ka={},qa={};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=yP;let Ja;const pP=new Uint8Array(16);function yP(){if(!Ja&&(Ja=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ja))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ja(pP)}var Dn={},Hn={},Wa={};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.default=void 0;var hP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Wa.default=hP,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.default=void 0;var fP=mP(Wa);function mP(n){return n&&n.__esModule?n:{default:n}}function TP(n){return typeof n=="string"&&fP.default.test(n)}var EP=TP;Hn.default=EP,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.default=void 0,Dn.unsafeStringify=Pm;var RP=bP(Hn);function bP(n){return n&&n.__esModule?n:{default:n}}const ze=[];for(let n=0;n<256;++n)ze.push((n+256).toString(16).slice(1));function Pm(n,e=0){return ze[n[e+0]]+ze[n[e+1]]+ze[n[e+2]]+ze[n[e+3]]+"-"+ze[n[e+4]]+ze[n[e+5]]+"-"+ze[n[e+6]]+ze[n[e+7]]+"-"+ze[n[e+8]]+ze[n[e+9]]+"-"+ze[n[e+10]]+ze[n[e+11]]+ze[n[e+12]]+ze[n[e+13]]+ze[n[e+14]]+ze[n[e+15]]}function gP(n,e=0){const t=Pm(n,e);if(!(0,RP.default)(t))throw TypeError("Stringified UUID is invalid");return t}var vP=gP;Dn.default=vP,Object.defineProperty(ka,"__esModule",{value:!0}),ka.default=void 0;var IP=DP(qa),PP=Dn;function DP(n){return n&&n.__esModule?n:{default:n}}let Dm,tl,nl=0,rl=0;function AP(n,e,t){let i=e&&t||0;const a=e||new Array(16);n=n||{};let s=n.node||Dm,o=n.clockseq!==void 0?n.clockseq:tl;if(s==null||o==null){const b=n.random||(n.rng||IP.default)();s==null&&(s=Dm=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=tl=(b[6]<<8|b[7])&16383)}let u=n.msecs!==void 0?n.msecs:Date.now(),p=n.nsecs!==void 0?n.nsecs:rl+1;const h=u-nl+(p-rl)/1e4;if(h<0&&n.clockseq===void 0&&(o=o+1&16383),(h<0||u>nl)&&n.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");nl=u,rl=p,tl=o,u+=122192928e5;const m=((u&268435455)*1e4+p)%4294967296;a[i++]=m>>>24&255,a[i++]=m>>>16&255,a[i++]=m>>>8&255,a[i++]=m&255;const T=u/4294967296*1e4&268435455;a[i++]=T>>>8&255,a[i++]=T&255,a[i++]=T>>>24&15|16,a[i++]=T>>>16&255,a[i++]=o>>>8|128,a[i++]=o&255;for(let b=0;b<6;++b)a[i+b]=s[b];return e||(0,PP.unsafeStringify)(a)}var SP=AP;ka.default=SP;var Ha={},An={},Ni={};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var OP=CP(Hn);function CP(n){return n&&n.__esModule?n:{default:n}}function BP(n){if(!(0,OP.default)(n))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var wP=BP;Ni.default=wP,Object.defineProperty(An,"__esModule",{value:!0}),An.URL=An.DNS=void 0,An.default=VP;var _P=Dn,MP=NP(Ni);function NP(n){return n&&n.__esModule?n:{default:n}}function $P(n){n=unescape(encodeURIComponent(n));const e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}const Am="6ba7b810-9dad-11d1-80b4-00c04fd430c8";An.DNS=Am;const Sm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";An.URL=Sm;function VP(n,e,t){function i(a,s,o,u){var p;if(typeof a=="string"&&(a=$P(a)),typeof s=="string"&&(s=(0,MP.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let h=new Uint8Array(16+a.length);if(h.set(s),h.set(a,s.length),h=t(h),h[6]=h[6]&15|e,h[8]=h[8]&63|128,o){u=u||0;for(let m=0;m<16;++m)o[u+m]=h[m];return o}return(0,_P.unsafeStringify)(h)}try{i.name=n}catch{}return i.DNS=Am,i.URL=Sm,i}var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.default=void 0;function LP(n){if(typeof n=="string"){const e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return GP(FP(UP(n),n.length*8))}function GP(n){const e=[],t=n.length*32,i="0123456789abcdef";for(let a=0;a<t;a+=8){const s=n[a>>5]>>>a%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(s&15),16);e.push(o)}return e}function Om(n){return(n+64>>>9<<4)+14+1}function FP(n,e){n[e>>5]|=128<<e%32,n[Om(e)-1]=e;let t=1732584193,i=-271733879,a=-1732584194,s=271733878;for(let o=0;o<n.length;o+=16){const u=t,p=i,h=a,m=s;t=Ke(t,i,a,s,n[o],7,-680876936),s=Ke(s,t,i,a,n[o+1],12,-389564586),a=Ke(a,s,t,i,n[o+2],17,606105819),i=Ke(i,a,s,t,n[o+3],22,-1044525330),t=Ke(t,i,a,s,n[o+4],7,-176418897),s=Ke(s,t,i,a,n[o+5],12,1200080426),a=Ke(a,s,t,i,n[o+6],17,-1473231341),i=Ke(i,a,s,t,n[o+7],22,-45705983),t=Ke(t,i,a,s,n[o+8],7,1770035416),s=Ke(s,t,i,a,n[o+9],12,-1958414417),a=Ke(a,s,t,i,n[o+10],17,-42063),i=Ke(i,a,s,t,n[o+11],22,-1990404162),t=Ke(t,i,a,s,n[o+12],7,1804603682),s=Ke(s,t,i,a,n[o+13],12,-40341101),a=Ke(a,s,t,i,n[o+14],17,-1502002290),i=Ke(i,a,s,t,n[o+15],22,1236535329),t=et(t,i,a,s,n[o+1],5,-165796510),s=et(s,t,i,a,n[o+6],9,-1069501632),a=et(a,s,t,i,n[o+11],14,643717713),i=et(i,a,s,t,n[o],20,-373897302),t=et(t,i,a,s,n[o+5],5,-701558691),s=et(s,t,i,a,n[o+10],9,38016083),a=et(a,s,t,i,n[o+15],14,-660478335),i=et(i,a,s,t,n[o+4],20,-405537848),t=et(t,i,a,s,n[o+9],5,568446438),s=et(s,t,i,a,n[o+14],9,-1019803690),a=et(a,s,t,i,n[o+3],14,-187363961),i=et(i,a,s,t,n[o+8],20,1163531501),t=et(t,i,a,s,n[o+13],5,-1444681467),s=et(s,t,i,a,n[o+2],9,-51403784),a=et(a,s,t,i,n[o+7],14,1735328473),i=et(i,a,s,t,n[o+12],20,-1926607734),t=tt(t,i,a,s,n[o+5],4,-378558),s=tt(s,t,i,a,n[o+8],11,-2022574463),a=tt(a,s,t,i,n[o+11],16,1839030562),i=tt(i,a,s,t,n[o+14],23,-35309556),t=tt(t,i,a,s,n[o+1],4,-1530992060),s=tt(s,t,i,a,n[o+4],11,1272893353),a=tt(a,s,t,i,n[o+7],16,-155497632),i=tt(i,a,s,t,n[o+10],23,-1094730640),t=tt(t,i,a,s,n[o+13],4,681279174),s=tt(s,t,i,a,n[o],11,-358537222),a=tt(a,s,t,i,n[o+3],16,-722521979),i=tt(i,a,s,t,n[o+6],23,76029189),t=tt(t,i,a,s,n[o+9],4,-640364487),s=tt(s,t,i,a,n[o+12],11,-421815835),a=tt(a,s,t,i,n[o+15],16,530742520),i=tt(i,a,s,t,n[o+2],23,-995338651),t=nt(t,i,a,s,n[o],6,-198630844),s=nt(s,t,i,a,n[o+7],10,1126891415),a=nt(a,s,t,i,n[o+14],15,-1416354905),i=nt(i,a,s,t,n[o+5],21,-57434055),t=nt(t,i,a,s,n[o+12],6,1700485571),s=nt(s,t,i,a,n[o+3],10,-1894986606),a=nt(a,s,t,i,n[o+10],15,-1051523),i=nt(i,a,s,t,n[o+1],21,-2054922799),t=nt(t,i,a,s,n[o+8],6,1873313359),s=nt(s,t,i,a,n[o+15],10,-30611744),a=nt(a,s,t,i,n[o+6],15,-1560198380),i=nt(i,a,s,t,n[o+13],21,1309151649),t=nt(t,i,a,s,n[o+4],6,-145523070),s=nt(s,t,i,a,n[o+11],10,-1120210379),a=nt(a,s,t,i,n[o+2],15,718787259),i=nt(i,a,s,t,n[o+9],21,-343485551),t=Sn(t,u),i=Sn(i,p),a=Sn(a,h),s=Sn(s,m)}return[t,i,a,s]}function UP(n){if(n.length===0)return[];const e=n.length*8,t=new Uint32Array(Om(e));for(let i=0;i<e;i+=8)t[i>>5]|=(n[i/8]&255)<<i%32;return t}function Sn(n,e){const t=(n&65535)+(e&65535);return(n>>16)+(e>>16)+(t>>16)<<16|t&65535}function xP(n,e){return n<<e|n>>>32-e}function za(n,e,t,i,a,s){return Sn(xP(Sn(Sn(e,n),Sn(i,s)),a),t)}function Ke(n,e,t,i,a,s,o){return za(e&t|~e&i,n,e,a,s,o)}function et(n,e,t,i,a,s,o){return za(e&i|t&~i,n,e,a,s,o)}function tt(n,e,t,i,a,s,o){return za(e^t^i,n,e,a,s,o)}function nt(n,e,t,i,a,s,o){return za(t^(e|~i),n,e,a,s,o)}var jP=LP;Ya.default=jP,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.default=void 0;var kP=Cm(An),qP=Cm(Ya);function Cm(n){return n&&n.__esModule?n:{default:n}}var JP=(0,kP.default)("v3",48,qP.default);Ha.default=JP;var Za={},Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=void 0;var WP={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Xa.default=WP,Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=void 0;var Bm=wm(Xa),HP=wm(qa),YP=Dn;function wm(n){return n&&n.__esModule?n:{default:n}}function zP(n,e,t){if(Bm.default.randomUUID&&!e&&!n)return Bm.default.randomUUID();n=n||{};const i=n.random||(n.rng||HP.default)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=i[a];return e}return(0,YP.unsafeStringify)(i)}var ZP=zP;Za.default=ZP;var Qa={},Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=void 0;function XP(n,e,t,i){switch(n){case 0:return e&t^~e&i;case 1:return e^t^i;case 2:return e&t^e&i^t&i;case 3:return e^t^i}}function il(n,e){return n<<e|n>>>32-e}function QP(n){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){const o=unescape(encodeURIComponent(n));n=[];for(let u=0;u<o.length;++u)n.push(o.charCodeAt(u))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);const i=n.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let o=0;o<a;++o){const u=new Uint32Array(16);for(let p=0;p<16;++p)u[p]=n[o*64+p*4]<<24|n[o*64+p*4+1]<<16|n[o*64+p*4+2]<<8|n[o*64+p*4+3];s[o]=u}s[a-1][14]=(n.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(n.length-1)*8&4294967295;for(let o=0;o<a;++o){const u=new Uint32Array(80);for(let I=0;I<16;++I)u[I]=s[o][I];for(let I=16;I<80;++I)u[I]=il(u[I-3]^u[I-8]^u[I-14]^u[I-16],1);let p=t[0],h=t[1],m=t[2],T=t[3],b=t[4];for(let I=0;I<80;++I){const C=Math.floor(I/20),G=il(p,5)+XP(C,h,m,T)+b+e[C]+u[I]>>>0;b=T,T=m,m=il(h,30)>>>0,h=p,p=G}t[0]=t[0]+p>>>0,t[1]=t[1]+h>>>0,t[2]=t[2]+m>>>0,t[3]=t[3]+T>>>0,t[4]=t[4]+b>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var KP=QP;Ka.default=KP,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.default=void 0;var eD=_m(An),tD=_m(Ka);function _m(n){return n&&n.__esModule?n:{default:n}}var nD=(0,eD.default)("v5",80,tD.default);Qa.default=nD;var es={};Object.defineProperty(es,"__esModule",{value:!0}),es.default=void 0;var rD="00000000-0000-0000-0000-000000000000";es.default=rD;var ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0;var iD=aD(Hn);function aD(n){return n&&n.__esModule?n:{default:n}}function sD(n){if(!(0,iD.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var oD=sD;ts.default=oD,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return o.default}});var e=m(ka),t=m(Ha),i=m(Za),a=m(Qa),s=m(es),o=m(ts),u=m(Hn),p=m(Dn),h=m(Ni);function m(T){return T&&T.__esModule?T:{default:T}}}(Im);function al(n,e){if(!n||!e||!n.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=n,this.dstAlphabet=e}al.prototype.convert=function(n){var e,t,i,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,u=n.length,p=typeof n=="string"?"":[];if(!this.isValid(n))throw new Error('Number "'+n+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return n;for(e=0;e<u;e++)a[e]=this.srcAlphabet.indexOf(n[e]);do{for(t=0,i=0,e=0;e<u;e++)t=t*s+a[e],t>=o?(a[i++]=parseInt(t/o,10),t=t%o):i>0&&(a[i++]=0);u=i,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(i!==0);return p},al.prototype.isValid=function(n){for(var e=0;e<n.length;++e)if(this.srcAlphabet.indexOf(n[e])===-1)return!1;return!0};var lD=al,cD=lD;function $i(n,e){var t=new cD(n,e);return function(i){return t.convert(i)}}$i.BIN="01",$i.OCT="01234567",$i.DEC="0123456789",$i.HEX="0123456789abcdef";var dD=$i;const{v4:sl,validate:uD}=Im,ns=dD,ol={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},pD={consistentLength:!0};let ll;const Mm=(n,e,t)=>{const i=e(n.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?i:i.padStart(t.shortIdLength,t.paddingChar)},Nm=(n,e)=>{const i=e(n).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[i[1],i[2],i[3],i[4],i[5]].join("-")},yD=n=>Math.ceil(Math.log(2**128)/Math.log(n));var hD=(()=>{const n=(e,t)=>{const i=e||ol.flickrBase58,a={...pD,...t};if([...new Set(Array.from(i))].length!==i.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=yD(i.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:i[0]},u=ns(ns.HEX,i),p=ns(i,ns.HEX),h=()=>Mm(sl(),u,o),T={alphabet:i,fromUUID:b=>Mm(b,u,o),maxLength:s,generate:h,new:h,toUUID:b=>Nm(b,p),uuid:sl,validate:(b,I=!1)=>{if(!b||typeof b!="string")return!1;const C=a.consistentLength?b.length===s:b.length<=s,G=b.split("").every(J=>i.includes(J));return I===!1?C&&G:C&&G&&uD(Nm(b,p))}};return Object.freeze(T),T};return n.constants=ol,n.uuid=sl,n.generate=()=>(ll||(ll=n(ol.flickrBase58).generate),ll()),n})();const $m=uP(hD),fD=$m();function Vm(){return fD.uuid()}function Lm(n){return n.rangeStart+Math.random()}function Gm(n){const e=n.rangeEnd;return Math.random()*e}function Fm(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random()*(t-e)+e}function Um(n){return n.rangeStart&&n.rangeEnd?Fm(n):n.rangeStart?Lm(n):n.rangeEnd?Gm(n):Math.random()}function xm(n){const e=n.rangeStart;return Math.random().toString(36).substring(e)}function jm(n){const e=n.rangeEnd;return Math.random().toString(36).substring(0,e)}function km(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random().toString(36).substring(e,t)}function qm(n){return n.rangeStart&&n.rangeEnd?km(n):n.rangeStart?xm(n):n.rangeEnd?jm(n):Math.random().toString(36)}function Jm(n){return Math.random()>=.5}function mD(n){if(!n||!n.autogeneration)return null;switch(n.autogeneration.type){case xe.CurrentDateAndTime:if(n.name===g.Date)return new Date;case xe.Random:{if(n.name===g.Date)return vm(n.autogeneration);if(n.name===g.Number)return Um(n.autogeneration);if(n.name===g.String)return qm(n.autogeneration);if(n.name===g.Boolean)return Jm(n.autogeneration)}case xe.Unique:if(n.name===g.UUID)return Vm();default:throw new Error(`Generating a ${n.autogeneration.type} value for a ${n.name} is not supported`)}}const q="e7eb5382-3d99-44fd-972a-b8b1e819f6be",cl="global-user-variable-id",Wm="last-executed-timestamp-variable-id",TD={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},ED={id:"alternative-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:r.Property},RD={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:TD,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:ED},rs={id:"alternative-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},bD={required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:Oa,static:!0,index:0,dataType:RD,description:"The name of the main database inside of the server instance where the data will be stored.",parent:rs};r.GenericReference,r.DataType;const gD={id:"alternative-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:r.Property},vD={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:gD},ID={required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:Ca,static:!0,index:1,dataType:vD,description:"The username that will be used to connect to the database.",parent:rs};r.GenericReference,r.DataType;const PD={id:"alternative-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:r.Property},DD={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:PD},AD={required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:Ba,static:!0,index:2,dataType:DD,description:"The password that will be used to connect to the database.",parent:rs},SD={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},OD={id:"alternative-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:r.Property},CD={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:SD,autogeneration:null,valueAsType:null},parent:OD},BD={required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:wa,static:!0,index:3,dataType:CD,description:"The minimum size of the database in GB.",parent:rs},wD={id:"alternative-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},Hm={id:"alternative-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[bD,ID,AD,BD],methods:[],abstractMethods:[],extends:[],implements:[Rn],x:0,y:0,parent:wD},_D={id:"animal-prototype-database-property-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-id",entityType:r.Property},MD={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:r.DataType},ND={id:"animal-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Rn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:Hm,autogeneration:null,parent:MD},parent:_D},$D={id:"animal-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},VD={required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:mi,static:!0,index:0,dataType:ND,description:"The database that the entity belongs to.",parent:$D},LD={type:r.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:r.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},GD={id:"c1930577-9e79-48a6-8905-be24611015c1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LD},FD={type:r.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},UD={required:!0,type:r.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:GD,abstract:!1,parent:FD},xD={type:r.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:r.Project,entityId:q},jD={type:r.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[VD,UD],methods:[],extends:[],implements:[Be],x:0,y:0,parent:xD},kD={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:r.DataType},qD={id:"default-relational-database-entity-identifier-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:r.Property},JD={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:null,parent:kD,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:qD},is={id:"default-relational-database-entity-ref-id",type:r.GenericReference,entityId:w.PERSISTED_ENTITY,entityType:r.BuiltInBaseEntity},WD={required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:r.Property,private:!1,abstract:!1,implements:Oa,static:!0,index:0,dataType:JD,description:"The name of the main database inside of the server instance where the data will be stored.",parent:is};r.GenericReference,r.DataType;const HD={id:"default-relational-database-entity-username-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:r.Property},YD={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:HD},zD={required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:r.Property,private:!1,abstract:!1,implements:Ca,static:!0,index:1,dataType:YD,description:"The username that will be used to connect to the database.",parent:is};r.GenericReference,r.DataType;const ZD={id:"default-relational-database-entity-password-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:r.Property},XD={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:ZD},QD={required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:r.Property,private:!1,abstract:!1,implements:Ba,static:!0,index:2,dataType:XD,description:"The password that will be used to connect to the database.",parent:is},KD={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:r.DataType},eA={id:"default-relational-database-entity-min-size-property-ref-id",type:r.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:r.Property},tA={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ce,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:6,parent:KD,autogeneration:null,valueAsType:null},parent:eA},nA={required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:r.Property,private:!1,abstract:!1,implements:wa,static:!0,index:3,dataType:tA,description:"The minimum size of the database in GB.",parent:is},rA={id:"default-relational-database-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},dl={id:"default-relational-database-entity-id",type:r.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[WD,zD,QD,nA],methods:[],abstractMethods:[],extends:[],implements:[Rn],x:0,y:0,parent:rA},iA={id:"user-prototype-database-property-data-type-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:r.DataType},aA={id:"user-prototype-database-property-ref-id",type:r.GenericReference,entityId:"user-prototype-database-property-id",entityType:r.Property},sA={id:"user-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Rn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:dl,autogeneration:null,parent:iA},parent:aA},oA={id:"user-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},lA={required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:mi,static:!0,index:0,dataType:sA,description:"The database that the entity belongs to.",parent:oA},cA={type:r.GenericReference,id:"user-prototype-parent-ref-id",entityType:r.Project,entityId:q},ul={type:r.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Be],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[lA],methods:[],x:0,y:0,parent:cA},dA={type:r.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:r.Property,entityId:"person-date-of-birth-property-id"},uA={id:"person-date-of-birth-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ar,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:dA},pA={type:r.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},yA={required:!0,type:r.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,dataType:uA,abstract:!1,parent:pA},hA={type:r.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:r.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},fA={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:hA},mA={type:r.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:r.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},TA={required:!0,type:r.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,dataType:fA,abstract:!1,parent:mA},EA={type:r.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:r.Project,entityId:q},ct={type:r.CustomEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[TA,yA],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[ul],x:0,y:0,parent:EA},RA={type:r.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},bA={type:r.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:r.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},gA={type:r.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},vA={type:r.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:r.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},IA={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vA},pl={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:r.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:IA,readsValue:gA,required:!0,index:0,parent:bA},PA={type:r.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},DA={type:r.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:r.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},Ym={type:r.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[pl],calledByError:[],calledByEntry:[PA],calledBySuccess:[],throws:null,x:0,y:0,parent:DA},AA={type:r.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:r.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},SA={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AA},zm={id:"500dee3a-3435-4453-9699-0d053f646523",type:r.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:SA,required:!0,writesValues:[pl],index:0,parent:RA},OA={type:r.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Zm={type:r.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[zm],calls:[Ym],returnStatements:[Ym],index:0,collapsed:!1,private:!1,x:0,y:0,parent:OA},CA={type:r.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:r.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},BA={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CA},wA={type:r.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:r.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},_A={type:r.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},MA={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:r.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:BA,readsValue:wA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:_A},NA={type:r.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},$A={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:r.OutputMap,version:1,declaration:pl,writesValues:[MA],index:0,parent:NA},VA={type:r.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},LA={type:r.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},GA={type:r.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},FA={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:GA},UA={type:r.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},xA={type:r.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},jA={type:r.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:r.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},kA={type:r.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:r.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},Xm={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:r.InputMap,version:1,declaration:zm,name:null,description:null,readsValue:kA,dynamicArguments:[],defaultValue:null,index:0,parent:jA},qA={type:r.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:FA,readsValue:UA,writesValues:[Xm],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:xA},JA={type:r.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:Zm,inputs:[Xm],outputs:[$A],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[VA],calledBySuccess:[],parent:LA,error:null,x:0,y:0},WA={type:r.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:r.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},HA={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WA},YA={type:r.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:r.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},zA={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:r.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:HA,required:!0,index:0,writesValues:[qA],parent:YA},ZA={type:r.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},XA={type:r.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[zA],collapsed:!0,returnStatements:[],calls:[JA],private:!1,index:0,implements:null,x:0,y:0,parent:ZA},QA={type:r.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:r.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},KA={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:QA},eS={type:r.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Qm={required:!0,type:r.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:KA,abstract:!1,parent:eS},tS={type:r.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:r.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},nS={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tS},rS={type:r.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:r.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},Km={required:!0,type:r.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:nS,implements:null,static:!1,private:!0,abstract:!1,parent:rS},iS={type:r.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:r.Project,entityId:q},Vr={type:r.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[Qm,Km],methods:[Zm,XA],extends:[],implements:[Be],x:0,y:0,parent:iS},Vi="bitcoin-api-response-id",eT="time-property-id",tT="disclamer-property-id",nT="chart-name-property-id",rT="bpi-property-id",as="bpi-entity-id",iT="usd-property-id",aT="gbp-property-id",sT="eur-property-id",Lr="currency-entity-id",oT="currency-code-property-id",lT="currency-symbol-property-id",cT="currency-rate-property-id",dT="currency-description-property-id",uT="currency-rate-number-property-id",aS={type:r.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:r.Property,entityId:oT},sS={id:"code-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:En,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:aS},oS={type:r.GenericReference,id:"code-property-parent-ref-id",entityType:r.CustomEntity,entityId:Lr},lS={required:!0,type:r.Property,id:oT,version:1,name:"code",description:null,dataType:sS,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:oS},cS={type:r.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:r.Property,entityId:lT},dS={id:"symbol-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:En,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:cS},uS={type:r.GenericReference,id:"symbol-property-parent-ref-id",entityType:r.CustomEntity,entityId:Lr},pS={required:!0,type:r.Property,id:lT,version:1,name:"symbol",description:null,index:0,dataType:dS,implements:null,static:!1,private:!1,abstract:!1,parent:uS},yS={type:r.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:r.Property,entityId:cT},hS={id:"rate-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yS},fS={type:r.GenericReference,id:"rate-property-parent-ref-id",entityType:r.CustomEntity,entityId:Lr},mS={required:!0,type:r.Property,id:cT,version:1,name:"rate",description:null,index:0,dataType:hS,implements:null,static:!1,private:!1,abstract:!1,parent:fS},TS={type:r.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:r.Property,entityId:dT},ES={id:"description-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:TS},RS={type:r.GenericReference,id:"description-property-parent-ref-id",entityType:r.CustomEntity,entityId:Lr},bS={required:!0,type:r.Property,id:dT,version:1,name:"description",description:null,dataType:ES,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:RS},gS={type:r.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:r.Property,entityId:uT},vS={id:"rate-number-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gS},IS={type:r.GenericReference,id:"rate-number-property-parent-ref-id",entityType:r.CustomEntity,entityId:Lr},PS={required:!0,type:r.Property,id:uT,version:1,name:"rate_float",description:null,dataType:vS,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:IS},DS={type:r.GenericReference,id:"currency-prototype-parent-ref-id",entityType:r.Project,entityId:q},ss={type:r.CustomEntity,id:Lr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[lS,pS,mS,bS,PS],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:DS},AS={type:r.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:r.Property,entityId:iT},SS={id:"usd-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ss,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AS},OS={type:r.GenericReference,id:"usd-property-parent-ref-id",entityType:r.CustomEntity,entityId:as},CS={required:!0,id:iT,type:r.Property,version:1,name:"USD",description:null,index:0,dataType:SS,implements:null,static:!1,private:!1,abstract:!1,parent:OS},BS={type:r.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:r.Property,entityId:aT},wS={id:"gbp-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ss,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:BS},_S={type:r.GenericReference,id:"gbp-property-parent-ref-id",entityType:r.CustomEntity,entityId:as},MS={required:!0,id:aT,type:r.Property,version:1,name:"GBP",description:null,index:0,dataType:wS,implements:null,static:!1,private:!1,abstract:!1,parent:_S},NS={type:r.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:r.Property,entityId:sT},$S={id:"eur-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ss,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:NS},VS={type:r.GenericReference,id:"eur-property-parent-ref-id",entityType:r.CustomEntity,entityId:as},LS={required:!0,id:sT,type:r.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:$S,private:!1,abstract:!1,parent:VS},GS={type:r.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:r.Project,entityId:q},pT={type:r.CustomEntity,id:as,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[CS,MS,LS],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:GS},FS={type:r.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:r.Property,entityId:eT},US={id:"time-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Eo,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FS},xS={type:r.GenericReference,id:"time-property-parent-ref-id",entityType:r.CustomEntity,entityId:Vi},jS={required:!0,type:r.Property,id:eT,version:1,name:"time",description:null,index:0,dataType:US,implements:null,static:!1,private:!1,abstract:!1,parent:xS},kS={type:r.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:r.Property,entityId:tT},qS={id:"disclamer-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kS},JS={type:r.GenericReference,id:"disclamer-property-parent-ref-id",entityType:r.CustomEntity,entityId:Vi},WS={required:!0,type:r.Property,id:tT,version:1,name:"disclamer",description:null,index:0,dataType:qS,implements:null,static:!1,private:!1,abstract:!1,parent:JS},HS={type:r.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:r.Property,entityId:nT},YS={id:"chart-name-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:HS},zS={type:r.GenericReference,id:"chart-name-property-parent-ref-id",entityType:r.CustomEntity,entityId:Vi},ZS={required:!0,type:r.Property,id:nT,version:1,name:"chartName",description:null,index:0,dataType:YS,implements:null,static:!1,private:!1,abstract:!1,parent:zS},XS={type:r.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:r.Property,entityId:rT},QS={id:"bpi-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:pT,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XS},KS={type:r.GenericReference,id:"bpi-property-parent-ref-id",entityType:r.CustomEntity,entityId:Vi},eO={required:!0,type:r.Property,id:rT,version:1,name:"bpi",description:null,implements:null,index:0,dataType:QS,static:!1,private:!1,abstract:!1,parent:KS},tO={type:r.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:r.Project,entityId:q},yT={type:r.CustomEntity,id:Vi,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[jS,WS,ZS,eO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:tO},nO={type:r.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},rO={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:nO},iO={type:r.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:r.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},aO={type:r.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:r.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},sO={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aO},oO={type:r.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:r.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},hT={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:sO,readsValue:oO,required:!0,index:0,parent:iO},lO={type:r.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},cO={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:r.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:rO,writesValues:[hT],required:!0,index:0,parent:lO},dO={type:r.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},uO={type:r.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},pO={type:r.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},fT={type:r.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[hT],calledByError:[],calledByEntry:[uO],calledBySuccess:[],throws:null,x:0,y:0,parent:pO},yO={type:r.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[cO],calls:[fT],index:0,collapsed:!1,implements:null,returnStatements:[fT],private:!1,x:0,y:0,parent:dO},hO={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},fO={type:r.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},mO={type:r.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:r.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},TO={type:r.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},EO={type:r.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:r.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},RO={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Fn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:EO},yl={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:r.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:RO,readsValue:TO,required:!0,index:0,parent:mO},mT={type:r.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[yl],calledByError:[],calledByEntry:[],calledBySuccess:[hO],throws:null,x:0,y:0,parent:fO},bO={type:r.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},gO={type:r.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},TT={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Mo,name:null,description:null,dynamicArguments:[],readsValue:gO,defaultValue:null,parent:bO,index:2},vO={type:r.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:r.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},IO={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Fn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vO},PO={type:r.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},DO={type:r.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:r.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},AO={type:r.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:r.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},ET={type:r.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",dataType:IO,readsValue:DO,writesValues:[yl],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[AO],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:PO},SO={type:r.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:r.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},OO={type:r.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},CO={type:r.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:ga,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:g.String,valueAsType:null,parent:SO,autogeneration:null},index:1,dynamicArguments:[],parent:OO},BO={type:r.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},wO={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:r.OutputMap,version:1,declaration:yi,index:2,writesValues:[ET],parent:BO},_O={type:r.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},MO={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:r.InputMap,version:1,declaration:ba,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:_O},NO={type:r.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},$O={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:r.InputMap,version:1,name:null,description:null,declaration:va,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:NO},VO={type:r.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},LO={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:r.InputMap,version:1,declaration:Ia,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:VO},GO={type:r.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},FO={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:r.OutputMap,version:1,declaration:Pa,index:1,writesValues:[],parent:GO},UO={type:r.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},xO={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:r.OutputMap,version:1,declaration:yi,index:0,writesValues:[],parent:UO},jO={type:r.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},kO={type:r.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},qO={type:r.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},JO={type:r.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:r.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},WO={type:r.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:r.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},HO={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xe,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WO},YO={type:r.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:r.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},RT={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:r.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:HO,required:!0,readsValue:null,index:0,parent:YO},zO={type:r.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[JO],throws:RT,x:0,y:0,parent:qO},ZO={type:r.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:r.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},XO={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:r.OutputMap,declaration:$o,version:1,writesValues:[RT],index:0,parent:ZO},QO={type:r.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:hi,inputs:[MO,CO,TT,$O,LO],outputs:[xO,FO,wO],process:null,calledByError:[],calledByEntry:[jO],calledBySuccess:[],successCalls:[mT,ET],errorCalls:[zO],error:XO,dynamicArguments:[],x:0,y:0,parent:kO},KO={type:r.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:r.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},eC={type:r.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},tC={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:r.InputMap,version:1,declaration:Ta,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"?name=",name:g.String,parent:KO,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:eC},nC={type:r.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},rC={type:r.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},iC={type:r.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:r.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},aC={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:iC},sC={type:r.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:r.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},oC={type:r.GenericReference,id:"assembled-query-string-called-by-ref",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},bT={type:r.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",dataType:aC,readsValue:sC,writesValues:[TT],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[oC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:rC},lC={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:r.OutputMap,version:1,writesValues:[bT],declaration:ui,index:0,parent:nC},cC={type:r.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},dC={type:r.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},uC={type:r.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:r.ArgumentDeclaration},pC={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},gT={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:r.InputMap,declaration:Ea,name:null,description:null,readsValue:uC,dynamicArguments:[],defaultValue:null,index:1,parent:pC},yC={type:r.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:pi,version:1,inputs:[tC,gT],outputs:[lC],process:null,calledByError:[],calledByEntry:[cC],calledBySuccess:[],dynamicArguments:[],successCalls:[bT],errorCalls:[],error:null,x:0,y:0,parent:dC},hC={type:r.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:r.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},fC={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hC},mC={type:r.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:r.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},vT={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:r.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:fC,required:!1,writesValues:[gT],index:0,parent:mC},TC={type:r.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:r.Project,entityId:q},IT={type:r.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[vT],calls:[yC,QO],returnStatements:[mT],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:TC},EC={type:r.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},RC={type:r.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},bC={type:r.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},gC={type:r.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},PT={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:r.InputMap,declaration:vT,name:null,description:null,readsValue:bC,dynamicArguments:[],defaultValue:null,index:0,parent:gC},vC={type:r.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},IC={type:r.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:r.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},PC={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Fn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:IC},DC={type:r.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:r.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},AC={type:r.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},SC={type:r.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:r.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},DT={type:r.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:PC,readsValue:DC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[SC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:AC},OC={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.OutputMap,version:1,declaration:yl,writesValues:[DT],index:0,parent:vC},CC={type:r.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:IT,inputs:[PT],outputs:[OC],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[EC],successCalls:[DT],errorCalls:[],error:null,x:0,y:0,parent:RC},BC={type:r.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},wC={type:r.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},_C={type:r.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},MC={type:r.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:r.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},AT={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:r.InputMap,declaration:kn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:_C,defaultValue:null,index:0,parent:MC},NC={type:r.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:kn,inputs:[AT],calledByError:[],calledByEntry:[BC],calledBySuccess:[],successCalls:[CC],errorCalls:[],x:0,y:0,parent:wC},$C={type:r.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},VC={type:r.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:r.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},LC={id:"d64152ea-831f-4426-9506-a39bfa170513",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Vr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:VC},GC={type:r.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},FC={type:r.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},UC={type:r.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},ST={type:r.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",dataType:LC,readsValue:FC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[UC],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:GC},xC={type:r.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:r.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},jC={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Vr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xC},kC={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:r.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:jC,required:!0,index:1,writesValues:[ST],parent:$C},qC={type:r.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},JC={type:r.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:r.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},WC={type:r.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:r.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},HC={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WC},YC={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:r.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:HC,required:!0,index:0,writesValues:[AT,PT],parent:JC},zC={type:r.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[YC,kC],calls:[NC,ST],index:1,private:!1,implements:null,x:0,y:0,parent:qC},ZC={type:r.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},XC={type:r.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-manager-property-id"},QC={id:"employee-manager-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ZC,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:XC},KC={type:r.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},eB={required:!0,type:r.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:QC,abstract:!1,parent:KC},tB={type:r.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:r.Property,entityId:"employee-start-date-property-id"},nB={id:"employee-start-date-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ar,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:tB},rB={type:r.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},iB={required:!0,type:r.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,implements:null,dataType:nB,abstract:!1,parent:rB},aB={type:r.GenericReference,id:"employee-department-property-ref-id",entityType:r.Property,entityId:"employee-department-property-id"},sB={id:"employee-department-property-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:En,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:aB},oB={type:r.GenericReference,id:"employee-department-property-parent-ref-id",entityType:r.CustomEntity,entityId:"employee-entity-id"},lB={required:!0,type:r.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,implements:null,static:!1,private:!1,dataType:sB,abstract:!1,parent:oB},cB={type:r.GenericReference,id:"employee-prototype-parent-ref-id",entityType:r.Project,entityId:q},It={type:r.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[lB,iB,eB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[ct],x:0,y:0,parent:cB},dB={type:r.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:r.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},uB={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:dB},pB={type:r.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},yB={required:!0,type:r.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:uB,abstract:!1,parent:pB},hB={type:r.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:r.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},fB={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Vr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hB},mB={type:r.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},hl={required:!0,type:r.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,dataType:fB,abstract:!1,parent:mB},TB={type:r.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:r.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},EB={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ct,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:TB},RB={type:r.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},bB={required:!0,type:r.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,dataType:EB,private:!0,abstract:!1,parent:RB},gB={type:r.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:r.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},vB={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gB},IB={type:r.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:r.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},PB={required:!0,type:r.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:vB,implements:null,private:!0,static:!1,abstract:!1,parent:IB},DB={type:r.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:r.Project,entityId:q},mt={type:r.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[yB,hl,bB,PB],static:!1,abstract:!1,abstractMethods:[],methods:[yO,zC],extends:[],implements:[Be],x:0,y:0,parent:DB},AB={type:r.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:r.Project,entityId:q},fl={type:r.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:AB};r.GenericReference,r.DataType;const SB={id:"cron-job-entity-expression-property-ref-id",type:r.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:r.Property},OB={id:"cron-job-entity-expression-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:null,parent:SB},CB={id:"cron-job-entity-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},BB={required:!0,id:"cron-job-entity-expression-property-id",type:r.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:OB,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:CB},wB={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:r.GenericReference,entityId:"show-popup-func-decl-id",entityType:r.FunctionDeclaration},_B={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:r.FunctionDeclaration},MB={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:r.FunctionCall,declaration:fl,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[wB],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:_B},NB={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:r.GenericReference,entityId:"cron-job-entity-id",entityType:r.CustomEntity},$B={id:"cron-job-entity-trigger-func-decl-id",version:1,type:r.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:xo,calls:[MB],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:NB},VB={id:"cron-job-entity-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},LB={id:"cron-job-entity-id",version:1,type:r.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[BB],static:!0,abstract:!1,abstractMethods:[],extends:[jo],implements:[],methods:[$B],x:0,y:0,parent:VB},GB={type:r.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:r.Project,entityId:q},FB={type:r.CustomEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[Sa],x:0,y:0,parent:GB},OT="f558fbf8-67de-4545-9804-6ae621e0b2d4",UB={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},xB={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},jB={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:F,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:UB,autogeneration:null,valueAsType:null},parent:xB},kB={id:"getCompanyByIdEndpointReachedEntityEventRef",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},qB={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},JB={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},WB={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:qB,autogeneration:null,valueAsType:null},parent:JB},HB={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:WB,required:!0,index:0,parent:kB},YB={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},zB={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:r.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],dataType:jB,required:!0,index:1,parent:YB},ZB={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},XB={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},QB={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},KB={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:F,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:XB,autogeneration:null,valueAsType:null},parent:QB},ew={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:r.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:KB,required:!0,index:2,parent:ZB},tw={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},nw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},rw={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:nw},iw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:r.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:rw,index:3,required:!0,parent:tw},aw={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},sw={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aw},ow={id:"getCompanyByIdEndpointReturnStatementRef",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},lw={isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:r.ReturnDeclaration,name:"Response code",dataType:sw,readsValue:null,required:!0,index:0,parent:ow},cw={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},dw={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},uw={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Xe,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.JSON,value:{},parent:cw,autogeneration:null,valueAsType:null},parent:dw},pw={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},yw={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:r.ReturnDeclaration,name:"Response headers",dataType:uw,readsValue:null,required:!0,index:1,parent:pw},hw={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:r.GenericReference,entityType:r.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},fw={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Xe,defaultValue:null,parent:hw},mw={id:"getCompanyByIdEndpointReturnStatementRefThree",type:r.GenericReference,entityType:r.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},Tw={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:r.ReturnDeclaration,name:"Response body",dataType:fw,readsValue:null,required:!0,index:2,parent:mw},Ew={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:r.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:r.FunctionDeclaration},Rw={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},bw={id:"getCompanyByIdEndpointReturnStatement",type:r.ReturnStatement,version:1,outputs:[lw,yw,Tw],calledByError:[],calledByEntry:[Ew],calledBySuccess:[],throws:null,x:0,y:0,parent:Rw},gw={id:"endpointBuiltInBaseEntityRefFour",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:OT},vw={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:r.FunctionDeclaration,inputs:[HB,zB,ew,iw],returnStatements:[bw],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:Fo,index:0,private:!1,x:0,y:0,parent:gw},Iw={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},Pw={id:"getCompanyByIdEndpointPathPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointPathProperty"},Dw={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:F,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,name:g.String,value:"/company/{id}",parent:Iw,valueAsType:null,autogeneration:null},parent:Pw},Aw={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},Sw={required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:Lo,dataType:Dw,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Aw},Ow={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:r.GenericReference,entityType:r.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},Cw={id:"getCompanyByIdEndpointMethodPropertyRef",type:r.GenericReference,entityType:r.Property,entityId:"getCompanyByIdEndpointMethodProperty"},Bw={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:En,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:r.PrimitiveValue,version:1,value:"GET",name:g.Enum,parent:Ow,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Cw},ww={id:"getCompanyByIdEndpointBaseEntityRefThree",type:r.GenericReference,entityType:r.BuiltInBaseEntity,entityId:w.HTTP_ENDPOINT},_w={required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:r.Property,private:!1,abstract:!1,static:!0,implements:Go,index:0,dataType:Bw,description:null,parent:ww},Mw={type:r.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:r.Project,entityId:q},Nw={type:r.CustomEntity,id:OT,version:1,name:"Get given company data by id",description:null,properties:[Sw,_w],methods:[vw],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[Sa],x:0,y:0,parent:Mw},$w={id:"product-prototype-database-property-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-id",entityType:r.Property},Vw={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:r.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:r.DataType},Lw={id:"product-prototype-database-property-data-type-id",version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Rn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.EntityTemplate,valueAsType:dl,autogeneration:null,parent:Vw},parent:$w},Gw={id:"product-prototype-database-property-parent-ref-id",type:r.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:r.CustomEntity},Fw={required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:r.Property,private:!1,abstract:!1,implements:mi,static:!0,index:0,dataType:Lw,description:"The database that the entity belongs to.",parent:Gw},Uw={type:r.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:r.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},xw={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Uw},jw={type:r.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:r.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},kw={required:!0,type:r.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,dataType:xw,abstract:!1,parent:jw},qw={type:r.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:r.Project,entityId:q},Jw={type:r.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Be],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[Fw,kw],methods:[],x:0,y:0,parent:qw},Li="project-loaded-event-id",Wt="get-bitcoin-price-http-call-operation-id",CT="get-bitcoin-price-http-call-response-body-id",os="validate-bitcoin-price-response-operation-ids",Ww={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:CT},Hw={type:r.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:r.Operation,entityId:os},BT={id:"validate-bitcoin-data-to-validate-input-map-id",type:r.InputMap,version:1,declaration:xn.fixedArguments[1],name:null,description:null,readsValue:Ww,defaultValue:null,dynamicArguments:[],index:0,parent:Hw},Yw={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},zw={type:r.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:r.Operation,entityId:os},Zw={id:"validate-bitcoin-type-to-match-input-map-id",type:r.InputMap,version:1,declaration:xn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:r.PrimitiveValue,version:1,name:g.EntityTemplate,valueAsType:yT,value:null,parent:Yw,autogeneration:null},dynamicArguments:[],index:0,parent:zw},Xw={type:r.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:r.Operation,entityId:os},Qw={id:"validate-bitcoin-validated-entity-output-map-id",type:r.OutputMap,version:1,declaration:xn.fixedReturns[0],writesValues:[],index:0,parent:Xw},Kw={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:r.GlobalEvent,entityId:Li},e_={type:r.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:r.Operation,entityId:Wt},t_={type:r.Operation,id:os,version:1,declaration:xn,inputs:[Zw,BT],outputs:[Qw],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[e_],parent:Kw},n_={type:r.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:r.FunctionCall,entityId:Wt},r_={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:r.InputMap,declaration:ba,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:n_},i_={type:r.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:r.FunctionCall,entityId:Wt},a_={type:r.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:r.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},s_={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:r.InputMap,declaration:ga,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:r.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:g.String,parent:a_,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:i_},o_={type:r.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:r.FunctionCall,entityId:Wt},l_={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:r.InputMap,declaration:va,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:o_},c_={type:r.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:r.FunctionCall,entityId:Wt},d_={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:r.InputMap,declaration:Ia,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:c_},u_={type:r.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:r.FunctionCall,entityId:Wt},p_={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:r.OutputMap,declaration:Pa,writesValues:[],index:1,parent:u_},y_={type:r.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:r.FunctionCall,entityId:Wt},h_={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:r.OutputMap,declaration:No,writesValues:[],index:0,parent:y_},f_={type:r.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:r.FunctionCall,entityId:Wt},m_={id:CT,type:r.OutputMap,version:1,declaration:yi,writesValues:[BT],index:2,parent:f_},T_={type:r.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:r.FunctionDeclaration,entityId:Wt},E_={type:r.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:r.GlobalEvent,entityId:Li},R_={type:r.Operation,id:Wt,version:1,declaration:hi,inputs:[r_,s_,l_,d_],outputs:[h_,p_,m_],process:null,parent:E_,calledByError:[],calledByEntry:[T_],calledBySuccess:[],dynamicArguments:[],successCalls:[t_],errorCalls:[],error:null,x:0,y:0},b_={type:r.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:r.GlobalEvent,entityId:Li},g_={type:r.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:r.GlobalEvent,entityId:Li},v_={process:null,type:r.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:fl,inputs:[],outputs:[],calledByError:[],calledByEntry:[b_],calledBySuccess:[],parent:g_,successCalls:[],errorCalls:[],error:null,x:0,y:0},I_={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:r.GenericReference,entityType:r.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},P_={type:r.GlobalEvent,id:Li,version:1,name:Kt.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:_a,parent:I_,inputs:[],calls:[v_,R_],x:0,y:0},Bt="abort-execution-func-declaration-id",Gi="abort-execution-func-exec-var-declaration-id",ls="abort-execution-func-small-wait-op-id",ml="abort-execution-func-long-wait-op-id",wT="abort-execution-func-long-wait-process-output-id",_T="abort-execution-func-exec-var-instance-write-id",MT="abort-execution-func-long-wait-return-stmt-id",NT="abort-execution-func-small-wait-return-stmt-id",D_="abort-execution-func-exec-var-instance-abort-call-id",Tl="abort-execution-func-exec-var-instance-abort-internal-call-id",$T="abort-execution-func-exec-second-wait-op-id",A_={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},S_={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},O_={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:S_},constant:!1,parent:A_},C_={type:r.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:NT},B_={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:O_,readsValue:null,required:!0,index:0,parent:C_},w_={type:r.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:ls},__={type:r.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},VT={type:r.ReturnStatement,id:NT,version:1,outputs:[B_],calledByError:[],calledByEntry:[],calledBySuccess:[w_],throws:null,x:0,y:0,parent:__},M_={type:r.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"second-wait-argument-map-id"},N_={type:r.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:$T},$_={id:"second-wait-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:M_},index:0,parent:N_},V_={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},L_={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.InternalCall,entityId:Tl},G_={id:$T,type:r.Operation,version:1,declaration:ot,inputs:[$_],dynamicArguments:[],outputs:[],process:null,successCalls:[VT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[L_],error:null,parent:V_},F_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:r.VariableInstance,entityId:_T},U_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:r.Operation,entityId:ls},x_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},j_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:Gi},k_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:r.InternalCall,entityId:Tl},q_={id:D_,type:r.VariableInstance,version:1,declaration:j_,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[k_],parent:x_},LT={id:Tl,type:r.InternalCall,version:1,inputs:[],outputs:[],declaration:ko,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[F_,U_],successCalls:[G_],errorCalls:[],error:null,index:0,parent:q_},J_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},W_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:Gi},H_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:Bt},Y_={type:r.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:Gi},z_={type:r.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:r.OutputMap,entityId:wT},El={id:_T,type:r.VariableInstance,version:1,declaration:Y_,inputs:[],outputs:[],calledByError:[],calledByEntry:[H_],calledBySuccess:[W_],successCalls:[LT],errorCalls:[],x:0,y:0,readsValue:z_,writesValues:[],internalCalls:[],parent:J_},Z_={type:r.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:Gi};r.GenericReference,r.DataType;const X_={id:"abort-exec-func-var-decl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:qo,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:Z_,defaultValue:null},Q_={type:r.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},K_={type:r.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},eM={id:Gi,type:r.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:X_,inputs:[],outputs:[],calledByError:[],calledByEntry:[K_],calledBySuccess:[],successCalls:[El],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:Q_},tM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},nM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:r.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},rM={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:nM},constant:!1,parent:tM},iM={type:r.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:r.ReturnStatement,entityId:MT},aM={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:rM,readsValue:null,required:!0,index:0,parent:iM},sM={type:r.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:ml},oM={type:r.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},GT={type:r.ReturnStatement,id:MT,version:1,outputs:[aM],calledByError:[],calledByEntry:[],calledBySuccess:[sM],throws:null,x:0,y:0,parent:oM},lM={type:r.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"long-argument-map-id"},FT={type:r.GenericReference,id:"long-argument-map-parent-ref-id",entityType:r.Operation,entityId:ml},cM={id:"long-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:r.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:g.Number,parent:lM},index:0,parent:FT},dM={type:r.GenericReference,id:"long-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},uM={type:r.GenericReference,id:"long-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},pM={id:wT,type:r.OutputMap,version:1,declaration:Wo,writesValues:[El],index:0,parent:FT},yM={id:ml,type:r.Operation,version:1,declaration:ot,inputs:[cM],dynamicArguments:[],outputs:[],process:pM,successCalls:[GT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[uM],calledBySuccess:[],error:null,parent:dM},hM={type:r.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"small-wait-argument-map-id"},fM={type:r.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:r.Operation,entityId:ls},mM={id:"small-wait-argument-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:r.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:g.Number,parent:hM},index:0,parent:fM},TM={type:r.GenericReference,id:"small-wait-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Bt},EM={type:r.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:Bt},RM={id:ls,type:r.Operation,version:1,declaration:ot,inputs:[mM],dynamicArguments:[],outputs:[],process:null,successCalls:[LT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[EM],calledBySuccess:[],error:null,parent:TM},bM={type:r.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:r.Project,entityId:q},UT={id:"abort-execution-func-decl-id",type:r.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[GT,VT],calls:[RM,eM,El,yM],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:bM},gM={type:r.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:r.Project,entityId:q},vM={id:"call-execution-abort-func-id",type:r.FunctionCall,version:1,declaration:UT,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:gM},Rl="manual-hello-world-loop-func-decl-id",xT="manual-hello-world-loop-func-return-statement-id",an="manual-hello-world-loop-id",Fi="manual-hello-world-loop-body-id",jT="manual-hello-world-loop-break-statement-id",cs="manual-hello-world-loop-current-iteration-number-output-map-id",bl="manual-hello-world-loop-previous-iterations-results-output-map-id",gl="assembled-hello-world-text-output-id",kT="assembled-hello-world-list-output-id",Ui="iteration-number-is-equal-or-greater-than-10-condition-id",ds="join-hello-world-and-number-operation-id",us="append-string-to-list-operation-id",qT="hello-world-loop-output-map-id",IM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:r.ReturnStatement,entityId:xT},PM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:r.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},DM={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PM},AM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:r.OutputMap,entityId:qT},JT={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:r.ReturnDeclaration,name:"Results",description:null,dataType:DM,readsValue:AM,required:!0,index:0,parent:IM},SM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:r.Loop,entityId:an},OM={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:r.FunctionDeclaration,entityId:Rl},WT={type:r.ReturnStatement,id:xT,version:1,outputs:[JT],calledByError:[],calledByEntry:[],calledBySuccess:[SM],parent:OM,throws:null,x:0,y:0},CM={type:r.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:r.BreakStatement,entityId:jT},BM={type:r.GenericReference,id:"hello-world-loop-break-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-break-statement-output-id"},wM={id:"hello-world-loop-break-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:BM},_M={type:r.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:gl},vl={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:wM,readsValue:_M,required:!0,index:0,parent:CM},MM={type:r.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:r.Condition,entityId:Ui},NM={type:r.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:r.Loop,entityId:an},HT={type:r.BreakStatement,id:jT,version:1,outputs:[vl],calledByError:[],calledByEntry:[],calledBySuccess:[MM],parent:NM,throws:null,x:0,y:0},$M={type:r.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:r.ContinueStatement,entityId:"hello-world-loop-continue-statement"},VM={type:r.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:r.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},LM={id:"hello-world-loop-continue-statement-output-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:VM},GM={type:r.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:r.OutputMap,entityId:gl},YT={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:r.ReturnDeclaration,name:"Iteration result",description:null,dataType:LM,readsValue:GM,required:!0,index:0,parent:$M},FM={type:r.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:r.Condition,entityId:Ui},UM={type:r.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:r.Loop,entityId:an},zT={type:r.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[YT],calledBySuccess:[],calledByError:[FM],calledByEntry:[],parent:UM,throws:null,x:0,y:0};r.GenericReference,r.InputMap;const xM={type:r.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:r.Operation,entityId:us},jM={type:r.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:r.OutputMap,entityId:bl},ZT={id:"append-string-to-list-base-string-map-id",type:r.InputMap,version:1,declaration:Ao,name:null,description:null,readsValue:jM,defaultValue:null,dynamicArguments:[],index:0,parent:xM},kM={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:us},qM={id:kT,type:r.OutputMap,version:1,writesValues:[vl],declaration:ui,index:0,parent:kM},JM={type:r.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:r.Condition,entityId:Ui},WM={type:r.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:kT},HM={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:us},XT={id:"latest-string-to-add-input-map-id",version:1,type:r.InputMap,declaration:So,name:null,description:null,readsValue:WM,dynamicArguments:[],defaultValue:null,index:1,parent:HM},YM={type:r.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:r.FunctionDeclaration,entityId:an},zM={type:r.Operation,id:us,declaration:Ra,version:1,inputs:[ZT,XT],outputs:[qM],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[JM],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:YM},ZM={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Fi},XM={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:r.Loop,entityId:an},QM={type:r.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:cs},QT={type:r.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:r.Condition,entityId:Ui},KM={id:"current-iteration-number-to-check-map-id",version:1,type:r.InputMap,declaration:Cr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:QM,index:1,defaultValue:null,parent:QT},eN={type:r.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:r.InputMap,entityId:"max-num-iterations-value-map-id"},tN={id:"max-num-iterations-value-map-id",version:1,type:r.InputMap,declaration:Cr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:r.PrimitiveValue,version:1,name:g.Number,value:10,autogeneration:null,valueAsType:null,parent:eN},parent:QT},nN={type:r.Condition,id:Ui,version:1,declaration:Cr,inputs:[tN,KM],calledByError:[],calledByEntry:[ZM],calledBySuccess:[],successCalls:[HT,zM],errorCalls:[zT],x:0,y:0,parent:XM},rN={type:r.GenericReference,id:"base-string-map-ref-id",entityType:r.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},iN={type:r.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:r.Operation,entityId:ds},aN={id:"join-hello-world-and-number-base-string-map-id",type:r.InputMap,version:1,declaration:Ta,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:r.PrimitiveValue,version:1,value:"Hello world ",name:g.String,parent:rN,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:iN},sN={type:r.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:r.Operation,entityId:ds},oN={id:gl,type:r.OutputMap,version:1,writesValues:[XT,YT],declaration:ui,index:0,parent:sN},lN={type:r.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Fi},cN={type:r.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:cs},dN={type:r.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:r.Operation,entityId:ds},KT={id:"current-iteration-number-input-map-id",version:1,type:r.InputMap,declaration:Ea,name:null,description:null,readsValue:cN,dynamicArguments:[],defaultValue:null,index:1,parent:dN},uN={type:r.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:r.FunctionDeclaration,entityId:an},pN={type:r.Operation,id:ds,declaration:pi,version:1,inputs:[aN,KT],outputs:[oN],process:null,calledByError:[],calledByEntry:[lN],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:uN},yN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:bl,entityType:r.ArgumentDeclaration},hN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:yN},fN={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:r.GenericReference,entityId:Fi,entityType:r.FunctionDeclaration},mN={id:bl,type:r.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:hN,writesValues:[ZT],index:1,parent:fN},TN={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:r.GenericReference,entityId:Fi,entityType:r.FunctionDeclaration},EN={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:r.GenericReference,entityId:cs,entityType:r.ArgumentDeclaration};r.DataType;const RN={id:cs,type:r.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[KT],index:0,parent:TN},bN={id:"manual-flow-loop-body-parent-ref-id",type:r.GenericReference,entityId:an,entityType:r.Loop},gN={id:Fi,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[RN,mN],calls:[nN,pN],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:bN},vN={type:r.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:r.Loop,entityId:an},IN={type:r.OutputMap,id:qT,version:1,declaration:vl,writesValues:[JT],index:0,parent:vN},PN={id:"manual-hello-world-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},DN={id:"manual-hello-world-loop-called-by-ref-id",type:r.GenericReference,entityId:Rl,entityType:r.FunctionDeclaration},AN={id:an,type:r.Loop,version:1,declaration:Vo,inputs:[],outputs:[IN],body:gN,successCalls:[WT],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[DN],calledBySuccess:[],breakStatements:[HT],continueStatements:[zT],x:0,y:0,parent:PN},SN={type:r.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},eE={type:r.FunctionDeclaration,id:Rl,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[AN],returnStatements:[WT],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:SN},ON={type:r.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:r.Project,entityId:q},CN={id:"call-hello-world-loop-id",type:r.FunctionCall,version:1,declaration:eE,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:ON},sn="company-dto-function-declaration-id",Il="company-dto-func-declaration-argument-dcl-id",Ht="company-dto-function-company-variable-id",On="company-dto-function-company-dto-variable-id",Gr="iterate-over-employee-list-loop-id",tE="iterate-over-employee-list-loop-employee-dto-output-map-id",Pl="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",xi="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",nE="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",BN="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",rE="iterate-over-employee-list-continue-statement-id",ps="iterate-over-employee-list-loop-body-id",iE="company-dto-func-declaration-return-statement-id",aE="company-dto-func-declaration-return-decl-id",sE="company-dto-func-declaration-company-variable-id-output-map-id",oE="company-dto-func-declaration-company-variable-employess-output-map-id",lE="company-dto-func-declaration-company-variable-name-output-map-id",wN="company-dto-func-declaration-company-dto-variable-input-map-id",_N="company-dto-func-declaration-company-dto-variable-employess-input-map-id",MN="company-dto-func-declaration-company-dto-variable-name-input-map-id",ys="company-dto-func-declaration-owner-variable-id",NN="company-dto-func-declaration-company-dto-variable-owner-input-map-id",cE="company-dto-func-declaration-company-variable-owner-output-map-id",dE="company-dto-func-declaration-owner-variable-id-output-map-id",hs="company-dto-func-declaration-bank-account-variable-id",$N="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",uE="company-dto-func-declaration-company-variable-bank-account-output-map-id",pE="company-dto-func-declaration-bank-account-variable-id-output-map-id",VN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:aE},LN={id:"company-dto-func-returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:VN},GN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:iE},FN={type:r.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:On},yE={isError:!1,id:aE,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:LN,readsValue:FN,required:!0,index:0,parent:GN},UN={type:r.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:On},xN={type:r.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},Dl={type:r.ReturnStatement,id:iE,version:1,outputs:[yE],calledByError:[],calledByEntry:[],calledBySuccess:[UN],throws:null,x:0,y:0,parent:xN},jN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:dE},kN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:On},hE={id:NN,type:r.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:jN,parent:kN},qN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:pE},JN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:On},fE={id:$N,type:r.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:qN,parent:JN},WN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:lE},HN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:On},mE={id:MN,type:r.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:WN,parent:HN},YN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:tE},zN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:On},TE={id:_N,type:r.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:YN,parent:zN},ZN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:sE},XN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:On},EE={id:wN,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:ZN,parent:XN},QN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},KN={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:r.VariableDeclaration,entityId:hs},e0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:r.VariableDeclaration,entityId:ys},t0={type:r.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:r.VariableDeclaration,entityId:Gr},Al={id:On,type:r.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[KN,e0,t0],successCalls:[Dl],errorCalls:[],readsValue:null,writesValues:[yE],inputs:[EE,mE,fE,hE,TE],outputs:[],internalCalls:[],parent:QN,x:0,y:0},Yn="employee-dto-func-declaration-id",Sl="employee-dto-func-declaration-argument-dcl-id",RE="employee-dto-func-declaration-return-statement-id",bE="employee-dto-func-declaration-return-decl-id",zn="employee-dto-func-declaration-employee-variable-id",Zn="employee-dto-func-declaration-employee-dto-variable-id",fs="employee-dto-func-declaration-manager-variable-id",gE="employee-dto-func-declaration-employee-variable-id-output-map-id",vE="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",IE="employee-dto-func-declaration-employee-variable-department-output-map-id",PE="employee-dto-func-declaration-employee-variable-manager-output-map-id",DE="employee-dto-func-declaration-manager-variable-id-output-map-id",n0="employee-dto-func-declaration-employee-dto-variable-input-map-id",r0="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",i0="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",a0="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",s0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:bE},o0={id:"employee-dto-func-returned-employee-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:s0},l0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:RE},c0={type:r.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:Zn},AE={isError:!1,id:bE,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:o0,readsValue:c0,required:!0,index:0,parent:l0},d0={type:r.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:r.Operation,entityId:Zn},u0={type:r.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Yn},Ol={type:r.ReturnStatement,id:RE,version:1,outputs:[AE],calledByError:[],calledByEntry:[],calledBySuccess:[d0],throws:null,x:0,y:0,parent:u0},p0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:DE},y0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},SE={id:a0,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:p0,parent:y0},h0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:IE},f0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},OE={id:i0,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:h0,parent:f0},m0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:vE},T0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},CE={id:r0,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:m0,parent:T0},E0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:gE},R0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Zn},BE={id:n0,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:E0,parent:R0},b0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Yn},g0={type:r.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:fs},v0={id:Zn,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[g0],successCalls:[Ol],errorCalls:[],readsValue:null,writesValues:[AE],inputs:[BE,CE,OE,SE],outputs:[],internalCalls:[],parent:b0,x:0,y:0},I0={type:r.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:fs},P0={id:DE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[SE],parent:I0},D0={type:r.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:fs},A0={id:"employee-dto-func-manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:D0,defaultValue:null},S0={type:r.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:PE},O0={type:r.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Yn};r.GenericReference,r.VariableDeclaration;const wE={id:fs,type:r.VariableDeclaration,version:1,name:"Manager",dataType:A0,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[v0],errorCalls:[],readsValue:S0,writesValues:[],inputs:[],outputs:[P0],internalCalls:[],parent:O0,x:0,y:0},C0={type:r.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:zn},B0={id:PE,type:r.OutputMap,version:1,declaration:It.properties[2],index:3,writesValues:[wE],parent:C0},w0={type:r.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:zn},_0={id:IE,type:r.OutputMap,version:1,declaration:It.properties[0],index:2,writesValues:[OE],parent:w0},M0={type:r.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:zn},N0={id:vE,type:r.OutputMap,version:1,declaration:ct.properties[1],index:1,writesValues:[CE],parent:M0},$0={type:r.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:zn},V0={id:gE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[BE],parent:$0},L0={type:r.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:zn},G0={id:"employee-dto-func-employee-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:L0,defaultValue:null},F0={type:r.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Yn},U0={type:r.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Sl},x0={type:r.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:Yn},_E={id:zn,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:G0,description:"A variable holding a company employee",calledByError:[],calledByEntry:[x0],calledBySuccess:[],successCalls:[wE],errorCalls:[],readsValue:U0,writesValues:[],inputs:[],outputs:[V0,N0,_0,B0],internalCalls:[],parent:F0,x:0,y:0},j0={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Sl,entityType:r.ArgumentDeclaration},k0={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:It,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:j0,defaultValue:null},q0={type:r.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:Yn,entityType:r.FunctionDeclaration},J0={type:r.ArgumentDeclaration,id:Sl,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:k0,index:0,writesValues:[_E],parent:q0},W0={type:r.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},Cl={type:r.FunctionDeclaration,id:Yn,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[J0],calls:[_E],implements:null,returnStatements:[Ol],collapsed:!1,private:!1,x:0,y:0,parent:W0},H0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:nE,entityType:r.ReturnDeclaration},Y0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:It,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:H0},z0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:r.GenericReference,entityId:xi,entityType:r.OutputMap},Z0={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:r.GenericReference,entityId:rE,entityType:r.ContinueStatement},ME={isError:!1,id:nE,type:r.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:z0,dataType:Y0,required:!0,index:0,parent:Z0},X0={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:r.GenericReference,entityId:xi,entityType:r.FunctionCall},Q0={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:r.GenericReference,entityId:Gr,entityType:r.Loop},NE={id:rE,type:r.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[X0],outputs:[ME],throws:null,x:0,y:0,parent:Q0},K0={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:xi,entityType:r.FunctionCall},e1={id:BN,type:r.OutputMap,version:1,declaration:Ol.outputs[0],writesValues:[ME],index:0,parent:K0},t1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:r.GenericReference,entityId:Pl,entityType:r.ArgumentDeclaration},n1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:r.GenericReference,entityId:xi,entityType:r.FunctionCall},$E={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:Cl.inputs[0],readsValue:t1,index:0,defaultValue:null,dynamicArguments:[],parent:n1},r1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:r.GenericReference,entityId:ps,entityType:r.FunctionDeclaration},i1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:r.GenericReference,entityId:ps,entityType:r.FunctionDeclaration},a1={id:xi,type:r.FunctionCall,version:1,declaration:Cl,inputs:[$E],process:null,outputs:[e1],calledByError:[],calledByEntry:[r1],calledBySuccess:[],successCalls:[NE],errorCalls:[],error:null,x:0,y:0,parent:i1},s1={type:r.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Pl,entityType:r.ArgumentDeclaration},o1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:It,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:s1},l1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:ps,entityType:r.FunctionDeclaration},c1={id:Pl,type:r.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:o1,required:!0,index:0,writesValues:[$E],parent:l1},d1={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:Gr,entityType:r.Loop},u1={id:ps,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[c1],calls:[a1],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:d1},p1={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:Gr,entityType:r.Loop},y1={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:r.GenericReference,entityId:oE,entityType:r.OutputMap},VE={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:jn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:y1,index:0,parent:p1},h1={id:"iterate-over-employee-list-loop-parent-ref-id",type:r.GenericReference,entityId:sn,entityType:r.FunctionDeclaration},f1={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:r.GenericReference,entityId:Gr,entityType:r.Loop},m1={id:tE,type:r.OutputMap,version:1,declaration:jn.fixedReturns[0],writesValues:[TE],index:0,parent:f1},T1={type:r.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:r.VariableDeclaration,entityId:Ht},E1={id:Gr,type:r.Loop,version:1,declaration:jn,inputs:[VE],successCalls:[Al],errorCalls:[],outputs:[m1],body:u1,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[T1],breakStatements:[],continueStatements:[NE],error:null,x:0,y:0,parent:h1},R1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:hs},b1={id:pE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[fE],parent:R1},g1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:hs},v1={id:"company-dto-func-bank-account-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:g1,defaultValue:null},I1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:uE},P1={type:r.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn};r.GenericReference,r.VariableDeclaration;const LE={id:hs,type:r.VariableDeclaration,version:1,name:"Bank account",dataType:v1,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Al],errorCalls:[],readsValue:I1,writesValues:[],inputs:[],outputs:[b1],internalCalls:[],parent:P1,x:0,y:0},D1={type:r.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:ys},A1={id:dE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[hE],parent:D1},S1={type:r.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:ys},O1={id:"company-dto-func-owner-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:S1,defaultValue:null},C1={type:r.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:cE},B1={type:r.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn};r.GenericReference,r.VariableDeclaration;const GE={id:ys,type:r.VariableDeclaration,version:1,name:"Owner",dataType:O1,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Al],errorCalls:[],readsValue:C1,writesValues:[],inputs:[],outputs:[A1],internalCalls:[],parent:B1,x:0,y:0},w1={type:r.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},_1={id:cE,type:r.OutputMap,version:1,declaration:mt.properties[2],index:4,writesValues:[GE],parent:w1},M1={type:r.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},N1={id:uE,type:r.OutputMap,version:1,declaration:mt.properties[2],index:3,writesValues:[LE],parent:M1},$1={type:r.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},V1={id:lE,type:r.OutputMap,version:1,declaration:mt.properties[0],index:2,writesValues:[mE],parent:$1},L1={type:r.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},G1={id:oE,type:r.OutputMap,version:1,declaration:mt.properties[3],index:1,writesValues:[VE],parent:L1},F1={type:r.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},U1={id:sE,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[EE],parent:F1},x1={type:r.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ht},j1={id:"company-dto-func-company-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:x1,defaultValue:null},k1={type:r.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:sn},q1={type:r.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Il},J1={type:r.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:r.FunctionDeclaration,entityId:sn},FE={id:Ht,type:r.VariableDeclaration,version:1,name:"Company",dataType:j1,description:"A variable holding a company",calledByError:[],calledByEntry:[J1],calledBySuccess:[],successCalls:[LE,GE,E1],errorCalls:[],readsValue:q1,writesValues:[],inputs:[],outputs:[U1,G1,V1,N1,_1],internalCalls:[],parent:k1,x:0,y:0},W1={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:Il,entityType:r.ArgumentDeclaration},H1={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:W1,defaultValue:null},Y1={type:r.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:sn,entityType:r.FunctionDeclaration},z1={type:r.ArgumentDeclaration,id:Il,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:H1,index:0,writesValues:[FE],parent:Y1},Z1={type:r.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:r.Project,entityId:q},Bl={type:r.FunctionDeclaration,id:sn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[z1],calls:[FE],implements:null,index:null,returnStatements:[Dl],collapsed:!1,private:!1,x:0,y:0,parent:Z1},ji="exec-in-parallel-operation-call-id",ki="exec-sequentially-operation-call-id",dt="concurrency-and-wait-function-declaration-id",UE="concurrency-and-wait-return-statement-id",xE="concurrency-and-wait-return-declaration-id",wl="exec-in-parallel-argument-map-id",jE="exec-sequentially-argument-map-id",_l="wait-for-2-seconds-operation-id",kE="wait-for-2-seconds-argument-map-id",Ml="map-company-dto-function-call-id",qE="map-company-dto-function-call-company-dto-output-map-id",qi="company-dto-variable-one-id",Nl="company-dto-variable-one-instance-id",X1="company-dto-variable-two-id",Q1={type:r.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:xE},K1={id:"returned-company-dto-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Q1},e$={type:r.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:r.ReturnStatement,entityId:UE},t$={type:r.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:qi},JE={isError:!1,id:xE,type:r.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:K1,readsValue:t$,required:!0,index:0,parent:e$},n$={type:r.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:r.Operation,entityId:_l},r$={type:r.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},WE={type:r.ReturnStatement,id:UE,version:1,outputs:[JE],calledByError:[],calledByEntry:[],calledBySuccess:[n$],throws:null,x:0,y:0,parent:r$},i$={type:r.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:r.VariableInstance,entityId:Nl},a$={type:r.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:r.VariableInstance,entityId:Nl},s$={type:r.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},HE={id:X1,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[i$],internalCalls:[],writesValues:[JE],readsValue:a$,x:0,y:0,parent:s$},o$={type:r.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:r.VariableDeclaration,entityId:qi},l$={type:r.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:r.VariableDeclaration,entityId:qi},c$={type:r.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},d$={type:r.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:qi},YE={id:Nl,type:r.VariableInstance,version:1,declaration:d$,inputs:[],outputs:[],successCalls:[HE],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[o$],internalCalls:[],writesValues:[HE],readsValue:l$,x:0,y:0,parent:c$},u$={type:r.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:r.FunctionCall,entityId:Ml},p$={type:r.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:r.OutputMap,entityId:qE},y$={type:r.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},zE={id:qi,type:r.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[YE],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[u$],internalCalls:[],writesValues:[YE],readsValue:p$,x:0,y:0,parent:y$},ZE={type:r.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:r.FunctionCall,entityId:Ml},h$={id:"map-company-dto-function-call-company-input-map-id",type:r.InputMap,version:1,declaration:Bl.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:ZE},f$={id:qE,type:r.OutputMap,version:1,declaration:Dl.outputs[0],writesValues:[zE],index:0,parent:ZE},m$={id:"map-company-dto-function-call-called-by-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:dt},T$={id:"map-company-dto-function-call-parent-ref-id",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:dt},E$={id:Ml,type:r.FunctionCall,version:1,declaration:Bl,successCalls:[zE],process:null,errorCalls:[],inputs:[h$],outputs:[f$],calledByError:[],calledByEntry:[m$],calledBySuccess:[],parent:T$,x:0,y:0,error:null},R$={type:r.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:Wm},b$={type:r.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:r.DataType,entityId:"last-timestamp-variable-datatype-id"},g$={id:"last-timestamp-variable-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Ar,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:R$,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,name:g.Date,value:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:b$,valueAsType:null}},v$={type:r.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:r.Project,entityId:q},$l={id:Wm,type:r.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:g$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:v$},I$={type:r.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:kE},P$={type:r.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:r.Operation,entityId:_l},D$={id:kE,type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:r.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:g.Number,parent:I$},index:0,parent:P$},A$={type:r.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},S$={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:r.FunctionDeclaration,entityId:ki},O$={type:r.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:r.FunctionDeclaration,entityId:ji},XE={id:_l,type:r.Operation,version:1,declaration:$t,inputs:[D$],dynamicArguments:[],outputs:[],process:null,successCalls:[WE],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[S$,O$],calledBySuccess:[],error:null,parent:A$},C$={type:r.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:r.InputMap,entityId:"wait-for-random-amount-input-map-id"},B$={type:r.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:r.Operation,entityId:"wait-for-random-amount-id"},w$={id:"wait-for-random-amount-input-map-id",type:r.InputMap,version:1,declaration:Un,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:r.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:xe.Random,rangeStart:1e3,rangeEnd:4e3},name:g.Number,parent:C$},index:0,parent:B$},_$={type:r.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:r.Project,entityId:q},Fr={id:"wait-for-random-amount-id",type:r.Operation,version:1,declaration:$t,inputs:[w$],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:_$},QE="list-of-functions-variable-id",M$={type:r.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:QE},N$={id:"list-of-functions-variable-action-descriptor-id",type:r.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:L.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:L.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},$$={type:r.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:r.DataType,entityId:"list-of-functions-variable-data-type-id"},V$={id:"list-of-functions-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:N$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:r.PrimitiveValue,version:1,name:g.ActionDescriptor,value:null,valueAsType:[Fr,Fr,Fr,Fr,Fr],autogeneration:null,parent:$$},constant:!1,parent:M$},L$={type:r.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt};r.GenericReference,r.InputMap;const G$={type:r.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:r.InputMap,entityId:jE},F$={type:r.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:r.InputMap,entityId:wl},KE={id:QE,type:r.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:V$,parent:L$,readsValue:null,writesValues:[G$,F$],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},U$={type:r.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:r.Operation,entityId:ji},x$={type:r.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},j$={type:r.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-in-parallel-return-map-id"},k$={type:r.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:r.Operation,entityId:ji},eR={id:"exec-in-parallel-result-variable-id",type:r.VariableInstance,version:1,declaration:$l,readsValue:j$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[k$],successCalls:[],errorCalls:[],internalCalls:[],parent:x$,x:0,y:0},q$={id:"exec-in-parallel-return-map-id",type:r.OutputMap,version:1,declaration:Co,writesValues:[eR],index:0,parent:U$},J$={type:r.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:r.Operation,entityId:ji},W$={id:wl,type:r.InputMap,version:1,declaration:Oo,name:null,description:null,dynamicArguments:[],readsValue:KE,defaultValue:null,index:0,parent:J$},H$={type:r.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},Y$={type:r.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:dt},z$={process:null,id:ji,type:r.Operation,version:1,declaration:$t,inputs:[W$],dynamicArguments:[],outputs:[q$],successCalls:[XE,eR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[Y$],calledBySuccess:[],error:null,parent:H$},Z$={type:r.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:r.Operation,entityId:ki},X$={type:r.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},Q$={type:r.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:"exec-sequentially-return-map-id"},K$={type:r.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:r.Operation,entityId:ki},tR={id:"exec-sequentially-result-variable-id",type:r.VariableInstance,version:1,declaration:$l,readsValue:Q$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[K$],successCalls:[],errorCalls:[],internalCalls:[],parent:X$,x:0,y:0},eV={id:"exec-sequentially-return-map-id",type:r.OutputMap,version:1,declaration:wo,writesValues:[tR],index:0,parent:Z$},tV={type:r.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:r.Operation,entityId:ki},nV={id:jE,type:r.InputMap,version:1,declaration:Bo,name:null,description:null,dynamicArguments:[],readsValue:KE,defaultValue:null,index:0,parent:tV},rV={type:r.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:r.FunctionDeclaration,entityId:dt},iV={type:r.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:dt},aV={id:ki,type:r.Operation,version:1,declaration:tn,inputs:[nV],process:null,dynamicArguments:[],outputs:[eV],successCalls:[XE,tR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[iV],calledBySuccess:[],error:null,parent:rV},sV={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},oV={type:r.FunctionDeclaration,id:dt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[aV,z$,E$],returnStatements:[WE],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:sV},lV={type:r.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:r.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},cV={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:mt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:lV},dV={type:r.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:r.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},uV={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:r.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:cV,readsValue:null,required:!0,index:0,parent:dV},pV={type:r.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},yV={type:r.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:r.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},nR={type:r.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[uV],calledByError:[],calledByEntry:[yV],calledBySuccess:[],throws:null,x:0,y:0,parent:pV},hV={type:r.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:r.Project,entityId:q},fV={type:r.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[nR],index:null,implements:null,returnStatements:[nR],collapsed:!1,private:!1,x:0,y:0,parent:hV},Vl="get-current-date-and-time-func-decl-id",rR="get-current-date-and-time-return-statement-id",iR="get-current-date-and-time-return-declaration-id",aR="get-current-date-and-time-return-declaration-data-type-id",mV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:r.DataType,entityId:aR},TV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:r.ReturnDeclaration,entityId:iR},EV={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:aR,version:1,entity:Ar,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:r.PrimitiveValue,version:1,value:null,name:g.Date,valueAsType:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:mV},constant:!1,parent:TV},RV={type:r.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:r.ReturnStatement,entityId:rR};r.ReturnDeclaration;const bV={type:r.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Vl},gV={type:r.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Vl};r.ReturnStatement;const vV={type:r.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:r.Project,entityId:q},IV={type:r.FunctionDeclaration,id:Vl,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:vV},sR="do-math-return-statement-id",oR="do-math-return-declaration-id",PV={type:r.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:r.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},DV={id:"do-math-func-var-to-return-one-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PV},AV={type:r.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},SV={type:r.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:r.ReturnDeclaration,entityId:oR},OV={type:r.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:DV,readsValue:null,writesValues:[SV],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:AV},CV={type:r.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:r.ReturnStatement,entityId:sR},BV={type:r.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:r.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},wV={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:BV},_V={isError:!1,id:oR,version:1,type:r.ReturnDeclaration,name:"Result",description:null,dataType:wV,readsValue:OV,required:!0,index:0,parent:CV},MV={type:r.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},NV={type:r.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},lR={type:r.ReturnStatement,id:sR,version:1,outputs:[_V],calledByError:[],calledByEntry:[],calledBySuccess:[MV],parent:NV,throws:null,x:0,y:0},$V={type:r.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:r.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},VV={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$V},LV={type:r.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},GV={type:r.GenericReference,id:"do-math-func-return-one-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},FV={type:r.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},cR={type:r.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:VV,description:null,readsValue:FV,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[GV],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:LV},UV={type:r.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},xV={type:r.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:r.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},jV={type:r.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:r.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},kV={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jV},qV={type:r.GenericReference,id:"do-math-func-return-two-called-by",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},dR={type:r.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[qV],successCalls:[],errorCalls:[],dataType:kV,readsValue:xV,writesValues:[],internalCalls:[],parent:UV,x:0,y:0},uR={type:r.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},JV={type:r.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},WV={type:r.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},HV={type:r.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:r.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},pR={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:r.InputMap,declaration:Ro,name:null,description:null,dynamicArguments:[],readsValue:HV,defaultValue:null,index:0,parent:WV},YV={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:r.OutputMap,version:1,declaration:go,writesValues:[cR,dR],index:0,parent:JV},zV={type:r.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:r.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},ZV={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:r.GenericReference,entityType:r.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},yR={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:r.InputMap,declaration:bo,name:null,description:null,dynamicArguments:[],readsValue:ZV,defaultValue:null,index:1,parent:zV},XV={type:r.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:ma,version:1,inputs:[pR,yR],dynamicArguments:[],outputs:[YV],calledByError:[],calledByEntry:[uR],calledBySuccess:[],process:null,successCalls:[lR,cR,dR],errorCalls:[],parent:uR,error:null,x:0,y:0},QV={type:r.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:r.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},KV={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:r.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:r.ArgumentDeclaration},hR={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:r.PrimitiveValue,version:1,value:1,name:g.Number,parent:QV,valueAsType:null,autogeneration:null},constant:!1,parent:KV},eL={type:r.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:r.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},tL={type:r.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},nL={type:r.GenericReference,id:"do-math-func-var-called-by-ref",entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},fR={type:r.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:hR,inputs:[],outputs:[],calledByError:[],calledByEntry:[nL],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:eL,writesValues:[yR],internalCalls:[],x:0,y:0,parent:tL},rL={entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:r.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},iL={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:r.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:hR,writesValues:[fR],required:!0,index:1,parent:rL},aL={type:r.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:r.Project,entityId:q},sL={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},oL={type:r.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:r.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},lL={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:r.ArgumentDeclaration},cL={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:r.PrimitiveValue,version:1,value:5,name:g.Number,parent:oL,valueAsType:null,autogeneration:null},constant:!1,parent:lL},dL={id:"d8895765-f705-457e-85fa-25d130926769",type:r.ArgumentDeclaration,version:1,name:"N",dataType:cL,description:"The number to add",writesValues:[pR],required:!0,index:0,parent:sL},uL={type:r.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[dL,iL],calls:[XV,fR],implements:null,index:null,collapsed:!1,returnStatements:[lR],private:!1,x:0,y:0,parent:aL},Pt="replace-bank-account-in-company-func-declaration-id",Ll="company-entity-to-modify-arg-declaration-id",pL="account-number-to-create-arg-decl-id",Ur="company-variable-id",xr="search-person-by-id-id",mR="new-bank-account-owner-arg-decl-id",TR="search-person-by-id-output-declaration-id",Gl="search-person-by-id-output-entity-map-id",ms="person-not-empty-condition-id",Ts="create-new-bank-account-instance-operation-id",ER="create-new-bank-account-instance-operation-output-entity-map-id",RR="company-bank-account-output-map-id",bR="old-bank-account-var-declaration-id",gR="company-variable-instance-id",yL="delete-bank-account-internal-call-id",hL={type:r.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},fL={type:r.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:r.InternalCall,entityId:yL},mL={type:r.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:r.VariableDeclaration,entityId:Ur},TL={type:r.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:r.VariableInstance,entityId:gR},EL={type:r.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:ER},vR={type:r.InputMap,id:"bank-account-input-map-id",version:1,readsValue:EL,declaration:hl,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:TL},RL={type:r.VariableInstance,id:gR,version:1,declaration:mL,inputs:[vR],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[fL],successCalls:[],errorCalls:[],internalCalls:[],parent:hL,readsValue:null,writesValues:[],x:0,y:0},bL={type:r.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ur},gL={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:Vr,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:bL},vL={type:r.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:RR},IL={type:r.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},PL={type:r.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:r.VariableDeclaration,entityId:Ur},DL={type:r.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:r.Operation,entityId:Ts},AL={type:r.GenericReference,id:"delete-bank-account-internal-call-parent-ref-id",entityType:r.VariableDeclaration,entityId:bR},IR={process:null,type:r.InternalCall,id:"delete-bank-account-internal-call-id",version:1,declaration:Uo,index:0,successCalls:[RL],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[DL],parent:AL},PR={type:r.VariableDeclaration,id:bR,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:gL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[PL],successCalls:[],internalCalls:[IR],errorCalls:[],parent:IL,readsValue:vL,writesValues:[],x:0,y:0},SL={type:r.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ur},OL={type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:mt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:SL},CL={type:r.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:r.ArgumentDeclaration,entityId:Ll},BL={type:r.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},wL={type:r.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},_L={type:r.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:Ur},ML={id:RR,version:1,type:r.OutputMap,declaration:hl,index:0,parent:_L,writesValues:[PR]},DR={type:r.VariableDeclaration,id:Ur,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:OL,inputs:[],outputs:[ML],calledByError:[],calledByEntry:[wL],calledBySuccess:[],successCalls:[PR],errorCalls:[],parent:BL,internalCalls:[],readsValue:CL,writesValues:[],x:0,y:0},NL={type:r.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},$L={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.OutputMap,entityId:Gl},AR={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:r.InputMap,declaration:Km,name:null,description:null,dynamicArguments:[],readsValue:$L,index:1,defaultValue:null,parent:NL},VL={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:r.GenericReference,entityType:r.ArgumentDeclaration,entityId:pL},LL={type:r.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:r.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},SR={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:r.InputMap,declaration:Qm,name:null,description:null,dynamicArguments:[],readsValue:VL,defaultValue:null,index:0,parent:LL},GL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:r.Operation,entityId:Ts},FL={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:r.InputMap,declaration:Sr.fixedArguments[0],name:null,description:null,dynamicArguments:[SR,AR],index:0,readsValue:null,defaultValue:{type:r.PrimitiveValue,name:g.EntityTemplate,value:null,valueAsType:Vr,autogeneration:null},parent:GL},UL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:r.Operation,entityId:Ts},xL={id:ER,version:1,type:r.OutputMap,declaration:Sr.fixedReturns[0],index:0,writesValues:[vR],parent:UL},jL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:r.Condition,entityId:ms},kL={type:r.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},qL={process:null,id:Ts,type:r.Operation,version:1,declaration:Sr,inputs:[FL],dynamicArguments:[],error:null,outputs:[xL],successCalls:[IR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[jL],parent:kL,x:0,y:0},JL={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:r.DataType},WL={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:r.ReturnDeclaration};r.DataType,r.PrimitiveValue,g.String;const HL={id:"person-not-found-thrown-error-parent-ref-id",type:r.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:r.ReturnStatement},YL={isError:!0,id:"person-not-found-thrown-error-id",type:r.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:HL,required:!0,index:0,readsValue:null},zL={id:"person-not-found-error-return-statement-called-by-ref-id",type:r.GenericReference,entityId:ms,entityType:r.Condition},ZL={id:"person-not-found-error-return-statement-parent-ref-id",type:r.GenericReference,entityId:Pt,entityType:r.FunctionDeclaration},XL={id:"person-not-found-error-return-statement-id",type:r.ReturnStatement,version:1,throws:YL,outputs:[],calledBySuccess:[],calledByError:[zL],calledByEntry:[],x:0,y:0,parent:ZL},QL={type:r.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:r.Search,entityId:xr},KL={type:r.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},eG={type:r.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:r.OutputMap,entityId:Gl},tG={type:r.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:r.Condition,entityId:ms},OR={id:"person-entity-to-check-map-id",version:1,type:r.InputMap,declaration:kn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:eG,index:0,defaultValue:null,parent:tG},nG={type:r.Condition,id:ms,version:1,declaration:kn,inputs:[OR],calledByError:[],calledByEntry:[],calledBySuccess:[QL],successCalls:[qL],errorCalls:[XL],x:0,y:0,parent:KL},rG={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:r.ReturnDeclaration,entityId:TR},iG={id:"search-person-by-id-output-entity-declaration-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:ct,defaultValue:null,parent:rG},aG={type:r.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:r.Search,entityId:xr},CR={isError:!1,id:TR,type:r.ReturnDeclaration,version:1,dataType:iG,name:"Found person",description:"The person entity that was found",parent:aG,required:!0,index:0,readsValue:null},sG={type:r.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:r.Search,entityId:xr},oG={type:r.OutputMap,id:Gl,version:1,declaration:CR,parent:sG,writesValues:[OR,AR],index:0},lG={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:r.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:r.ArgumentDeclaration};r.DataType;const cG={type:r.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:r.Search,entityId:xr},BR={id:"search-person-by-id-input-declaration-id",type:r.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:cG,writesValues:[]},dG={type:r.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:r.Search,entityId:xr},uG={id:"search-person-by-id-input-map-reads-value-ref-id",type:r.GenericReference,entityId:mR,entityType:r.ArgumentDeclaration},wR={type:r.InputMap,id:"search-person-by-id-input-map",version:1,declaration:BR,name:null,description:null,readsValue:uG,defaultValue:null,parent:dG,dynamicArguments:[],index:0},pG={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},yG={type:r.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},hG={type:r.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:r.FunctionDeclaration,entityId:Pt},fG={type:r.Search,id:xr,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:pG,inputsDeclarations:[BR],inputs:[wR],outputsDeclarations:[CR],outputs:[oG],calledByError:[],calledByEntry:[hG],calledBySuccess:[],error:null,successCalls:[nG],errorCalls:[],parent:yG,x:0,y:0};r.GenericReference,r.DataType;const mG={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:r.ArgumentDeclaration},TG={id:"account-number-to-create-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:F,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:mG},EG={entityType:r.FunctionDeclaration,entityId:Pt,type:r.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},RG={id:"account-number-to-create-arg-decl-id",type:r.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:TG,writesValues:[SR],required:!0,index:1,parent:EG};r.GenericReference,r.DataType;const bG={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:r.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:r.ArgumentDeclaration},gG={id:"new-bank-account-owner-arg-decl-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:fa,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:bG},vG={entityType:r.FunctionDeclaration,entityId:Pt,type:r.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},IG={id:mR,type:r.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",dataType:gG,writesValues:[wR],required:!1,index:1,parent:vG},PG={type:r.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:r.Project,entityId:q},DG={type:r.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:r.FunctionDeclaration,entityId:Pt};r.GenericReference,r.DataType;const AG={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:r.GenericReference,entityId:Ll,entityType:r.ArgumentDeclaration},SG={id:"company-entity-to-modify-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ce,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:AG},OG={id:Ll,type:r.ArgumentDeclaration,version:1,name:"Company",dataType:SG,description:"The company to replace the bank account for",writesValues:[DR],required:!0,index:0,parent:DG},CG={type:r.FunctionDeclaration,id:Pt,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[OG,RG,IG],index:null,implements:null,calls:[fG,DR],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:PG},BG={type:r.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},wG={type:r.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:BG,x:0,y:0},_G={type:r.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:r.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},MG={type:r.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:r.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},NG={type:r.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[wG],events:[],implements:MG,parent:_G,x:0,y:0},Fl="iterate-over-list-loop-id",_R="iterate-over-list-loop-body-id",MR="iterate-over-list-loop-body-current-iteration-argument-declaration-id",$G={type:r.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:MR,entityType:r.ArgumentDeclaration},VG={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:$G},LG={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:r.GenericReference,entityId:_R,entityType:r.FunctionDeclaration},GG={id:MR,type:r.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:VG,required:!0,index:0,writesValues:[],parent:LG},FG={id:"iterate-over-list-loop-body-parent-ref-id",type:r.GenericReference,entityId:Fl,entityType:r.Loop},UG={id:_R,type:r.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[GG],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:FG},xG={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:r.GenericReference,entityId:Fl,entityType:r.Loop},jG={id:"iterate-over-list-loop-iteration-list-input-map-id",type:r.InputMap,version:1,name:null,description:null,declaration:jn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:xG},kG={id:"iterate-over-list-loop-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},qG={id:Fl,type:r.Loop,version:1,declaration:jn,inputs:[jG],successCalls:[],errorCalls:[],outputs:[],process:null,body:UG,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:kG};var Ul=(n=>(n.EQ="eq",n.NEQ="neq",n.GT="gt",n.GTE="gte",n.LT="lt",n.LTE="lte",n.LIKE="like",n.ILIKE="ilike",n))(Ul||{}),NR=(n=>(n.COUNT="count",n.SUM="sum",n.AVG="avg",n.MIN="min",n.MAX="max",n))(NR||{});const JG={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:NR.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:Ul.NEQ,value:null}]},where:[{name:"employee_count",operation:Ul.GT,value:1}]},WG={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:r.GenericReference,entityId:q,entityType:r.Project},HG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},$R={isError:!1,id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:r.ReturnDeclaration,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,readsValue:null,required:!0,index:0,parent:HG},YG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:r.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:r.Search},zG={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:r.OutputMap,version:1,declaration:$R,writesValues:[],index:0,parent:YG},ZG={id:"find-companies-with-multiple-employees-and-bank-account",type:r.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[$R],inputs:[],outputs:[zG],query:JG,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:WG},jr="random-company-employee-test-variable-id",xl="manager-global-variable-id",VR="global-user-instance-id",kr="employee-mapped-dto-variable-id",LR="random-employee-id-output-map-id",GR="random-employee-birth-date-output-map-id",FR="random-employee-department-output-map-id",UR="random-employee-manager-output-map-id",xR="manager-global-id-output-map-id",jR="global-user-instance-id-output-map-id",XG="employee-mapped-dto-requester-id-input-map-id",QG="employee-mapped-dto-id-input-map-id",KG="employee-mapped-dto-birth-date-input-map-id",eF="employee-mapped-dto-department-input-map-id",tF="employee-mapped-dto-manager-input-map-id",nF={type:r.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:xR},rF={type:r.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr},kR={id:tF,type:r.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:nF,parent:rF},iF={type:r.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:FR},aF={type:r.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr},qR={id:eF,type:r.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:iF,parent:aF},sF={type:r.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:r.OutputMap,entityId:GR},oF={type:r.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr},JR={id:KG,type:r.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:sF,parent:oF},lF={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:LR},cF={type:r.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr},WR={id:QG,type:r.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:lF,parent:cF},dF={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:r.OutputMap,entityId:jR},uF={type:r.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:kr},HR={id:XG,type:r.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:dF,parent:uF},pF={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:xl},yF={id:xR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[kR],parent:pF},hF={type:r.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:xl},fF={id:"manager-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:hF,defaultValue:null},mF={type:r.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:r.OutputMap,entityId:UR},TF={type:r.GenericReference,id:"manager-variable-parent-ref-id",entityType:r.Project,entityId:q},YR={id:xl,type:r.VariableDeclaration,version:1,name:"Manager",dataType:fF,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:mF,writesValues:[],inputs:[],outputs:[yF],internalCalls:[],parent:TF,x:0,y:0},EF={type:r.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},RF={id:UR,type:r.OutputMap,version:1,declaration:It.properties[2],index:3,writesValues:[YR],parent:EF},bF={type:r.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},gF={id:FR,type:r.OutputMap,version:1,declaration:It.properties[0],index:2,writesValues:[qR],parent:bF},vF={type:r.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},IF={id:GR,type:r.OutputMap,version:1,declaration:ct.properties[1],index:1,writesValues:[JR],parent:vF},PF={type:r.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},DF={id:LR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[WR],parent:PF},AF={type:r.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:r.VariableDeclaration,entityId:jr},SF={id:"random-company-employee-test-variable-data-type-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:It,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:AF,defaultValue:null},OF={type:r.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:r.Project,entityId:q},CF={id:jr,type:r.VariableDeclaration,version:1,name:"Company employee",dataType:SF,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[DF,IF,gF,RF],internalCalls:[],parent:OF,x:0,y:0},BF={type:r.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:r.Project,entityId:q},wF={id:kr,type:r.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[HR,WR,JR,qR,kR],outputs:[],internalCalls:[],parent:BF,x:0,y:0},_F={type:r.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:r.VariableDeclaration,entityId:cl},MF={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:ul,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:_F,defaultValue:null},NF={type:r.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:r.Project,entityId:q},zR={id:cl,type:r.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:MF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:NF},$F={type:r.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:r.VariableInstance,entityId:VR},VF={id:jR,type:r.OutputMap,version:1,declaration:Be.properties[1],index:0,writesValues:[HR],parent:$F},LF={type:r.GenericReference,id:"global-user-instance-parent-ref-id",entityType:r.Project,entityId:q},GF={id:VR,type:r.VariableInstance,version:1,declaration:zR,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[VF],internalCalls:[],parent:LF,x:0,y:0},FF={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:r.VariableDeclaration,entityId:cl},UF={type:r.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:r.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},xF={id:"is-test-environment-variable-dcl-datatype-id",type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Fn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:FF,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:g.Boolean,version:1,value:null,type:r.PrimitiveValue,autogeneration:{type:xe.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:UF}},jF={type:r.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:r.Project,entityId:q},ZR={id:"is-test-environment-variable-dcl-id",type:r.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:xF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:jF},kF={type:r.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:r.Project,entityId:q},qF={id:"is-test-environment-variable-instance-id",type:r.VariableInstance,version:1,declaration:ZR,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:kF,x:0,y:0},XR={type:r.Project,id:q,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[NG],entities:[dl,ul,ct,Jw,It,ss,pT,yT,Vr,FB,mt,Nw,Hm,jD,LB],functions:[oV,UT,Cl,fV,IV,eE,Bl,fl,CG,IT,uL],events:[P_],variableDeclarations:[ZR,zR,$l,CF,YR,wF],variableInstances:[qF,GF],conditions:[],operations:[Fr],functionCalls:[vM,CN],loops:[qG],searches:[ZG]};var f=(n=>(n.Error="error",n.Warning="warning",n))(f||{}),v=(n=>(n.InvalidObjectStructure="invalid-object-structure",n.NameNotUniqueInScope="name-not-unique-in-scope",n.EmptyName="empty-name",n.MissingCaller="missing-caller",n.PropertyOverwrite="property-overwrite",n.MethodOverwrite="method-overwrite",n.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",n.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",n.UnreachableEntity="unreachable-entity",n))(v||{}),y=(n=>(n.RootReference="root-reference",n.ReferencedEntityNotFound="referenced-entity-not-found",n.EntityIdNotUnique="entity-id-not-unique",n.BuiltInEntityGenerated="built-in-entity-generated",n.BuiltInEntityUpdated="built-in-entity-updated",n.BuiltInEntityDeleted="built-in-entity-deleted",n.UnknownEntityType="unknown-entity-type",n.MissingTypeProperty="missing-type-property",n.MissingIdProperty="missing-id-property",n.BuiltInEntityParent="built-in-entity-parent",n.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",n.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",n.RecommendedImplementOperationAction="recommended-implement-operation-action",n.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",n.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",n.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",n.RecommendedImplementConditionAction="recommended-implement-condition-action",n.InvalidReferenceObjectStructure="invalid-reference-object-structure",n.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",n.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",n.InvalidParentReference="invalid-parent-reference",n.InvalidImplementsReference="invalid-implements-reference",n.InvalidExtendsReference="invalid-extends-reference",n.InvalidGenerationActionPayload="invalid-generation-action-payload",n.InvalidReference="invalid-reference",n.InvalidInternalCallParentDeclarationRelation="invalid-internal-call-parent-declaration-relation",n.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",n.InvalidUpdateEntityOperation="invalid-update-entity-operation",n.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",n.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",n.UnrecognizedProperty="unrecognized-property",n.SelfReference="self-reference",n.DuplicateReference="duplicate-reference",n.CallerWithIncompatibleScope="caller-with-incompatible-scope",n.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",n.InvalidInputMapDeclaration="invalid-input-map-declaration",n.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",n.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",n.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",n.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",n.OutputOverwrite="output-overwrite",n.InputOverwrite="input-overwrite",n.IncompatibleScope="incompatible-scope",n.InvalidParentUpdate="invalid-parent-update",n.NonInteractiveEntityReferenced="non-interactive-entity-referenced",n.InvalidParentRelationType="invalid-parent-relation-type",n))(y||{}),M=(n=>(n.ScopeWithoutLogic="scope-without-logic",n.ExtendingAbstractEntity="extending-abstract-entity",n.ImplementingNonAbstractEntity="implementing-non-abstract-entity",n.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",n.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",n.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",n.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",n.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",n.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",n.IncorrectEntityImplementation="incorrect-entity-implementation",n.IncorrectMethodImplementation="incorrect-method-implementation",n.IncorrectPropertyImplementation="incorrect-property-implementation",n.PropertyImplementsNonAbstact="property-implements-non-abstract",n.NonStaticPropertyImplementsStatic="non-static-property-implements-static",n.StaticPropertyImplementsNonStatic="static-property-implements-non-static",n.PropertyImplementsIncompatibleType="property-implements-incompatible-type",n.MissingPropertyImplementation="missing-property-implementation",n.MissingMethodImplementation="missing-method-implementation",n.NoProperties="no-properties",n.ReadingFromIncompatibleType="reading-from-incompatible-type",n.WritingToIncompatibleType="writing-to-incompatible-type",n.InvalidPropertiesCombination="invalid-properties-combination",n.DisconnectedCallableEntity="disconnected-callable-entity",n))(M||{});class E{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in v?new Xn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class Xn{constructor(e){l(this,"id");l(this,"message");l(this,"issue");l(this,"severity");l(this,"code");l(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new Xn({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function JF(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function H(n){const e=n.entity.errors.find(i=>i.id===n.id);return e?{new:!1,error:e}:{new:!0,error:new Xn(n)}}function WF(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function X(n,e){const t=[];return e.forEach(i=>{const a=n.find(s=>s.id===i.id);a?t.push(a):t.push(i)}),t}const Ji=c.union([c.string(),c.number(),c.boolean(),c.date()]),QR=c.enum([xe.CurrentDateAndTime,xe.Random,xe.Unique]),Es=c.object({type:QR,rangeStart:Ji.nullable(),rangeEnd:Ji.nullable()}),Wi=Es.extend({type:c.literal(xe.Random),rangeStart:Ji,rangeEnd:Ji}),jl=Es.extend({type:c.literal(xe.Unique),rangeStart:c.null(),rangeEnd:c.null()}),KR=Es.extend({type:c.literal(xe.CurrentDateAndTime),rangeStart:c.null(),rangeEnd:c.null()}),Rs=Wi.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),eb=Rs.extend({rangeStart:c.number(),rangeEnd:c.null()}),tb=Rs.extend({rangeStart:c.null(),rangeEnd:c.number()}),nb=Rs.extend({rangeStart:c.number(),rangeEnd:c.number()}),bs=Wi.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),rb=bs.extend({rangeStart:c.number(),rangeEnd:c.null()}),ib=bs.extend({rangeStart:c.null(),rangeEnd:c.number()}),ab=bs.extend({rangeStart:c.number(),rangeEnd:c.number()}),gs=Wi.extend({rangeStart:c.date().nullable(),rangeEnd:c.date().nullable()}),sb=gs.extend({rangeStart:c.date(),rangeEnd:c.null()}),ob=gs.extend({rangeStart:c.null(),rangeEnd:c.date()}),lb=gs.extend({rangeStart:c.date(),rangeEnd:c.date()}),kl=Wi.extend({rangeStart:c.null(),rangeEnd:c.null()}),ql=c.union([rb,ib,ab]),Jl=c.union([eb,tb,nb]),Wl=c.union([sb,ob,lb,KR]),Hl=c.union([ql,Jl,Wl,jl,kl]);function Yl(){return c.union([c.object({type:c.literal(r.ValueDescriptor)}),c.record(c.string(),c.any())])}function cb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ValueDescriptor)})}function zl(){return c.object({id:c.string(),type:c.literal(r.ValueDescriptor),name:c.string(),required:c.boolean()})}function HF(){return zl().merge(c.object({version:c.number(),index:c.number()}))}function YF(){return zl().merge(c.object({}))}function zF(){return c.object({dataType:cn(),parent:on()})}function ZF(){return HF().merge(zF())}function vs(){return c.union([c.object({type:c.literal(r.PrimitiveEntity)}),c.record(c.string(),c.any())])}function Is(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.PrimitiveEntity)})}function Ps(){return c.object({id:c.string(),type:c.literal(r.PrimitiveEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function XF(){return Ps().merge(c.object({version:c.number()}))}function QF(){return Ps().merge(c.object({}))}function KF(){return c.object({properties:c.array(Qn()),methods:c.array(At()),abstractMethods:c.array(Yt()),extends:c.array(c.union([vs(),qr()]))})}function e4(){return XF().merge(KF())}function Qn(){return c.union([c.object({type:c.literal(r.Property)}),c.record(c.string(),c.any())])}function db(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Property)})}function Zl(){return c.object({id:c.string(),type:c.literal(r.Property),name:c.string(),description:c.string().nullable(),private:c.boolean(),static:c.boolean(),required:c.boolean(),abstract:c.boolean()})}function t4(){return Zl().merge(c.object({version:c.number(),index:c.number()}))}function n4(){return Zl().merge(c.object({}))}function r4(){return c.object({dataType:cn(),implements:Qn().nullable(),parent:c.union([nr(),Is(),Ds()])})}function i4(){return t4().merge(r4())}function a4(){return c.enum([w.CRON_JOB,w.EXECUTION,w.HTTP_ENDPOINT,w.PERSISTED_ENTITY,w.RELATIONAL_DATABASE])}function qr(){return c.union([c.object({type:c.literal(r.BuiltInBaseEntity)}),c.record(c.string(),c.any())])}function Ds(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BuiltInBaseEntity)})}function Xl(){return c.object({id:c.string(),version:c.number(),type:c.literal(r.BuiltInBaseEntity),name:a4(),description:c.string().nullable(),abstract:c.boolean(),static:c.boolean()})}function s4(){return Xl()}function o4(){return Xl().merge(c.object({}))}function l4(){return c.object({properties:c.array(Qn()),methods:c.array(At()),abstractMethods:c.array(Yt()),extends:c.array(c.union([qr(),vs()]))})}function c4(){return s4().merge(l4())}function ub(){return c.enum([L.Dynamic,L.Fixed,L.None])}function Yt(){return c.union([c.object({type:c.literal(r.ActionDescriptor)}),c.record(c.string(),c.any())])}function on(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ActionDescriptor)})}function As(){return c.object({id:c.string(),type:c.literal(r.ActionDescriptor),name:c.string(),description:c.string().nullable(),argumentsType:ub(),returnsType:ub()})}function d4(){return As().merge(c.object({version:c.number()}))}function u4(){return As().merge(c.object({}))}function p4(){return c.object({fixedArguments:c.array(Yl()),fixedReturns:c.array(Yl()),dynamicArgumentTypes:cn().nullable(),dynamicReturnTypes:cn().nullable(),parent:c.union([Tt(),nr(),Ds(),Is()]).nullable()})}function pb(){return d4().merge(p4())}function Jr(){return c.union([c.object({type:c.literal(r.Loop)}),c.record(c.string(),c.any())])}function zt(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Loop)})}function yb(){return c.object({id:c.string(),type:c.literal(r.Loop)})}function y4(){return yb().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function h4(){return yb().merge(c.object({declaration:c.union([c.string(),At()])}))}function f4(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),declaration:Yt(),inputs:c.array(Dt()),outputs:c.array(ut()),successCalls:c.array(ke()),errorCalls:c.array(ke()),error:ut(),body:At(),parent:c.union([un(),Tt()]),breakStatements:c.array(Zr()),continueStatements:c.array(Wr())})}function m4(){return y4().merge(f4())}function Wr(){return c.union([c.object({type:c.literal(r.ContinueStatement)}),c.record(c.string(),c.any())])}function Hr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ContinueStatement)})}function Ql(){return c.object({id:c.string(),type:c.literal(r.ContinueStatement)})}function T4(){return Ql().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function E4(){return Ql().merge(c.object({}))}function R4(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),outputs:c.array(Zt()),throws:c.optional(Zt()),parent:zt()})}function b4(){return T4().merge(R4())}function Kn(){return c.union([c.object({type:c.literal(r.ReturnStatement)}),c.record(c.string(),c.any())])}function Yr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnStatement)})}function Kl(){return c.object({id:c.string(),type:c.literal(r.ReturnStatement)})}function g4(){return Kl().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function v4(){return Kl().merge(c.object({}))}function I4(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),outputs:c.array(Zt()),throws:c.optional(Zt()),parent:un()})}function P4(){return g4().merge(I4())}function Hi(){return c.union([c.object({type:c.literal(r.Search)}),c.record(c.string(),c.any())])}function zr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Search)})}function ec(){return c.object({id:c.string(),type:c.literal(r.Search),name:c.string(),query:c.any(),description:c.string().nullable()})}function D4(){return ec().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function A4(){return ec().merge(c.object({}))}function S4(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),inputsDeclarations:c.array(tr()),inputs:c.array(Dt()),outputsDeclarations:c.array(Zt()),outputs:c.array(ut()),parent:c.union([un(),Tt()]),error:ut().nullable()})}function O4(){return D4().merge(S4())}function Zt(){return c.union([c.object({type:c.literal(r.ReturnDeclaration)}),c.record(c.string(),c.any())])}function hb(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnDeclaration)})}function tc(){return c.object({id:c.string(),type:c.literal(r.ReturnDeclaration),name:c.string(),description:c.string().nullable(),isError:c.boolean()})}function C4(){return tc().merge(c.object({version:c.number(),index:c.number()}))}function B4(){return tc().merge(c.object({}))}function w4(){return c.object({dataType:cn().nullable(),readsValue:Xi().nullable(),parent:c.union([Yr(),on(),on(),zr(),ln(),Hr()])})}function _4(){return C4().merge(w4())}function Zr(){return c.union([c.object({type:c.literal(r.BreakStatement)}),c.record(c.string(),c.any())])}function ln(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BreakStatement)})}function nc(){return c.object({id:c.string(),type:c.literal(r.BreakStatement)})}function M4(){return nc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function N4(){return nc().merge(c.object({}))}function $4(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),outputs:c.array(Zt()),throws:c.optional(Zt()),parent:zt()})}function V4(){return M4().merge($4())}function ut(){return c.union([c.object({type:c.literal(r.OutputMap)}),c.record(c.string(),c.any())])}function rc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.OutputMap)})}function ic(){return c.object({id:c.string(),type:c.literal(r.OutputMap)})}function L4(){return ic().merge(c.object({version:c.number(),index:c.number()}))}function G4(){return ic().merge(c.object({}))}function F4(){return c.object({writesValues:c.array(dn()),declaration:c.union([Zt(),Qn()]),parent:c.union([ye(),zt(),ln()])})}function U4(){return L4().merge(F4())}function Xr(){return c.union([c.object({type:c.literal(r.FunctionCall)}),c.record(c.string(),c.any())])}function Yi(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionCall)})}function ac(){return c.object({id:c.string(),type:c.literal(r.FunctionCall)})}function x4(){return ac().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function j4(){return ac().merge(c.object({}))}function k4(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),writesValues:c.array(dn()),declaration:At(),inputs:c.array(Dt()),outputs:c.array(ut()),error:c.optional(ut()),parent:c.union([un(),Tt()])})}function q4(){return x4().merge(k4())}function J4(){return c.enum([Ae.Equal,Ae.NotEqual,Ae.MoreThan,Ae.MoreThanOrEqual,Ae.LessThan,Ae.LessThanOrEqual,Ae.And,Ae.Or,Ct.Empty,Ct.NotEmpty])}function zi(){return c.union([c.object({type:c.literal(r.Condition)}),c.record(c.string(),c.any())])}function Ss(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Condition)})}function sc(){return c.object({id:c.string(),type:c.literal(r.Condition)})}function W4(){return sc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function H4(){return sc().merge(c.object({}))}function Y4(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),leftValue:Dt(),rightValue:Dt().nullable(),operator:J4(),parent:c.union([un(),Tt()])})}function z4(){return W4().merge(Y4())}function Zi(){return c.union([c.object({type:c.literal(r.InternalCall)}),c.record(c.string(),c.any())])}function oc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InternalCall)})}function lc(){return c.object({id:c.string(),type:c.literal(r.InternalCall),index:c.number()})}function Z4(){return lc().merge(c.object({version:c.number(),index:c.number()}))}function X4(){return lc().merge(c.object({declaration:c.union([c.string(),At()])}))}function Q4(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),writesValues:c.array(dn()),declaration:At(),inputs:c.array(Dt()),outputs:c.array(ut()),parent:Cn(),error:c.optional(ut())})}function K4(){return Z4().merge(Q4())}function Dt(){return c.union([c.object({type:c.literal(r.InputMap)}),c.record(c.string(),c.any())])}function Os(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InputMap)})}function cc(){return c.object({id:c.string(),type:c.literal(r.InputMap),name:c.string().nullable().optional(),description:c.string().nullable().optional()})}function eU(){return cc().merge(c.object({version:c.number(),index:c.number()}))}function tU(){return cc().merge(c.object({}))}function nU(){return c.object({defaultValue:dc().nullable(),declaration:c.union([tr(),Qn()]).nullable(),readsValue:Xi().nullable(),parent:c.union([ye(),Os(),zt(),ln()]),dynamicArguments:c.array(Dt())})}function rU(){return eU().merge(nU())}function Qr(){return c.union([c.object({type:c.literal(r.Operation)}),c.record(c.string(),c.any())])}function Kr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Operation)})}function Cs(){return c.object({id:c.string(),type:c.literal(r.Operation)})}function iU(){return Cs().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function aU(){return Cs().merge(c.object({}))}function sU(){return Cs().merge(c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),writesValues:c.array(dn()),declaration:Yt(),inputs:c.array(Dt()),outputs:c.array(ut()),error:c.array(ut()),dynamicArguments:c.array(Dt()),parent:c.union([un(),Tt()])}))}function oU(){return iU().merge(sU())}function Bs(){return c.union([c.string(),c.number(),c.boolean(),c.null(),c.date()])}function fb(){return c.record(c.string(),Bs())}function lU(){return c.array(c.union([Bs(),fb()]))}function mb(){return c.union([Bs(),fb(),lU()])}function Tb(){return c.union([Bs(),mb()])}function Eb(){return c.enum([g.String,g.Number,g.Boolean,g.Null,g.Date,g.JSON,g.Enum,g.File,g.UUID,g.EntityTemplate,g.ActionDescriptor])}function cU(){return c.union([nr(),Kr(),Qi()])}function dU(){return c.object({id:c.string(),name:Eb(),type:c.literal(r.PrimitiveValue),value:Tb(),autogeneration:Hl.nullable()})}function uU(){return dU().merge(c.object({}))}function Ft(){return c.object({id:c.string(),version:c.number(),name:Eb(),type:c.literal(r.PrimitiveValue),value:Tb(),valueAsType:cU().nullable(),autogeneration:Hl.nullable(),parent:c.union([uc(),Os()])})}function pU(){return Ft().extend({name:c.literal(g.String),value:c.string(),autogeneration:ql.nullable()})}function yU(){return Ft().extend({name:c.literal(g.Number),value:c.number(),autogeneration:Jl.nullable()})}function hU(){return Ft().extend({name:c.literal(g.Boolean),value:c.boolean(),autogeneration:kl.nullable()})}function fU(){return Ft().extend({name:c.literal(g.Null),value:c.null(),autogeneration:c.null()})}function mU(){return Ft().extend({name:c.literal(g.Date),value:c.date(),autogeneration:Wl.nullable()})}function TU(){return Ft().extend({name:c.literal(g.JSON),value:mb(),autogeneration:c.null()})}function EU(){return Ft().extend({name:c.literal(g.Enum),value:c.string(),autogeneration:c.null()})}function RU(){return Ft().extend({name:c.literal(g.File),value:c.string(),autogeneration:c.null()})}function bU(){return Ft().extend({name:c.literal(g.UUID),value:c.string(),autogeneration:jl.nullable()})}function gU(){return Ft().extend({name:c.literal(g.EntityTemplate),value:nr(),autogeneration:c.null()})}function vU(){return Ft().extend({name:c.literal(g.ActionDescriptor),value:Qi(),autogeneration:c.null()})}function dc(){return c.union([pU(),yU(),hU(),fU(),mU(),TU(),EU(),RU(),bU(),gU(),vU()])}function cn(){return c.union([c.object({type:c.literal(r.DataType)}),c.record(c.string(),c.any())])}function uc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.DataType)})}function pc(){return c.object({id:c.string(),type:c.literal(r.DataType),isNullable:c.boolean(),isList:c.boolean(),constant:c.boolean(),asType:c.boolean(),options:c.array(c.string()).optional()})}function IU(){return pc().merge(c.object({version:c.number()}))}function PU(){return pc().merge(c.object({}))}function DU(){return c.object({defaultValue:dc().nullable(),entity:c.union([ei(),qr(),vs(),Yt()]).nullable(),parent:c.union([db(),gb(),on(),cb()])})}function AU(){return IU().merge(DU())}function yc(){return c.union([c.object({type:c.literal(r.VariableDeclaration)}),c.record(c.string(),c.any())])}function SU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableDeclaration)})}function hc(){return c.object({id:c.string(),type:c.literal(r.VariableDeclaration),name:c.string(),description:c.string().nullable()})}function OU(){return hc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function CU(){return hc().merge(c.object({}))}function BU(){return c.object({dataType:cn().nullable(),readsValue:Xi().nullable(),writesValues:c.array(dn()),inputs:c.array(Dt()),outputs:c.array(ut()),successCalls:c.array(ke()),errorCalls:c.array(ke()),internalCalls:c.array(Zi()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),parent:c.union([un(),Tt()])})}function wU(){return OU().merge(BU())}function Rb(){return c.union([c.object({type:c.literal(r.VariableInstance)}),c.record(c.string(),c.any())])}function _U(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableInstance)})}function fc(){return c.object({id:c.string(),type:c.literal(r.VariableInstance)})}function MU(){return fc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function NU(){return fc().merge(c.object({}))}function $U(){return c.object({declaration:yc(),dataType:cn().nullable(),readsValue:Xi().nullable(),writesValues:c.array(dn()),inputs:c.array(Dt()),outputs:c.array(ut()),successCalls:c.array(ke()),errorCalls:c.array(ke()),internalCalls:c.array(Zi()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(Ue()),parent:c.union([un(),Tt()])})}function VU(){return MU().merge($U())}function mc(){return c.union([c.object({type:c.literal(r.InstalledProject)}),c.record(c.string(),c.any())])}function ws(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InstalledProject)})}function LU(){return c.object({id:c.string(),type:c.literal(r.InstalledProject)})}function GU(){return c.object({version:c.number(),x:c.number(),y:c.number()})}function FU(){return c.object({})}function UU(){return c.object({implements:Tt(),description:c.string().nullable(),functions:c.array(At()),events:c.array(Tc()),parent:Tt()})}function xU(){return GU().merge(UU())}function Tc(){return c.union([c.object({type:c.literal(r.GlobalEvent)}),c.record(c.string(),c.any())])}function jU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.GlobalEvent)})}function _s(){return c.object({id:c.string(),type:c.literal(r.GlobalEvent),name:c.string(),collapsed:c.boolean()})}function kU(){return _s().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function qU(){return _s().merge(c.object({}))}function JU(){return _s().merge(c.object({returnStatements:c.array(Kn()),implements:c.array(pb()),inputs:c.array(tr()),calls:c.array(ke()),parent:c.union([Tt(),ws()])}))}function WU(){return kU().merge(JU())}function er(){return c.union([yc(),Rb()])}function Cn(){return c.union([SU(),_U()])}function dn(){return c.union([er(),Dt(),Zt()])}function bb(){return c.union([Cn(),Os(),hb()])}function Xi(){return c.union([er(),tr(),ut(),Qr(),Zi(),Xr()])}function HU(){return c.union([Cn(),Ec(),rc(),Kr(),oc(),Yi()])}function YU(){return c.union([tr(),ut(),dn()])}function gb(){return c.union([Ec(),rc(),bb()])}function Ms(){return Tc()}function Ns(){return jU()}function $s(){return c.union([Qr(),Xr(),zi(),Hi(),er(),Zi(),Jr()])}function ye(){return c.union([Kr(),Yi(),Ss(),zr(),Cn(),oc(),zt()])}function Vs(){return c.union([Qr(),Xr(),zi(),Hi(),er(),Jr()])}function Ls(){return c.union([Kr(),Yi(),Ss(),zr(),Cn(),zt()])}function vb(){return c.union([$s(),Kn(),Zr(),Wr()])}function ke(){return c.union([ye(),Yr(),ln(),Hr()])}function Ib(){return c.union([Vs(),Kn(),Zr(),Wr()])}function Pb(){return c.union([Ls(),Yr(),ln(),Hr()])}function Bn(){return c.union([At(),Ms()])}function Ue(){return c.union([Qi(),Ns()])}function zU(){return c.union([$s(),Bn()])}function ZU(){return c.union([ye(),Ue()])}function XU(){return c.union([Vs(),Bn()])}function QU(){return c.union([Ls(),Ue()])}function KU(){return c.union([vb(),Bn()])}function ex(){return c.union([ke(),Ue()])}function tx(){return c.union([Ib(),Bn()])}function nx(){return c.union([Pb(),Ue()])}function rx(){return c.union([Bn(),Jr()])}function un(){return c.union([Ue(),zt()])}function ix(){return c.union([$s(),Bn()])}function ax(){return c.union([ye(),Ue()])}function sx(){return c.union([Vs(),Bn()])}function ox(){return c.union([Ls(),Ue()])}function lx(){return c.union([Kn(),Zr(),Wr()])}function cx(){return c.union([Yr(),ln(),Hr()])}function dx(){return c.union([qr(),vx(),mc(),ei(),At(),Ms(),er(),Dt(),ut(),zi(),Qr(),Xr(),Zt(),tr(),vs(),cn(),Qn(),Yt(),Kn(),Wr(),Zr(),Jr(),Hi(),Yt(),Yt(),Yl(),Zi()])}function ux(){return c.union([Ds(),Tt(),ws(),nr(),Qi(),Ns(),Cn(),Os(),rc(),Ss(),Kr(),Yi(),hb(),Ec(),Is(),uc(),db(),on(),Yr(),Hr(),ln(),zt(),zr(),on(),on(),cb(),oc()])}function px(){return c.union([mc(),ei(),At(),Ms(),er(),zi(),Qr(),Xr(),Kn(),Wr(),Zr(),Jr(),Hi()])}function yx(){return c.union([ws(),nr(),Qi(),Ns(),Cn(),Ss(),Kr(),Yi(),Yr(),Hr(),ln(),zt(),zr()])}function tr(){return c.union([c.object({type:c.literal(r.ArgumentDeclaration)}),c.record(c.string(),c.any())])}function Ec(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ArgumentDeclaration)})}function Rc(){return c.object({id:c.string(),type:c.literal(r.ArgumentDeclaration)})}function hx(){return Rc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function fx(){return Rc().merge(c.object({}))}function mx(){return c.object({dataType:cn().nullable(),writesValues:c.array(dn()),parent:c.union([Ue(),on(),on(),zr(),ln()])})}function Tx(){return hx().merge(mx())}function At(){return c.union([c.object({type:c.literal(r.FunctionDeclaration)}),c.record(c.string(),c.any())])}function Qi(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionDeclaration)})}function bc(){return c.object({id:c.string(),type:c.literal(r.FunctionDeclaration),name:c.string(),description:c.string().nullable()})}function Ex(){return bc().merge(c.object({version:c.number(),x:c.number(),y:c.number(),index:c.number().nullable()}))}function Rx(){return bc()}function bx(){return c.object({inputs:c.array(tr()),implements:Yt().nullable(),returnStatements:c.array(Kn()),parent:c.union([Tt(),ws(),nr(),zt(),Ds(),Is()])})}function gx(){return Ex().merge(bx())}function vx(){return c.union([c.object({type:c.literal(r.Project)}),c.record(c.string(),c.any())])}function Tt(){return c.object({entityType:c.literal(r.Project),entityId:c.string(),id:c.string(),type:c.literal(r.GenericReference)})}function gc(){return c.object({id:c.string(),type:c.literal(r.Project),name:c.string(),description:c.string().nullable()})}function Ix(){return gc().merge(c.object({version:c.number()}))}function Px(){return gc()}function Dx(){return c.object({entities:c.array(ei()),functions:c.array(At()),events:c.array(Tc()),projects:c.array(mc()),variableDeclarations:c.array(yc()),variableInstances:c.array(Rb()),conditions:c.array(zi()),operations:c.array(Qr()),functionCalls:c.array(Xr()),loops:c.array(Jr()),searches:c.array(Hi())})}function Ax(){return Ix().merge(Dx())}function ei(){return c.union([c.object({type:c.literal(r.CustomEntity)}),c.record(c.string(),c.any())])}function nr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.CustomEntity)})}function vc(){return c.object({id:c.string(),type:c.literal(r.CustomEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function Sx(){return vc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Ox(){return vc().merge(c.object({}))}function Cx(){return c.union([Tt(),uc()])}function Bx(){return c.object({properties:c.array(Qn()),methods:c.array(At()),abstractMethods:c.array(Yt()),extends:c.array(c.union([ei(),qr()])),implements:c.array(c.union([ei(),qr()])),parent:Cx()})}function wx(){return Sx().merge(Bx())}function _x(n){const e=wx(),t=n.toJSON();e.safeParse(t).success;const a=n.implements.flatMap(m=>$x(n,m)),s=n.extends.flatMap(m=>Vx(n,m)),o=Gx(n),u=Lx(n);n.methods.flatMap(m=>m.validate());const p=[...a,...s,...o,...u];return X(n.errors,p)}function Mx(n,e){const t=e.properties.filter(s=>s.abstract),i=[];let a=[...n.properties];return t.forEach(s=>{const o=a.find(u=>{var p;return((p=u.implements)==null?void 0:p.id)===s.id});o?a=a.filter(u=>u.id!==o.id):i.push(s)}),i}function Nx(n,e){const t=e.abstractMethods,i=[];let a=[...n.methods];return t.forEach(s=>{const o=a.find(u=>{var p;return((p=u.implements)==null?void 0:p.id)===s.id});o?a=a.filter(u=>u.id!==o.id):i.push(s)}),i}function $x(n,e){const t=[];if(!e.abstract){const m=H({id:n.id+"--"+M.ImplementingNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:M.ImplementingNonAbstractEntity,entity:n});return t.push(m.error),t}const i=e.properties.filter(m=>m.abstract),a=[];let s=[...n.properties];i.forEach(m=>{const T=s.find(b=>{var I;return((I=b.implements)==null?void 0:I.id)===m.id});T?s=s.filter(b=>b.id!==T.id):a.push(m)}),a.length&&a.forEach(m=>{const T=H({id:n.id+"--"+M.MissingPropertyImplementation+"--"+m.id,message:`Property "${m.name}" with id "${m.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:f.Error,code:M.MissingPropertyImplementation,entity:n});t.push(T.error)});const o=[];let u=[...n.methods];e.abstractMethods.forEach(m=>{const T=u.find(b=>{var I;return((I=b.implements)==null?void 0:I.id)===m.id});T?u=u.filter(b=>b.id!==T.id):o.push(m)}),o.length&&o.forEach(m=>{const T=H({id:n.id+"--"+M.MissingMethodImplementation+"--"+m.id,message:`Method "${m.name}" with id "${m.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:f.Error,code:M.MissingMethodImplementation,entity:n});t.push(T.error)});const p=[];e.properties.forEach(m=>{const T=s.find(b=>b.name===m.name);T&&p.push([T,m])}),p.length&&p.forEach(([m])=>{const T=H({id:n.id+"--"+v.PropertyOverwrite+"--"+m.id,message:`Property "${m.name}" with id "${m.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.PropertyOverwrite,entity:n});t.push(T.error)});const h=[];return e.methods.forEach(m=>{const T=u.find(b=>b.name===m.name);T&&h.push([T,m])}),h.length&&h.forEach(([m])=>{const T=H({id:n.id+"--"+v.MethodOverwrite+"--"+m.id,message:`Method "${m.name}" with id "${m.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.MethodOverwrite,entity:n});t.push(T.error)}),t}function Vx(n,e){const t=[],i=[];if(e.abstract){const s=H({id:n.id+"--"+M.ExtendingAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:M.ExtendingAbstractEntity,entity:n});return t.push(s.error),t}n.properties.forEach(s=>{var u;const o=e.properties.find(p=>p.name===s.name);((u=s.implements)==null?void 0:u.id)!==(o==null?void 0:o.id)&&o&&i.push(s)}),i.length&&i.forEach(s=>{const o=H({id:n.id+"--"+v.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.PropertyOverwrite,entity:n});t.push(o.error)});const a=[];return n.methods.forEach(s=>{var u;const o=e.methods.find(p=>p.name===s.name);((u=s.implements)==null?void 0:u.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=H({id:n.id+"--"+v.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.MethodOverwrite,entity:n});t.push(o.error)}),t}function Lx(n){const e=[];if(!n.properties.length){const t=H({id:n.id+"--"+M.NoProperties,message:"No properties implemented",issue:null,severity:f.Warning,code:M.NoProperties,entity:n});e.push(t.error)}return n.properties.forEach(t=>{t.validate()}),e}function Gx(n){const e=[];if(n.abstract){if(n.methods.length){const t=H({id:n.id+"--"+M.AbstractEntityWithNonAbstractMethods,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:f.Error,code:M.AbstractEntityWithNonAbstractMethods,entity:n});e.push(t.error)}if(n.properties.some(t=>!t.abstract)){const t=H({id:n.id+"--"+M.AbstractEntityWithNonAbstractProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:f.Error,code:M.AbstractEntityWithNonAbstractProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.abstract){const a=H({id:n.id+"--"+M.StaticEntityWithNonStaticProperties+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:f.Error,code:M.StaticEntityWithNonStaticProperties,entity:n});e.push(a.error)}})}}else{if(n.abstractMethods.length){const t=H({id:n.id+"--"+M.AbstractPropertyInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract methods`,issue:null,severity:f.Error,code:M.AbstractPropertyInNonAbstractEntity,entity:n});e.push(t.error)}if(n.properties.some(t=>t.abstract)){const t=H({id:n.id+"--"+M.AbstractMethodInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract properties`,issue:null,severity:f.Error,code:M.AbstractMethodInNonAbstractEntity,entity:n});e.push(t.error),n.properties.forEach(i=>{if(i.abstract){const a=H({id:n.id+"--"+M.AbstractMethodInNonAbstractEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:f.Error,code:M.AbstractMethodInNonAbstractEntity,entity:n});e.push(a.error)}})}}if(n.static&&n.properties.some(t=>!t.static)){const t=H({id:n.id+"--"+M.StaticEntityWithNonStaticProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as static but has non-static properties`,issue:null,severity:f.Error,code:M.StaticEntityWithNonStaticProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.static){const a=H({id:n.id+"--"+M.NonStaticPropertyInStaticEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as static but the entity is marked as static`,issue:null,severity:f.Error,code:M.NonStaticPropertyInStaticEntity,entity:n});e.push(a.error)}})}return e}function Fx(n){return n instanceof Error&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)}var Ux=class extends Error{constructor(e,t){super(e,t);l(this,"name");l(this,"details");this.name="ZodValidationError",this.details=xx(t)}toString(){return this.message}};function xx(n){if(n){const e=n.cause;if(Fx(e))return e.issues}return[]}var jx="; ",Db="Validation error",kx=": ",qx=", or ";function Jx(n,e,t){return e!==null?n.length>0?[e,n].join(t):e:n.length>0?n:Db}var Wx=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function Hx(n){return n.length===1?n[0].toString():n.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+Yx(t)+'"]';if(!Wx.test(t))return e+'["'+t+'"]';const i=e.length===0?"":".";return e+i+t},"")}function Yx(n){return n.replace(/"/g,'\\"')}function zx(n){return n.length!==0}function Gs(n){const{issue:e,issueSeparator:t,unionSeparator:i,includePath:a}=n;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const u=o.issues.map(p=>Gs({issue:p,issueSeparator:t,unionSeparator:i,includePath:a})).join(t);return s.includes(u)||s.push(u),s},[]).join(i);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>Gs({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>Gs({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(a&&zx(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${Hx(e.path)}"`}return e.message}function Zx(n,e={}){const{issueSeparator:t=jx,unionSeparator:i=qx,prefixSeparator:a=kx,prefix:s=Db,includePath:o=!0}=e,u=Gs({issue:n,issueSeparator:t,unionSeparator:i,includePath:o}),p=Jx(u,s,a);return new Ux(p,{cause:new ft([n])})}var Ab="1.13.7",Sb=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Fs=Array.prototype,Ic=Object.prototype,Ob=typeof Symbol<"u"?Symbol.prototype:null,Xx=Fs.push,Ki=Fs.slice,ea=Ic.toString,Qx=Ic.hasOwnProperty,Cb=typeof ArrayBuffer<"u",Kx=typeof DataView<"u",e8=Array.isArray,Bb=Object.keys,wb=Object.create,_b=Cb&&ArrayBuffer.isView,t8=isNaN,n8=isFinite,Mb=!{toString:null}.propertyIsEnumerable("toString"),Nb=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],r8=Math.pow(2,53)-1;function Et(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),i=Array(t),a=0;a<t;a++)i[a]=arguments[a+e];switch(e){case 0:return n.call(this,i);case 1:return n.call(this,arguments[0],i);case 2:return n.call(this,arguments[0],arguments[1],i)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=i,n.apply(this,s)}}function wn(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function i8(n){return n===null}function $b(n){return n===void 0}function Vb(n){return n===!0||n===!1||ea.call(n)==="[object Boolean]"}function a8(n){return!!(n&&n.nodeType===1)}function rt(n){var e="[object "+n+"]";return function(t){return ea.call(t)===e}}const Pc=rt("String"),Lb=rt("Number"),s8=rt("Date"),o8=rt("RegExp"),l8=rt("Error"),Gb=rt("Symbol"),Fb=rt("ArrayBuffer");var Ub=rt("Function"),c8=Sb.document&&Sb.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof c8!="function"&&(Ub=function(n){return typeof n=="function"||!1});const pt=Ub,xb=rt("Object");var jb=Kx&&(!/\[native code\]/.test(String(DataView))||xb(new DataView(new ArrayBuffer(8)))),Dc=typeof Map<"u"&&xb(new Map),d8=rt("DataView");function u8(n){return n!=null&&pt(n.getInt8)&&Fb(n.buffer)}const Us=jb?u8:d8,rr=e8||rt("Array");function _n(n,e){return n!=null&&Qx.call(n,e)}var Ac=rt("Arguments");(function(){Ac(arguments)||(Ac=function(n){return _n(n,"callee")})})();const Sc=Ac;function p8(n){return!Gb(n)&&n8(n)&&!isNaN(parseFloat(n))}function kb(n){return Lb(n)&&t8(n)}function qb(n){return function(){return n}}function Jb(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=r8}}function Wb(n){return function(e){return e==null?void 0:e[n]}}const xs=Wb("byteLength"),y8=Jb(xs);var h8=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function f8(n){return _b?_b(n)&&!Us(n):y8(n)&&h8.test(ea.call(n))}const Hb=Cb?f8:qb(!1),Rt=Wb("length");function m8(n){for(var e={},t=n.length,i=0;i<t;++i)e[n[i]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,n.push(a)}}}function Yb(n,e){e=m8(e);var t=Nb.length,i=n.constructor,a=pt(i)&&i.prototype||Ic,s="constructor";for(_n(n,s)&&!e.contains(s)&&e.push(s);t--;)s=Nb[t],s in n&&n[s]!==a[s]&&!e.contains(s)&&e.push(s)}function We(n){if(!wn(n))return[];if(Bb)return Bb(n);var e=[];for(var t in n)_n(n,t)&&e.push(t);return Mb&&Yb(n,e),e}function ta(n){if(n==null)return!0;var e=Rt(n);return typeof e=="number"&&(rr(n)||Pc(n)||Sc(n))?e===0:Rt(We(n))===0}function zb(n,e){var t=We(e),i=t.length;if(n==null)return!i;for(var a=Object(n),s=0;s<i;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function Q(n){if(n instanceof Q)return n;if(!(this instanceof Q))return new Q(n);this._wrapped=n}Q.VERSION=Ab,Q.prototype.value=function(){return this._wrapped},Q.prototype.valueOf=Q.prototype.toJSON=Q.prototype.value,Q.prototype.toString=function(){return String(this._wrapped)};function Zb(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,xs(n))}var Xb="[object DataView]";function Oc(n,e,t,i){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var a=typeof n;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:Qb(n,e,t,i)}function Qb(n,e,t,i){n instanceof Q&&(n=n._wrapped),e instanceof Q&&(e=e._wrapped);var a=ea.call(n);if(a!==ea.call(e))return!1;if(jb&&a=="[object Object]"&&Us(n)){if(!Us(e))return!1;a=Xb}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return Ob.valueOf.call(n)===Ob.valueOf.call(e);case"[object ArrayBuffer]":case Xb:return Qb(Zb(n),Zb(e),t,i)}var s=a==="[object Array]";if(!s&&Hb(n)){var o=xs(n);if(o!==xs(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof n!="object"||typeof e!="object")return!1;var u=n.constructor,p=e.constructor;if(u!==p&&!(pt(u)&&u instanceof u&&pt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in e)return!1}t=t||[],i=i||[];for(var h=t.length;h--;)if(t[h]===n)return i[h]===e;if(t.push(n),i.push(e),s){if(h=n.length,h!==e.length)return!1;for(;h--;)if(!Oc(n[h],e[h],t,i))return!1}else{var m=We(n),T;if(h=m.length,We(e).length!==h)return!1;for(;h--;)if(T=m[h],!(_n(e,T)&&Oc(n[T],e[T],t,i)))return!1}return t.pop(),i.pop(),!0}function T8(n,e){return Oc(n,e)}function na(n){if(!wn(n))return[];var e=[];for(var t in n)e.push(t);return Mb&&Yb(n,e),e}function Cc(n){var e=Rt(n);return function(t){if(t==null)return!1;var i=na(t);if(Rt(i))return!1;for(var a=0;a<e;a++)if(!pt(t[n[a]]))return!1;return n!==tg||!pt(t[Bc])}}var Bc="forEach",Kb="has",wc=["clear","delete"],eg=["get",Kb,"set"],E8=wc.concat(Bc,eg),tg=wc.concat(eg),R8=["add"].concat(wc,Bc,Kb);const b8=Dc?Cc(E8):rt("Map"),g8=Dc?Cc(tg):rt("WeakMap"),v8=Dc?Cc(R8):rt("Set"),I8=rt("WeakSet");function ti(n){for(var e=We(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=n[e[a]];return i}function P8(n){for(var e=We(n),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=[e[a],n[e[a]]];return i}function ng(n){for(var e={},t=We(n),i=0,a=t.length;i<a;i++)e[n[t[i]]]=t[i];return e}function _c(n){var e=[];for(var t in n)pt(n[t])&&e.push(t);return e.sort()}function Mc(n,e){return function(t){var i=arguments.length;if(e&&(t=Object(t)),i<2||t==null)return t;for(var a=1;a<i;a++)for(var s=arguments[a],o=n(s),u=o.length,p=0;p<u;p++){var h=o[p];(!e||t[h]===void 0)&&(t[h]=s[h])}return t}}const rg=Mc(na),js=Mc(We),ig=Mc(na,!0);function D8(){return function(){}}function ag(n){if(!wn(n))return{};if(wb)return wb(n);var e=D8();e.prototype=n;var t=new e;return e.prototype=null,t}function A8(n,e){var t=ag(n);return e&&js(t,e),t}function S8(n){return wn(n)?rr(n)?n.slice():rg({},n):n}function O8(n,e){return e(n),n}function sg(n){return rr(n)?n:[n]}Q.toPath=sg;function ra(n){return Q.toPath(n)}function Nc(n,e){for(var t=e.length,i=0;i<t;i++){if(n==null)return;n=n[e[i]]}return t?n:void 0}function og(n,e,t){var i=Nc(n,ra(e));return $b(i)?t:i}function C8(n,e){e=ra(e);for(var t=e.length,i=0;i<t;i++){var a=e[i];if(!_n(n,a))return!1;n=n[a]}return!!t}function $c(n){return n}function ia(n){return n=js({},n),function(e){return zb(e,n)}}function Vc(n){return n=ra(n),function(e){return Nc(e,n)}}function aa(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(i){return n.call(e,i)};case 3:return function(i,a,s){return n.call(e,i,a,s)};case 4:return function(i,a,s,o){return n.call(e,i,a,s,o)}}return function(){return n.apply(e,arguments)}}function lg(n,e,t){return n==null?$c:pt(n)?aa(n,e,t):wn(n)&&!rr(n)?ia(n):Vc(n)}function Lc(n,e){return lg(n,e,1/0)}Q.iteratee=Lc;function bt(n,e,t){return Q.iteratee!==Lc?Q.iteratee(n,e):lg(n,e,t)}function B8(n,e,t){e=bt(e,t);for(var i=We(n),a=i.length,s={},o=0;o<a;o++){var u=i[o];s[u]=e(n[u],u,n)}return s}function cg(){}function w8(n){return n==null?cg:function(e){return og(n,e)}}function _8(n,e,t){var i=Array(Math.max(0,n));e=aa(e,t,1);for(var a=0;a<n;a++)i[a]=e(a);return i}function Gc(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const sa=Date.now||function(){return new Date().getTime()};function dg(n){var e=function(s){return n[s]},t="(?:"+We(n).join("|")+")",i=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,i.test(s)?s.replace(a,e):s}}const ug={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},M8=dg(ug),N8=ng(ug),$8=dg(N8),V8=Q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Fc=/(.)^/,L8={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G8=/\\|'|\r|\n|\u2028|\u2029/g;function F8(n){return"\\"+L8[n]}var U8=/^\s*(\w|\$)+\s*$/;function x8(n,e,t){!e&&t&&(e=t),e=ig({},e,Q.templateSettings);var i=RegExp([(e.escape||Fc).source,(e.interpolate||Fc).source,(e.evaluate||Fc).source].join("|")+"|$","g"),a=0,s="__p+='";n.replace(i,function(h,m,T,b,I){return s+=n.slice(a,I).replace(G8,F8),a=I+h.length,m?s+=`'+
2
2
  ((__t=(`+m+`))==null?'':_.escape(__t))+
3
3
  '`:T?s+=`'+
4
4
  ((__t=(`+T+`))==null?'':__t)+
5
5
  '`:b&&(s+=`';
6
6
  `+b+`
7
7
  __p+='`),h}),s+=`';
8
- `;var o=e.variable;if(o){if(!X4.test(o))throw new Error("variable is not a bare identifier: "+o)}else s=`with(obj||{}){
8
+ `;var o=e.variable;if(o){if(!U8.test(o))throw new Error("variable is not a bare identifier: "+o)}else s=`with(obj||{}){
9
9
  `+s+`}
10
10
  `,o="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
11
11
  `+s+`return __p;
12
- `;var u;try{u=new Function(o,"_",s)}catch(h){throw h.source=s,h}var p=function(h){return u.call(this,h,X)};return p.source="function("+o+`){
13
- `+s+"}",p}function K4(n,e,t){e=Xi(e);var i=e.length;if(!i)return ut(t)?t.call(n):t;for(var a=0;a<i;a++){var s=n==null?void 0:n[e[a]];s===void 0&&(s=t,a=i),n=ut(s)?s.call(n):s}return n}var ex=0;function tx(n){var e=++ex+"";return n?n+e:e}function nx(n){var e=X(n);return e._chain=!0,e}function kb(n,e,t,i,a){if(!(i instanceof e))return n.apply(t,a);var s=Vb(n.prototype),o=n.apply(s,a);return Bn(o)?o:s}var Hr=Tt(function(n,e){var t=Hr.placeholder,i=function(){for(var a=0,s=e.length,o=Array(s),u=0;u<s;u++)o[u]=e[u]===t?arguments[a++]:e[u];for(;a<arguments.length;)o.push(arguments[a++]);return kb(n,i,this,this,o)};return i});Hr.placeholder=X;const qb=Tt(function(n,e,t){if(!ut(n))throw new TypeError("Bind must be called on a function");var i=Tt(function(a){return kb(n,i,e,this,t.concat(a))});return i}),Dt=vb(Et);function er(n,e,t,i){if(i=i||[],!e&&e!==0)e=1/0;else if(e<=0)return i.concat(n);for(var a=i.length,s=0,o=Et(n);s<o;s++){var u=n[s];if(Dt(u)&&(Kn(u)||Zl(u)))if(e>1)er(u,e-1,t,i),a=i.length;else for(var p=0,h=u.length;p<h;)i[a++]=u[p++];else t||(i[a++]=u)}return i}const rx=Tt(function(n,e){e=er(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var i=e[t];n[i]=qb(n[i],n)}return n});function ix(n,e){var t=function(i){var a=t.cache,s=""+(e?e.apply(this,arguments):i);return wn(a,s)||(a[s]=n.apply(this,arguments)),a[s]};return t.cache={},t}const Jb=Tt(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),ax=Hr(Jb,X,1);function sx(n,e,t){var i,a,s,o,u=0;t||(t={});var p=function(){u=t.leading===!1?0:ea(),i=null,o=n.apply(a,s),i||(a=s=null)},h=function(){var m=ea();!u&&t.leading===!1&&(u=m);var T=e-(m-u);return a=this,s=arguments,T<=0||T>e?(i&&(clearTimeout(i),i=null),u=m,o=n.apply(a,s),i||(a=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(p,T)),o};return h.cancel=function(){clearTimeout(i),u=0,i=a=s=null},h}function ox(n,e,t){var i,a,s,o,u,p=function(){var m=ea()-a;e>m?i=setTimeout(p,e-m):(i=null,t||(o=n.apply(u,s)),i||(s=u=null))},h=Tt(function(m){return u=this,s=m,a=ea(),i||(i=setTimeout(p,e),t&&(o=n.apply(u,s))),o});return h.cancel=function(){clearTimeout(i),i=s=u=null},h}function lx(n,e){return Hr(e,n)}function cc(n){return function(){return!n.apply(this,arguments)}}function cx(){var n=arguments,e=n.length-1;return function(){for(var t=e,i=n[e].apply(this,arguments);t--;)i=n[t].call(this,i);return i}}function dx(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function Wb(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const ux=Hr(Wb,2);function Hb(n,e,t){e=Rt(e,t);for(var i=We(n),a,s=0,o=i.length;s<o;s++)if(a=i[s],e(n[a],a,n))return a}function Yb(n){return function(e,t,i){t=Rt(t,i);for(var a=Et(e),s=n>0?0:a-1;s>=0&&s<a;s+=n)if(t(e[s],s,e))return s;return-1}}const dc=Yb(1),zb=Yb(-1);function Zb(n,e,t,i){t=Rt(t,i,1);for(var a=t(e),s=0,o=Et(n);s<o;){var u=Math.floor((s+o)/2);t(n[u])<a?s=u+1:o=u}return s}function Xb(n,e,t){return function(i,a,s){var o=0,u=Et(i);if(typeof s=="number")n>0?o=s>=0?s:Math.max(s+u,o):u=s>=0?Math.min(s+1,u):s+u+1;else if(t&&s&&u)return s=t(i,a),i[s]===a?s:-1;if(a!==a)return s=e(Hi.call(i,o,u),bb),s>=0?s+o:-1;for(s=n>0?o:u-1;s>=0&&s<u;s+=n)if(i[s]===a)return s;return-1}}const Qb=Xb(1,dc,Zb),px=Xb(-1,zb);function uc(n,e,t){var i=Dt(n)?dc:Hb,a=i(n,e,t);if(a!==void 0&&a!==-1)return n[a]}function yx(n,e){return uc(n,Qi(e))}function on(n,e,t){e=Ki(e,t);var i,a;if(Dt(n))for(i=0,a=n.length;i<a;i++)e(n[i],i,n);else{var s=We(n);for(i=0,a=s.length;i<a;i++)e(n[s[i]],s[i],n)}return n}function tr(n,e,t){e=Rt(e,t);for(var i=!Dt(n)&&We(n),a=(i||n).length,s=Array(a),o=0;o<a;o++){var u=i?i[o]:o;s[o]=e(n[u],u,n)}return s}function Kb(n){var e=function(t,i,a,s){var o=!Dt(t)&&We(t),u=(o||t).length,p=n>0?0:u-1;for(s||(a=t[o?o[p]:p],p+=n);p>=0&&p<u;p+=n){var h=o?o[p]:p;a=i(a,t[h],h,t)}return a};return function(t,i,a,s){var o=arguments.length>=3;return e(t,Ki(i,s,4),a,o)}}const pc=Kb(1),eg=Kb(-1);function Yr(n,e,t){var i=[];return e=Rt(e,t),on(n,function(a,s,o){e(a,s,o)&&i.push(a)}),i}function hx(n,e,t){return Yr(n,cc(Rt(e)),t)}function tg(n,e,t){e=Rt(e,t);for(var i=!Dt(n)&&We(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(!e(n[o],o,n))return!1}return!0}function ng(n,e,t){e=Rt(e,t);for(var i=!Dt(n)&&We(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(e(n[o],o,n))return!0}return!1}function ln(n,e,t,i){return Dt(n)||(n=Wr(n)),(typeof t!="number"||i)&&(t=0),Qb(n,e,t)>=0}const fx=Tt(function(n,e,t){var i,a;return ut(e)?a=e:(e=Xi(e),i=e.slice(0,-1),e=e[e.length-1]),tr(n,function(s){var o=a;if(!o){if(i&&i.length&&(s=rc(s,i)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function yc(n,e){return tr(n,ac(e))}function mx(n,e){return Yr(n,Qi(e))}function rg(n,e,t){var i=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Dt(n)?n:Wr(n);for(var u=0,p=n.length;u<p;u++)s=n[u],s!=null&&s>i&&(i=s)}else e=Rt(e,t),on(n,function(h,m,T){o=e(h,m,T),(o>a||o===-1/0&&i===-1/0)&&(i=h,a=o)});return i}function Tx(n,e,t){var i=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Dt(n)?n:Wr(n);for(var u=0,p=n.length;u<p;u++)s=n[u],s!=null&&s<i&&(i=s)}else e=Rt(e,t),on(n,function(h,m,T){o=e(h,m,T),(o<a||o===1/0&&i===1/0)&&(i=h,a=o)});return i}var Ex=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function ig(n){return n?Kn(n)?Hi.call(n):Hl(n)?n.match(Ex):Dt(n)?tr(n,ic):Wr(n):[]}function ag(n,e,t){if(e==null||t)return Dt(n)||(n=Wr(n)),n[oc(n.length-1)];var i=ig(n),a=Et(i);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var u=oc(o,s),p=i[o];i[o]=i[u],i[u]=p}return i.slice(0,e)}function Rx(n){return ag(n,1/0)}function bx(n,e,t){var i=0;return e=Rt(e,t),yc(tr(n,function(a,s,o){return{value:a,index:i++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,u=s.criteria;if(o!==u){if(o>u||o===void 0)return 1;if(o<u||u===void 0)return-1}return a.index-s.index}),"value")}function As(n,e){return function(t,i,a){var s=e?[[],[]]:{};return i=Rt(i,a),on(t,function(o,u){var p=i(o,u,t);n(s,o,p)}),s}}const gx=As(function(n,e,t){wn(n,t)?n[t].push(e):n[t]=[e]}),vx=As(function(n,e,t){n[t]=e}),Ix=As(function(n,e,t){wn(n,t)?n[t]++:n[t]=1}),Px=As(function(n,e,t){n[t?0:1].push(e)},!0);function Dx(n){return n==null?0:Dt(n)?n.length:We(n).length}function Ax(n,e,t){return e in t}const sg=Tt(function(n,e){var t={},i=e[0];if(n==null)return t;ut(i)?(e.length>1&&(i=Ki(i,e[1])),e=Zi(n)):(i=Ax,e=er(e,!1,!1),n=Object(n));for(var a=0,s=e.length;a<s;a++){var o=e[a],u=n[o];i(u,o,n)&&(t[o]=u)}return t}),Sx=Tt(function(n,e){var t=e[0],i;return ut(t)?(t=cc(t),e.length>1&&(i=e[1])):(e=tr(er(e,!1,!1),String),t=function(a,s){return!ln(e,s)}),sg(n,t,i)});function og(n,e,t){return Hi.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function hc(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:og(n,n.length-e)}function Ss(n,e,t){return Hi.call(n,e==null||t?1:e)}function Ox(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:Ss(n,Math.max(0,n.length-e))}function Cx(n){return Yr(n,Boolean)}function Bx(n,e){return er(n,e,!1)}const lg=Tt(function(n,e){return e=er(e,!0,!0),Yr(n,function(t){return!ln(e,t)})}),wx=Tt(function(n,e){return lg(n,e)});function fc(n,e,t,i){yb(e)||(i=t,t=e,e=!1),t!=null&&(t=Rt(t,i));for(var a=[],s=[],o=0,u=Et(n);o<u;o++){var p=n[o],h=t?t(p,o,n):p;e&&!t?((!o||s!==h)&&a.push(p),s=h):t?ln(s,h)||(s.push(h),a.push(p)):ln(a,p)||a.push(p)}return a}const _x=Tt(function(n){return fc(er(n,!0,!0))});function Mx(n){for(var e=[],t=arguments.length,i=0,a=Et(n);i<a;i++){var s=n[i];if(!ln(e,s)){var o;for(o=1;o<t&&ln(arguments[o],s);o++);o===t&&e.push(s)}}return e}function mc(n){for(var e=n&&rg(n,Et).length||0,t=Array(e),i=0;i<e;i++)t[i]=yc(n,i);return t}const Nx=Tt(mc);function $x(n,e){for(var t={},i=0,a=Et(n);i<a;i++)e?t[n[i]]=e[i]:t[n[i][0]]=n[i][1];return t}function Vx(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var i=Math.max(Math.ceil((e-n)/t),0),a=Array(i),s=0;s<i;s++,n+=t)a[s]=n;return a}function Lx(n,e){if(e==null||e<1)return[];for(var t=[],i=0,a=n.length;i<a;)t.push(Hi.call(n,i,i+=e));return t}function Tc(n,e){return n._chain?X(e).chain():e}function cg(n){return on(tc(n),function(e){var t=X[e]=n[e];X.prototype[e]=function(){var i=[this._wrapped];return l4.apply(i,arguments),Tc(this,t.apply(X,i))}}),X}on(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=vs[n];X.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),Tc(this,t)}}),on(["concat","join","slice"],function(n){var e=vs[n];X.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),Tc(this,t)}});var dg=cg(Object.freeze(Object.defineProperty({__proto__:null,VERSION:rb,after:dx,all:tg,allKeys:Zi,any:ng,assign:Ds,before:Wb,bind:qb,bindAll:rx,chain:nx,chunk:Lx,clone:G4,collect:tr,compact:Cx,compose:cx,constant:gb,contains:ln,countBy:Ix,create:L4,debounce:ox,default:X,defaults:$b,defer:ax,delay:Jb,detect:uc,difference:lg,drop:Ss,each:on,escape:q4,every:tg,extend:Nb,extendOwn:Ds,filter:Yr,find:uc,findIndex:dc,findKey:Hb,findLastIndex:zb,findWhere:yx,first:hc,flatten:Bx,foldl:pc,foldr:eg,forEach:on,functions:tc,get:Gb,groupBy:gx,has:x4,head:hc,identity:ic,include:ln,includes:ln,indexBy:vx,indexOf:Qb,initial:og,inject:pc,intersection:Mx,invert:Mb,invoke:fx,isArguments:Zl,isArray:Kn,isArrayBuffer:mb,isBoolean:yb,isDataView:Is,isDate:T4,isElement:m4,isEmpty:zi,isEqual:O4,isError:R4,isFinite:I4,isFunction:ut,isMap:w4,isMatch:Ab,isNaN:bb,isNull:f4,isNumber:hb,isObject:Bn,isRegExp:E4,isSet:M4,isString:Hl,isSymbol:fb,isTypedArray:Pb,isUndefined:pb,isWeakMap:_4,isWeakSet:N4,iteratee:sc,keys:We,last:Ox,lastIndexOf:px,map:tr,mapObject:U4,matcher:Qi,matches:Qi,max:rg,memoize:ix,methods:tc,min:Tx,mixin:cg,negate:cc,noop:xb,now:ea,object:$x,omit:Sx,once:ux,pairs:$4,partial:Hr,partition:Px,pick:sg,pluck:yc,property:ac,propertyOf:j4,random:oc,range:Vx,reduce:pc,reduceRight:eg,reject:hx,rest:Ss,restArguments:Tt,result:K4,sample:ag,select:Yr,shuffle:Rx,size:Dx,some:ng,sortBy:bx,sortedIndex:Zb,tail:Ss,take:hc,tap:F4,template:Q4,templateSettings:H4,throttle:sx,times:k4,toArray:ig,toPath:Lb,transpose:mc,unescape:W4,union:_x,uniq:fc,unique:fc,uniqueId:tx,unzip:mc,values:Wr,where:mx,without:wx,wrap:lx,zip:Nx},Symbol.toStringTag,{value:"Module"})));dg._=dg;function ug(n,e){if(n.type!==r.Property||e.type!==r.Property)throw new Error(`Expected property entities for comparison. But got ${n.type} and ${e.type}.`);return n===e||n.id===e.id?!0:n.name!==e.name||n.static!==e.static||n.abstract!==e.abstract?!1:Os(n.dataType,e.dataType).compatible}function pg(n,e){if(n.type!==r.CustomEntity||e.type!==r.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${n.type} and ${e.type}.`);if(n===e||n.id===e.id)return!0;if(n.properties.length!==e.properties.length)return!1;let t=[...e.properties];const i=[];for(let a=0;a<n.properties.length;a++){const s=n.properties[a];t.find(u=>{const p=ug(s,u);return p&&(t=t.filter(h=>h.id!==u.id)),p})||i.push(s)}return!(i.length>0)}var wt=(n=>(n.BothUnconstrained="both-unconstrained",n.AConstraintBUnconstrained="a-constraint-b-unconstrained",n.BConstraintAUnconstrained="b-constraint-a-unconstrained",n.Same="same",n.AIsListBIsNot="a-is-list-b-is-not",n.BIsListAIsNot="b-is-list-a-is-not",n.AIsNullableBIsNot="a-is-nullable-b-is-not",n.BIsNullableAIsNot="b-is-nullable-a-is-not",n.AIsTemplateBIsNot="a-is-template-b-is-not",n.BIsTemplateAIsNot="b-is-template-a-is-not",n.BothUntyped="both-untyped",n.AIsUntypedBIsNot="a-is-untyped-b-is-not",n.BIsUntypedAIsNot="b-is-untyped-a-is-not",n.TypeEntityMismatch="type-entity-mismatch",n.SameCustomEntities="same-custom-entities",n.CompatibleCustomEntities="compatible-custom-entities",n.IncompatibleCustomEntities="incompatible-custom-entities",n.SamePrimitiveEntities="same-primitive-entities",n.IncompatiblePrimitiveEntities="incompatible-primitive-entities",n.SameBuiltInBaseEntities="same-built-in-base-entities",n.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",n.CheckUnknown="check-unknown",n))(wt||{});function Os(n,e){var t,i,a,s,o,u,p,h,m,T,b;if(n&&n.type!==r.DataType||e&&e.type!==r.DataType)throw new Error(`Expected data-type entities for comparison. But got ${n==null?void 0:n.type} and ${e==null?void 0:e.type}.`);if(n===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(n===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(n===e)return{compatible:!0,type:"same"};if(n.id===e.id)return{compatible:!0,type:"same"};if(n.isList!==e.isList)return{compatible:!1,type:n.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(n.isNullable!==e.isNullable)return{compatible:!1,type:n.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(n.asType!==e.asType)return{compatible:!1,type:n.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!n.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(n.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!n.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=n.entity)==null?void 0:t.type)!==((i=e.entity)==null?void 0:i.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=n.entity)==null?void 0:a.type)===r.CustomEntity){if(((s=n.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const I=pg(n.entity,e.entity);return{compatible:I,type:I?"compatible-custom-entities":"incompatible-custom-entities"}}return((u=n.entity)==null?void 0:u.type)===r.PrimitiveEntity?((p=n.entity)==null?void 0:p.id)===((h=e.entity)==null?void 0:h.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((m=n.entity)==null?void 0:m.type)===r.BuiltInBaseEntity?((T=n.entity)==null?void 0:T.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function yg(n){const e=n.project.builtInBaseEntities.find(a=>a.id===w.EXECUTION),t={id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},i=R(t,n.project);return i.inferred=!0,i.sync(t),i.setParent(n),i.entity=e,i}function hg(n){return n.dataType?n.dataType:null}function fg(n){return n.declaration?n.declaration.dataType:n.readsValue?Cs(n.readsValue):null}function mg(n){return n.declaration.dataType}function Tg(n){if(n.dataType)return n.dataType;if(n.readsValue)return[r.Operation,r.FunctionCall,r.InternalCall].includes(n.readsValue.type)?yg(n):Cs(n.readsValue);const e={id:n.id+"--infered-entity",type:r.CustomEntity,version:1,name:A(n,n.project),description:n.description,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:null},t=R(e,n.project);t.sync(e);const i=n.inputs.map(s=>{const o=Cs(s),u={id:s.id+"--infered-property",type:r.Property,version:1,name:A(s,n.project),description:s.description,static:!0,abstract:!1,private:!1,required:!1,index:s.index,implements:null,dataType:null,parent:null},p=R(u,n.project);return p.setParent(t),p.dataType=o,p});t.properties=wv(t.properties,i);const a=R({id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},n.project);return a.inferred=!0,t.setParent(a),a.entity=t,a.setParent(n),a}function Eg(n){return n.declaration?n.declaration.dataType:null}function Cs(n){switch(n.type){case r.VariableDeclaration:return Tg(n);case r.ArgumentDeclaration:return hg(n);case r.ReturnDeclaration:return null;case r.VariableInstance:return mg(n);case r.InputMap:return fg(n);case r.OutputMap:return Eg(n);default:throw new Error(`Cannot infer data type from entity of type ${n.type}.`)}}function Ec(n){var e;switch(n.type){case r.ArgumentDeclaration:return n.dataType;case r.InputMap:return((e=n.declaration)==null?void 0:e.dataType)||null;case r.VariableDeclaration:return n.dataType;case r.VariableInstance:return n.declaration.dataType;case r.OutputMap:return n.declaration.dataType;case r.ReturnDeclaration:return n.dataType;default:return null}}function Rc(){return c.union([c.object({type:c.literal(r.ValueDescriptor)}),c.record(c.string(),c.any())])}function Rg(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ValueDescriptor)})}function bc(){return c.object({id:c.string(),type:c.literal(r.ValueDescriptor),name:c.string(),required:c.boolean()})}function Gx(){return bc().merge(c.object({version:c.number(),index:c.number()}))}function Fx(){return bc().merge(c.object({}))}function xx(){return c.object({dataType:yn(),parent:dn()})}function Ux(){return Gx().merge(xx())}function zr(){return c.union([c.object({type:c.literal(r.ContinueStatement)}),c.record(c.string(),c.any())])}function Zr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ContinueStatement)})}function gc(){return c.object({id:c.string(),type:c.literal(r.ContinueStatement)})}function jx(){return gc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function kx(){return gc().merge(c.object({}))}function qx(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),outputs:c.array(zt()),throws:c.optional(zt()),parent:Yt()})}function Jx(){return jx().merge(qx())}function pt(){return c.union([c.object({type:c.literal(r.OutputMap)}),c.record(c.string(),c.any())])}function vc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.OutputMap)})}function Ic(){return c.object({id:c.string(),type:c.literal(r.OutputMap)})}function Wx(){return Ic().merge(c.object({version:c.number(),index:c.number()}))}function Hx(){return Ic().merge(c.object({}))}function Yx(){return c.object({writesValues:c.array(un()),declaration:c.union([zt(),sr()]),parent:c.union([ye(),Yt(),cn()])})}function zx(){return Wx().merge(Yx())}function Xr(){return c.union([c.object({type:c.literal(r.Loop)}),c.record(c.string(),c.any())])}function Yt(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Loop)})}function bg(){return c.object({id:c.string(),type:c.literal(r.Loop)})}function Zx(){return bg().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function Xx(){return bg().merge(c.object({declaration:c.union([c.string(),At()])}))}function Qx(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),declaration:Zt(),inputs:c.array(St()),outputs:c.array(pt()),successCalls:c.array(ke()),errorCalls:c.array(ke()),error:pt(),body:At(),parent:c.union([pn(),bt()]),breakStatements:c.array(Qr()),continueStatements:c.array(zr())})}function Kx(){return Zx().merge(Qx())}function Qr(){return c.union([c.object({type:c.literal(r.BreakStatement)}),c.record(c.string(),c.any())])}function cn(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BreakStatement)})}function Pc(){return c.object({id:c.string(),type:c.literal(r.BreakStatement)})}function eU(){return Pc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function tU(){return Pc().merge(c.object({}))}function nU(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),outputs:c.array(zt()),throws:c.optional(zt()),parent:Yt()})}function rU(){return eU().merge(nU())}function ta(){return c.union([c.object({type:c.literal(r.Search)}),c.record(c.string(),c.any())])}function Kr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Search)})}function Dc(){return c.object({id:c.string(),type:c.literal(r.Search),name:c.string(),query:c.any(),description:c.string().nullable()})}function iU(){return Dc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function aU(){return Dc().merge(c.object({}))}function sU(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),inputsDeclarations:c.array(ir()),inputs:c.array(St()),outputsDeclarations:c.array(zt()),outputs:c.array(pt()),parent:c.union([pn(),bt()]),error:pt().nullable()})}function oU(){return iU().merge(sU())}function zt(){return c.union([c.object({type:c.literal(r.ReturnDeclaration)}),c.record(c.string(),c.any())])}function gg(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnDeclaration)})}function Ac(){return c.object({id:c.string(),type:c.literal(r.ReturnDeclaration),name:c.string(),description:c.string().nullable(),isError:c.boolean()})}function lU(){return Ac().merge(c.object({version:c.number(),index:c.number()}))}function cU(){return Ac().merge(c.object({}))}function dU(){return c.object({dataType:yn().nullable(),readsValue:la().nullable(),parent:c.union([ei(),dn(),dn(),Kr(),cn(),Zr()])})}function uU(){return lU().merge(dU())}function nr(){return c.union([c.object({type:c.literal(r.ReturnStatement)}),c.record(c.string(),c.any())])}function ei(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ReturnStatement)})}function Sc(){return c.object({id:c.string(),type:c.literal(r.ReturnStatement)})}function pU(){return Sc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function yU(){return Sc().merge(c.object({}))}function hU(){return c.object({calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),outputs:c.array(zt()),throws:c.optional(zt()),parent:pn()})}function fU(){return pU().merge(hU())}function Oc(){return c.union([c.object({type:c.literal(r.GlobalEvent)}),c.record(c.string(),c.any())])}function mU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.GlobalEvent)})}function Bs(){return c.object({id:c.string(),type:c.literal(r.GlobalEvent),name:c.string(),collapsed:c.boolean()})}function TU(){return Bs().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function EU(){return Bs().merge(c.object({}))}function RU(){return Bs().merge(c.object({returnStatements:c.array(nr()),implements:c.array(Pg()),inputs:c.array(ir()),calls:c.array(ke()),parent:c.union([bt(),ws()])}))}function bU(){return TU().merge(RU())}function Cc(){return c.union([c.object({type:c.literal(r.InstalledProject)}),c.record(c.string(),c.any())])}function ws(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InstalledProject)})}function gU(){return c.object({id:c.string(),type:c.literal(r.InstalledProject)})}function vU(){return c.object({version:c.number(),x:c.number(),y:c.number()})}function IU(){return c.object({})}function PU(){return c.object({implements:bt(),description:c.string().nullable(),functions:c.array(At()),events:c.array(Oc()),parent:bt()})}function DU(){return vU().merge(PU())}function AU(){return c.enum([w.CRON_JOB,w.EXECUTION,w.HTTP_ENDPOINT,w.PERSISTED_ENTITY,w.RELATIONAL_DATABASE])}function ti(){return c.union([c.object({type:c.literal(r.BuiltInBaseEntity)}),c.record(c.string(),c.any())])}function _s(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.BuiltInBaseEntity)})}function Bc(){return c.object({id:c.string(),version:c.number(),type:c.literal(r.BuiltInBaseEntity),name:AU(),description:c.string().nullable(),abstract:c.boolean(),static:c.boolean()})}function SU(){return Bc()}function OU(){return Bc().merge(c.object({}))}function CU(){return c.object({properties:c.array(sr()),methods:c.array(At()),abstractMethods:c.array(Zt()),extends:c.array(c.union([ti(),Ms()]))})}function BU(){return SU().merge(CU())}function Ms(){return c.union([c.object({type:c.literal(r.PrimitiveEntity)}),c.record(c.string(),c.any())])}function Ns(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.PrimitiveEntity)})}function $s(){return c.object({id:c.string(),type:c.literal(r.PrimitiveEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function wU(){return $s().merge(c.object({version:c.number()}))}function _U(){return $s().merge(c.object({}))}function MU(){return c.object({properties:c.array(sr()),methods:c.array(At()),abstractMethods:c.array(Zt()),extends:c.array(c.union([Ms(),ti()]))})}function NU(){return wU().merge(MU())}function At(){return c.union([c.object({type:c.literal(r.FunctionDeclaration)}),c.record(c.string(),c.any())])}function na(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionDeclaration)})}function wc(){return c.object({id:c.string(),type:c.literal(r.FunctionDeclaration),name:c.string(),description:c.string().nullable()})}function $U(){return wc().merge(c.object({version:c.number(),x:c.number(),y:c.number(),index:c.number().nullable()}))}function VU(){return wc()}function LU(){return c.object({inputs:c.array(ir()),implements:Zt().nullable(),returnStatements:c.array(nr()),parent:c.union([bt(),ws(),rr(),Yt(),_s(),Ns()])})}function GU(){return $U().merge(LU())}function ni(){return c.union([c.object({type:c.literal(r.CustomEntity)}),c.record(c.string(),c.any())])}function rr(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.CustomEntity)})}function _c(){return c.object({id:c.string(),type:c.literal(r.CustomEntity),name:c.string(),description:c.string().nullable(),static:c.boolean(),abstract:c.boolean()})}function FU(){return _c().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function xU(){return _c().merge(c.object({}))}function UU(){return c.union([bt(),Xc()])}function jU(){return c.object({properties:c.array(sr()),methods:c.array(At()),abstractMethods:c.array(Zt()),extends:c.array(c.union([ni(),ti()])),implements:c.array(c.union([ni(),ti()])),parent:UU()})}function kU(){return FU().merge(jU())}function ra(){return c.union([c.object({type:c.literal(r.InternalCall)}),c.record(c.string(),c.any())])}function Mc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InternalCall)})}function Nc(){return c.object({id:c.string(),type:c.literal(r.InternalCall),index:c.number()})}function qU(){return Nc().merge(c.object({version:c.number(),index:c.number()}))}function JU(){return Nc().merge(c.object({declaration:c.union([c.string(),At()])}))}function WU(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),writesValues:c.array(un()),declaration:At(),inputs:c.array(St()),outputs:c.array(pt()),parent:_n(),error:c.optional(pt())})}function HU(){return qU().merge(WU())}function vg(){return c.union([c.object({type:c.literal(r.VariableInstance)}),c.record(c.string(),c.any())])}function YU(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableInstance)})}function $c(){return c.object({id:c.string(),type:c.literal(r.VariableInstance)})}function zU(){return $c().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function ZU(){return $c().merge(c.object({}))}function XU(){return c.object({declaration:zc(),dataType:yn().nullable(),readsValue:la().nullable(),writesValues:c.array(un()),inputs:c.array(St()),outputs:c.array(pt()),successCalls:c.array(ke()),errorCalls:c.array(ke()),internalCalls:c.array(ra()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),parent:c.union([pn(),bt()])})}function QU(){return zU().merge(XU())}function KU(){return c.enum([Ae.Equal,Ae.NotEqual,Ae.MoreThan,Ae.MoreThanOrEqual,Ae.LessThan,Ae.LessThanOrEqual,Ae.And,Ae.Or,Ct.Empty,Ct.NotEmpty])}function ia(){return c.union([c.object({type:c.literal(r.Condition)}),c.record(c.string(),c.any())])}function Vs(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Condition)})}function Vc(){return c.object({id:c.string(),type:c.literal(r.Condition)})}function e8(){return Vc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function t8(){return Vc().merge(c.object({}))}function n8(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),leftValue:St(),rightValue:St().nullable(),operator:KU(),parent:c.union([pn(),bt()])})}function r8(){return e8().merge(n8())}function ri(){return c.union([c.object({type:c.literal(r.Operation)}),c.record(c.string(),c.any())])}function ii(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Operation)})}function Ls(){return c.object({id:c.string(),type:c.literal(r.Operation)})}function i8(){return Ls().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function a8(){return Ls().merge(c.object({}))}function s8(){return Ls().merge(c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),writesValues:c.array(un()),declaration:Zt(),inputs:c.array(St()),outputs:c.array(pt()),error:c.array(pt()),dynamicArguments:c.array(St()),parent:c.union([pn(),bt()])}))}function o8(){return i8().merge(s8())}function ai(){return c.union([c.object({type:c.literal(r.FunctionCall)}),c.record(c.string(),c.any())])}function aa(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.FunctionCall)})}function Lc(){return c.object({id:c.string(),type:c.literal(r.FunctionCall)})}function l8(){return Lc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function c8(){return Lc().merge(c.object({}))}function d8(){return c.object({successCalls:c.array(ke()),errorCalls:c.array(ke()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),writesValues:c.array(un()),declaration:At(),inputs:c.array(St()),outputs:c.array(pt()),error:c.optional(pt()),parent:c.union([pn(),bt()])})}function u8(){return l8().merge(d8())}function p8(){return c.union([c.object({type:c.literal(r.Project)}),c.record(c.string(),c.any())])}function bt(){return c.object({entityType:c.literal(r.Project),entityId:c.string(),id:c.string(),type:c.literal(r.GenericReference)})}function Gc(){return c.object({id:c.string(),type:c.literal(r.Project),name:c.string(),description:c.string().nullable()})}function y8(){return Gc().merge(c.object({version:c.number()}))}function h8(){return Gc()}function f8(){return c.object({entities:c.array(ni()),functions:c.array(At()),events:c.array(Oc()),projects:c.array(Cc()),variableDeclarations:c.array(zc()),variableInstances:c.array(vg()),conditions:c.array(ia()),operations:c.array(ri()),functionCalls:c.array(ai()),loops:c.array(Xr()),searches:c.array(ta())})}function m8(){return y8().merge(f8())}function Ig(){return c.enum([V.Dynamic,V.Fixed,V.None])}function Zt(){return c.union([c.object({type:c.literal(r.ActionDescriptor)}),c.record(c.string(),c.any())])}function dn(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ActionDescriptor)})}function Gs(){return c.object({id:c.string(),type:c.literal(r.ActionDescriptor),name:c.string(),description:c.string().nullable(),argumentsType:Ig(),returnsType:Ig()})}function T8(){return Gs().merge(c.object({version:c.number()}))}function E8(){return Gs().merge(c.object({}))}function R8(){return c.object({fixedArguments:c.array(Rc()),fixedReturns:c.array(Rc()),dynamicArgumentTypes:yn().nullable(),dynamicReturnTypes:yn().nullable(),parent:c.union([bt(),rr(),_s(),Ns()]).nullable()})}function Pg(){return T8().merge(R8())}function ir(){return c.union([c.object({type:c.literal(r.ArgumentDeclaration)}),c.record(c.string(),c.any())])}function Fc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.ArgumentDeclaration)})}function xc(){return c.object({id:c.string(),type:c.literal(r.ArgumentDeclaration)})}function b8(){return xc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function g8(){return xc().merge(c.object({}))}function v8(){return c.object({dataType:yn().nullable(),writesValues:c.array(un()),parent:c.union([xe(),dn(),dn(),Kr(),cn()])})}function I8(){return b8().merge(v8())}const sa=c.union([c.string(),c.number(),c.boolean(),c.date()]),Dg=c.enum([Ue.CurrentDateAndTime,Ue.Random,Ue.Unique]),Fs=c.object({type:Dg,rangeStart:sa.nullable(),rangeEnd:sa.nullable()}),oa=Fs.extend({type:c.literal(Ue.Random),rangeStart:sa,rangeEnd:sa}),Uc=Fs.extend({type:c.literal(Ue.Unique),rangeStart:c.null(),rangeEnd:c.null()}),Ag=Fs.extend({type:c.literal(Ue.CurrentDateAndTime),rangeStart:c.null(),rangeEnd:c.null()}),xs=oa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),Sg=xs.extend({rangeStart:c.number(),rangeEnd:c.null()}),Og=xs.extend({rangeStart:c.null(),rangeEnd:c.number()}),Cg=xs.extend({rangeStart:c.number(),rangeEnd:c.number()}),Us=oa.extend({rangeStart:c.number().nullable(),rangeEnd:c.number().nullable()}),Bg=Us.extend({rangeStart:c.number(),rangeEnd:c.null()}),wg=Us.extend({rangeStart:c.null(),rangeEnd:c.number()}),_g=Us.extend({rangeStart:c.number(),rangeEnd:c.number()}),js=oa.extend({rangeStart:c.date().nullable(),rangeEnd:c.date().nullable()}),Mg=js.extend({rangeStart:c.date(),rangeEnd:c.null()}),Ng=js.extend({rangeStart:c.null(),rangeEnd:c.date()}),$g=js.extend({rangeStart:c.date(),rangeEnd:c.date()}),jc=oa.extend({rangeStart:c.null(),rangeEnd:c.null()}),kc=c.union([Bg,wg,_g]),qc=c.union([Sg,Og,Cg]),Jc=c.union([Mg,Ng,$g,Ag]),Wc=c.union([kc,qc,Jc,Uc,jc]);function ks(){return c.union([c.string(),c.number(),c.boolean(),c.null(),c.date()])}function Vg(){return c.record(c.string(),ks())}function P8(){return c.array(c.union([ks(),Vg()]))}function Lg(){return c.union([ks(),Vg(),P8()])}function Gg(){return c.union([ks(),Lg()])}function Fg(){return c.enum([g.String,g.Number,g.Boolean,g.Null,g.Date,g.JSON,g.Enum,g.File,g.UUID,g.EntityTemplate,g.ActionDescriptor])}function D8(){return c.union([rr(),ii(),na()])}function A8(){return c.object({id:c.string(),name:Fg(),type:c.literal(r.PrimitiveValue),value:Gg(),autogeneration:Wc.nullable()})}function S8(){return A8().merge(c.object({}))}function Ft(){return c.object({id:c.string(),version:c.number(),name:Fg(),type:c.literal(r.PrimitiveValue),value:Gg(),valueAsType:D8().nullable(),autogeneration:Wc.nullable(),parent:c.union([Xc(),qs()])})}function O8(){return Ft().extend({name:c.literal(g.String),value:c.string(),autogeneration:kc.nullable()})}function C8(){return Ft().extend({name:c.literal(g.Number),value:c.number(),autogeneration:qc.nullable()})}function B8(){return Ft().extend({name:c.literal(g.Boolean),value:c.boolean(),autogeneration:jc.nullable()})}function w8(){return Ft().extend({name:c.literal(g.Null),value:c.null(),autogeneration:c.null()})}function _8(){return Ft().extend({name:c.literal(g.Date),value:c.date(),autogeneration:Jc.nullable()})}function M8(){return Ft().extend({name:c.literal(g.JSON),value:Lg(),autogeneration:c.null()})}function N8(){return Ft().extend({name:c.literal(g.Enum),value:c.string(),autogeneration:c.null()})}function $8(){return Ft().extend({name:c.literal(g.File),value:c.string(),autogeneration:c.null()})}function V8(){return Ft().extend({name:c.literal(g.UUID),value:c.string(),autogeneration:Uc.nullable()})}function L8(){return Ft().extend({name:c.literal(g.EntityTemplate),value:rr(),autogeneration:c.null()})}function G8(){return Ft().extend({name:c.literal(g.ActionDescriptor),value:na(),autogeneration:c.null()})}function Hc(){return c.union([O8(),C8(),B8(),w8(),_8(),M8(),N8(),$8(),V8(),L8(),G8()])}function St(){return c.union([c.object({type:c.literal(r.InputMap)}),c.record(c.string(),c.any())])}function qs(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.InputMap)})}function Yc(){return c.object({id:c.string(),type:c.literal(r.InputMap),name:c.string().nullable().optional(),description:c.string().nullable().optional()})}function F8(){return Yc().merge(c.object({version:c.number(),index:c.number()}))}function x8(){return Yc().merge(c.object({}))}function U8(){return c.object({defaultValue:Hc().nullable(),declaration:c.union([ir(),sr()]).nullable(),readsValue:la().nullable(),parent:c.union([ye(),qs(),Yt(),cn()]),dynamicArguments:c.array(St())})}function j8(){return F8().merge(U8())}function zc(){return c.union([c.object({type:c.literal(r.VariableDeclaration)}),c.record(c.string(),c.any())])}function k8(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.VariableDeclaration)})}function Zc(){return c.object({id:c.string(),type:c.literal(r.VariableDeclaration),name:c.string(),description:c.string().nullable()})}function q8(){return Zc().merge(c.object({version:c.number(),x:c.number(),y:c.number()}))}function J8(){return Zc().merge(c.object({}))}function W8(){return c.object({dataType:yn().nullable(),readsValue:la().nullable(),writesValues:c.array(un()),inputs:c.array(St()),outputs:c.array(pt()),successCalls:c.array(ke()),errorCalls:c.array(ke()),internalCalls:c.array(ra()),calledBySuccess:c.array(ye()),calledByError:c.array(ye()),calledByEntry:c.array(xe()),parent:c.union([pn(),bt()])})}function H8(){return q8().merge(W8())}function ar(){return c.union([zc(),vg()])}function _n(){return c.union([k8(),YU()])}function un(){return c.union([ar(),St(),zt()])}function xg(){return c.union([_n(),qs(),gg()])}function la(){return c.union([ar(),ir(),pt(),ri(),ra(),ai()])}function Y8(){return c.union([_n(),Fc(),vc(),ii(),Mc(),aa()])}function z8(){return c.union([ir(),pt(),un()])}function Ug(){return c.union([Fc(),vc(),xg()])}function Js(){return Oc()}function Ws(){return mU()}function Hs(){return c.union([ri(),ai(),ia(),ta(),ar(),ra(),Xr()])}function ye(){return c.union([ii(),aa(),Vs(),Kr(),_n(),Mc(),Yt()])}function Ys(){return c.union([ri(),ai(),ia(),ta(),ar(),Xr()])}function zs(){return c.union([ii(),aa(),Vs(),Kr(),_n(),Yt()])}function jg(){return c.union([Hs(),nr(),Qr(),zr()])}function ke(){return c.union([ye(),ei(),cn(),Zr()])}function kg(){return c.union([Ys(),nr(),Qr(),zr()])}function qg(){return c.union([zs(),ei(),cn(),Zr()])}function Mn(){return c.union([At(),Js()])}function xe(){return c.union([na(),Ws()])}function Z8(){return c.union([Hs(),Mn()])}function X8(){return c.union([ye(),xe()])}function Q8(){return c.union([Ys(),Mn()])}function K8(){return c.union([zs(),xe()])}function e9(){return c.union([jg(),Mn()])}function t9(){return c.union([ke(),xe()])}function n9(){return c.union([kg(),Mn()])}function r9(){return c.union([qg(),xe()])}function i9(){return c.union([Mn(),Xr()])}function pn(){return c.union([xe(),Yt()])}function a9(){return c.union([Hs(),Mn()])}function s9(){return c.union([ye(),xe()])}function o9(){return c.union([Ys(),Mn()])}function l9(){return c.union([zs(),xe()])}function c9(){return c.union([nr(),Qr(),zr()])}function d9(){return c.union([ei(),cn(),Zr()])}function u9(){return c.union([ti(),p8(),Cc(),ni(),At(),Js(),ar(),St(),pt(),ia(),ri(),ai(),zt(),ir(),Ms(),yn(),sr(),Zt(),nr(),zr(),Qr(),Xr(),ta(),Zt(),Zt(),Rc(),ra()])}function p9(){return c.union([_s(),bt(),ws(),rr(),na(),Ws(),_n(),qs(),vc(),Vs(),ii(),aa(),gg(),Fc(),Ns(),Xc(),Jg(),dn(),ei(),Zr(),cn(),Yt(),Kr(),dn(),dn(),Rg(),Mc()])}function y9(){return c.union([Cc(),ni(),At(),Js(),ar(),ia(),ri(),ai(),nr(),zr(),Qr(),Xr(),ta()])}function h9(){return c.union([ws(),rr(),na(),Ws(),_n(),Vs(),ii(),aa(),ei(),Zr(),cn(),Yt(),Kr()])}function yn(){return c.union([c.object({type:c.literal(r.DataType)}),c.record(c.string(),c.any())])}function Xc(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.DataType)})}function Qc(){return c.object({id:c.string(),type:c.literal(r.DataType),isNullable:c.boolean(),isList:c.boolean(),constant:c.boolean(),asType:c.boolean(),options:c.array(c.string()).optional()})}function f9(){return Qc().merge(c.object({version:c.number()}))}function m9(){return Qc().merge(c.object({}))}function T9(){return c.object({defaultValue:Hc().nullable(),entity:c.union([ni(),ti(),Ms(),Zt()]).nullable(),parent:c.union([Jg(),Ug(),dn(),Rg()])})}function E9(){return f9().merge(T9())}function sr(){return c.union([c.object({type:c.literal(r.Property)}),c.record(c.string(),c.any())])}function Jg(){return c.object({id:c.string(),type:c.literal(r.GenericReference),entityId:c.string(),entityType:c.literal(r.Property)})}function Kc(){return c.object({id:c.string(),type:c.literal(r.Property),name:c.string(),description:c.string().nullable(),private:c.boolean(),static:c.boolean(),required:c.boolean(),abstract:c.boolean()})}function R9(){return Kc().merge(c.object({version:c.number(),index:c.number()}))}function b9(){return Kc().merge(c.object({}))}function g9(){return c.object({dataType:yn(),implements:sr().nullable(),parent:c.union([rr(),Ns(),_s()])})}function v9(){return R9().merge(g9())}function I9(n){var o;const e=v9(),t=n.toJSON();e.safeParse(t).success;const a=P9(n);(o=n.dataType)==null||o.validate();const s=[...a];if(n.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return s}function P9(n){const e=[];if(!n.implements)return e;const t=n.implements;if(!t.abstract){const a=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});e.push(a.error)}if(n.static&&!t.static){const a=H({id:`${n.id}--${M.NonStaticPropertyImplementsStatic}`,message:`Static property "${A(n,n.project)}" with id "${n.id}" implements a non-static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.NonStaticPropertyImplementsStatic,entity:n});e.push(a.error)}if(!n.static&&t.static){const a=H({id:`${n.id}--${M.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${A(n,n.project)}" with id "${n.id}" implements a static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.StaticPropertyImplementsNonStatic,entity:n});e.push(a.error)}if(!Os(n.dataType,t.dataType)){const a=H({id:`${n.id}--${M.PropertyImplementsIncompatibleType}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a property "${A(t,n.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:f.Error,code:M.PropertyImplementsIncompatibleType,entity:n});e.push(a.error)}return Z(n.errors,e)}function D9(n,e){const t=[];if(n.parent){const a=e.get(n.parent);if(!a)t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const s=vr(a);if(s){const o=a!==s?`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,a.project)}) higher up in the tree.`:`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${n.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:o,issue:null}))}else if(![r.CustomEntity].includes(a.type))t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const u=Gn(a).filter(p=>!p.interactive);if(u.length){let p=u.length>1?`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(u.map(h=>A(h,h.project)),'", "','" and "')}").`:`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(u[0],u[0].project)}").`;p+=`
14
- ${Vn}`,t.push(new E({id:`${n.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new E({id:`${n.id}--${n.implements}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const h=a.properties.find(m=>{var T;return((T=m.implements)==null?void 0:T.id)===n.implements});h?t.push(new E({id:`${n.id}--${v.PropertyOverwrite}`,code:v.PropertyOverwrite,severity:f.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${h.id}' that implements the same base property.`,issue:null})):[r.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Ge(n,{},e);return t.push(...i.errors),t}function D(n){if(n){let e=null;return typeof n=="string"?e=n:n.entityId?e=n.entityId:n.type!==r.GenericReference&&(e=n.id),e}return null}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",r.Property);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,description:e.description,implements:s,dataType:null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=D9(i,t),o=Od(i,t);return a.push(...s,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
12
+ `;var u;try{u=new Function(o,"_",s)}catch(h){throw h.source=s,h}var p=function(h){return u.call(this,h,Q)};return p.source="function("+o+`){
13
+ `+s+"}",p}function j8(n,e,t){e=ra(e);var i=e.length;if(!i)return pt(t)?t.call(n):t;for(var a=0;a<i;a++){var s=n==null?void 0:n[e[a]];s===void 0&&(s=t,a=i),n=pt(s)?s.call(n):s}return n}var k8=0;function q8(n){var e=++k8+"";return n?n+e:e}function J8(n){var e=Q(n);return e._chain=!0,e}function pg(n,e,t,i,a){if(!(i instanceof e))return n.apply(t,a);var s=ag(n.prototype),o=n.apply(s,a);return wn(o)?o:s}var ni=Et(function(n,e){var t=ni.placeholder,i=function(){for(var a=0,s=e.length,o=Array(s),u=0;u<s;u++)o[u]=e[u]===t?arguments[a++]:e[u];for(;a<arguments.length;)o.push(arguments[a++]);return pg(n,i,this,this,o)};return i});ni.placeholder=Q;const yg=Et(function(n,e,t){if(!pt(n))throw new TypeError("Bind must be called on a function");var i=Et(function(a){return pg(n,i,e,this,t.concat(a))});return i}),St=Jb(Rt);function ir(n,e,t,i){if(i=i||[],!e&&e!==0)e=1/0;else if(e<=0)return i.concat(n);for(var a=i.length,s=0,o=Rt(n);s<o;s++){var u=n[s];if(St(u)&&(rr(u)||Sc(u)))if(e>1)ir(u,e-1,t,i),a=i.length;else for(var p=0,h=u.length;p<h;)i[a++]=u[p++];else t||(i[a++]=u)}return i}const W8=Et(function(n,e){e=ir(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var i=e[t];n[i]=yg(n[i],n)}return n});function H8(n,e){var t=function(i){var a=t.cache,s=""+(e?e.apply(this,arguments):i);return _n(a,s)||(a[s]=n.apply(this,arguments)),a[s]};return t.cache={},t}const hg=Et(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),Y8=ni(hg,Q,1);function z8(n,e,t){var i,a,s,o,u=0;t||(t={});var p=function(){u=t.leading===!1?0:sa(),i=null,o=n.apply(a,s),i||(a=s=null)},h=function(){var m=sa();!u&&t.leading===!1&&(u=m);var T=e-(m-u);return a=this,s=arguments,T<=0||T>e?(i&&(clearTimeout(i),i=null),u=m,o=n.apply(a,s),i||(a=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(p,T)),o};return h.cancel=function(){clearTimeout(i),u=0,i=a=s=null},h}function Z8(n,e,t){var i,a,s,o,u,p=function(){var m=sa()-a;e>m?i=setTimeout(p,e-m):(i=null,t||(o=n.apply(u,s)),i||(s=u=null))},h=Et(function(m){return u=this,s=m,a=sa(),i||(i=setTimeout(p,e),t&&(o=n.apply(u,s))),o});return h.cancel=function(){clearTimeout(i),i=s=u=null},h}function X8(n,e){return ni(e,n)}function Uc(n){return function(){return!n.apply(this,arguments)}}function Q8(){var n=arguments,e=n.length-1;return function(){for(var t=e,i=n[e].apply(this,arguments);t--;)i=n[t].call(this,i);return i}}function K8(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function fg(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const e9=ni(fg,2);function mg(n,e,t){e=bt(e,t);for(var i=We(n),a,s=0,o=i.length;s<o;s++)if(a=i[s],e(n[a],a,n))return a}function Tg(n){return function(e,t,i){t=bt(t,i);for(var a=Rt(e),s=n>0?0:a-1;s>=0&&s<a;s+=n)if(t(e[s],s,e))return s;return-1}}const xc=Tg(1),Eg=Tg(-1);function Rg(n,e,t,i){t=bt(t,i,1);for(var a=t(e),s=0,o=Rt(n);s<o;){var u=Math.floor((s+o)/2);t(n[u])<a?s=u+1:o=u}return s}function bg(n,e,t){return function(i,a,s){var o=0,u=Rt(i);if(typeof s=="number")n>0?o=s>=0?s:Math.max(s+u,o):u=s>=0?Math.min(s+1,u):s+u+1;else if(t&&s&&u)return s=t(i,a),i[s]===a?s:-1;if(a!==a)return s=e(Ki.call(i,o,u),kb),s>=0?s+o:-1;for(s=n>0?o:u-1;s>=0&&s<u;s+=n)if(i[s]===a)return s;return-1}}const gg=bg(1,xc,Rg),t9=bg(-1,Eg);function jc(n,e,t){var i=St(n)?xc:mg,a=i(n,e,t);if(a!==void 0&&a!==-1)return n[a]}function n9(n,e){return jc(n,ia(e))}function pn(n,e,t){e=aa(e,t);var i,a;if(St(n))for(i=0,a=n.length;i<a;i++)e(n[i],i,n);else{var s=We(n);for(i=0,a=s.length;i<a;i++)e(n[s[i]],s[i],n)}return n}function ar(n,e,t){e=bt(e,t);for(var i=!St(n)&&We(n),a=(i||n).length,s=Array(a),o=0;o<a;o++){var u=i?i[o]:o;s[o]=e(n[u],u,n)}return s}function vg(n){var e=function(t,i,a,s){var o=!St(t)&&We(t),u=(o||t).length,p=n>0?0:u-1;for(s||(a=t[o?o[p]:p],p+=n);p>=0&&p<u;p+=n){var h=o?o[p]:p;a=i(a,t[h],h,t)}return a};return function(t,i,a,s){var o=arguments.length>=3;return e(t,aa(i,s,4),a,o)}}const kc=vg(1),Ig=vg(-1);function ri(n,e,t){var i=[];return e=bt(e,t),pn(n,function(a,s,o){e(a,s,o)&&i.push(a)}),i}function r9(n,e,t){return ri(n,Uc(bt(e)),t)}function Pg(n,e,t){e=bt(e,t);for(var i=!St(n)&&We(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(!e(n[o],o,n))return!1}return!0}function Dg(n,e,t){e=bt(e,t);for(var i=!St(n)&&We(n),a=(i||n).length,s=0;s<a;s++){var o=i?i[s]:s;if(e(n[o],o,n))return!0}return!1}function yn(n,e,t,i){return St(n)||(n=ti(n)),(typeof t!="number"||i)&&(t=0),gg(n,e,t)>=0}const i9=Et(function(n,e,t){var i,a;return pt(e)?a=e:(e=ra(e),i=e.slice(0,-1),e=e[e.length-1]),ar(n,function(s){var o=a;if(!o){if(i&&i.length&&(s=Nc(s,i)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function qc(n,e){return ar(n,Vc(e))}function a9(n,e){return ri(n,ia(e))}function Ag(n,e,t){var i=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=St(n)?n:ti(n);for(var u=0,p=n.length;u<p;u++)s=n[u],s!=null&&s>i&&(i=s)}else e=bt(e,t),pn(n,function(h,m,T){o=e(h,m,T),(o>a||o===-1/0&&i===-1/0)&&(i=h,a=o)});return i}function s9(n,e,t){var i=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=St(n)?n:ti(n);for(var u=0,p=n.length;u<p;u++)s=n[u],s!=null&&s<i&&(i=s)}else e=bt(e,t),pn(n,function(h,m,T){o=e(h,m,T),(o<a||o===1/0&&i===1/0)&&(i=h,a=o)});return i}var o9=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Sg(n){return n?rr(n)?Ki.call(n):Pc(n)?n.match(o9):St(n)?ar(n,$c):ti(n):[]}function Og(n,e,t){if(e==null||t)return St(n)||(n=ti(n)),n[Gc(n.length-1)];var i=Sg(n),a=Rt(i);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var u=Gc(o,s),p=i[o];i[o]=i[u],i[u]=p}return i.slice(0,e)}function l9(n){return Og(n,1/0)}function c9(n,e,t){var i=0;return e=bt(e,t),qc(ar(n,function(a,s,o){return{value:a,index:i++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,u=s.criteria;if(o!==u){if(o>u||o===void 0)return 1;if(o<u||u===void 0)return-1}return a.index-s.index}),"value")}function ks(n,e){return function(t,i,a){var s=e?[[],[]]:{};return i=bt(i,a),pn(t,function(o,u){var p=i(o,u,t);n(s,o,p)}),s}}const d9=ks(function(n,e,t){_n(n,t)?n[t].push(e):n[t]=[e]}),u9=ks(function(n,e,t){n[t]=e}),p9=ks(function(n,e,t){_n(n,t)?n[t]++:n[t]=1}),y9=ks(function(n,e,t){n[t?0:1].push(e)},!0);function h9(n){return n==null?0:St(n)?n.length:We(n).length}function f9(n,e,t){return e in t}const Cg=Et(function(n,e){var t={},i=e[0];if(n==null)return t;pt(i)?(e.length>1&&(i=aa(i,e[1])),e=na(n)):(i=f9,e=ir(e,!1,!1),n=Object(n));for(var a=0,s=e.length;a<s;a++){var o=e[a],u=n[o];i(u,o,n)&&(t[o]=u)}return t}),m9=Et(function(n,e){var t=e[0],i;return pt(t)?(t=Uc(t),e.length>1&&(i=e[1])):(e=ar(ir(e,!1,!1),String),t=function(a,s){return!yn(e,s)}),Cg(n,t,i)});function Bg(n,e,t){return Ki.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function Jc(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:Bg(n,n.length-e)}function qs(n,e,t){return Ki.call(n,e==null||t?1:e)}function T9(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:qs(n,Math.max(0,n.length-e))}function E9(n){return ri(n,Boolean)}function R9(n,e){return ir(n,e,!1)}const wg=Et(function(n,e){return e=ir(e,!0,!0),ri(n,function(t){return!yn(e,t)})}),b9=Et(function(n,e){return wg(n,e)});function Wc(n,e,t,i){Vb(e)||(i=t,t=e,e=!1),t!=null&&(t=bt(t,i));for(var a=[],s=[],o=0,u=Rt(n);o<u;o++){var p=n[o],h=t?t(p,o,n):p;e&&!t?((!o||s!==h)&&a.push(p),s=h):t?yn(s,h)||(s.push(h),a.push(p)):yn(a,p)||a.push(p)}return a}const g9=Et(function(n){return Wc(ir(n,!0,!0))});function v9(n){for(var e=[],t=arguments.length,i=0,a=Rt(n);i<a;i++){var s=n[i];if(!yn(e,s)){var o;for(o=1;o<t&&yn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Hc(n){for(var e=n&&Ag(n,Rt).length||0,t=Array(e),i=0;i<e;i++)t[i]=qc(n,i);return t}const I9=Et(Hc);function P9(n,e){for(var t={},i=0,a=Rt(n);i<a;i++)e?t[n[i]]=e[i]:t[n[i][0]]=n[i][1];return t}function D9(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var i=Math.max(Math.ceil((e-n)/t),0),a=Array(i),s=0;s<i;s++,n+=t)a[s]=n;return a}function A9(n,e){if(e==null||e<1)return[];for(var t=[],i=0,a=n.length;i<a;)t.push(Ki.call(n,i,i+=e));return t}function Yc(n,e){return n._chain?Q(e).chain():e}function _g(n){return pn(_c(n),function(e){var t=Q[e]=n[e];Q.prototype[e]=function(){var i=[this._wrapped];return Xx.apply(i,arguments),Yc(this,t.apply(Q,i))}}),Q}pn(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=Fs[n];Q.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),Yc(this,t)}}),pn(["concat","join","slice"],function(n){var e=Fs[n];Q.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),Yc(this,t)}});var Mg=_g(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Ab,after:K8,all:Pg,allKeys:na,any:Dg,assign:js,before:fg,bind:yg,bindAll:W8,chain:J8,chunk:A9,clone:S8,collect:ar,compact:E9,compose:Q8,constant:qb,contains:yn,countBy:p9,create:A8,debounce:Z8,default:Q,defaults:ig,defer:Y8,delay:hg,detect:jc,difference:wg,drop:qs,each:pn,escape:M8,every:Pg,extend:rg,extendOwn:js,filter:ri,find:jc,findIndex:xc,findKey:mg,findLastIndex:Eg,findWhere:n9,first:Jc,flatten:R9,foldl:kc,foldr:Ig,forEach:pn,functions:_c,get:og,groupBy:d9,has:C8,head:Jc,identity:$c,include:yn,includes:yn,indexBy:u9,indexOf:gg,initial:Bg,inject:kc,intersection:v9,invert:ng,invoke:i9,isArguments:Sc,isArray:rr,isArrayBuffer:Fb,isBoolean:Vb,isDataView:Us,isDate:s8,isElement:a8,isEmpty:ta,isEqual:T8,isError:l8,isFinite:p8,isFunction:pt,isMap:b8,isMatch:zb,isNaN:kb,isNull:i8,isNumber:Lb,isObject:wn,isRegExp:o8,isSet:v8,isString:Pc,isSymbol:Gb,isTypedArray:Hb,isUndefined:$b,isWeakMap:g8,isWeakSet:I8,iteratee:Lc,keys:We,last:T9,lastIndexOf:t9,map:ar,mapObject:B8,matcher:ia,matches:ia,max:Ag,memoize:H8,methods:_c,min:s9,mixin:_g,negate:Uc,noop:cg,now:sa,object:P9,omit:m9,once:e9,pairs:P8,partial:ni,partition:y9,pick:Cg,pluck:qc,property:Vc,propertyOf:w8,random:Gc,range:D9,reduce:kc,reduceRight:Ig,reject:r9,rest:qs,restArguments:Et,result:j8,sample:Og,select:ri,shuffle:l9,size:h9,some:Dg,sortBy:c9,sortedIndex:Rg,tail:qs,take:Jc,tap:O8,template:x8,templateSettings:V8,throttle:z8,times:_8,toArray:Sg,toPath:sg,transpose:Hc,unescape:$8,union:g9,uniq:Wc,unique:Wc,uniqueId:q8,unzip:Hc,values:ti,where:a9,without:b9,wrap:X8,zip:I9},Symbol.toStringTag,{value:"Module"})));Mg._=Mg;function Js(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ng(n){return n.charAt(0).toLowerCase()+n.slice(1)}function $g(n,e){if(n.type!==r.Property||e.type!==r.Property)throw new Error(`Expected property entities for comparison. But got ${n.type} and ${e.type}.`);return n===e||n.id===e.id?!0:n.name!==e.name||n.static!==e.static||n.abstract!==e.abstract?!1:Ws(n.dataType,e.dataType).compatible}function Vg(n,e){if(n.type!==r.CustomEntity||e.type!==r.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${n.type} and ${e.type}.`);if(n===e||n.id===e.id)return!0;if(n.properties.length!==e.properties.length)return!1;let t=[...e.properties];const i=[];for(let a=0;a<n.properties.length;a++){const s=n.properties[a];t.find(u=>{const p=$g(s,u);return p&&(t=t.filter(h=>h.id!==u.id)),p})||i.push(s)}return!(i.length>0)}var wt=(n=>(n.BothUnconstrained="both-unconstrained",n.AConstraintBUnconstrained="a-constraint-b-unconstrained",n.BConstraintAUnconstrained="b-constraint-a-unconstrained",n.Same="same",n.AIsListBIsNot="a-is-list-b-is-not",n.BIsListAIsNot="b-is-list-a-is-not",n.AIsNullableBIsNot="a-is-nullable-b-is-not",n.BIsNullableAIsNot="b-is-nullable-a-is-not",n.AIsTemplateBIsNot="a-is-template-b-is-not",n.BIsTemplateAIsNot="b-is-template-a-is-not",n.BothUntyped="both-untyped",n.AIsUntypedBIsNot="a-is-untyped-b-is-not",n.BIsUntypedAIsNot="b-is-untyped-a-is-not",n.TypeEntityMismatch="type-entity-mismatch",n.SameCustomEntities="same-custom-entities",n.CompatibleCustomEntities="compatible-custom-entities",n.IncompatibleCustomEntities="incompatible-custom-entities",n.SamePrimitiveEntities="same-primitive-entities",n.IncompatiblePrimitiveEntities="incompatible-primitive-entities",n.SameBuiltInBaseEntities="same-built-in-base-entities",n.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",n.CheckUnknown="check-unknown",n))(wt||{});function Ws(n,e){var t,i,a,s,o,u,p,h,m,T,b;if(n&&n.type!==r.DataType||e&&e.type!==r.DataType)throw new Error(`Expected data-type entities for comparison. But got ${n==null?void 0:n.type} and ${e==null?void 0:e.type}.`);if(n===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(n===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(n===e)return{compatible:!0,type:"same"};if(n.id===e.id)return{compatible:!0,type:"same"};if(n.isList!==e.isList)return{compatible:!1,type:n.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(n.isNullable!==e.isNullable)return{compatible:!1,type:n.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(n.asType!==e.asType)return{compatible:!1,type:n.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!n.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(n.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!n.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=n.entity)==null?void 0:t.type)!==((i=e.entity)==null?void 0:i.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=n.entity)==null?void 0:a.type)===r.CustomEntity){if(((s=n.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const I=Vg(n.entity,e.entity);return{compatible:I,type:I?"compatible-custom-entities":"incompatible-custom-entities"}}return((u=n.entity)==null?void 0:u.type)===r.PrimitiveEntity?((p=n.entity)==null?void 0:p.id)===((h=e.entity)==null?void 0:h.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((m=n.entity)==null?void 0:m.type)===r.BuiltInBaseEntity?((T=n.entity)==null?void 0:T.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function Lg(n){const e=n.project.builtInBaseEntities.find(a=>a.id===w.EXECUTION),t={id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},i=R(t,n.project);return i.inferred=!0,i.sync(t),i.setParent(n),i.entity=e,i}function Gg(n){return n.dataType?n.dataType:null}function Fg(n){return n.declaration?n.declaration.dataType:n.readsValue?Hs(n.readsValue):null}function Ug(n){return n.declaration.dataType}function xg(n){if(n.dataType)return n.dataType;if(n.readsValue)return[r.Operation,r.FunctionCall,r.InternalCall].includes(n.readsValue.type)?Lg(n):Hs(n.readsValue);const e={id:n.id+"--infered-entity",type:r.CustomEntity,version:1,name:A(n,n.project),description:n.description,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:null},t=R(e,n.project);t.sync(e);const i=n.inputs.map(s=>{const o=Hs(s),u={id:s.id+"--infered-property",type:r.Property,version:1,name:A(s,n.project),description:s.description,static:!0,abstract:!1,private:!1,required:!1,index:s.index,implements:null,dataType:null,parent:null},p=R(u,n.project);return p.setParent(t),p.dataType=o,p});t.properties=Lv(t.properties,i);const a=R({id:n.id+"--infered-data-type",version:1,type:r.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},n.project);return a.inferred=!0,t.setParent(a),a.entity=t,a.setParent(n),a}function jg(n){return n.declaration?n.declaration.dataType:null}function Hs(n){switch(n.type){case r.VariableDeclaration:return xg(n);case r.ArgumentDeclaration:return Gg(n);case r.ReturnDeclaration:return null;case r.VariableInstance:return Ug(n);case r.InputMap:return Fg(n);case r.OutputMap:return jg(n);default:throw new Error(`Cannot infer data type from entity of type ${n.type}.`)}}function zc(n){var e;switch(n.type){case r.ArgumentDeclaration:return n.dataType;case r.InputMap:return((e=n.declaration)==null?void 0:e.dataType)||null;case r.VariableDeclaration:return n.dataType;case r.VariableInstance:return n.declaration.dataType;case r.OutputMap:return n.declaration.dataType;case r.ReturnDeclaration:return n.dataType;default:return null}}function D(n){if(n){let e=null;return typeof n=="string"?e=n:n.entityId?e=n.entityId:n.type!==r.GenericReference&&(e=n.id),e}return null}function Zc(n){return n.declaration||n}function S9(n){return n.type===r.VariableDeclaration?n.parent===n.project?"global-declaration":"local-declaration":n.declaration.parent===n.project?"global-instance":"local-instance"}function Xc(n,e){const t=[];if(n.type===r.Project)t.push(...n.variableDeclarations);else{const a=_t(Me(n)).filter(s=>s.type===r.VariableDeclaration);t.push(...a),n.parent&&(st.includes(n.parent.type)||n.parent.type===r.Project)&&t.push(...Xc(n.parent))}return t}function O9(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function C9(n){return n.split(/\s+/).map(i=>i[0].toUpperCase()+i.slice(1).toLowerCase()).join("")}function kg(n){var e;return(e=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function Ys(n){return kg(n).toLowerCase()}function sr(n,e=!0){if(!(n!=null&&n.dataType))return"Any data type";if(!n.dataType.entity)return n.dataType.isList?"List of an unknown data type":"Unknown data type";if(n.dataType.entity.type===r.PrimitiveEntity){let t=n.dataType.entity.name;switch(n.dataType.entity.name){case g.String:t="Text";break;case g.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=n.dataType.entity.name;break}return n.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function qg(n){return sr(n.declaration)}function B9(n){return n.type===r.VariableInstance?qg(n):sr(n)}function Jg(n){if(!n)return"Any data type";if(!n.entity)return"Inherited";if(n.entity.type===r.PrimitiveEntity){const e=n.entity.name===g.String?"Text":n.entity.name;return n.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.entity.type===r.CustomEntity){const e=Kc(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.entity.type===r.BuiltInBaseEntity){const e=Qc(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.isList?`List of ${n.entity.name} entities`:`${n.entity.name.slice(0,1).toUpperCase()+n.entity.name.slice(1)} entity`}function Wg(n){if(!n.dataType)return"Any data type";if(!n.dataType.entity)return"Inherited";if(n.dataType.entity.type===r.PrimitiveEntity){const e=n.dataType.entity.name===g.String?"Text":n.dataType.entity.name;return n.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.dataType.entity.type===r.CustomEntity){const e=Kc(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.dataType.entity.type===r.BuiltInBaseEntity){const e=Qc(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function Hg(n){switch(n.type){case r.Property:return Wg(n);case r.VariableDeclaration:return sr(n);case r.ArgumentDeclaration:return sr(n,!1);case r.InputMap:{const e=n.declaration;return e?Hg(e):"Unknown data type"}case r.ReturnDeclaration:return sr(n,!1);case r.OutputMap:{const e=n.declaration;return sr(e,!1)}}return"Unknown data type"}function zs(n){switch(n.declaration.id){case Ae.Equal:return"is equal to";case Ae.NotEqual:return"is not equal to";case Ae.MoreThan:return"is greater than";case Ae.MoreThanOrEqual:return"is greater than or equal to";case Ae.LessThan:return"is less than";case Ae.LessThanOrEqual:return"is less than or equal to";case Ae.And:return"and";case Ae.Or:return"or";case Ct.Empty:return"is empty";case Ct.NotEmpty:return"is not empty"}}function Yg(n){return n.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":n.includes(w.PERSISTED_ENTITY)?"Persisted entity":n.includes(w.CRON_JOB)?"Scheduled execution":n.includes(w.RELATIONAL_DATABASE)?"Relational database":"Entity"}function Qc(n){switch(n.name){case w.HTTP_ENDPOINT:return"HTTP endpoint";case w.PERSISTED_ENTITY:return"Persisted entity";case w.CRON_JOB:return"Scheduled execution";case w.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function Kc(n){const e=wv(n);if(!e){const t=Cv(n);return t.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(w.PERSISTED_ENTITY)?"Persisted entity":t.includes(w.CRON_JOB)?"Scheduled execution":t.includes(w.RELATIONAL_DATABASE)?"Relational database":A(n,n.project)+" entity"}return A(e,n.project)+" entity"}function zg(n){let e="Find ";return n.outputsDeclarations.forEach((t,i)=>{const a=zc(t),s=Ng(a&&a.entity?A(a.entity,n.project):"unstructured data");i===0?e+=`${s} `:i===n.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function Zg(n){switch(n.name){case g.String:return"Text";case g.Number:return"Number";case g.Boolean:return"Boolean";case g.JSON:return"Data structure";case g.UUID:return"Unique identifier";case g.Date:return"Date";case g.EntityTemplate:return"Entity as template";case g.Enum:return"Enumeration";case g.File:return"File";case g.Null:return"Empty";case g.ActionDescriptor:return"Action descriptor";default:return n.name}}function Xg(n){switch(n.id){case je.List:return"Loop over list items";case je.ManualFlow:return"Manual flow control loop";case je.ObjectKeys:return"Loop over object keys";case je.ObjectValues:return"Loop over object values";case je.Counted:return"Loop given number of times";case je.String:return"Loop over text characters";case at.Addition:return"Sum numbers";case at.Substraction:return"Subtract numbers";case at.Multiplication:return"Multiply numbers";case at.Division:return"Divide numbers";case at.Remainder:return"Get remainder of numbers";case at.Exponentiation:return"Get exponent of numbers";case ve.AddIndex:return"Add at index position";case ve.DeleteFirst:return"Delete first character";case ve.DeleteLast:return"Delete last character";case ve.DeleteIndex:return"Delete at index position";case ve.Join:return"Join texts";case ve.ReplaceAllMatches:return"Replace all matches";case ve.ReplaceFirst:return"Replace first match";case ve.ReplaceLast:return"Replace last match";case ve.Split:return"Split text";case ve.ReplaceIndex:return"Replace at index position";case ve.ReplaceSingleMatch:return"Replace single match";case ve.GetFirst:return"Get first character";case ve.GetLast:return"Get last character";case ve.GetIndex:return"Get at index position";case ve.Append:return"Add at the end";case ve.Prepend:return"Add at the start";case Ie.Wait:return"Wait";case Ie.Parallel:return"Run in parallel";case Ie.Sequential:return"Run in sequence";case Ye.HttpRequest:return"HTTP request";case Ze.CreateNewInstance:return"Create new copy of entity";case j.AddIndex:return"Add item at index position";case j.DeleteFirst:return"Delete first item";case j.DeleteLast:return"Delete last item";case j.DeleteIndex:return"Delete item at index position";case j.Join:return"Join lists";case j.ReplaceAllMatches:return"Replace all matches";case j.ReplaceFirst:return"Replace first match";case j.ReplaceLast:return"Replace last match";case j.Split:return"Split list";case j.ReplaceIndex:return"Replace at index position";case j.ReplaceSingleMatch:return"Replace single match";case j.GetFirst:return"Get first item";case j.GetLast:return"Get last item";case j.GetIndex:return"Get item at index position";case j.Append:return"Add item at the end";case j.Prepend:return"Add item at the start";case Kt.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(n.name.slice(0,1).toUpperCase()+n.name.slice(1)).replaceAll("-"," ")}}function A(n,e){var t;if(r.FunctionDeclaration===n.type){const i=n.name;if(Object.values(vt).includes(i))switch(i){case vt.AbortExecution:return"Abort execution";case vt.DeletePersistedEntity:return"Delete persisted entity";case vt.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Js(n.type).replaceAll("-"," ")}return i}if(r.BuiltInBaseEntity===n.type)return Yg([n.name]);if(wd.includes(n.type)&&n.type!==r.ActionDescriptor)return n.name;switch(n.type){case r.Search:return zg(n);case r.Operation:case r.InternalCall:case r.Loop:const i=Mt(n.declaration,e);return A(i,e);case r.ActionDescriptor:return Xg(n);case r.BreakStatement:const a=Mt(n.parent,e);return`Stop loop ${A(a,e)}`;case r.ContinueStatement:const s=Mt(n.parent,e);return`Execute next iteration of ${A(s,e)}`;case r.FunctionCall:return Mt(n.declaration,e).name;case r.Condition:{const u=n;if((t=n.inputs)!=null&&t.length){const p=A(u.inputs[0],u.project);if(u.inputs[1]){const h=u.inputs[1].declaration.name;return`If ${p} ${zs(u)} ${h}`}return`If ${p} ${zs(u)}`}else return`If ${zs(u)}`}case r.ReturnStatement:{const u=Mt(n.parent,e);return`Output of ${A(u,e)}`}case r.InputMap:if(n.declaration){const u=Mt(n.declaration,e);return A(u,e)||""}else return n.name||"";case r.VariableInstance:{const u=Mt(n.declaration,e);return A(u,e)||""}case r.OutputMap:if(n.declaration){const u=Mt(n.declaration,e);return(u==null?void 0:u.name)||""}else return"";case r.PrimitiveEntity:case r.PrimitiveValue:return Zg(n);default:return Js(n.type).replaceAll("-"," ")}}function Zs(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=e.entities.filter(a=>a.name===n.name);return i.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in the project. Entity with id "${i[0].id}" has the same name.
14
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null})),t}function ed(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=n.parent?D(n.parent):null;let a=e;i&&(a=e.get(i));const s=[];a.type===r.CustomEntity?s.push(...a.methods.map(u=>u)):a.type===r.Project?s.push(...a.functions.map(u=>u)):a.type===r.Loop?a.body&&s.push(a.body):a.type===r.InstalledProject&&s.push(...a.functions.map(u=>u));const o=s.filter(u=>u.name===n.name);return o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in ${a.type===r.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
15
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null})),t}function td(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=n.parent&&Mt(n.parent,e)||e;if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${n.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const s=Xc(i).filter(o=>o.name===n.name);s.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
16
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}return t}function nd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
17
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function rd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=Rd(a).filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
18
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function id(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=bd(a).filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
19
+ Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function w9(n,e){switch(n.type){case r.CustomEntity:return Zs(n,e);case r.FunctionDeclaration:return ed(n,e);case r.VariableDeclaration:return td(n,e);case r.Property:return nd(n,e);case r.ArgumentDeclaration:return rd(n,e);case r.ReturnDeclaration:return id(n,e);default:return[]}}function Xt(n,e,t){const a=`${Ys(n)}-${e}-id`;return t.instances[a]?$.UUID.uuid():a}function ad(n,e){let t="",i=null;if(n.parent){const s=e.get(n.parent);s&&(i=s)}let a="";return i&&(a=`${Ys(A(i,e))}-`),t=`${a}${Ys(A(n,e))}-id`,e.instances[t]?$.UUID.uuid():t}function _9(n){var o;const e=i4(),t=n.toJSON();e.safeParse(t).success;const a=M9(n);(o=n.dataType)==null||o.validate();const s=[...a];if(n.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return s}function M9(n){const e=[];if(!n.implements)return e;const t=n.implements;if(!t.abstract){const a=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});e.push(a.error)}if(n.static&&!t.static){const a=H({id:`${n.id}--${M.NonStaticPropertyImplementsStatic}`,message:`Static property "${A(n,n.project)}" with id "${n.id}" implements a non-static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.NonStaticPropertyImplementsStatic,entity:n});e.push(a.error)}if(!n.static&&t.static){const a=H({id:`${n.id}--${M.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${A(n,n.project)}" with id "${n.id}" implements a static property "${A(t,n.project)}" with id "${t.id}".`,issue:null,severity:f.Error,code:M.StaticPropertyImplementsNonStatic,entity:n});e.push(a.error)}if(!Ws(n.dataType,t.dataType)){const a=H({id:`${n.id}--${M.PropertyImplementsIncompatibleType}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a property "${A(t,n.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:f.Error,code:M.PropertyImplementsIncompatibleType,entity:n});e.push(a.error)}return X(n.errors,e)}function N9(n,e){const t=[];if(n.parent){const a=e.get(n.parent);if(!a)t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const s=vr(a);if(s){const o=a!==s?`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,a.project)}) higher up in the tree.`:`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${n.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:o,issue:null}))}else if(![r.CustomEntity].includes(a.type))t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const u=Ln(a).filter(p=>!p.interactive);if(u.length){let p=u.length>1?`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(u.map(h=>A(h,h.project)),'", "','" and "')}").`:`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(u[0],u[0].project)}").`;p+=`
20
+ ${$n}`,t.push(new E({id:`${n.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new E({id:`${n.id}--${n.implements}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const h=a.properties.find(m=>{var T;return((T=m.implements)==null?void 0:T.id)===n.implements});h?t.push(new E({id:`${n.id}--${v.PropertyOverwrite}`,code:v.PropertyOverwrite,severity:f.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${h.id}' that implements the same base property.`,issue:null})):[r.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${n.implements}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Ge(n,{},e);return t.push(...i.errors),t}const he=class he{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"private");l(this,"abstract");l(this,"index");l(this,"static");l(this,"required");l(this,"type",r.Property);l(this,"dataType",null);l(this,"implements",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.implements){const p=D(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,description:e.description,implements:s,dataType:null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=N9(i,t),o=nd(i,t);return a.push(...s,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
15
21
  This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),(e.readsValue||e.writesValue)&&t.push(new E({id:`${this.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
16
- ${Ks}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addProperty(this),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.abstract=e.abstract||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.parent.type===r.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.parent.type===r.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,abstract:this.abstract,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,required:this.required,abstract:this.abstract,static:this.static,implements:((e=this.implements)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=I9(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,i=!0){var m;const a=t||Qt(A(this,this.project),r.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,u={id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=ma(u,this.project);i&&p.subscribe();const h=((m=this.dataType)==null?void 0:m.clone(p,o+"-data-type-id",i))||null;if(h&&p.setDataType(h),this.implements){const T=this.implements.clone(e||this.parent.type===r.CustomEntity?e:null,o+"-implements-id",i);p.implements=T}return p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(he,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),l(he,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),l(he,"MUTABLE_META_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,"index"]),l(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),l(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),l(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(he,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),l(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let or=he;function A9(n){const e=GU(),t=n.toJSON();e.safeParse(t).success;const a=S9(n),s=O9(n),o=gt(n);n.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const u=[...a,...s];if(n.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});u.push(p.error)}return Z(n.errors,u)}function S9(n){const e=[];if(!n.calls.length){const t=H({id:`${n.id}--${M.ScopeWithoutLogic}`,message:`Action "${A(n,n.project)}" with id "${n.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:f.Error,code:M.ScopeWithoutLogic,entity:n});e.push(t.error)}return Z(n.errors,e)}function O9(n){const e=[];return n.implements,Z(n.errors,e)}const Q=class Q{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"private");l(this,"index",null);l(this,"type",r.FunctionDeclaration);l(this,"implements",null);l(this,"inputs",[]);l(this,"returnStatements",[]);l(this,"calls",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.collapsed=e.collapsed,this.x=e.x,this.y=e.y,this.index=e.index}static fromGenerationTarget(e,t){let i=t;if(e.parent){const u=D(e.parent);i=t.get(u)}let a=null;if(e.implements){const u=D(e.implements);a=t.get(u)}const s={id:e.id,version:1,name:e.name,type:r.FunctionDeclaration,index:i.type===r.CustomEntity?i.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){var m;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Project,r.InstalledProject,r.CustomEntity,r.Loop],optional:!0},implements:{list:!1,types:[r.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=Ad(i,t),u=i.parent?t.get(i.parent):null;if(u&&u.type===r.CustomEntity){const T=u,I=Gn(T).filter(C=>!C.interactive);if(I.length){let C=I.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${T.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(I.map(L=>A(L,L.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${T.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(I[0],I[0].project)}").`;C+=`
17
- ${Vn}`,a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:C,issue:null}))}else{const C=T.methods.find(Ut=>{var Le;return((Le=Ut.implements)==null?void 0:Le.id)===i.implements});C&&a.push(new E({id:`${i.id}--${v.MethodOverwrite}`,code:v.MethodOverwrite,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity already has a ${r.FunctionDeclaration} with id '${C.id}' that implements the same base method.
22
+ ${eo}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addProperty(this),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.abstract=e.abstract||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.parent.type===r.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.parent.type===r.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,abstract:this.abstract,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,required:this.required,abstract:this.abstract,static:this.static,implements:((e=this.implements)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=_9(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,i=!0){var m;const a=t||Xt(A(this,this.project),r.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,u={id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=ha(u,this.project);i&&p.subscribe();const h=((m=this.dataType)==null?void 0:m.clone(p,o+"-data-type-id",i))||null;if(h&&p.setDataType(h),this.implements){const T=this.implements.clone(e||this.parent.type===r.CustomEntity?e:null,o+"-implements-id",i);p.implements=T}return p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(he,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),l(he,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),l(he,"MUTABLE_META_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,"index"]),l(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),l(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),l(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(he,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),l(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let or=he;function $9(n){const e=gx(),t=n.toJSON();e.safeParse(t).success;const a=V9(n),s=L9(n),o=gt(n);n.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const u=[...a,...s];if(n.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});u.push(p.error)}return X(n.errors,u)}function V9(n){const e=[];if(!n.calls.length){const t=H({id:`${n.id}--${M.ScopeWithoutLogic}`,message:`Action "${A(n,n.project)}" with id "${n.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:f.Error,code:M.ScopeWithoutLogic,entity:n});e.push(t.error)}return X(n.errors,e)}function L9(n){const e=[];return n.implements,X(n.errors,e)}const K=class K{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"private");l(this,"index",null);l(this,"type",r.FunctionDeclaration);l(this,"implements",null);l(this,"inputs",[]);l(this,"returnStatements",[]);l(this,"calls",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.collapsed=e.collapsed,this.x=e.x,this.y=e.y,this.index=e.index}static fromGenerationTarget(e,t){let i=t;if(e.parent){const u=D(e.parent);i=t.get(u)}let a=null;if(e.implements){const u=D(e.implements);a=t.get(u)}const s={id:e.id,version:1,name:e.name,type:r.FunctionDeclaration,index:i.type===r.CustomEntity?i.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){var m;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Project,r.InstalledProject,r.CustomEntity,r.Loop],optional:!0},implements:{list:!1,types:[r.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=ed(i,t),u=i.parent?t.get(i.parent):null;if(u&&u.type===r.CustomEntity){const T=u,I=Ln(T).filter(C=>!C.interactive);if(I.length){let C=I.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${T.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(I.map(G=>A(G,G.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${T.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(I[0],I[0].project)}").`;C+=`
23
+ ${$n}`,a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:C,issue:null}))}else{const C=T.methods.find(xt=>{var Le;return((Le=xt.implements)==null?void 0:Le.id)===i.implements});C&&a.push(new E({id:`${i.id}--${v.MethodOverwrite}`,code:v.MethodOverwrite,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity already has a ${r.FunctionDeclaration} with id '${C.id}' that implements the same base method.
18
24
  A ${r.FunctionDeclaration} that has a parent of type '${r.CustomEntity}' is considered a method of that entity, and cannot implement the same '${r.ActionDescriptor}' more than once.
19
25
  ${r.ActionDescriptor} entities inside a ${r.CustomEntity} are considered abstract methods that can be implemented by ${r.FunctionDeclaration} entities inside the same parent.
20
- If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const L=i.implements;T.abstractMethods.find(Ut=>Ut.id===L)||a.push(new E({id:`${i.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity with id "${T.id}" does not have a action descriptor (abstract method) with that id.
26
+ If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}));const G=i.implements;T.abstractMethods.find(xt=>xt.id===G)||a.push(new E({id:`${i.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${r.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity with id "${T.id}" does not have a action descriptor (abstract method) with that id.
21
27
  A ${r.FunctionDeclaration} that has a parent of type '${r.CustomEntity}' is considered a method of that entity, and if it implements a action-descriptor, it needs to be one of the parent's action descriptors.
22
28
  If you want to implement a new method, you can create a new 'function-declaration' inside the parent custom-entity. But note that often custom-entities already come the boiler plate for all the methods they need from the base entity they implement, which are often auto-generated when the parent custom-entity is first created.
23
29
  If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(u&&u.type===r.Loop){const T=u.body;T&&((m=T.implements)==null?void 0:m.id)===i.implements&&a.push(new E({id:`${i.id}--${v.MethodOverwrite}`,code:v.MethodOverwrite,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is being added as the 'body' of the ${r.Loop} with id "${u.id}", but the loop already has a function-declaration body. A loop can only have one function-declaration body at a time. You can edit the existing body instead, but it will have to match the same base signature, otherwise the implementation will have a validation error.`,issue:null}))}const p=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),h=p?vr(p):null;return h&&a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(h,t)}" with id '${h.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null})),a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===r.Project?t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
24
30
  This is likely an incorrect strategy because this is a globally declared '${this.type}' entity which can only have the root project as its parent.`,issue:null})):t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
25
31
  This is likely an incorrect strategy because this function declaration is a method, since it belongs to a '${this.parent.type}' entity, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.
26
- Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===r.CustomEntity?this.parent.addMethod(this):this.parent.type===r.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),gt(this).forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),gt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=A9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=gt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Q(this.toJSON(),this.project)}getVariableInstances(){return z(this).filter(i=>i.type===r.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const i={id:t.id||G.uuid(),version:t.version||1,type:r.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(Q,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(Q,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Q,"BASE_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"MUTABLE_META_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(Q,"INMUTABLE_META_PROPERTIES",[...Q.INMUTABLE_BASE_PROPERTIES]),l(Q,"META_PROPERTIES",[...Q.MUTABLE_META_PROPERTIES,...Q.INMUTABLE_META_PROPERTIES]),l(Q,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Q,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(Q,"UPSTREAM_PROPERTIES",[...Q.MUTABLE_UPSTREAM_PROPERTIES,...Q.INMUATABLE_UPSTREAM_PROPERTIES]),l(Q,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(Q,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(Q,"DOWNSTREAM_PROPERTIES",[...Q.MUTABLE_DOWNSTREAM_PROPERTIES,...Q.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(Q,"PROPERTIES",[...Q.META_PROPERTIES,...Q.UPSTREAM_PROPERTIES,...Q.DOWNSTREAM_PROPERTIES]);let lr=Q;function C9(n){const e=E9(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=H({id:n.id+"--"+M.InvalidPropertiesCombination,message:`Data type with id "${n.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:f.Error,code:M.InvalidPropertiesCombination,entity:n});a.push(s.error)}return Z(n.errors,a)}function B9(n,e){const t=[],i=[r.CustomEntity,r.ActionDescriptor,r.Property,r.ArgumentDeclaration,r.ReturnDeclaration,r.VariableDeclaration,r.ValueDescriptor,r.DataType],a=`'${N(i,"', '","' or '")}'`;if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const s=e.get(n.parent);s?i.includes(s.type)||t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(n.entity){if(n.id===n.entity)return t.push(new E({id:`${n.id}--${n.entity}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(n.entity);s?[r.CustomEntity,r.PrimitiveEntity,r.ActionDescriptor,r.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${n.entity}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",r.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=B9(i,t);if(a.push(...s,...Pe(i)),i.entity){const h=t.get(i.entity);if(h.type===r.CustomEntity){const T=Gn(h).filter(b=>!b.interactive);if(T.length){const b=T.length>1?`entities with ids '${N(T.map(I=>I.id),"', '","' and '")}'`:`entity with id '${T[0].id}'`;a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${i.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
27
- ${Vn}`,issue:null}))}}}const o=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),u=o?vr(o):null;if(u)a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(u,t)}" with id '${u.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const h=o.type,m=[r.Property,r.VariableDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.ValueDescriptor];if(m.includes(h)&&(i.parentRelationType&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${h}'.
32
+ Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===r.CustomEntity?this.parent.addMethod(this):this.parent.type===r.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),gt(this).forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),gt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=$9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=gt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new K(this.toJSON(),this.project)}getVariableInstances(){return z(this).filter(i=>i.type===r.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(K,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(K,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUATABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(K,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let lr=K;function G9(n){const e=AU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=H({id:n.id+"--"+M.InvalidPropertiesCombination,message:`Data type with id "${n.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:f.Error,code:M.InvalidPropertiesCombination,entity:n});a.push(s.error)}return X(n.errors,a)}function F9(n,e){const t=[],i=[r.CustomEntity,r.ActionDescriptor,r.Property,r.ArgumentDeclaration,r.ReturnDeclaration,r.VariableDeclaration,r.ValueDescriptor,r.DataType],a=`'${N(i,"', '","' or '")}'`;if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const s=e.get(n.parent);s?i.includes(s.type)||t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(n.entity){if(n.id===n.entity)return t.push(new E({id:`${n.id}--${n.entity}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(n.entity);s?[r.CustomEntity,r.PrimitiveEntity,r.ActionDescriptor,r.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${n.entity}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",r.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=F9(i,t);if(a.push(...s,...Pe(i)),i.entity){const h=t.get(i.entity);if(h.type===r.CustomEntity){const T=Ln(h).filter(b=>!b.interactive);if(T.length){const b=T.length>1?`entities with ids '${N(T.map(I=>I.id),"', '","' and '")}'`:`entity with id '${T[0].id}'`;a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${i.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
33
+ ${$n}`,issue:null}))}}}const o=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),u=o?vr(o):null;if(u)a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(u,t)}" with id '${u.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const h=o.type,m=[r.Property,r.VariableDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.ValueDescriptor];if(m.includes(h)&&(i.parentRelationType&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${h}'.
28
34
  The entitities of type '${N(m,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const T=(p=o.dataType)==null?void 0:p.id;a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${i.parent}' and type '${h}', because it already has a 'data-type' child with id '${T}'.
29
35
  The entitities of type '${N(m,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property. You can inspect the existing data-type entity with the 'describe_entity' action. Like so:
30
- ${Xt({describe_entity:T})}
31
- Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}h===r.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===qe.DynamicArgumentTypes||i.parentRelationType===qe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),h===r.DataType&&(!i.parentRelationType||!(i.parentRelationType===qe.AndDataTypeGroup||i.parentRelationType===qe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this.parent.type===r.DataType?this.parentRelationType===qe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===qe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===r.ActionDescriptor?this.parentRelationType===qe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),this}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,this.project))),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}if(!e){this.parent.type===r.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===r.DataType){if(this.parentRelationType===qe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(u=>u.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(u=>u.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===r.ActionDescriptor){const o=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===qe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();i.push(s)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.defaultValue){const{affected:i}=this.defaultValue.restore({seenEntities:e});t.push(...i)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:i}=this.entity.restore({seenEntities:e});t.push(...i)}if(this.parent.type===r.DataType){const i=this.parent;Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this)}if(this.parent.type===r.DataType){const i=this.parent;this.parentRelationType===qe.AndDataTypeGroup?Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this):this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(i.orChildrenGroup)&&i.orChildrenGroup.push(this)}else if(this.parent.type===r.ActionDescriptor){const i=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?i.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&i.setDynamicReturnTypes(this)}else{const i=this.parent;i.setDataType(this),t.push(i)}return{affected:t,self:this}}toFlat(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.andChildrenGroup)==null?void 0:i.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.andChildrenGroup)==null?void 0:i.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.defaultValue)==null?void 0:i.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(u=>u.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(u=>u.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.defaultValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==r.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,i,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(i=this.orChildrenGroup)==null||i.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=C9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0){var b,I,C;const a=this.toJSON(),s=t||Qt(Vv(this),r.DataType,this.project),o=s.split("-id"),u=o[o.length-1||0]||s;a.id=s;const p=ma(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const h=(b=this.defaultValue)==null?void 0:b.clone(p,u+"-default-value-id",i);p.defaultValue=h||null;const m=(I=this.andChildrenGroup)==null?void 0:I.map((L,J)=>L.clone(this,u+"-and-group-data-type-"+J+"-id",i)),T=(C=this.orChildrenGroup)==null?void 0:C.map((L,J)=>L.clone(this,u+"-or-group-data-type-"+J+"-id",i));return p.andChildrenGroup=m||null,p.orChildrenGroup=T||null,p}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}};l(fe,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),l(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"inferred"]),l(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),l(fe,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),l(fe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),l(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),l(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let si=fe;function w9(n){var u;const e=o8(),t=n.toJSON();e.safeParse(t).success;const a=_9(n),s=mn(n),o=[...a,...s];if(n.id==="exec-sequentially-operation-call-id"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});o.push(p.error)}return n.outputs.forEach(p=>p.validate()),(u=n.error)==null||u.validate(),Z(n.errors,o)}function _9(n){const e=[];return n.inputs.forEach(t=>{t.validate()}),n.dynamicArguments.forEach(t=>{t.validate()}),Z(n.errors,e)}const K=class K{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Operation);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"dynamicArguments",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.Operation,declaration:s,calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=D(i.declaration);if(o){const u=rv(o,t);a.push(...u)}else{const u=`
36
+ ${Qt({describe_entity:T})}
37
+ Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}h===r.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===qe.DynamicArgumentTypes||i.parentRelationType===qe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),h===r.DataType&&(!i.parentRelationType||!(i.parentRelationType===qe.AndDataTypeGroup||i.parentRelationType===qe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this.parent.type===r.DataType?this.parentRelationType===qe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===qe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===r.ActionDescriptor?this.parentRelationType===qe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),this}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(i=>i.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,this.project))),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}if(!e){this.parent.type===r.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===r.DataType){if(this.parentRelationType===qe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(u=>u.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(u=>u.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===r.ActionDescriptor){const o=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===qe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();i.push(s)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.defaultValue){const{affected:i}=this.defaultValue.restore({seenEntities:e});t.push(...i)}if(this.entity&&this.entity.type===r.CustomEntity&&this.entity.parent===this){const{affected:i}=this.entity.restore({seenEntities:e});t.push(...i)}if(this.parent.type===r.DataType){const i=this.parent;Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this)}if(this.parent.type===r.DataType){const i=this.parent;this.parentRelationType===qe.AndDataTypeGroup?Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this):this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(i.orChildrenGroup)&&i.orChildrenGroup.push(this)}else if(this.parent.type===r.ActionDescriptor){const i=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?i.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&i.setDynamicReturnTypes(this)}else{const i=this.parent;i.setDataType(this),t.push(i)}return{affected:t,self:this}}toFlat(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.andChildrenGroup)==null?void 0:i.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.andChildrenGroup)==null?void 0:i.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((i=this.orChildrenGroup)==null?void 0:i.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.defaultValue)==null?void 0:i.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(u=>u.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(u=>u.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.defaultValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==r.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,i,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(i=this.orChildrenGroup)==null||i.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=G9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0){var b,I,C;const a=this.toJSON(),s=t||Xt(Jg(this),r.DataType,this.project),o=s.split("-id"),u=o[o.length-1||0]||s;a.id=s;const p=ha(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const h=(b=this.defaultValue)==null?void 0:b.clone(p,u+"-default-value-id",i);p.defaultValue=h||null;const m=(I=this.andChildrenGroup)==null?void 0:I.map((G,J)=>G.clone(this,u+"-and-group-data-type-"+J+"-id",i)),T=(C=this.orChildrenGroup)==null?void 0:C.map((G,J)=>G.clone(this,u+"-or-group-data-type-"+J+"-id",i));return p.andChildrenGroup=m||null,p.orChildrenGroup=T||null,p}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}};l(fe,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),l(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"inferred"]),l(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),l(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),l(fe,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),l(fe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),l(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),l(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let ii=fe;function U9(n){var u;const e=oU(),t=n.toJSON();e.safeParse(t).success;const a=x9(n),s=mn(n),o=[...a,...s];if(n.id==="exec-sequentially-operation-call-id"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});o.push(p.error)}return n.outputs.forEach(p=>p.validate()),(u=n.error)==null||u.validate(),X(n.errors,o)}function x9(n){const e=[];return n.inputs.forEach(t=>{t.validate()}),n.dynamicArguments.forEach(t=>{t.validate()}),X(n.errors,e)}const ee=class ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Operation);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"dynamicArguments",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.Operation,declaration:s,calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=D(i.declaration);if(o){const u=cv(o,t);a.push(...u)}else{const u=`
32
38
  All built-in 'action-descriptor' entity ids are:
33
39
  - ${t.operationDeclarations.map(p=>`${p.id} (${A(p,t)})`).join(`
34
40
  - `)}.
35
41
  `;a.push(new E({id:`${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${r.Operation}" with id "${i.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'action-descriptor' entity.
36
42
  References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${u}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
37
43
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
38
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addOperation(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==r.InternalCall&&t.setParent(this.parent),t.initChildren(),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),dynamicArguments:this.dynamicArguments.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArguments.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.dynamicArguments.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=w9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new K(this.toJSON(),this.project)}};l(K,"MUTABLE_BASE_PROPERTIES",[]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(K,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUTABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),l(K,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let cr=K;function M9(n){const e=bU(),t=n.toJSON();e.safeParse(t).success;const a=gt(n);n.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return Z(n.errors,s)}const ee=class ee{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"type",r.GlobalEvent);l(this,"inputs",[]);l(this,"calls",[]);l(this,"returnStatements",[]);l(this,"parent");l(this,"implements");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.collapsed=e.collapsed}static fromGenerationTarget(e,t){let i=t;if(e.parent){const u=D(e.parent);i=t.get(u)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:r.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{},t);if(i=s.modifiedData,a.push(...s.errors,...Pe(i)),!e.implements)a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
39
- ${to(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't found in the project. The 'implements' property must point to one of the built-in action descriptors reserved for 'global-event' entities.
40
- ${to(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't pointing to an action descriptor reserved for 'global-event' entities.
41
- ${to(t)}`,issue:null}));else{const p=t.events.find(h=>h.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that points to an action descriptor that is already implemented by another global event with id '${p.id}' in the project. Each global event must implement a unique action descriptor.
42
- You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.project.addGlobalEvent(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.implements=R(this.initialData.implements,this.project),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),gt(this).forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),gt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,x:this.x,y:this.y,collapsed:this.collapsed,implements:this.implements.toJSON(),returnStatements:this.returnStatements.map(e=>e.toJSON()),inputs:this.inputs.map(e=>e.toJSON()),calls:this.calls.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,collapsed:this.collapsed,x:this.x,y:this.y,implements:this.implements.toReference(),inputs:this.inputs.map(e=>e.toReference()),calls:this.calls.map(e=>e.toReference()),returnStatements:this.returnStatements.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=M9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=gt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(){return new ee(this.toJSON(),this.project)}getVariableInstances(){return z(this).filter(i=>i.type===r.VariableInstance)}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(ee,"MUTABLE_BASE_PROPERTIES",["description"]),l(ee,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),l(ee,"BASE_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"MUTABLE_META_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),l(ee,"INMUTABLE_META_PROPERTIES",[...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"META_PROPERTIES",[...ee.MUTABLE_META_PROPERTIES,...ee.INMUTABLE_META_PROPERTIES]),l(ee,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(ee,"UPSTREAM_PROPERTIES",[...ee.MUTABLE_UPSTREAM_PROPERTIES,...ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ee,"DOWNSTREAM_PROPERTIES",[...ee.MUTABLE_DOWNSTREAM_PROPERTIES,...ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ee,"PROPERTIES",[...ee.META_PROPERTIES,...ee.UPSTREAM_PROPERTIES,...ee.DOWNSTREAM_PROPERTIES]);let oi=ee;function N9(n){var o,u;const e=Kx(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(o=n.error)==null||o.validate(),(u=n.body)==null||u.validate();const s=[...mn(n)];if(n.id==="iterate-over-list-loop-id"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}return Z(n.errors,s)}const te=class te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Loop);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"breakStatements",[]);l(this,"continueStatements",[]);l(this,"body");l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.Loop,declaration:s,calledByEntry:o,calledBySuccess:u,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0},declaration:{list:!1,types:[r.ActionDescriptor]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${r.Condition}' entities.
43
- ${no(t)}`,issue:null})):a.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
44
- ${no(t)}`,issue:null})):a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
45
- ${no(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
46
- If an entity is called by another, they must be in the same scope, which means they have the same parent.
47
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}setBody(e){return this.body=e,this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(i=>i.toFlat(e)),...this.breakStatements.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(i=>i.toFlatIds(e)),...this.breakStatements.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(i=>i.toJSON()),continueStatements:this.continueStatements.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((i=this.process)==null?void 0:i.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.body)==null?void 0:i.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.body)==null?void 0:i.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.continueStatements.forEach(i=>i.clearErrors()),this.breakStatements.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=N9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new te(this.toJSON(),this.project)}getVariableInstances(){return this.body?z(this.body).filter(i=>i.type===r.VariableInstance):[]}addReturnStatement(e){return this.body.addReturnStatement(e),this}removeReturnStatement(e){return this.body.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}};l(te,"MUTABLE_BASE_PROPERTIES",[]),l(te,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(te,"BASE_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,...te.INMUTABLE_BASE_PROPERTIES]),l(te,"MUTABLE_META_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,"x","y"]),l(te,"INMUTABLE_META_PROPERTIES",[...te.INMUTABLE_BASE_PROPERTIES]),l(te,"META_PROPERTIES",[...te.MUTABLE_META_PROPERTIES,...te.INMUTABLE_META_PROPERTIES]),l(te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(te,"UPSTREAM_PROPERTIES",[...te.MUTABLE_UPSTREAM_PROPERTIES,...te.INMUTABLE_UPSTREAM_PROPERTIES]),l(te,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),l(te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(te,"DOWNSTREAM_PROPERTIES",[...te.MUTABLE_DOWNSTREAM_PROPERTIES,...te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(te,"PROPERTIES",[...te.META_PROPERTIES,...te.UPSTREAM_PROPERTIES,...te.DOWNSTREAM_PROPERTIES]);let dr=te;function $9(n){const e=r8(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate());const s=[...mn(n)];return Z(n.errors,s)}const me=class me{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Condition);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"declaration");l(this,"inputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),s=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),o=e.calledByError.map(m=>{const T=D(m);return t.get(T)});let u;if(e.declaration){const m=D(e.declaration);u=t.get(m)}const p={id:e.id,version:1,type:r.Condition,declaration:u,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:i},h=R(p,t);return h.setParent(i),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${r.Condition}' entities.
44
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addOperation(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==r.InternalCall&&t.setParent(this.parent),t.initChildren(),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),dynamicArguments:this.dynamicArguments.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArguments.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.dynamicArguments.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=U9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ee(this.toJSON(),this.project)}};l(ee,"MUTABLE_BASE_PROPERTIES",[]),l(ee,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ee,"BASE_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"MUTABLE_META_PROPERTIES",[...ee.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ee,"INMUTABLE_META_PROPERTIES",[...ee.INMUTABLE_BASE_PROPERTIES]),l(ee,"META_PROPERTIES",[...ee.MUTABLE_META_PROPERTIES,...ee.INMUTABLE_META_PROPERTIES]),l(ee,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(ee,"UPSTREAM_PROPERTIES",[...ee.MUTABLE_UPSTREAM_PROPERTIES,...ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),l(ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ee,"DOWNSTREAM_PROPERTIES",[...ee.MUTABLE_DOWNSTREAM_PROPERTIES,...ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ee,"PROPERTIES",[...ee.META_PROPERTIES,...ee.UPSTREAM_PROPERTIES,...ee.DOWNSTREAM_PROPERTIES]);let cr=ee;function j9(n){const e=WU(),t=n.toJSON();e.safeParse(t).success;const a=gt(n);n.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return X(n.errors,s)}const te=class te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"collapsed");l(this,"type",r.GlobalEvent);l(this,"inputs",[]);l(this,"calls",[]);l(this,"returnStatements",[]);l(this,"parent");l(this,"implements");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.collapsed=e.collapsed}static fromGenerationTarget(e,t){let i=t;if(e.parent){const u=D(e.parent);i=t.get(u)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:r.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:i},o=R(s,t);return o.setParent(i),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{},t);if(i=s.modifiedData,a.push(...s.errors,...Pe(i)),!e.implements)a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
45
+ ${no(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't found in the project. The 'implements' property must point to one of the built-in action descriptors reserved for 'global-event' entities.
46
+ ${no(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't pointing to an action descriptor reserved for 'global-event' entities.
47
+ ${no(t)}`,issue:null}));else{const p=t.events.find(h=>h.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that points to an action descriptor that is already implemented by another global event with id '${p.id}' in the project. Each global event must implement a unique action descriptor.
48
+ You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.project.addGlobalEvent(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.implements=R(this.initialData.implements,this.project),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),gt(this).forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),gt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:S(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=gt(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,x:this.x,y:this.y,collapsed:this.collapsed,implements:this.implements.toJSON(),returnStatements:this.returnStatements.map(e=>e.toJSON()),inputs:this.inputs.map(e=>e.toJSON()),calls:this.calls.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,collapsed:this.collapsed,x:this.x,y:this.y,implements:this.implements.toReference(),inputs:this.inputs.map(e=>e.toReference()),calls:this.calls.map(e=>e.toReference()),returnStatements:this.returnStatements.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=j9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=gt(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(){return new te(this.toJSON(),this.project)}getVariableInstances(){return z(this).filter(i=>i.type===r.VariableInstance)}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(te,"MUTABLE_BASE_PROPERTIES",["description"]),l(te,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),l(te,"BASE_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,...te.INMUTABLE_BASE_PROPERTIES]),l(te,"MUTABLE_META_PROPERTIES",[...te.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),l(te,"INMUTABLE_META_PROPERTIES",[...te.INMUTABLE_BASE_PROPERTIES]),l(te,"META_PROPERTIES",[...te.MUTABLE_META_PROPERTIES,...te.INMUTABLE_META_PROPERTIES]),l(te,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(te,"UPSTREAM_PROPERTIES",[...te.MUTABLE_UPSTREAM_PROPERTIES,...te.INMUTABLE_UPSTREAM_PROPERTIES]),l(te,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(te,"DOWNSTREAM_PROPERTIES",[...te.MUTABLE_DOWNSTREAM_PROPERTIES,...te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(te,"PROPERTIES",[...te.META_PROPERTIES,...te.UPSTREAM_PROPERTIES,...te.DOWNSTREAM_PROPERTIES]);let ai=te;function k9(n){var o,u;const e=m4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(o=n.error)==null||o.validate(),(u=n.body)==null||u.validate();const s=[...mn(n)];if(n.id==="iterate-over-list-loop-id"){const p=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}return X(n.errors,s)}const ne=class ne{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Loop);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"breakStatements",[]);l(this,"continueStatements",[]);l(this,"body");l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"detachedChildren",[]);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.Loop,declaration:s,calledByEntry:o,calledBySuccess:u,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0},declaration:{list:!1,types:[r.ActionDescriptor]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${r.Condition}' entities.
48
49
  ${ro(t)}`,issue:null})):a.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
49
50
  ${ro(t)}`,issue:null})):a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
50
51
  ${ro(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
51
- If an entity is called by another, they must be in the same scope, which means they have the same parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this}removeOutput(e){return this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=$9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new me(this.toJSON(),this.project)}};l(me,"MUTABLE_BASE_PROPERTIES",["operator"]),l(me,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),l(me,"MUTABLE_META_PROPERTIES",["x","y"]),l(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),l(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),l(me,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(me,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),l(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),l(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let ur=me;class Wg{constructor(){l(this,"initialData")}}class V9{}class L9 extends Wg{}class G9{}class F9{}class x9{}class ed{}class U9 extends ed{}class j9 extends ed{}class k9{}class ca{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==r.GenericReference&&(e.readsValue=R(e.initialData.readsValue,e.project),Fe.includes(e.readsValue.type))){let t=e.parent;st.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.addValueReader(e),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}return e.readsValue}}class da{static initWritesValues(e,t){const i=e.initialData.writesValues.reduce((s,o)=>{if(o.type===r.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const u=R(o,e.project);return u.setValueWriter(e),Fe.includes(u.type)&&(u.setParent(t),u.initChildren()),[...s,u]},[]),a=[...e.writesValues];return e.writesValues=S([...a,...i]),e.writesValues}}class q9{}function J9(n){var o;const e=H8(),t=n.toJSON();e.safeParse(t).success,(o=n.dataType)==null||o.validate(),n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),n.internalCalls.forEach(u=>u.validate());const s=[...mn(n)];if(n.id==="random-company-employee-test-variable-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}if(n.id==="company-dto-variable-one-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return Z(n.errors,s)}const ne=class ne{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"dataType",null);l(this,"x");l(this,"y");l(this,"type",r.VariableDeclaration);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),s=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),o=e.calledByError.map(m=>{const T=D(m);return t.get(T)});let u=null;if(e.readsValue){const m=D(e.readsValue);u=t.get(m)}const p={id:e.id,version:1,type:r.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:u,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},h=R(p,t);return h.setParent(i),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData;const o=Sd(i,t);return a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=pa(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
52
+ If an entity is called by another, they must be in the same scope, which means they have the same parent.
53
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}setBody(e){return this.body=e,this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(i=>i.toFlat(e)),...this.breakStatements.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(i=>i.toFlatIds(e)),...this.breakStatements.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(i=>i.toJSON()),continueStatements:this.continueStatements.map(i=>i.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((i=this.process)==null?void 0:i.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.body)==null?void 0:i.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.body)==null?void 0:i.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),this.continueStatements.forEach(i=>i.clearErrors()),this.breakStatements.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=k9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ne(this.toJSON(),this.project)}getVariableInstances(){return this.body?z(this.body).filter(i=>i.type===r.VariableInstance):[]}addReturnStatement(e){return this.body.addReturnStatement(e),this}removeReturnStatement(e){return this.body.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}};l(ne,"MUTABLE_BASE_PROPERTIES",[]),l(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),l(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),l(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),l(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let dr=ne;function q9(n){const e=z4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate());const s=[...mn(n)];return X(n.errors,s)}const me=class me{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.Condition);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"declaration");l(this,"inputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),s=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),o=e.calledByError.map(m=>{const T=D(m);return t.get(T)});let u;if(e.declaration){const m=D(e.declaration);u=t.get(m)}const p={id:e.id,version:1,type:r.Condition,declaration:u,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:i},h=R(p,t);return h.setParent(i),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${r.Condition}' entities.
54
+ ${io(t)}`,issue:null})):a.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
55
+ ${io(t)}`,issue:null})):a.push(new E({id:`${e.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.
56
+ ${io(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
57
+ If an entity is called by another, they must be in the same scope, which means they have the same parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this}removeOutput(e){return this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=q9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new me(this.toJSON(),this.project)}};l(me,"MUTABLE_BASE_PROPERTIES",["operator"]),l(me,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),l(me,"MUTABLE_META_PROPERTIES",["x","y"]),l(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),l(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),l(me,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(me,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),l(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),l(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let ur=me;class Qg{constructor(){l(this,"initialData")}}class J9{}class W9 extends Qg{}class H9{}class Y9{}class z9{}class sd{}class Z9 extends sd{}class X9 extends sd{}class Q9{}class oa{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==r.GenericReference&&(e.readsValue=R(e.initialData.readsValue,e.project),Fe.includes(e.readsValue.type))){let t=e.parent;st.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.addValueReader(e),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}return e.readsValue}}class la{static initWritesValues(e,t){const i=e.initialData.writesValues.reduce((s,o)=>{if(o.type===r.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const u=R(o,e.project);return u.setValueWriter(e),Fe.includes(u.type)&&(u.setParent(t),u.initChildren()),[...s,u]},[]),a=[...e.writesValues];return e.writesValues=S([...a,...i]),e.writesValues}}class K9{}function e6(n){var o;const e=wU(),t=n.toJSON();e.safeParse(t).success,(o=n.dataType)==null||o.validate(),n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),n.internalCalls.forEach(u=>u.validate());const s=[...mn(n)];if(n.id==="random-company-employee-test-variable-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}if(n.id==="company-dto-variable-one-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return X(n.errors,s)}const re=class re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"dataType",null);l(this,"x");l(this,"y");l(this,"type",r.VariableDeclaration);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const m=D(e.parent);i=t.get(m)}const a=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),s=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),o=e.calledByError.map(m=>{const T=D(m);return t.get(T)});let u=null;if(e.readsValue){const m=D(e.readsValue);u=t.get(m)}const p={id:e.id,version:1,type:r.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:u,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},h=R(p,t);return h.setParent(i),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData;const o=td(i,t);return a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=da(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
52
58
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
53
59
  Specifically for variables, their scope is also calculated from their value readers and value writters.
54
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),da.initWritesValues(this,this.parent),ca.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.internalCalls=this.initialData.internalCalls.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),fa(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toJSON()),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),internalCalls:this.internalCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=J9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,i;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((i=this.readsValue)==null?void 0:i.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ne(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const i={id:t.id||G.uuid(),version:t.version||1,type:r.VariableInstance,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:G.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:G.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType||null}};l(ne,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),l(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),l(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),l(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let pr=ne;function W9(n){const e=QU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate()),n.outputs.forEach(o=>o.validate()),n.internalCalls.forEach(o=>o.validate());const s=[...mn(n)];if(n.id==="exec-sequentially-result-variable-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(o.error)}return Z(n.errors,s)}const re=class re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.VariableInstance);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const b=D(e.parent);i=t.get(b)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const I=D(b);return t.get(I)}),u=e.calledBySuccess.map(b=>{const I=D(b);return t.get(I)}),p=e.calledByError.map(b=>{const I=D(b);return t.get(I)});let h=null;if(e.readsValue){const b=D(e.readsValue);h=t.get(b)}const m={id:e.id,version:1,type:r.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:h,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},T=R(m,t);return T.setParent(i),T.initChildren(),T}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0},declaration:{list:!1,types:[r.VariableDeclaration]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=pa(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
60
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),la.initWritesValues(this,this.parent),oa.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.internalCalls=this.initialData.internalCalls.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ya(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toJSON()),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),internalCalls:this.internalCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=e6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,i;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((i=this.readsValue)==null?void 0:i.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new re(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.VariableInstance,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:$.UUID.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if(this.dataType.entity.type===r.CustomEntity)return this.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:$.UUID.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType||null}};l(re,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(re,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(re,"BASE_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,...re.INMUTABLE_BASE_PROPERTIES]),l(re,"MUTABLE_META_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,"x","y"]),l(re,"INMUTABLE_META_PROPERTIES",[...re.INMUTABLE_BASE_PROPERTIES]),l(re,"META_PROPERTIES",[...re.MUTABLE_META_PROPERTIES,...re.INMUTABLE_META_PROPERTIES]),l(re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(re,"UPSTREAM_PROPERTIES",[...re.MUTABLE_UPSTREAM_PROPERTIES,...re.INMUTABLE_UPSTREAM_PROPERTIES]),l(re,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(re,"DOWNSTREAM_PROPERTIES",[...re.MUTABLE_DOWNSTREAM_PROPERTIES,...re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(re,"PROPERTIES",[...re.META_PROPERTIES,...re.UPSTREAM_PROPERTIES,...re.DOWNSTREAM_PROPERTIES]);let pr=re;function t6(n){const e=VU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate()),n.outputs.forEach(o=>o.validate()),n.internalCalls.forEach(o=>o.validate());const s=[...mn(n)];if(n.id==="exec-sequentially-result-variable-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(o.error)}return X(n.errors,s)}const ie=class ie{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.VariableInstance);l(this,"writesValues",[]);l(this,"readsValue",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"internalCalls",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const b=D(e.parent);i=t.get(b)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const I=D(b);return t.get(I)}),u=e.calledBySuccess.map(b=>{const I=D(b);return t.get(I)}),p=e.calledByError.map(b=>{const I=D(b);return t.get(I)});let h=null;if(e.readsValue){const b=D(e.readsValue);h=t.get(b)}const m={id:e.id,version:1,type:r.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:h,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},T=R(m,t);return T.setParent(i),T.initChildren(),T}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0},declaration:{list:!1,types:[r.VariableDeclaration]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=da(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
55
61
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
56
62
  Specifically for variables, their scope is also calculated from their value readers and value writters.
57
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return da.initWritesValues(this,this.parent),ca.initReadsValue(this),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===r.GenericReference){const i=this.project.findSubscribedInstanceFromReference(t);if(!i)return e;const a=i;return a.setParent(this),[...e,a]}else{const i=R(t,this.project);return i.setParent(this),i.initChildren(),[...e,i]}},[]),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this}setValueWriter(e){return this.readsValue=e,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),fa(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.internalCalls.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.internalCalls.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.declaration)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.declaration)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=W9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...this.internalCalls.flatMap(i=>i.getErrors()),...this.outputs.flatMap(i=>i.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new re(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:G.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:G.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(re,"MUTABLE_BASE_PROPERTIES",[]),l(re,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(re,"BASE_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,...re.INMUTABLE_BASE_PROPERTIES]),l(re,"MUTABLE_META_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,"x","y"]),l(re,"INMUTABLE_META_PROPERTIES",[...re.INMUTABLE_BASE_PROPERTIES]),l(re,"META_PROPERTIES",[...re.MUTABLE_META_PROPERTIES,...re.INMUTABLE_META_PROPERTIES]),l(re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(re,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(re,"UPSTREAM_PROPERTIES",[...re.MUTABLE_UPSTREAM_PROPERTIES,...re.INMUTABLE_UPSTREAM_PROPERTIES]),l(re,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(re,"DOWNSTREAM_PROPERTIES",[...re.MUTABLE_DOWNSTREAM_PROPERTIES,...re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(re,"PROPERTIES",[...re.META_PROPERTIES,...re.UPSTREAM_PROPERTIES,...re.DOWNSTREAM_PROPERTIES]);let yr=re;function H9(n){var s;const e=uU(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return Z(n.errors,a)}const ie=class ie{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"isError");l(this,"type",r.ReturnDeclaration);l(this,"dataType",null);l(this,"readsValue",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.isError=e.isError}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.readsValue){const p=D(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var u,p;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.ReturnStatement,r.Search,r.BreakStatement,r.ContinueStatement]}},t),o=Bd(i,t);if(i=s.modifiedData,i.parent){const h=t.get(D(i.parent));if(h&&[r.BreakStatement,r.ContinueStatement].includes(h.type)){const m=h,T=m.parent,b=[...T.breakStatements.filter(C=>C.id!==h.id),...T.continueStatements.filter(C=>C.id!==h.id)];if(m.outputs.length)a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${m.type}' with id '${m.id}'. This '${m.type}' already has return declarations.
58
- ${sd}`,issue:null}));else{const C=(p=(u=b[0])==null?void 0:u.outputs[0])==null?void 0:p.name;C!==i.name&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${m.type}' with id '${m.id}'. This new 'return-declaration' doesn't have the same name "${C}" as the return declarations on the other statements in the same scope.
59
- ${sd}`,issue:null}))}}else if(h&&h.type===r.ReturnStatement){const m=h.parent;if(m&&$e.includes(m.type)){const T=m.implements;if(T)if(T.returnsType===V.Fixed){const b=T.fixedReturns.find(Le=>Le.name===i.name),I=T.fixedReturns.filter(Le=>!h.outputs.find(Yv=>Yv.type===r.ReturnDeclaration&&Yv.name===Le.name)),C=h.outputs.filter(Le=>Le.type===r.ReturnDeclaration),L=C.find(Le=>Le.name===i.name),J=C.length?`The parent entity already implements the following return declarations: ${N(C.map(Le=>`'${Le.id}' (${Le.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",Ut=I.length?`The parent entity is still missing the following returns in the implementation: ${N(I.map(Le=>`'${Le.id}' (${Le.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?L&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
63
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&this.readsValue.addValueReader(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!e)return this;this.declaration=e}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return la.initWritesValues(this,this.parent),oa.initReadsValue(this),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.internalCalls=this.initialData.internalCalls.reduce((e,t)=>{if(t.type===r.GenericReference){const i=this.project.findSubscribedInstanceFromReference(t);if(!i)return e;const a=i;return a.setParent(this),[...e,a]}else{const i=R(t,this.project);return i.setParent(this),i.initChildren(),[...e,i]}},[]),this.inputs.push(...this.generateUnusedInputs()),this.outputs.push(...this.generateUnusedOutputs()),this}setValueWriter(e){return this.readsValue=e,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ya(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.internalCalls.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e)),...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.internalCalls.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e)),...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.internalCalls.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(i=>i.toReference()),inputs:this.inputs.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toReference()),successCalls:this.successCalls.map(i=>i.toReference()),errorCalls:this.errorCalls.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),internalCalls:this.internalCalls.map(i=>i.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.declaration)==null?void 0:i.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.declaration)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=t6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...this.internalCalls.flatMap(i=>i.getErrors()),...this.outputs.flatMap(i=>i.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.inputs.find(a=>a.declaration===i)).map(i=>{const a={id:$.UUID.uuid(),version:1,type:r.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:i,defaultValue:null,index:i.index,readsValue:null},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if(this.declaration.dataType.entity.type===r.CustomEntity)return this.declaration.dataType.entity.properties.filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:$.UUID.uuid(),version:1,type:r.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,s})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(ie,"MUTABLE_BASE_PROPERTIES",[]),l(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),l(ie,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),l(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),l(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),l(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let yr=ie;function n6(n){var s;const e=_4(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return X(n.errors,a)}const ae=class ae{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"isError");l(this,"type",r.ReturnDeclaration);l(this,"dataType",null);l(this,"readsValue",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.isError=e.isError}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.readsValue){const p=D(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:r.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var u,p;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.ReturnStatement,r.Search,r.BreakStatement,r.ContinueStatement]}},t),o=id(i,t);if(i=s.modifiedData,i.parent){const h=t.get(D(i.parent));if(h&&[r.BreakStatement,r.ContinueStatement].includes(h.type)){const m=h,T=m.parent,b=[...T.breakStatements.filter(C=>C.id!==h.id),...T.continueStatements.filter(C=>C.id!==h.id)];if(m.outputs.length)a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${m.type}' with id '${m.id}'. This '${m.type}' already has return declarations.
64
+ ${dd}`,issue:null}));else{const C=(p=(u=b[0])==null?void 0:u.outputs[0])==null?void 0:p.name;C!==i.name&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${m.type}' with id '${m.id}'. This new 'return-declaration' doesn't have the same name "${C}" as the return declarations on the other statements in the same scope.
65
+ ${dd}`,issue:null}))}}else if(h&&h.type===r.ReturnStatement){const m=h.parent;if(m&&$e.includes(m.type)){const T=m.implements;if(T)if(T.returnsType===L.Fixed){const b=T.fixedReturns.find(Le=>Le.name===i.name),I=T.fixedReturns.filter(Le=>!h.outputs.find(Jv=>Jv.type===r.ReturnDeclaration&&Jv.name===Le.name)),C=h.outputs.filter(Le=>Le.type===r.ReturnDeclaration),G=C.find(Le=>Le.name===i.name),J=C.length?`The parent entity already implements the following return declarations: ${N(C.map(Le=>`'${Le.id}' (${Le.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",xt=I.length?`The parent entity is still missing the following returns in the implementation: ${N(I.map(Le=>`'${Le.id}' (${Le.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?G&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
60
66
  Adding a new return would make the implementation invalid. An return with the same name already exists in the parent entity.
61
67
  ${J}
62
- ${Ut}`,issue:null})):a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
68
+ ${xt}`,issue:null})):a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with fixed outputs.
63
69
  Adding a new return would make the implementation invalid. There are no returns in the descriptor with the same name.
64
70
  ${J}
65
- ${Ut}`,issue:null}))}else T.returnsType===V.Dynamic||T.returnsType===V.None&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with no outputs.
66
- Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=pa(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
67
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){var e;return this.parent.addOutputDeclaration(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),ca.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),fa(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const i=this.dataType.restore({seenEntities:e});t.push(...i.affected)}return{affected:[],self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,dataType:((t=this.dataType)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,isError:this.isError,readsValue:(e=this.readsValue)==null?void 0:e.id,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.readsValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=H9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(ie,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),l(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"index"]),l(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),l(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),l(ie,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),l(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let Ot=ie;function Y9(n){var o;const e=oU(),t=n.toJSON();e.safeParse(t).success,n.inputsDeclarations.forEach(u=>u.validate()),n.inputs.forEach(u=>u.validate()),n.outputsDeclarations.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];if(n.id==="search-person-by-id-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return Z(n.errors,s)}const De=class De{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"query");l(this,"type",r.Search);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"inputsDeclarations",[]);l(this,"inputs",[]);l(this,"outputsDeclarations",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y,this.name=e.name,this.query=e.query,this.description=e.description}static fromGenerationTarget(e,t){let i=t;if(e.parent){const h=D(e.parent);i=t.get(h)}const a=e.calledByEntry.map(h=>{const m=D(h);return t.get(m)}),s=e.calledBySuccess.map(h=>{const m=D(h);return t.get(m)}),o=e.calledByError.map(h=>{const m=D(h);return t.get(m)}),u={id:e.id,version:1,type:r.Search,name:e.name,description:e.description,query:e.query,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputsDeclarations:[],inputs:[],outputsDeclarations:[],outputs:[],error:null,x:0,y:0,parent:i},p=R(u,t);return p.setParent(i),p.initChildren(),p}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
71
+ ${xt}`,issue:null}))}else T.returnsType===L.Dynamic||T.returnsType===L.None&&a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${h.type}' with id '${h.id}' that implements a ${r.ActionDescriptor} with no outputs.
72
+ Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=da(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
73
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){var e;return this.parent.addOutputDeclaration(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),oa.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ya(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const i=this.dataType.restore({seenEntities:e});t.push(...i.affected)}return{affected:[],self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,dataType:((t=this.dataType)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,isError:this.isError,readsValue:(e=this.readsValue)==null?void 0:e.id,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((i=this.readsValue)==null?void 0:i.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=n6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ae(this.toJSON(),this.project)}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};l(ae,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),l(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"index"]),l(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),l(ae,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),l(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),l(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let Ot=ae;function r6(n){var o;const e=O4(),t=n.toJSON();e.safeParse(t).success,n.inputsDeclarations.forEach(u=>u.validate()),n.inputs.forEach(u=>u.validate()),n.outputsDeclarations.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];if(n.id==="search-person-by-id-id"){const u=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});s.push(u.error)}return X(n.errors,s)}const De=class De{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"query");l(this,"type",r.Search);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"inputsDeclarations",[]);l(this,"inputs",[]);l(this,"outputsDeclarations",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y,this.name=e.name,this.query=e.query,this.description=e.description}static fromGenerationTarget(e,t){let i=t;if(e.parent){const h=D(e.parent);i=t.get(h)}const a=e.calledByEntry.map(h=>{const m=D(h);return t.get(m)}),s=e.calledBySuccess.map(h=>{const m=D(h);return t.get(m)}),o=e.calledByError.map(h=>{const m=D(h);return t.get(m)}),u={id:e.id,version:1,type:r.Search,name:e.name,description:e.description,query:e.query,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputsDeclarations:[],inputs:[],outputsDeclarations:[],outputs:[],error:null,x:0,y:0,parent:i},p=R(u,t);return p.setParent(i),p.initChildren(),p}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
68
74
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
69
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const i=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return i>-1&&this.inputsDeclarations.splice(i,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(i=>i.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(i=>i.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this.name=e.name||this.name,this.query=e.query||this.query,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputsDeclarations.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.inputsDeclarations.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.outputsDeclarations.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=Y9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new De(this.toJSON(),this.project)}};l(De,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),l(De,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(De,"BASE_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,...De.INMUTABLE_BASE_PROPERTIES]),l(De,"MUTABLE_META_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,"x","y"]),l(De,"INMUTABLE_META_PROPERTIES",[...De.INMUTABLE_BASE_PROPERTIES]),l(De,"META_PROPERTIES",[...De.MUTABLE_META_PROPERTIES,...De.INMUTABLE_META_PROPERTIES]),l(De,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(De,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(De,"UPSTREAM_PROPERTIES",[...De.MUTABLE_UPSTREAM_PROPERTIES,...De.INMUTABLE_UPSTREAM_PROPERTIES]),l(De,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),l(De,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(De,"DOWNSTREAM_PROPERTIES",[...De.MUTABLE_DOWNSTREAM_PROPERTIES,...De.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(De,"PROPERTIES",[...Ot.META_PROPERTIES,...Ot.UPSTREAM_PROPERTIES,...Ot.DOWNSTREAM_PROPERTIES]);let hr=De;function z9(n){const e=DU(),t=n.toJSON();e.safeParse(t).success,n.functions.forEach(s=>s.validate()),n.events.forEach(s=>s.validate());const a=[];return Z(n.errors,a)}const Te=class Te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"type",r.InstalledProject);l(this,"implements");l(this,"functions",[]);l(this,"events",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const i=t,a={id:e.id,version:1,name:e.name,type:r.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:r.Project,type:r.GenericReference,id:G.uuid()},x:0,y:0,parent:i},s=R(a,t);return s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an installed project, must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...u)}),this.events.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...u)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(i=>i.toFlatIds(e)),...this.events.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=z9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Te(this.toJSON(),this.project)}};l(Te,"MUTABLE_BASE_PROPERTIES",[]),l(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),l(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"MUTABLE_META_PROPERTIES",["x","y"]),l(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),l(Te,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Te,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),l(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),l(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),l(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let fr=Te;function Z9(n){var o;const e=HU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];return Z(n.errors,s)}const ae=class ae{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.InternalCall);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"project");l(this,"errors",[]);l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=D(e.declaration),o=t.get(s),u=e.calledByEntry.map(b=>{const I=D(b);return t.get(I)}),p=e.calledBySuccess.map(b=>{const I=D(b);return t.get(I)}),h=e.calledByError.map(b=>{const I=D(b);return t.get(I)}),m={id:e.id,version:1,type:r.InternalCall,index:a.internalCalls.length,declaration:o.toReference(),calledByEntry:u,calledBySuccess:p,calledByError:h,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,parent:a},T=R(m,t);return T.setParent(a),T.initChildren(),T}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:Fe}},t);i=s.modifiedData;const o=D(i.parent),u=t.get(o);if(u){const p=Ec(u),h=p==null?void 0:p.entity;if(!h)a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${i.declaration}".`,issue:null}));else if(![r.CustomEntity,r.BuiltInBaseEntity,r.PrimitiveEntity].includes(h.type))a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
70
- This variable's data-type has an 'entity' field that references an entity with id '${h.id}' and of type '${h.type}'.`,issue:null}));else{const m=Av(h);let T="";m?h.methods.length?T=`
75
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(e=>{e.addSuccessCaller(this)}),this.errorCalls.forEach(e=>{e.addErrorCaller(this)}),this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const i=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return i>-1&&this.inputsDeclarations.splice(i,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(i=>i.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(i=>i.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this.name=e.name||this.name,this.query=e.query||this.query,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{i.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputsDeclarations.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.inputsDeclarations.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.outputsDeclarations.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.toReference()),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=r6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new De(this.toJSON(),this.project)}};l(De,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),l(De,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(De,"BASE_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,...De.INMUTABLE_BASE_PROPERTIES]),l(De,"MUTABLE_META_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,"x","y"]),l(De,"INMUTABLE_META_PROPERTIES",[...De.INMUTABLE_BASE_PROPERTIES]),l(De,"META_PROPERTIES",[...De.MUTABLE_META_PROPERTIES,...De.INMUTABLE_META_PROPERTIES]),l(De,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(De,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(De,"UPSTREAM_PROPERTIES",[...De.MUTABLE_UPSTREAM_PROPERTIES,...De.INMUTABLE_UPSTREAM_PROPERTIES]),l(De,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),l(De,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(De,"DOWNSTREAM_PROPERTIES",[...De.MUTABLE_DOWNSTREAM_PROPERTIES,...De.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(De,"PROPERTIES",[...Ot.META_PROPERTIES,...Ot.UPSTREAM_PROPERTIES,...Ot.DOWNSTREAM_PROPERTIES]);let hr=De;function i6(n){const e=xU(),t=n.toJSON();e.safeParse(t).success,n.functions.forEach(s=>s.validate()),n.events.forEach(s=>s.validate());const a=[];return X(n.errors,a)}const Te=class Te{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"type",r.InstalledProject);l(this,"implements");l(this,"functions",[]);l(this,"events",[]);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const i=t,a={id:e.id,version:1,name:e.name,type:r.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:r.Project,type:r.GenericReference,id:$.UUID.uuid()},x:0,y:0,parent:i},s=R(a,t);return s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an installed project, must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...u)}),this.events.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...u)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(i=>i.toFlatIds(e)),...this.events.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=i6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Te(this.toJSON(),this.project)}};l(Te,"MUTABLE_BASE_PROPERTIES",[]),l(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),l(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"MUTABLE_META_PROPERTIES",["x","y"]),l(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),l(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),l(Te,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Te,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),l(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),l(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),l(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let fr=Te;function a6(n){var o;const e=K4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];return X(n.errors,s)}const se=class se{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.InternalCall);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"process",null);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"error",null);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"parent");l(this,"project");l(this,"errors",[]);l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=D(e.declaration),o=t.get(s),u=e.calledByEntry.map(b=>{const I=D(b);return t.get(I)}),p=e.calledBySuccess.map(b=>{const I=D(b);return t.get(I)}),h=e.calledByError.map(b=>{const I=D(b);return t.get(I)}),m={id:e.id,version:1,type:r.InternalCall,index:a.internalCalls.length,declaration:o.toReference(),calledByEntry:u,calledBySuccess:p,calledByError:h,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,parent:a},T=R(m,t);return T.setParent(a),T.initChildren(),T}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:Fe}},t);i=s.modifiedData;const o=D(i.parent),u=t.get(o);if(u){const p=zc(u),h=p==null?void 0:p.entity;if(!h)a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${i.declaration}".`,issue:null}));else if(![r.CustomEntity,r.BuiltInBaseEntity,r.PrimitiveEntity].includes(h.type))a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
76
+ This variable's data-type has an 'entity' field that references an entity with id '${h.id}' and of type '${h.type}'.`,issue:null}));else{const m=_v(h);let T="";m?h.methods.length?T=`
71
77
  All 'function-declaration' entities attached as methods to the parent data-type 'entity' field, available to be called as 'internal-calls' in this variable are:
72
- - ${h.methods.map(L=>L.id).join(`
78
+ - ${h.methods.map(G=>G.id).join(`
73
79
  - `)}
74
80
  You can reference any of them as the 'delcaration' property on a new 'internal-call' entity.`:h.type===r.CustomEntity?T=`
75
81
  This variable's data-type 'entity' is a custom entity which doesn't have any methods attached to it yet.
@@ -77,14 +83,14 @@ You can attach methods to it by creating 'function-declaration' entities which h
77
83
  This variable's data-type 'entity' is a ${h.type} which doesn't have any methods attached to it yet.
78
84
  Built-in entity types can't have methods attached to them by the user. They are predefined entities that can't be modified. You can reference them as the 'declaration' property on a new 'internal-call' entity in a variable`):h.type===r.CustomEntity?T=`
79
85
  This variable's data-type 'entity' is a custom entity which extends or implements a non-interactive 'built-in-base-entity'.
80
- ${Vn}`:h.type===r.BuiltInBaseEntity&&(T=`
86
+ ${$n}`:h.type===r.BuiltInBaseEntity&&(T=`
81
87
  This variable's data-type 'entity' is a non-interactive 'built-in-base-entity'.
82
- ${Vn}`);const b=i.declaration,I=t.get(b);if(!I)a.push(new E({id:`${i.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a declaration method (function-declaration) that doesn't exist in the project.${T}`,issue:null}));else{const C=(h.methods||[]).find(L=>L.id===i.declaration);C?C.type!==r.FunctionDeclaration?a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", points to a 'declaration' that isn't a 'function-declaration' entity.
88
+ ${$n}`);const b=i.declaration,I=t.get(b);if(!I)a.push(new E({id:`${i.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a declaration method (function-declaration) that doesn't exist in the project.${T}`,issue:null}));else{const C=(h.methods||[]).find(G=>G.id===i.declaration);C?C.type!==r.FunctionDeclaration?a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", points to a 'declaration' that isn't a 'function-declaration' entity.
83
89
  The declaration of the internal-call must be a 'function-declaration' entity which exists as a method in the entity of the data-type of the parent variable.${T}`,issue:null})):I.parent.id!==h.id&&a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", has a declaration method (function-declaration) that doesn't belong to its parent's data type entity.
84
90
  The data type on this variable points to a different entity than the declaration of the internal-call.${T}`,issue:null})):a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentDeclarationRelation}`,code:y.InvalidInternalCallParentDeclarationRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) with id "${i.declaration}".${T}`,issue:null}))}}(u.inputs.length||u.outputs.length||u.internalCalls.length)&&a.push(new E({id:`${i.id}--${y.InvalidInternalCallParentRelation}`,code:y.InvalidInternalCallParentRelation,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}", can only be added to a variable declaration or variable instance parent if the parent doesn't already have inputs, outputs or other internal calls.
85
91
  If you need a new variable-instance for this, consider using the 'implement_variable_instance' generation action to create one and give it a caller.
86
92
  The you can attach the new internal-call to it.`,issue:null}))}return a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
87
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent.addInternalCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.parent.type!==r.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(i=>!!i.parent&&st.includes(i.parent.type));if(t){const i=R(t.parent,this.project);this.parent.setParent(i)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=Z9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ae(this.toJSON(),this.project)}};l(ae,"MUTABLE_BASE_PROPERTIES",[]),l(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"index"]),l(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),l(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),l(ae,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),l(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),l(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let li=ae;function X9(n){const e=j8(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-argument-map-id"){const s=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return Z(n.errors,a)}function td(n){return n.declaration||n}function Q9(n){return n.type===r.VariableDeclaration?n.parent===n.project?"global-declaration":"local-declaration":n.declaration.parent===n.project?"global-instance":"local-instance"}function nd(n,e){const t=[];if(n.type===r.Project)t.push(...n.variableDeclarations);else{const a=_t(Me(n)).filter(s=>s.type===r.VariableDeclaration);t.push(...a),n.parent&&(st.includes(n.parent.type)||n.parent.type===r.Project)&&t.push(...nd(n.parent))}return t}const se=class se{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"name",null);l(this,"description",null);l(this,"declaration",null);l(this,"type",r.InputMap);l(this,"defaultValue",null);l(this,"readsValue",null);l(this,"dynamicArguments",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name||null,this.description=e.description||null}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.declaration){const h=D(e.declaration);s=t.get(h)}let o=null;if(e.readsValue){const h=D(e.readsValue);o=t.get(h)}const u={id:e.id,version:1,name:e.name||null,type:r.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(u,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var h;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...Ne,r.InputMap]}},t);i=s.modifiedData;const o=t.get(i.parent),u=i.declaration&&(t.get(i.declaration)||t.getBuiltIn(i.declaration)),p=((o==null?void 0:o.inputs)||[]).find(m=>{var T;return i.declaration&&((T=m.declaration)==null?void 0:T.id)===i.declaration});if(i.declaration?u?[r.Property,r.ArgumentDeclaration,r.ValueDescriptor].includes(u.type)?o&&u.type===r.ArgumentDeclaration&&![r.FunctionCall,r.Search,r.InternalCall].includes(o.type)?a.push(new E({id:`${i.id}--${y.InvalidInputMapDeclaration}`,code:y.InvalidInputMapDeclaration,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.ArgumentDeclaration}' with id '${i.declaration}'.
93
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent.addInternalCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.parent.type!==r.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(i=>!!i.parent&&st.includes(i.parent.type));if(t){const i=R(t.parent,this.project);this.parent.setParent(i)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.calledBy.flatMap(i=>i.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=a6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new se(this.toJSON(),this.project)}};l(se,"MUTABLE_BASE_PROPERTIES",[]),l(se,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),l(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),l(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),l(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),l(se,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),l(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),l(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let si=se;function s6(n){const e=rU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-argument-map-id"){const s=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return X(n.errors,a)}const oe=class oe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"name",null);l(this,"description",null);l(this,"declaration",null);l(this,"type",r.InputMap);l(this,"defaultValue",null);l(this,"readsValue",null);l(this,"dynamicArguments",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name||null,this.description=e.description||null}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;if(e.declaration){const h=D(e.declaration);s=t.get(h)}let o=null;if(e.readsValue){const h=D(e.readsValue);o=t.get(h)}const u={id:e.id,version:1,name:e.name||null,type:r.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(u,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var h;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...Ne,r.InputMap]}},t);i=s.modifiedData;const o=t.get(i.parent),u=i.declaration&&(t.get(i.declaration)||t.getBuiltIn(i.declaration)),p=((o==null?void 0:o.inputs)||[]).find(m=>{var T;return i.declaration&&((T=m.declaration)==null?void 0:T.id)===i.declaration});if(i.declaration?u?[r.Property,r.ArgumentDeclaration,r.ValueDescriptor].includes(u.type)?o&&u.type===r.ArgumentDeclaration&&![r.FunctionCall,r.Search,r.InternalCall].includes(o.type)?a.push(new E({id:`${i.id}--${y.InvalidInputMapDeclaration}`,code:y.InvalidInputMapDeclaration,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.ArgumentDeclaration}' with id '${i.declaration}'.
88
94
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
89
95
  Only 'function-call', 'search' and 'internal-call' entities can have input-maps whose 'declaration' points to 'argument-declaration' entities.`,issue:null})):o&&u.type===r.Property&&!Fe.includes(o.type)?a.push(new E({id:`${i.id}--${y.InvalidInputMapDeclaration}`,code:y.InvalidInputMapDeclaration,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${r.Property}' with id '${i.declaration}'.
90
96
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
@@ -96,31 +102,31 @@ This is because a dynamically assembled object can have new properties added to
96
102
  Only input-map entities for variables with an inferred data type are allowed to not have a declaration.
97
103
  This is because a dynamically assembled object can have new properties added to it as input-maps. Otherwise all input maps need to point to a declaration`,issue:null})),u&&o){if(p)a.push(new E({id:`${i.id}--${y.InputOverwrite}`,code:y.InputOverwrite,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an input-map with id '${p.id}' that points to the same base ${u.type} as declaration.
98
104
  Any value reads can be done with that input-map instead.
99
- You can't edit input-map entities as they need to match their argument declarations, so you can only modify the 'readsValue' property so it reads the value from an external entity, or the 'defaultValue' so it has a hard-coded one.`,issue:null}));else if(Fe.includes(o.type)){const b=td(o).dataType,I=b==null?void 0:b.entity;I&&I.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
105
+ You can't edit input-map entities as they need to match their argument declarations, so you can only modify the 'readsValue' property so it reads the value from an external entity, or the 'defaultValue' so it has a hard-coded one.`,issue:null}));else if(Fe.includes(o.type)){const b=Zc(o).dataType,I=b==null?void 0:b.entity;I&&I.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
100
106
  This means it can hold a function-call or operation as its value, to be executed programatically.
101
- Input maps can only be added to variables which hold an entity with properties.`,issue:null})):I&&!(b!=null&&b.inferred)&&(I.properties.find(L=>L.id===u.id)||a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${u.id}' of the 'input-map' does not exist in the entity of the 'data-type'.
102
- The entity of the data-type has the following properties that can be reads as input maps, ids: '${N(I.properties.map(L=>L.id),"', '","' and '")}'`,issue:null})))}else if(Ne.filter(m=>Fe.includes(m)).includes(o.type)){const T=fd(o),b=T.find(C=>C.id===i.declaration),I=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${N(T.map(C=>C.id),"', '","' and '")}'`;b||a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent entity does not have an 'argument-declaration' with id '${i.declaration}'.
107
+ Input maps can only be added to variables which hold an entity with properties.`,issue:null})):I&&!(b!=null&&b.inferred)&&(I.properties.find(G=>G.id===u.id)||a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${u.id}' of the 'input-map' does not exist in the entity of the 'data-type'.
108
+ The entity of the data-type has the following properties that can be reads as input maps, ids: '${N(I.properties.map(G=>G.id),"', '","' and '")}'`,issue:null})))}else if(Ne.filter(m=>Fe.includes(m)).includes(o.type)){const T=Rd(o),b=T.find(C=>C.id===i.declaration),I=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${N(T.map(C=>C.id),"', '","' and '")}'`;b||a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.InputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent entity does not have an 'argument-declaration' with id '${i.declaration}'.
103
109
  You can't add an input-map to an entity that doesn't have a matching 'argument-declaration'.
104
- ${I}`,issue:null}))}}return a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=pa(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
105
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){var e;return this.parent.addInput(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),ca.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),fa(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{i.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(i.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(i.push(this.parent),this.parent.removeInput(this)),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(i=>{t.push(i),i.restore({seenEntities:e})}),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,dynamicArguments:this.dynamicArguments.map(a=>a.toReference()),declaration:((t=this.declaration)==null?void 0:t.toReference())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dynamicArguments.flatMap(i=>i.toFlatJSON(e)),...this.defaultValue?this.defaultValue.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name||void 0,description:this.description||void 0,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.dynamicArguments.forEach(t=>t.clearErrors()),(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=X9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dynamicArguments.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return this.defaultValue||((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e){return new se(this.toJSON(),this.project)}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(se,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(se,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),l(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),l(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),l(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),l(se,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),l(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue","dynamicArguments"]),l(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let hn=se;class K9 extends hn{constructor(t,i){super(t,i);l(this,"declaration",null);l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}class e6 extends hn{constructor(t,i){super(t,i);l(this,"name",null);l(this,"description",null);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}function t6(n){const e=zx(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-return-map-id"){const s=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return Z(n.errors,a)}const oe=class oe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.OutputMap);l(this,"parentRelationType");l(this,"declaration");l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s;if(e.declaration){const p=D(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:r.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var u;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:Ne.filter(p=>p!==r.Condition)},declaration:{list:!1,types:[r.ReturnDeclaration,r.Property]}},t);i=s.modifiedData;const o=t.get(i.parent);if(o&&Ne.filter(p=>p!==r.Condition).includes(o.type)){const p=o.outputs.find(h=>h.declaration.id===D(i.declaration));if(p)a.push(new E({id:`${i.id}--${y.OutputOverwrite}`,code:y.OutputOverwrite,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${p.id}' that points to the same base 'return-declaration'.
110
+ ${I}`,issue:null}))}}return a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=da(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
111
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:i}}addSelfToProject(){var e;return this.parent.addInput(this),(e=this.readsValue)==null||e.addValueReader(this),this}setParent(e){return this.parent=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),oa.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ya(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(i.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{i.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(i.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(i.push(this.parent),this.parent.removeInput(this)),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(i=>{t.push(i),i.restore({seenEntities:e})}),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dynamicArguments.flatMap(i=>i.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(i=>i.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,dynamicArguments:this.dynamicArguments.map(a=>a.toReference()),declaration:((t=this.declaration)==null?void 0:t.toReference())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dynamicArguments.flatMap(i=>i.toFlatJSON(e)),...this.defaultValue?this.defaultValue.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name||void 0,description:this.description||void 0,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dynamicArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.dynamicArguments.forEach(t=>t.clearErrors()),(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=s6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dynamicArguments.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return this.defaultValue||((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e){return new oe(this.toJSON(),this.project)}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}};l(oe,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(oe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"index"]),l(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),l(oe,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),l(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),l(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue","dynamicArguments"]),l(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let hn=oe;class o6 extends hn{constructor(t,i){super(t,i);l(this,"declaration",null);l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}class l6 extends hn{constructor(t,i){super(t,i);l(this,"name",null);l(this,"description",null);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}function c6(n){const e=U4(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-return-map-id"){const s=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return X(n.errors,a)}const le=class le{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"index");l(this,"type",r.OutputMap);l(this,"parentRelationType");l(this,"declaration");l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s;if(e.declaration){const p=D(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:r.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){var u;let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:Ne.filter(p=>p!==r.Condition)},declaration:{list:!1,types:[r.ReturnDeclaration,r.Property]}},t);i=s.modifiedData;const o=t.get(i.parent);if(o&&Ne.filter(p=>p!==r.Condition).includes(o.type)){const p=o.outputs.find(h=>h.declaration.id===D(i.declaration));if(p)a.push(new E({id:`${i.id}--${y.OutputOverwrite}`,code:y.OutputOverwrite,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${p.id}' that points to the same base 'return-declaration'.
106
112
  Any value reads can be done with that output-map instead.
107
- You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}));else{const h=t.get(i.declaration);if(h&&Fe.includes(o.type)){const m=td(o),T=m.dataType,b=(u=m.dataType)==null?void 0:u.entity;T?b?b.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
113
+ You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}));else{const h=t.get(i.declaration);if(h&&Fe.includes(o.type)){const m=Zc(o),T=m.dataType,b=(u=m.dataType)==null?void 0:u.entity;T?b?b.type===r.ActionDescriptor?a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
108
114
  This means it can hold a function-call or operation as its value, to be executed programatically.
109
115
  Output maps can only be added to variables which hold an entity with properties.`,issue:null})):b.properties.find(C=>C.id===h.id)||a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The 'declaration' with '${h.id}' of the 'output-map' does not exist in the entity of the 'data-type'.
110
116
  The entity of the data-type has the following properties that can be reads as output maps, ids: '${N(b.properties.map(C=>C.id),"', '","' and '")}'`,issue:null})):a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' doesn't have an 'entity' set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
111
- ${od}`,issue:null})):a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is not set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
112
- ${od}`,issue:null}))}else if(h){const m=o.outputs.find(T=>T.declaration.id===i.declaration);m&&a.push(new E({id:`${i.id}--${y.OutputOverwrite}`,code:y.OutputOverwrite,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${m.id}' that points to the same declaration.
117
+ ${ud}`,issue:null})):a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is not set, so it cannot be determined if the output-map is reading a valid property of the data type entity.
118
+ ${ud}`,issue:null}))}else if(h){const m=o.outputs.find(T=>T.declaration.id===i.declaration);m&&a.push(new E({id:`${i.id}--${y.OutputOverwrite}`,code:y.OutputOverwrite,severity:f.Error,message:`Entity of type '${r.OutputMap}' with id '${i.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${m.id}' that points to the same declaration.
113
119
  Any value reads can be done with that output-map instead.
114
120
  You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}))}}}return a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
115
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addOutput(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,da.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,declaration:this.declaration.toReference(),writesValues:this.writesValues.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this}validate(){const e=t6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new oe(this.toJSON(),this.project)}getDataType(){return this.declaration.getDataType()||null}};l(oe,"MUTABLE_BASE_PROPERTIES",[]),l(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"index"]),l(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),l(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),l(oe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),l(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),l(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let fn=oe;class n6 extends fn{constructor(t,i){super(t,i);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}class r6 extends fn{constructor(t,i){super(t,i);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}function i6(n){var s;const e=I8(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="company-dto-func-declaration-argument-dcl-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}if(n.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return Z(n.errors,a)}const le=class le{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"type",r.ArgumentDeclaration);l(this,"dataType",null);l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s={id:e.id,version:1,name:e.name,type:r.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,dataType:null,writesValues:[],parent:a},o=R(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.FunctionDeclaration,r.Search,r.Condition]}},t);i=s.modifiedData;const o=Cd(i,t);if(console.log("Checking that the argument declaration does not overlap with the implemented signature"),i.parent){const u=t.get(D(i.parent));if(u)if(console.log("Parent found"),$e.includes(u.type)){console.log("Parent is an entry point");const p=u.implements;if(p)if(console.log("Parent implements a descriptor. Argument type: ",p.argumentsType),p.argumentsType===V.Fixed){console.log("Descriptor has fixed arguments");const h=p.fixedArguments.find(L=>L.name===i.name),m=p.fixedArguments.filter(L=>!u.inputs.find(Ut=>Ut.type===r.ArgumentDeclaration&&Ut.name===L.name)),T=u.inputs.filter(L=>L.type===r.ArgumentDeclaration),b=T.find(L=>L.name===i.name),I=T.length?`The parent entity already implements the following arguments: ${N(T.map(L=>`'${L.id}' (${L.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",C=m.length?`The parent entity is still missing the following arguments in the implementation: ${N(m.map(L=>`'${L.id}' (${L.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";h?b&&(console.log("Argument with the same name already implemented"),a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${r.ActionDescriptor} with fixed arguments.
121
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addOutput(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,la.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),{affected:i,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,declaration:this.declaration.toReference(),writesValues:this.writesValues.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this}validate(){const e=c6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new le(this.toJSON(),this.project)}getDataType(){return this.declaration.getDataType()||null}};l(le,"MUTABLE_BASE_PROPERTIES",[]),l(le,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),l(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"index"]),l(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),l(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),l(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),l(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),l(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),l(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let fn=le;class d6 extends fn{constructor(t,i){super(t,i);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}class u6 extends fn{constructor(t,i){super(t,i);l(this,"declaration");l(this,"parent");l(this,"errors",[])}toJSON(){return super.toJSON()}}function p6(n){var s;const e=Tx(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="company-dto-func-declaration-argument-dcl-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}if(n.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=H({id:`${n.id}--${M.PropertyImplementsNonAbstact}`,message:`Property "${A(n,n.project)}" with id "${n.id}" implements a non-abstract property "${A(n,n.project)}" with id "${n.id}".`,issue:null,severity:f.Error,code:M.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return X(n.errors,a)}const ce=class ce{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"type",r.ArgumentDeclaration);l(this,"dataType",null);l(this,"writesValues",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s={id:e.id,version:1,name:e.name,type:r.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,dataType:null,writesValues:[],parent:a},o=R(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.FunctionDeclaration,r.Search,r.Condition]}},t);i=s.modifiedData;const o=rd(i,t);if(console.log("Checking that the argument declaration does not overlap with the implemented signature"),i.parent){const u=t.get(D(i.parent));if(u)if(console.log("Parent found"),$e.includes(u.type)){console.log("Parent is an entry point");const p=u.implements;if(p)if(console.log("Parent implements a descriptor. Argument type: ",p.argumentsType),p.argumentsType===L.Fixed){console.log("Descriptor has fixed arguments");const h=p.fixedArguments.find(G=>G.name===i.name),m=p.fixedArguments.filter(G=>!u.inputs.find(xt=>xt.type===r.ArgumentDeclaration&&xt.name===G.name)),T=u.inputs.filter(G=>G.type===r.ArgumentDeclaration),b=T.find(G=>G.name===i.name),I=T.length?`The parent entity already implements the following arguments: ${N(T.map(G=>`'${G.id}' (${G.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",C=m.length?`The parent entity is still missing the following arguments in the implementation: ${N(m.map(G=>`'${G.id}' (${G.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";h?b&&(console.log("Argument with the same name already implemented"),a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${r.ActionDescriptor} with fixed arguments.
116
122
  Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
117
123
  ${I}
118
124
  ${C}`,issue:null}))):(console.log("No argument with the same name in the descriptor"),a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${r.ActionDescriptor} with fixed arguments.
119
125
  Adding a new argument would make the implementation invalid. There are no arguments in the descriptor with the same name.
120
126
  ${I}
121
- ${C}`,issue:null})))}else p.argumentsType===V.Dynamic?console.log("Descriptor has dynamic arguments"):p.argumentsType===V.None&&(console.log("Descriptor has no arguments"),a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${r.ActionDescriptor} with no arguments.
127
+ ${C}`,issue:null})))}else p.argumentsType===L.Dynamic?console.log("Descriptor has dynamic arguments"):p.argumentsType===L.None&&(console.log("Descriptor has no arguments"),a.push(new E({id:`${i.id}--${v.NoOverlapWithImplementedSignature}`,code:v.NoOverlapWithImplementedSignature,severity:f.Error,message:`Entity of type '${r.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${u.type}' with id '${u.id}' that implements a ${r.ActionDescriptor} with no arguments.
122
128
  Adding a new argument would make the implementation invalid.`,issue:null})));else console.log("Parent does not implement a descriptor")}else console.log("Parent is not an entry point");else console.log("Parent not found")}return a.push(...s.errors,...o,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
123
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addInputDeclaration(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),da.initWritesValues(this,this.parent),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),e||(i.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,writesValues:this.writesValues.map(t=>t.toReference()),dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=i6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this==null?void 0:this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new le(this.toJSON(),this.project)}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};l(le,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(le,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),l(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"index"]),l(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),l(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),l(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),l(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),l(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let mr=le;function a6(n){const e=Hc(),t=n.toJSON();e.safeParse(t).success;const a=[];return Z(n.errors,a)}function s6(n,e){const t=[];if(n.parent)if(n.parent){const i=e.get(n.parent);i?[r.InputMap,r.DataType].includes(i.type)?i.type===r.DataType&&i.defaultValue&&t.push(new E({id:`${n.id}--${n.parent}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${i.defaultValue.id}".
129
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.addInputDeclaration(this),this.writesValues.forEach(e=>{e.setValueWriter(this)}),this}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),la.initWritesValues(this,this.parent),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{i.push(s),s.readsValue=null}),e||(i.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((i=this.dataType)==null?void 0:i.toFlat(e))||[]])}toFlatIds(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((i=this.dataType)==null?void 0:i.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,writesValues:this.writesValues.map(t=>t.toReference()),dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...((i=this.dataType)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...((i=this.dataType)==null?void 0:i.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=p6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this==null?void 0:this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ce(this.toJSON(),this.project)}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};l(ce,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(ce,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,"index"]),l(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),l(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),l(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),l(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let mr=ce;function y6(n){const e=dc(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}function h6(n,e){const t=[];if(n.parent)if(n.parent){const i=e.get(n.parent);i?[r.InputMap,r.DataType].includes(i.type)?i.type===r.DataType&&i.defaultValue&&t.push(new E({id:`${n.id}--${n.parent}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${i.defaultValue.id}".
124
130
  Data types can only have one 'primitive-value' entity as 'defaultValue'.
125
131
  You can update the existing 'primitive-value' with the 'update' action, for example, like so:
126
132
  \`\`\`json
@@ -132,62 +138,62 @@ You can update the existing 'primitive-value' with the 'update' action, for exam
132
138
  }
133
139
  }
134
140
  }\`\`\`
135
- Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'input-map' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null}));else return t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null})),t;if(n.valueAsType){const i=[],a=[],s=n.valueAsType;Array.isArray(s)?s.forEach(o=>{typeof o=="string"?a.push(o):i.push(o)}):typeof s=="string"?a.push(s):i.push(s),i.forEach(o=>{const u=Xs(o);t.push(...u),u.length===0&&a.push(o.entityId)}),a.forEach(o=>{const u=e.get(o);u?[r.CustomEntity,r.BuiltInBaseEntity].includes(u.type)||t.push(new E({id:`${n.id}--${o}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'valueAsType' reference that isn't pointing to an entity of type 'custom-entity', 'function-declaration' or 'operation'.`,issue:null})):t.push(new E({id:`${n.id}--${o}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${o}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))})}return t}const Ee=class Ee{constructor(e,t){l(this,"initialData");l(this,"type",r.PrimitiveValue);l(this,"id");l(this,"version");l(this,"name");l(this,"autogeneration",null);l(this,"value",null);l(this,"valueAsType",null);l(this,"errors",[]);l(this,"parent");l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.autogeneration=e.autogeneration,this.value=e.value}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.valueAsType&&(Array.isArray(e.valueAsType)?s=e.valueAsType.map(p=>t.get(p)||t.getBuiltIn(p)):s=t.get(e.valueAsType)||t.getBuiltIn(e.valueAsType));const o={id:e.id,version:1,type:r.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=s6(i,t);return a.push(...s,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
136
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.setDefaultValue(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatJSON(e)):this.valueAsType.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.id):this.valueAsType.id:null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatGenerationTarget(e)):this.valueAsType.toFlatGenerationTarget(e):[]])}clearErrors(){return this.errors=[],this}validate(){const e=a6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0){const a=this.toJSON(),s=t||Qt(this.name,r.PrimitiveValue,this.project);a.id=s;const o=ma(a,this.project);return e&&o.setParent(e),i&&o.subscribe(),o}};l(Ee,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),l(Ee,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"MUTABLE_META_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES]),l(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),l(Ee,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),l(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let ci=Ee;function o6(n){var s;const e=fU(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return Z(n.errors,a)}function l6(n){var s;const e=Jx(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return Z(n.errors,a)}const Re=class Re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ContinueStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
141
+ Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'input-map' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}else t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null}));else return t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null})),t;if(n.valueAsType){const i=[],a=[],s=n.valueAsType;Array.isArray(s)?s.forEach(o=>{typeof o=="string"?a.push(o):i.push(o)}):typeof s=="string"?a.push(s):i.push(s),i.forEach(o=>{const u=Qs(o);t.push(...u),u.length===0&&a.push(o.entityId)}),a.forEach(o=>{const u=e.get(o);u?[r.CustomEntity,r.BuiltInBaseEntity].includes(u.type)||t.push(new E({id:`${n.id}--${o}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'valueAsType' reference that isn't pointing to an entity of type 'custom-entity', 'function-declaration' or 'operation'.`,issue:null})):t.push(new E({id:`${n.id}--${o}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${o}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))})}return t}const Ee=class Ee{constructor(e,t){l(this,"initialData");l(this,"type",r.PrimitiveValue);l(this,"id");l(this,"version");l(this,"name");l(this,"autogeneration",null);l(this,"value",null);l(this,"valueAsType",null);l(this,"errors",[]);l(this,"parent");l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.autogeneration=e.autogeneration,this.value=e.value}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.valueAsType&&(Array.isArray(e.valueAsType)?s=e.valueAsType.map(p=>t.get(p)||t.getBuiltIn(p)):s=t.get(e.valueAsType)||t.getBuiltIn(e.valueAsType));const o={id:e.id,version:1,type:r.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},u=R(o,t);return u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=h6(i,t);return a.push(...s,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
142
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent.setDefaultValue(this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatJSON(e)):this.valueAsType.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.id):this.valueAsType.id:null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(i=>i.toFlatGenerationTarget(e)):this.valueAsType.toFlatGenerationTarget(e):[]])}clearErrors(){return this.errors=[],this}validate(){const e=y6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0){const a=this.toJSON(),s=t||Xt(this.name,r.PrimitiveValue,this.project);a.id=s;const o=ha(a,this.project);return e&&o.setParent(e),i&&o.subscribe(),o}};l(Ee,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),l(Ee,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"MUTABLE_META_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES]),l(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),l(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),l(Ee,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),l(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),l(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let oi=Ee;function f6(n){var s;const e=P4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return X(n.errors,a)}function m6(n){var s;const e=b4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return X(n.errors,a)}const Re=class Re{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ContinueStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
137
143
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
138
144
  You shouldn't have to manually update a 'parent' property.
139
- Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addContinueStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(t=>t.toReference()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e)),...((i=this.throws)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=l6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Re(this.toJSON(),this.project)}};l(Re,"MUTABLE_BASE_PROPERTIES",[]),l(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"MUTABLE_META_PROPERTIES",["x","y"]),l(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),l(Re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Re,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),l(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let yt=Re;const it=class it{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ReturnStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:st}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
145
+ Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addContinueStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.calledBy.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.calledBy.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(t=>t.toReference()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var i;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e)),...((i=this.throws)==null?void 0:i.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=m6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Re(this.toJSON(),this.project)}};l(Re,"MUTABLE_BASE_PROPERTIES",[]),l(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"MUTABLE_META_PROPERTIES",["x","y"]),l(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),l(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),l(Re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(Re,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),l(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let yt=Re;const it=class it{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.ReturnStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:st}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
140
146
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
141
147
  You shouldn't have to manually update a 'parent' property.
142
- Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addReturnStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=o6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new it(this.toJSON(),this.project)}};l(it,"MUTABLE_BASE_PROPERTIES",[]),l(it,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(it,"BASE_PROPERTIES",[...yt.MUTABLE_BASE_PROPERTIES,...yt.INMUTABLE_BASE_PROPERTIES]),l(it,"MUTABLE_META_PROPERTIES",["x","y"]),l(it,"INMUTABLE_META_PROPERTIES",[...yt.INMUTABLE_BASE_PROPERTIES]),l(it,"META_PROPERTIES",[...yt.MUTABLE_META_PROPERTIES,...yt.INMUTABLE_META_PROPERTIES]),l(it,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(it,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(it,"UPSTREAM_PROPERTIES",[...yt.MUTABLE_UPSTREAM_PROPERTIES,...yt.INMUTABLE_UPSTREAM_PROPERTIES]),l(it,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(it,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(it,"DOWNSTREAM_PROPERTIES",[...yt.MUTABLE_DOWNSTREAM_PROPERTIES,...yt.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(it,"PROPERTIES",[...Ot.META_PROPERTIES,...Ot.UPSTREAM_PROPERTIES,...Ot.DOWNSTREAM_PROPERTIES]);let Tr=it;function c6(n){var s;const e=rU(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return Z(n.errors,a)}const be=class be{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.BreakStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
148
+ Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addReturnStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),outputs:this.outputs.map(i=>i.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=f6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new it(this.toJSON(),this.project)}};l(it,"MUTABLE_BASE_PROPERTIES",[]),l(it,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(it,"BASE_PROPERTIES",[...yt.MUTABLE_BASE_PROPERTIES,...yt.INMUTABLE_BASE_PROPERTIES]),l(it,"MUTABLE_META_PROPERTIES",["x","y"]),l(it,"INMUTABLE_META_PROPERTIES",[...yt.INMUTABLE_BASE_PROPERTIES]),l(it,"META_PROPERTIES",[...yt.MUTABLE_META_PROPERTIES,...yt.INMUTABLE_META_PROPERTIES]),l(it,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(it,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(it,"UPSTREAM_PROPERTIES",[...yt.MUTABLE_UPSTREAM_PROPERTIES,...yt.INMUTABLE_UPSTREAM_PROPERTIES]),l(it,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(it,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(it,"DOWNSTREAM_PROPERTIES",[...yt.MUTABLE_DOWNSTREAM_PROPERTIES,...yt.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(it,"PROPERTIES",[...Ot.META_PROPERTIES,...Ot.UPSTREAM_PROPERTIES,...Ot.DOWNSTREAM_PROPERTIES]);let Tr=it;function T6(n){var s;const e=V4(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return X(n.errors,a)}const be=class be{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.BreakStatement);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"throws",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i),s=e.calledByEntry.map(m=>{const T=D(m);return t.get(T)}),o=e.calledBySuccess.map(m=>{const T=D(m);return t.get(T)}),u=e.calledByError.map(m=>{const T=D(m);return t.get(T)}),p={id:e.id,version:1,type:r.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:u,calledByEntry:s,throws:null,parent:a},h=R(p,t);return h.setParent(a),h.initChildren(),h}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
143
149
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
144
150
  You shouldn't have to manually update a 'parent' property.
145
- Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addBreakStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=c6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors()),...this.throws?this.throws.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new be(this.toJSON(),this.project)}};l(be,"MUTABLE_BASE_PROPERTIES",[]),l(be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),l(be,"MUTABLE_META_PROPERTIES",["x","y"]),l(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),l(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),l(be,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(be,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),l(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let di=be;function d6(n){var s,o;const e=Pg(),t=n.toJSON();e.safeParse(t).success,n.fixedArguments.flatMap(u=>u.validate()),n.fixedReturns.flatMap(u=>u.validate()),(s=n.dynamicArgumentTypes)==null||s.validate(),(o=n.dynamicReturnTypes)==null||o.validate();const a=[];return Z(n.errors,a)}const ce=class ce{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"argumentsType");l(this,"returnsType");l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"implementation",null);l(this,"parent",null);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.argumentsType=e.argumentsType,this.returnsType=e.returnsType}static fromGenerationTarget(e,t){let i=null;if(e.parent){const o=D(e.parent);i=t.get(o)}const a={id:e.id,version:1,name:e.name,type:r.ActionDescriptor,description:e.description,dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:e.argumentsType,returnsType:e.returnsType,fixedArguments:[],fixedReturns:[],error:null,parent:i},s=R(a,t);return i&&s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.CustomEntity,r.DataType]}},t);i=s.modifiedData;const o=i.parent?t.get(i.parent):null;if(o&&o.type===r.CustomEntity){const u=o,h=Gn(u).filter(m=>!m.interactive);if(h.length){let m=h.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(h.map(T=>A(T,T.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(h[0],h[0].project)}").`;m+=`
146
- ${Vn}`,a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:m,issue:null}))}}else if(o&&o.type===r.DataType){const u=o;u.entity&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
151
+ Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.calledByEntry.forEach(e=>{e.addCall(this)}),this.calledBySuccess.forEach(e=>{e.addSuccessCall(this)}),this.calledByError.forEach(e=>{e.addErrorCall(this)}),this.parent.addBreakStatement(this),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:i}=this.throws.restore({seenEntities:e});t.push(...i)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(i=>i.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(i=>i.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(i=>i.toReference()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=T6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors()),...this.throws?this.throws.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new be(this.toJSON(),this.project)}};l(be,"MUTABLE_BASE_PROPERTIES",[]),l(be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),l(be,"MUTABLE_META_PROPERTIES",["x","y"]),l(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),l(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),l(be,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),l(be,"INMUTABLE_UPSTREAM_PROPERTIES",[]),l(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),l(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),l(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let li=be;function E6(n){var s,o;const e=pb(),t=n.toJSON();e.safeParse(t).success,n.fixedArguments.flatMap(u=>u.validate()),n.fixedReturns.flatMap(u=>u.validate()),(s=n.dynamicArgumentTypes)==null||s.validate(),(o=n.dynamicReturnTypes)==null||o.validate();const a=[];return X(n.errors,a)}const de=class de{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"argumentsType");l(this,"returnsType");l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"implementation",null);l(this,"parent",null);l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.argumentsType=e.argumentsType,this.returnsType=e.returnsType}static fromGenerationTarget(e,t){let i=null;if(e.parent){const o=D(e.parent);i=t.get(o)}const a={id:e.id,version:1,name:e.name,type:r.ActionDescriptor,description:e.description,dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:e.argumentsType,returnsType:e.returnsType,fixedArguments:[],fixedReturns:[],error:null,parent:i},s=R(a,t);return i&&s.setParent(i),s.initChildren(),s}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.CustomEntity,r.DataType]}},t);i=s.modifiedData;const o=i.parent?t.get(i.parent):null;if(o&&o.type===r.CustomEntity){const u=o,h=Ln(u).filter(m=>!m.interactive);if(h.length){let m=h.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it extends or implements multiple '${r.BuiltInBaseEntity}' entities that are non-interactive ("${N(h.map(T=>A(T,T.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it extends or implements a '${r.BuiltInBaseEntity}' entity that is non-interactive ("${A(h[0],h[0].project)}").`;m+=`
152
+ ${$n}`,a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:m,issue:null}))}}else if(o&&o.type===r.DataType){const u=o;u.entity&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${u.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
147
153
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
148
- ${Xt({describe_entity:u.entity.id})}
154
+ ${Qt({describe_entity:u.entity.id})}
149
155
  Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return a.push(...s.errors,...Pe(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated, as it would mean moving the '${this.type}' entity to another parent entity.
150
- This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent?(this.parent.type===r.CustomEntity?this.parent.addAbstractMethod(this):this.parent.type===r.DataType&&this.parent.setEntity(this),this):this}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.fixedArguments.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const i=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.dynamicReturnTypes){const i=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.error){const i=this.error.restore({seenEntities:e});t.push(...i.affected)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(i=>i.toFlat(e)),...this.fixedReturns.flatMap(i=>i.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(i=>i.toFlatIds(e)),...this.fixedReturns.flatMap(i=>i.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(i=>i.toFlatJSON(e)),...this.fixedReturns.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.fixedArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,u)=>{var h;const p={id:e+"--"+o.id+"--parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:r.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:u,dataType:((h=o.dataType)==null?void 0:h.toJSON())||null,parent:p}}),i=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((m,T)=>{var I;const b={id:e+"--return-statement--"+m.id+"--parent-ref",type:r.GenericReference,entityId:e,entityType:r.ReturnStatement};return{id:e+"--"+m.id,version:m.version,type:r.ReturnDeclaration,name:m.name,description:m.description,readsValue:null,required:m.required,isError:!1,index:T,dataType:((I=m.dataType)==null?void 0:I.toJSON())||null,parent:b}}),u={id:e+"--return-statement-parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},h={id:e+"--return-statement",version:this.version,type:r.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:u,x:0,y:0};i.push(h),a.push(h)}return{id:e,version:this.version,type:r.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:i,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,i=this.id+"--instance-"+G.fromUUID(G.uuid()),a={id:i,version:this.version,type:r.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((u,p)=>{const m={id:u.toReference().id+"--input-map-id",version:this.version,type:r.InputMap,name:null,description:null,declaration:u,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:G.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.inputs.push(m)}),this.fixedReturns.forEach((u,p)=>{const m={id:u.toReference().id+"--output-map-id",version:this.version,type:r.OutputMap,declaration:u,writesValues:[],index:p,parent:{id:G.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.outputs.push(m)});const s={id:i+"--body-function-declaration-id",version:this.version,type:r.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:G.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};s.inputs=[{id:G.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}},{id:G.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const i=e||this.project,a=t||this.id+"--instance-"+G.fromUUID(G.uuid()),s={id:a,version:this.version,type:r.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:i.toReference()};if(this.fixedArguments.forEach((u,p)=>{const h={id:a+Qt(u.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:u,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:G.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.inputs.push(h)}),this.fixedReturns.forEach((u,p)=>{const h={id:a+Qt(u.name,r.OutputMap,this.project),version:this.version,type:r.OutputMap,declaration:u,writesValues:[],index:p,parent:{id:G.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.outputs.push(h)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:r.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:G.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(i),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,i=this.id+"--instance-"+G.fromUUID(G.uuid()),a={id:i,version:this.version,type:r.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,u)=>{const p={id:i+Qt(o.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:u,dynamicArguments:[],parent:{id:G.uuid(),type:r.GenericReference,entityId:i,entityType:r.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,i;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(i=this.error)==null||i.clearErrors(),this}validate(){const e=d6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ce(this.toJSON(),this.project)}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};l(ce,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),l(ce,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES]),l(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),l(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),l(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),l(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),l(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let _e=ce;function u6(n){var s;const e=Ux(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];return Z(n.errors,a)}const de=class de{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"parentRelationType");l(this,"type",r.ValueDescriptor);l(this,"dataType",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=e.parent?D(e.parent):null,a=i?t.get(i):null,s=e.parentRelationType===O.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:r.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},u=R(o,t);return a&&u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.ActionDescriptor]}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=i.parent&&t.get(i.parent),u=o&&vr(o);return u&&u.type===r.ActionDescriptor&&a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${u.name}" of type '${u.type}' with id '${u.id}'.
156
+ This is likely an incorrect strategy, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent?(this.parent.type===r.CustomEntity?this.parent.addAbstractMethod(this):this.parent.type===r.DataType&&this.parent.setEntity(this),this):this}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s.affected),a.push(...s.removed)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.fixedArguments.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(i=>{const a=i.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const i=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.dynamicReturnTypes){const i=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...i.affected)}if(this.error){const i=this.error.restore({seenEntities:e});t.push(...i.affected)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(i=>i.toFlat(e)),...this.fixedReturns.flatMap(i=>i.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(i=>i.toFlatIds(e)),...this.fixedReturns.flatMap(i=>i.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((i=this.dynamicReturnTypes)==null?void 0:i.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(i=>i.toFlatJSON(e)),...this.fixedReturns.flatMap(i=>i.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.fixedArguments.flatMap(i=>i.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(i=>i.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,u)=>{var h;const p={id:e+"--"+o.id+"--parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:r.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:u,dataType:((h=o.dataType)==null?void 0:h.toJSON())||null,parent:p}}),i=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((m,T)=>{var I;const b={id:e+"--return-statement--"+m.id+"--parent-ref",type:r.GenericReference,entityId:e,entityType:r.ReturnStatement};return{id:e+"--"+m.id,version:m.version,type:r.ReturnDeclaration,name:m.name,description:m.description,readsValue:null,required:m.required,isError:!1,index:T,dataType:((I=m.dataType)==null?void 0:I.toJSON())||null,parent:b}}),u={id:e+"--return-statement-parent-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:r.GenericReference,entityType:r.FunctionDeclaration,entityId:e},h={id:e+"--return-statement",version:this.version,type:r.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:u,x:0,y:0};i.push(h),a.push(h)}return{id:e,version:this.version,type:r.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:i,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,i=this.id+"--instance-"+$.UUID.fromUUID($.UUID.uuid()),a={id:i,version:this.version,type:r.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((u,p)=>{const m={id:u.toReference().id+"--input-map-id",version:this.version,type:r.InputMap,name:null,description:null,declaration:u,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.inputs.push(m)}),this.fixedReturns.forEach((u,p)=>{const m={id:u.toReference().id+"--output-map-id",version:this.version,type:r.OutputMap,declaration:u,writesValues:[],index:p,parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};a.outputs.push(m)});const s={id:i+"--body-function-declaration-id",version:this.version,type:r.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:i,entityType:r.Loop}};s.inputs=[{id:$.UUID.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}},{id:$.UUID.uuid(),version:this.version,type:r.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:r.GenericReference,entityId:s.id,entityType:r.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const i=e||this.project,a=t||this.id+"--instance-"+$.UUID.fromUUID($.UUID.uuid()),s={id:a,version:this.version,type:r.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:i.toReference()};if(this.fixedArguments.forEach((u,p)=>{const h={id:a+Xt(u.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:u,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.inputs.push(h)}),this.fixedReturns.forEach((u,p)=>{const h={id:a+Xt(u.name,r.OutputMap,this.project),version:this.version,type:r.OutputMap,declaration:u,writesValues:[],index:p,parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.outputs.push(h)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:r.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:a,entityType:r.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(i),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,i=this.id+"--instance-"+$.UUID.fromUUID($.UUID.uuid()),a={id:i,version:this.version,type:r.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,u)=>{const p={id:i+Xt(o.name,r.InputMap,this.project),version:this.version,type:r.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:u,dynamicArguments:[],parent:{id:$.UUID.uuid(),type:r.GenericReference,entityId:i,entityType:r.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,i;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(i=this.error)==null||i.clearErrors(),this}validate(){const e=E6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new de(this.toJSON(),this.project)}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};l(de,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),l(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),l(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES]),l(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),l(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),l(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(de,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),l(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),l(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let _e=de;function R6(n){var s;const e=ZF(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];return X(n.errors,a)}const ue=class ue{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"index");l(this,"required");l(this,"parentRelationType");l(this,"type",r.ValueDescriptor);l(this,"dataType",null);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=e.parent?D(e.parent):null,a=i?t.get(i):null,s=e.parentRelationType===O.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:r.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},u=R(o,t);return a&&u.setParent(a),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[r.ActionDescriptor]}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=i.parent&&t.get(i.parent),u=o&&vr(o);return u&&u.type===r.ActionDescriptor&&a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${u.name}" of type '${u.type}' with id '${u.id}'.
151
157
  You can't modify system entities that are built-in.`,issue:null})),o&&o.type===r.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===O.FixedArguments||i.parentRelationType===O.FixedReturns||i.parentRelationType===O.ReturnedError)?a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either '${O.FixedArguments}', '${O.FixedReturns}', or '${O.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):i.parentRelationType===O.ReturnedError&&o.error&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', is being added as an error value-descriptor to an entity of type 'action-descriptor' with id '${o.id}', which already has an error value descriptor with id '${o.error.id}'.
152
158
  An action descriptor can only have one error value descriptor child.
153
159
  Either remove the existing error value descriptor or update it with the 'update' action.
154
160
  You can use the 'describe_entity' action to get more information about the existing error value descriptor like so:
155
- ${Xt({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var e,t;return this.parentRelationType===O.FixedArguments?(e=this.parent)==null||e.addFixedArgument(this):this.parentRelationType===O.FixedReturns?(t=this.parent)==null||t.addFixedReturn(this):this.parentRelationType===O.ReturnedError&&this.parent&&(this.parent.error=this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dataType?this.dataType.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parentRelationType:this.parentRelationType,parent:(e=this.parent)==null?void 0:e.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dataType?this.dataType.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=u6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dataType?this.dataType.getErrors():[]]}getShallowErrors(){return this.errors}clone(){return new de(this.toJSON(),this.project)}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}};l(de,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),l(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),l(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"index"]),l(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),l(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),l(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(de,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),l(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let Er=de;function p6(n,e){if(!n.type&&!n.id)return{errors:[new E({id:`last-generated-entity-payload--${y.MissingTypeProperty}`,message:"Last generated entity payload is missing a 'type' property.",severity:f.Error,code:y.MissingTypeProperty,issue:null}),new E({id:`last-generated-entity-payload--${y.MissingIdProperty}`,message:"Last generated entity payload is missing an 'id' property.",severity:f.Error,code:y.MissingIdProperty,issue:null})],modifiedData:null};if(n.type){if(!n.id)return{errors:[new E({id:`last-generated-entity-payload--${y.MissingIdProperty}`,message:`Last generated entity, with type "${n.type}" is missing an 'id' property.`,severity:f.Error,code:y.MissingIdProperty,issue:null})],modifiedData:null}}else return{errors:[new E({id:`${n.id}--${y.MissingTypeProperty}`,message:`Entity with id "${n.id}" is missing a 'type' property.`,severity:f.Error,code:y.MissingTypeProperty,issue:null})],modifiedData:null};if(n.type===r.GenericReference)return{errors:[new E({id:`${n.id}--${y.RootReference}`,message:`Generic reference entity with id "${n.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:f.Error,code:y.RootReference,issue:null})],modifiedData:null};const t=n,i=e.instances[t.id],a=e.builtInInstances[t.id];if(i&&!a&&t.type!==r.GenericReference){let s=`A previously generated entity with id "${t.id}" already exists in the project state.
161
+ ${Qt({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var e,t;return this.parentRelationType===O.FixedArguments?(e=this.parent)==null||e.addFixedArgument(this):this.parentRelationType===O.FixedReturns?(t=this.parent)==null||t.addFixedReturn(this):this.parentRelationType===O.ReturnedError&&this.parent&&(this.parent.error=this),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.index=e.index||this.index,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});i.push(...s),a.push(...o)}return{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.dataType){const{affected:i}=this.dataType.restore({seenEntities:e});t.push(...i)}return{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dataType?this.dataType.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parentRelationType:this.parentRelationType,parent:(e=this.parent)==null?void 0:e.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dataType?this.dataType.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=R6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dataType?this.dataType.getErrors():[]]}getShallowErrors(){return this.errors}clone(){return new ue(this.toJSON(),this.project)}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}};l(ue,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),l(ue,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),l(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"index"]),l(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),l(ue,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),l(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),l(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Er=ue;function b6(n,e){if(!n.type&&!n.id)return{errors:[new E({id:`last-generated-entity-payload--${y.MissingTypeProperty}`,message:"Last generated entity payload is missing a 'type' property.",severity:f.Error,code:y.MissingTypeProperty,issue:null}),new E({id:`last-generated-entity-payload--${y.MissingIdProperty}`,message:"Last generated entity payload is missing an 'id' property.",severity:f.Error,code:y.MissingIdProperty,issue:null})],modifiedData:null};if(n.type){if(!n.id)return{errors:[new E({id:`last-generated-entity-payload--${y.MissingIdProperty}`,message:`Last generated entity, with type "${n.type}" is missing an 'id' property.`,severity:f.Error,code:y.MissingIdProperty,issue:null})],modifiedData:null}}else return{errors:[new E({id:`${n.id}--${y.MissingTypeProperty}`,message:`Entity with id "${n.id}" is missing a 'type' property.`,severity:f.Error,code:y.MissingTypeProperty,issue:null})],modifiedData:null};if(n.type===r.GenericReference)return{errors:[new E({id:`${n.id}--${y.RootReference}`,message:`Generic reference entity with id "${n.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:f.Error,code:y.RootReference,issue:null})],modifiedData:null};const t=n,i=e.instances[t.id],a=e.builtInInstances[t.id];if(i&&!a&&t.type!==r.GenericReference){let s=`A previously generated entity with id "${t.id}" already exists in the project state.
156
162
  Are you trying to update that entity?
157
163
  If so, you should use the 'update' action for core mutable metadata properties, or 'delete' and then 'post' again to replace it.
158
- If you are trying to create a new entity, please use a different id, for example: "${wd(t,e)}".`;return{errors:[new E({id:`duplicate--${t.id}--${y.EntityIdNotUnique}`,message:s,severity:f.Error,code:y.EntityIdNotUnique,issue:null})],modifiedData:n}}else if(i&&t.type!==r.GenericReference)return{errors:[new E({id:`${t.id}--${y.EntityIdNotUnique}`,message:`A built in entity with id "${t.id}" already exists. You cannot modify built in entities. If you are trying to create a new entity, please use a different id, for example: "${wd(t,e)}".`,severity:f.Error,code:y.EntityIdNotUnique,issue:null})],modifiedData:n};switch(t.type){case r.Project:return Dr.validateGenerationTarget(t,e);case r.CustomEntity:return Pr.validateGenerationTarget(t,e);case r.Property:return or.validateGenerationTarget(t,e);case r.FunctionDeclaration:return lr.validateGenerationTarget(t,e);case r.DataType:return si.validateGenerationTarget(t,e);case r.Operation:return cr.validateGenerationTarget(t,e);case r.FunctionCall:return Rr.validateGenerationTarget(t,e);case r.VariableDeclaration:return pr.validateGenerationTarget(t,e);case r.VariableInstance:return yr.validateGenerationTarget(t,e);case r.GlobalEvent:return oi.validateGenerationTarget(t,e);case r.InputMap:return hn.validateGenerationTarget(t,e);case r.OutputMap:return fn.validateGenerationTarget(t,e);case r.ArgumentDeclaration:return mr.validateGenerationTarget(t,e);case r.ReturnDeclaration:return Ot.validateGenerationTarget(t,e);case r.Loop:return dr.validateGenerationTarget(t,e);case r.Condition:return ur.validateGenerationTarget(t,e);case r.Search:return hr.validateGenerationTarget(t,e);case r.InstalledProject:return fr.validateGenerationTarget(t,e);case r.InternalCall:return li.validateGenerationTarget(t,e);case r.PrimitiveValue:return ci.validateGenerationTarget(t,e);case r.ReturnStatement:return Tr.validateGenerationTarget(t,e);case r.BreakStatement:return di.validateGenerationTarget(t,e);case r.ContinueStatement:return yt.validateGenerationTarget(t,e);case r.ActionDescriptor:return _e.validateGenerationTarget(t,e);case r.ValueDescriptor:return Er.validateGenerationTarget(t,e);case r.BuiltInBaseEntity:case r.PrimitiveEntity:{const s="Did you mean to generate a",u={[r.BuiltInBaseEntity]:`${s} '${r.CustomEntity}' instead?`,[r.PrimitiveEntity]:`${s} '${r.CustomEntity}' instead?`}[t.type]||"";return{errors:[new E({id:`${t.id}--${y.BuiltInEntityGenerated}`,message:`Entity with id "${t.id} is of "${t.type}" type and should not be generated. Built in entities can only be referenced by user created entities.
159
- ${u}`,severity:f.Error,code:y.BuiltInEntityGenerated,issue:null})],modifiedData:n}}default:{const s=t;return{errors:[new E({id:`${s.id}--${y.UnknownEntityType}`,message:`Incorrect entity implementation for entity with id "${s.id}". Entity type "${s.type}" is not supported.`,severity:f.Error,code:y.UnknownEntityType,issue:null})],modifiedData:null}}}}function Zs(n){const e=co(n.type),t=e.MUTABLE_BASE_PROPERTIES,i=e.MUTABLE_UPSTREAM_PROPERTIES;let a=`Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated values.
164
+ If you are trying to create a new entity, please use a different id, for example: "${ad(t,e)}".`;return{errors:[new E({id:`duplicate--${t.id}--${y.EntityIdNotUnique}`,message:s,severity:f.Error,code:y.EntityIdNotUnique,issue:null})],modifiedData:n}}else if(i&&t.type!==r.GenericReference)return{errors:[new E({id:`${t.id}--${y.EntityIdNotUnique}`,message:`A built in entity with id "${t.id}" already exists. You cannot modify built in entities. If you are trying to create a new entity, please use a different id, for example: "${ad(t,e)}".`,severity:f.Error,code:y.EntityIdNotUnique,issue:null})],modifiedData:n};switch(t.type){case r.Project:return $.validateGenerationTarget(t,e);case r.CustomEntity:return Ir.validateGenerationTarget(t,e);case r.Property:return or.validateGenerationTarget(t,e);case r.FunctionDeclaration:return lr.validateGenerationTarget(t,e);case r.DataType:return ii.validateGenerationTarget(t,e);case r.Operation:return cr.validateGenerationTarget(t,e);case r.FunctionCall:return Rr.validateGenerationTarget(t,e);case r.VariableDeclaration:return pr.validateGenerationTarget(t,e);case r.VariableInstance:return yr.validateGenerationTarget(t,e);case r.GlobalEvent:return ai.validateGenerationTarget(t,e);case r.InputMap:return hn.validateGenerationTarget(t,e);case r.OutputMap:return fn.validateGenerationTarget(t,e);case r.ArgumentDeclaration:return mr.validateGenerationTarget(t,e);case r.ReturnDeclaration:return Ot.validateGenerationTarget(t,e);case r.Loop:return dr.validateGenerationTarget(t,e);case r.Condition:return ur.validateGenerationTarget(t,e);case r.Search:return hr.validateGenerationTarget(t,e);case r.InstalledProject:return fr.validateGenerationTarget(t,e);case r.InternalCall:return si.validateGenerationTarget(t,e);case r.PrimitiveValue:return oi.validateGenerationTarget(t,e);case r.ReturnStatement:return Tr.validateGenerationTarget(t,e);case r.BreakStatement:return li.validateGenerationTarget(t,e);case r.ContinueStatement:return yt.validateGenerationTarget(t,e);case r.ActionDescriptor:return _e.validateGenerationTarget(t,e);case r.ValueDescriptor:return Er.validateGenerationTarget(t,e);case r.BuiltInBaseEntity:case r.PrimitiveEntity:{const s="Did you mean to generate a",u={[r.BuiltInBaseEntity]:`${s} '${r.CustomEntity}' instead?`,[r.PrimitiveEntity]:`${s} '${r.CustomEntity}' instead?`}[t.type]||"";return{errors:[new E({id:`${t.id}--${y.BuiltInEntityGenerated}`,message:`Entity with id "${t.id} is of "${t.type}" type and should not be generated. Built in entities can only be referenced by user created entities.
165
+ ${u}`,severity:f.Error,code:y.BuiltInEntityGenerated,issue:null})],modifiedData:n}}default:{const s=t;return{errors:[new E({id:`${s.id}--${y.UnknownEntityType}`,message:`Incorrect entity implementation for entity with id "${s.id}". Entity type "${s.type}" is not supported.`,severity:f.Error,code:y.UnknownEntityType,issue:null})],modifiedData:null}}}}function Xs(n){const e=uo(n.type),t=e.MUTABLE_BASE_PROPERTIES,i=e.MUTABLE_UPSTREAM_PROPERTIES;let a=`Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated values.
160
166
  For entities of type "${n.type}", `;if(t.length>0?a+=`you can update the following metadata properties: '${N(t,"', '","' and '")}'. `:a+="there are no mutable metadata properties.",i.length>0){const s=t.length>0?`
161
167
  You can also update the following upstream references: `:`
162
168
  But can update the following upstream entity references: `;a+=`${s}'${N(i,"', '","' and '")}'.`}else a+=t.length>0?`
163
169
  And there are no upstream references that can be updated.`:`
164
- There are no upstream references that can be updated.`;return a}function y6(n,e){const t=[];let i=!1;if(Sr.includes(e.type)&&t.push(new E({id:`${e.id}--${y.BuiltInEntityGenerated}`,message:`Entity with id "${e.id} is of "${e.type}" type and should not be updated. Built in entities can only be referenced by user created entities.`,severity:f.Error,code:y.BuiltInEntityGenerated,issue:null})),n.id&&(t.push(new E({id:`last-action--${y.InvalidUpdateEntityOperation}`,code:y.InvalidUpdateEntityOperation,severity:f.Error,message:`The 'id' property cannot be updated in the 'update' action payload. The id of the entity is '${n.id}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'id'.`,issue:null})),i=!0),n.type&&(t.push(new E({id:`last-action--${y.InvalidUpdateEntityOperation}`,code:y.InvalidUpdateEntityOperation,severity:f.Error,message:`The 'type' property cannot be updated in the 'update' action payload. The type of the entity is '${e.type}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'type'.`,issue:null})),i=!0),t.length)return{errors:t,modifiedData:null,messageAddition:""};if($e.includes(e.type)?n.calls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calls" updated.
165
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})):Ne.includes(e.type)&&(n.successCalls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "successCalls" updated.
166
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.errorCalls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "errorCalls" updated.
167
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null}))),En.includes(e.type)&&(n.calledBy&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBy" updated.
168
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledByEntry&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByEntry" updated.
169
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledBySuccess&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBySuccess" updated.
170
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledByError&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByError" updated.
171
- ${$n}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null}))),t.length)return{errors:t,modifiedData:null,messageAddition:""};const a=co(e.type);if(a){(a.INMUTABLE_META_PROPERTIES||[]).forEach(J=>{["type","id"].includes(J)||n[J]&&!zi(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" updated. It is an inmutable property that is set only when the entity is created.
172
- If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),i=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach(J=>{n[J]&&!zi(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" set directly. It is a downstream property that points to a downstream nested entity.
170
+ There are no upstream references that can be updated.`;return a}function g6(n,e){const t=[];let i=!1;if(Dr.includes(e.type)&&t.push(new E({id:`${e.id}--${y.BuiltInEntityGenerated}`,message:`Entity with id "${e.id} is of "${e.type}" type and should not be updated. Built in entities can only be referenced by user created entities.`,severity:f.Error,code:y.BuiltInEntityGenerated,issue:null})),n.id&&(t.push(new E({id:`last-action--${y.InvalidUpdateEntityOperation}`,code:y.InvalidUpdateEntityOperation,severity:f.Error,message:`The 'id' property cannot be updated in the 'update' action payload. The id of the entity is '${n.id}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'id'.`,issue:null})),i=!0),n.type&&(t.push(new E({id:`last-action--${y.InvalidUpdateEntityOperation}`,code:y.InvalidUpdateEntityOperation,severity:f.Error,message:`The 'type' property cannot be updated in the 'update' action payload. The type of the entity is '${e.type}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'type'.`,issue:null})),i=!0),t.length)return{errors:t,modifiedData:null,messageAddition:""};if($e.includes(e.type)?n.calls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calls" updated.
171
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})):Ne.includes(e.type)&&(n.successCalls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "successCalls" updated.
172
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.errorCalls&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "errorCalls" updated.
173
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null}))),Tn.includes(e.type)&&(n.calledBy&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBy" updated.
174
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledByEntry&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByEntry" updated.
175
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledBySuccess&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBySuccess" updated.
176
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),n.calledByError&&t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledByError" updated.
177
+ ${Nn}`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null}))),t.length)return{errors:t,modifiedData:null,messageAddition:""};const a=uo(e.type);if(a){(a.INMUTABLE_META_PROPERTIES||[]).forEach(J=>{["type","id"].includes(J)||n[J]&&!ta(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" updated. It is an inmutable property that is set only when the entity is created.
178
+ If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),i=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach(J=>{n[J]&&!ta(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" set directly. It is a downstream property that points to a downstream nested entity.
173
179
  All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
174
- To modify '${J}', target the entity that it points to and its equivalent property.`,severity:f.Error,code:y.InvalidDownstreamPropertyOverride,issue:null})),i=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach(J=>{n[J]&&!zi(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" updated. It is an inmutable property that is set only when the entity is created.
175
- If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),i=!0)});const L=a.PROPERTIES||[];L.length>0&&Object.keys(n).forEach(J=>{L.includes(J)||t.push(new E({id:`${e.id}--${y.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${J}" that will be ignored.`,severity:f.Warning,code:y.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:i?Zs(e):""};const s=Hg(e),o=s==null?void 0:s.partial(),u=o==null?void 0:o.safeParse(n),p={...n,id:e.id,type:e.type},h=rd(p,u);if(t.push(...h),t.length)return{errors:t,modifiedData:null,messageAddition:i?Zs(e):""};const T=e.validateGeneratedUpdate(n);return{errors:[...t,...T.errors],modifiedData:T.modifiedData,messageAddition:i?Zs(e):""}}function Hg(n){switch(n.type){case r.PrimitiveValue:return $s();case r.CustomEntity:return _c();case r.PrimitiveEntity:return $s();case r.FunctionDeclaration:return wc();case r.GlobalEvent:return Bs();case r.DataType:return Qc();case r.Property:return Kc();case r.FunctionCall:return Lc();case r.Condition:return Vc();case r.Operation:return Ls();case r.VariableDeclaration:return Zc();case r.VariableInstance:return $c();case r.OutputMap:return Ic();case r.ReturnDeclaration:return Ac();case r.ArgumentDeclaration:return xc();case r.InputMap:return Yc();case r.Project:return Gc();case r.InstalledProject:return gU();case r.ActionDescriptor:return Gs();case r.ReturnStatement:return Sc();case r.Loop:return Gs();case r.Search:return Dc();case r.ValueDescriptor:return bc();case r.BuiltInBaseEntity:return Bc();case r.InternalCall:return Nc();case r.ContinueStatement:return gc();case r.BreakStatement:return Pc();default:return null}}function Yg(n){switch(n.type){case r.PrimitiveValue:return S8();case r.CustomEntity:return xU();case r.PrimitiveEntity:return _U();case r.FunctionDeclaration:return VU();case r.GlobalEvent:return EU();case r.DataType:return m9();case r.Property:return b9();case r.FunctionCall:return c8();case r.Condition:return t8();case r.Operation:return a8();case r.VariableDeclaration:return J8();case r.VariableInstance:return ZU();case r.OutputMap:return Hx();case r.ReturnDeclaration:return cU();case r.ArgumentDeclaration:return g8();case r.InputMap:return x8();case r.Project:return h8();case r.InstalledProject:return IU();case r.ActionDescriptor:return E8();case r.ReturnStatement:return yU();case r.Loop:return Xx();case r.Search:return aU();case r.ValueDescriptor:return Fx();case r.BuiltInBaseEntity:return OU();case r.InternalCall:return JU();case r.ContinueStatement:return kx();case r.BreakStatement:return tU();default:return null}}function Xs(n){const e=[];Bn(n)||e.push(new E({id:`${n}--${y.InvalidReferenceObjectStructure}`,message:`Reference object with id "${n}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));const t=n.id||"reference-to--"+(n.entityId||"unknown"),i=`Reference object ${n.id?`with id "${n.id}"`:`to entity with id "${n.entityId}" and type "${n.entityType}"`}`;return n.entityId||e.push(new E({id:`${t}--${y.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityId' property.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null})),n.entityType||e.push(new E({id:`${t}--${y.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityType' property.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null})),n.id||e.push(new E({id:`${t}--${y.MissingIdProperty}`,message:`${i} is missing an 'id' property.`,severity:f.Error,code:y.MissingIdProperty,issue:null})),n.type||e.push(new E({id:`${t}--${y.MissingTypeProperty}`,message:`${i} is missing a 'type' property.`,severity:f.Error,code:y.MissingTypeProperty,issue:null})),e}function rd(n,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${n.id}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" and with id "${n.id}", has an invalid structure: ${o4(t).toString().replace("Validation error: ","")}`,severity:f.Error,code:v.InvalidObjectStructure,issue:t}))}function Pe(n,e){const t=[],i=Yg(n);if(i){const s=i.safeParse(n);t.push(...rd(n,s))}const a=co(n.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(u=>{n[u]&&!zi(n[u])&&t.push(new E({id:`${n.id}--${y.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the property "${u}" set directly. It is a downstream property that points to a downstream nested entity.
180
+ To modify '${J}', target the entity that it points to and its equivalent property.`,severity:f.Error,code:y.InvalidDownstreamPropertyOverride,issue:null})),i=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach(J=>{n[J]&&!ta(n[J])&&(t.push(new E({id:`${e.id}--${y.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${J}" updated. It is an inmutable property that is set only when the entity is created.
181
+ If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:f.Error,code:y.InvalidInmutablePropertyOverride,issue:null})),i=!0)});const G=a.PROPERTIES||[];G.length>0&&Object.keys(n).forEach(J=>{G.includes(J)||t.push(new E({id:`${e.id}--${y.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${J}" that will be ignored.`,severity:f.Warning,code:y.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:i?Xs(e):""};const s=Kg(e),o=s==null?void 0:s.partial(),u=o==null?void 0:o.safeParse(n),p={...n,id:e.id,type:e.type},h=od(p,u);if(t.push(...h),t.length)return{errors:t,modifiedData:null,messageAddition:i?Xs(e):""};const T=e.validateGeneratedUpdate(n);return{errors:[...t,...T.errors],modifiedData:T.modifiedData,messageAddition:i?Xs(e):""}}function Kg(n){switch(n.type){case r.PrimitiveValue:return Ps();case r.CustomEntity:return vc();case r.PrimitiveEntity:return Ps();case r.FunctionDeclaration:return bc();case r.GlobalEvent:return _s();case r.DataType:return pc();case r.Property:return Zl();case r.FunctionCall:return ac();case r.Condition:return sc();case r.Operation:return Cs();case r.VariableDeclaration:return hc();case r.VariableInstance:return fc();case r.OutputMap:return ic();case r.ReturnDeclaration:return tc();case r.ArgumentDeclaration:return Rc();case r.InputMap:return cc();case r.Project:return gc();case r.InstalledProject:return LU();case r.ActionDescriptor:return As();case r.ReturnStatement:return Kl();case r.Loop:return As();case r.Search:return ec();case r.ValueDescriptor:return zl();case r.BuiltInBaseEntity:return Xl();case r.InternalCall:return lc();case r.ContinueStatement:return Ql();case r.BreakStatement:return nc();default:return null}}function ev(n){switch(n.type){case r.PrimitiveValue:return uU();case r.CustomEntity:return Ox();case r.PrimitiveEntity:return QF();case r.FunctionDeclaration:return Rx();case r.GlobalEvent:return qU();case r.DataType:return PU();case r.Property:return n4();case r.FunctionCall:return j4();case r.Condition:return H4();case r.Operation:return aU();case r.VariableDeclaration:return CU();case r.VariableInstance:return NU();case r.OutputMap:return G4();case r.ReturnDeclaration:return B4();case r.ArgumentDeclaration:return fx();case r.InputMap:return tU();case r.Project:return Px();case r.InstalledProject:return FU();case r.ActionDescriptor:return u4();case r.ReturnStatement:return v4();case r.Loop:return h4();case r.Search:return A4();case r.ValueDescriptor:return YF();case r.BuiltInBaseEntity:return o4();case r.InternalCall:return X4();case r.ContinueStatement:return E4();case r.BreakStatement:return N4();default:return null}}function Qs(n){const e=[];wn(n)||e.push(new E({id:`${n}--${y.InvalidReferenceObjectStructure}`,message:`Reference object with id "${n}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));const t=n.id||"reference-to--"+(n.entityId||"unknown"),i=`Reference object ${n.id?`with id "${n.id}"`:`to entity with id "${n.entityId}" and type "${n.entityType}"`}`;return n.entityId||e.push(new E({id:`${t}--${y.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityId' property.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null})),n.entityType||e.push(new E({id:`${t}--${y.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityType' property.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null})),n.id||e.push(new E({id:`${t}--${y.MissingIdProperty}`,message:`${i} is missing an 'id' property.`,severity:f.Error,code:y.MissingIdProperty,issue:null})),n.type||e.push(new E({id:`${t}--${y.MissingTypeProperty}`,message:`${i} is missing a 'type' property.`,severity:f.Error,code:y.MissingTypeProperty,issue:null})),e}function od(n,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${n.id}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" and with id "${n.id}", has an invalid structure: ${Zx(t).toString().replace("Validation error: ","")}`,severity:f.Error,code:v.InvalidObjectStructure,issue:t}))}function Pe(n,e){const t=[],i=ev(n);if(i){const s=i.safeParse(n);t.push(...od(n,s))}const a=uo(n.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(u=>{n[u]&&!ta(n[u])&&t.push(new E({id:`${n.id}--${y.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the property "${u}" set directly. It is a downstream property that points to a downstream nested entity.
176
182
  All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
177
- To modify '${u}', target the entity that it points to and its equivalent property.`,severity:f.Error,code:y.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(n).forEach(u=>{o.includes(u)||t.push(new E({id:`${n.id}--${y.UnrecognizedProperty}`,message:`Entity of type "${n.type}" with id "${n.id}" has an unrecognized property "${u}" that will be ignored.`,severity:f.Warning,code:y.UnrecognizedProperty,issue:null}))})}return t}function h6(n,e){const t=[];if(!n.parent)return t;const i=e.get(n.parent);return i?(Sr.includes(i==null?void 0:i.type)?t.push(new E({id:`${n.id}--${y.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:f.Error,code:y.BuiltInEntityParent,issue:null})):i.type===r.ActionDescriptor&&e.get(n.parent)&&t.push(new E({id:`${n.id}--${y.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified. Action descriptors are only sometimes built in, other times they are managed by the user.`,severity:f.Error,code:y.BuiltInEntityParent,issue:null})),t):[]}function id(n,e,t){const i=[],a=n[e.key];if(!a)return i.push(new E({id:`${n.id}--${e.key}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${n.type}" entity can be ${N(e.types,", "," or ")}.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entityState:null,errors:i};let s=null;if(typeof a=="string")s=a;else{const u=Xs(a);i.push(...u),u.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:i};if(n.id===s)return i.push(new E({id:`${n.id}--${s}--${y.SelfReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,severity:f.Error,code:y.SelfReference,issue:null})),{entityState:null,errors:i};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||i.push(new E({id:`${n.id}--${s}--${y.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${N(e.types,"', '","' or '")}'.`,severity:f.Error,code:y.InvalidReference,issue:null})):i.push(new E({id:`${n.id}--${s}--${y.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${s}" at '${e.key}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:i}}function Qs(n,e,t){const i=[],a=n[e];return a?Array.isArray(a)?{entities:a.map(o=>{let u=null;if(typeof o=="string")u=o;else{const h=Xs(o);i.push(...h),h.length===0&&(u=o.entityId)}if(!u)return{entityState:null,errors:[new E({id:`${n.id}--${e}--${y.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReference,issue:null})]};const p=t.get(u)||t.getBuiltIn(u);return p?{entityState:p,errors:[]}:(i.push(new E({id:`${n.id}--${u}--${y.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${u}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:i})}),errors:[]}:(i.push(new E({id:`${n.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:i}):(i.push(new E({id:`${n.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a list of references to "${e}" entities.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:i})}function ad(n,e,t){const i=[],a=id(n,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||i.push(new E({id:`${n.id}--${s.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${N(e.types,"', '","' or '")}'.`,issue:null})),n.id===s.id&&i.push(new E({id:`${n.id}--${s.id}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}))}return i}function N(n,e,t){if(n.length===1)return n[0];if(n.length===2)return n.join(t);{const i=n.pop();return`${n.join(e)}${t}${i}`}}const Nn=`Pass-through callable entities are entities that need to be called by another caller, then they execute some internal logic and when finished, it can call other callable entities with the "calledBySuccess" property or "calledByError" property based on whether their internal execution was successful or an error ocurred respectively.
178
- All pass-through callable entities are: ${N(Ne,", "," and ")}.`,ua=`Entry point entities are the entities which start the execution of a logic chain. They are ${N($e,", "," and ")}.They aren't explicitly called by any entities. Rather, they can be called implicitly by the system, or as a function-call somewhere else in the case of a function-declaration. `,zg=`Caller entities are entities that can call other entities. Regarless of whether they are entry-point entities or pass-through callable entities. All caller entity types are: ${N(en,", "," and ")}.`,f6=`Callable entities are entities that can be called by other entities. They can be called by an entry-point, a success caller, or an error caller.
179
- All callable entity types are: ${N(En,", "," and ")}.`,$n=`Caller to callee relationships can be updated with the 'add_caller' and 'remove_caller' generation action with the properties: 'callerEntityId', a 'calleeEntityId'. For adding a caller, you can optionally add a boolean property 'fromError' (if the caller calls when an error occured in its execution).
180
- Either of these two actions will only affect the one relationship between the given caller and callee and ignore any others present in either entity.`,sd=`Break and continue statements need to have exactly one 'return-declaration' entity each. It represents the result of the current iteration of the loop. It can have any name and have any 'data-type' but it needs to be identical among all statements in the same loop.
181
- Meaning, if the return declaration in one 'break-statement' is named 'result' and has a 'data-type' of 'number', all other 'break-statements' and 'continue-statements' in the same loop need to have a 'return-declaration' with the same name and 'data-type'.`,m6=`Return statements need to be identical inside the same scope. For example if a 'return-statement' belongs to a function, with multiple branches of logic, leading to multiple 'return-statement' entities, all of them need to have the exact same amount of 'return-declaration' entities, sharing the same name and an equivalent 'data-type' entity.
182
- Furthermore, some 'function-declarations' and all 'global-events' might be implementing a base 'action-descriptor' entity, which defines exactly the shape and number of the return declarations.`,od=`A variable without a data type which reads an-untyped object value, or has object properties written into it as input-map writes, will infere its data-type. This means that a 'data-type' will be created, with an implicitly declared 'custom-entity' as its 'entity' property, defining the structure of the object.
183
- This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,Vn=`Entities of type '${r.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,ld=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${N(Fn,"', '","' and '")}'.`,Zg=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${N(Se,"', '","' and '")}'.`,cd=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
183
+ To modify '${u}', target the entity that it points to and its equivalent property.`,severity:f.Error,code:y.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(n).forEach(u=>{o.includes(u)||t.push(new E({id:`${n.id}--${y.UnrecognizedProperty}`,message:`Entity of type "${n.type}" with id "${n.id}" has an unrecognized property "${u}" that will be ignored.`,severity:f.Warning,code:y.UnrecognizedProperty,issue:null}))})}return t}function v6(n,e){const t=[];if(!n.parent)return t;const i=e.get(n.parent);return i?(Dr.includes(i==null?void 0:i.type)?t.push(new E({id:`${n.id}--${y.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:f.Error,code:y.BuiltInEntityParent,issue:null})):i.type===r.ActionDescriptor&&e.get(n.parent)&&t.push(new E({id:`${n.id}--${y.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified. Action descriptors are only sometimes built in, other times they are managed by the user.`,severity:f.Error,code:y.BuiltInEntityParent,issue:null})),t):[]}function ld(n,e,t){const i=[],a=n[e.key];if(!a)return i.push(new E({id:`${n.id}--${e.key}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${n.type}" entity can be ${N(e.types,", "," or ")}.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entityState:null,errors:i};let s=null;if(typeof a=="string")s=a;else{const u=Qs(a);i.push(...u),u.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:i};if(n.id===s)return i.push(new E({id:`${n.id}--${s}--${y.SelfReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,severity:f.Error,code:y.SelfReference,issue:null})),{entityState:null,errors:i};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||i.push(new E({id:`${n.id}--${s}--${y.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${N(e.types,"', '","' or '")}'.`,severity:f.Error,code:y.InvalidReference,issue:null})):i.push(new E({id:`${n.id}--${s}--${y.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${s}" at '${e.key}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:i}}function Ks(n,e,t){const i=[],a=n[e];return a?Array.isArray(a)?{entities:a.map(o=>{let u=null;if(typeof o=="string")u=o;else{const h=Qs(o);i.push(...h),h.length===0&&(u=o.entityId)}if(!u)return{entityState:null,errors:[new E({id:`${n.id}--${e}--${y.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReference,issue:null})]};const p=t.get(u)||t.getBuiltIn(u);return p?{entityState:p,errors:[]}:(i.push(new E({id:`${n.id}--${u}--${y.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${u}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:i})}),errors:[]}:(i.push(new E({id:`${n.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:i}):(i.push(new E({id:`${n.id}--${e}--${v.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a list of references to "${e}" entities.`,severity:f.Error,code:v.InvalidObjectStructure,issue:null})),{entities:[],errors:i})}function cd(n,e,t){const i=[],a=ld(n,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||i.push(new E({id:`${n.id}--${s.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${N(e.types,"', '","' or '")}'.`,issue:null})),n.id===s.id&&i.push(new E({id:`${n.id}--${s.id}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}))}return i}function N(n,e,t){if(n.length===1)return n[0];if(n.length===2)return n.join(t);{const i=n.pop();return`${n.join(e)}${t}${i}`}}const Mn=`Pass-through callable entities are entities that need to be called by another caller, then they execute some internal logic and when finished, it can call other callable entities with the "calledBySuccess" property or "calledByError" property based on whether their internal execution was successful or an error ocurred respectively.
184
+ All pass-through callable entities are: ${N(Ne,", "," and ")}.`,ca=`Entry point entities are the entities which start the execution of a logic chain. They are ${N($e,", "," and ")}.They aren't explicitly called by any entities. Rather, they can be called implicitly by the system, or as a function-call somewhere else in the case of a function-declaration. `,tv=`Caller entities are entities that can call other entities. Regarless of whether they are entry-point entities or pass-through callable entities. All caller entity types are: ${N(en,", "," and ")}.`,I6=`Callable entities are entities that can be called by other entities. They can be called by an entry-point, a success caller, or an error caller.
185
+ All callable entity types are: ${N(Tn,", "," and ")}.`,Nn=`Caller to callee relationships can be updated with the 'add_caller' and 'remove_caller' generation action with the properties: 'callerEntityId', a 'calleeEntityId'. For adding a caller, you can optionally add a boolean property 'fromError' (if the caller calls when an error occured in its execution).
186
+ Either of these two actions will only affect the one relationship between the given caller and callee and ignore any others present in either entity.`,dd=`Break and continue statements need to have exactly one 'return-declaration' entity each. It represents the result of the current iteration of the loop. It can have any name and have any 'data-type' but it needs to be identical among all statements in the same loop.
187
+ Meaning, if the return declaration in one 'break-statement' is named 'result' and has a 'data-type' of 'number', all other 'break-statements' and 'continue-statements' in the same loop need to have a 'return-declaration' with the same name and 'data-type'.`,P6=`Return statements need to be identical inside the same scope. For example if a 'return-statement' belongs to a function, with multiple branches of logic, leading to multiple 'return-statement' entities, all of them need to have the exact same amount of 'return-declaration' entities, sharing the same name and an equivalent 'data-type' entity.
188
+ Furthermore, some 'function-declarations' and all 'global-events' might be implementing a base 'action-descriptor' entity, which defines exactly the shape and number of the return declarations.`,ud=`A variable without a data type which reads an-untyped object value, or has object properties written into it as input-map writes, will infere its data-type. This means that a 'data-type' will be created, with an implicitly declared 'custom-entity' as its 'entity' property, defining the structure of the object.
189
+ This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,$n=`Entities of type '${r.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,pd=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${N(Gn,"', '","' and '")}'.`,nv=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${N(Se,"', '","' and '")}'.`,yd=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
184
190
  A 'property' can have a default value through its nested 'data-type' entity.
185
191
  The 'property' entity only represents the data field in the declaration, and it can't write or read values.
186
- When a 'custom-entity' is instantiated as a variable, any writes or reads to its properties are done through 'input-map's and 'output-map's.`,Ks=`Some entities can hold values during runtime, they often can be given a hardcoded "default value" either directly or on their declarations, and can be connected to other entities that write or read values to and from them. Entities that can hold values are: '${N(Md,"', '","' and '")}'.
192
+ When a 'custom-entity' is instantiated as a variable, any writes or reads to its properties are done through 'input-map's and 'output-map's.`,eo=`Some entities can hold values during runtime, they often can be given a hardcoded "default value" either directly or on their declarations, and can be connected to other entities that write or read values to and from them. Entities that can hold values are: '${N(Cd,"', '","' and '")}'.
187
193
  Some entities with values can both write and read values, while others can only do one of the two.
188
- ${ld}
189
- ${Zg}.
190
- ${cd}`,dd=`To establish a connection of a reader and writter value during the generation process you can use the 'connect_values' generation action, like so:
194
+ ${pd}
195
+ ${nv}.
196
+ ${yd}`,hd=`To establish a connection of a reader and writter value during the generation process you can use the 'connect_values' generation action, like so:
191
197
  \`\`\`json
192
198
  {
193
199
  "connect_values": {
@@ -196,61 +202,61 @@ ${cd}`,dd=`To establish a connection of a reader and writter value during the ge
196
202
  }
197
203
  }
198
204
  \`\`\`
199
- You can use the 'disconnect_values' generation action to remove the connection between two value holding entities in the same way.`,eo=`If an explicit 'parent' isn't given for a callable entity, the scope will be auto-calculated to match the parent scope of the caller entity.
200
- If the entity that should be the parent of a callable entity is unclear, you can always skip the 'parent' property and the system will automatically calculate the parent based on the caller entity.`;function Xt(n){return`\`\`\`json
205
+ You can use the 'disconnect_values' generation action to remove the connection between two value holding entities in the same way.`,to=`If an explicit 'parent' isn't given for a callable entity, the scope will be auto-calculated to match the parent scope of the caller entity.
206
+ If the entity that should be the parent of a callable entity is unclear, you can always skip the 'parent' property and the system will automatically calculate the parent based on the caller entity.`;function Qt(n){return`\`\`\`json
201
207
  ${typeof n=="string"?n:JSON.stringify(n,null,2)}
202
- \`\`\``}function T6(n,e){let t={};switch(n){case"add_caller":return t.add_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},e.fromError&&(t.add_caller.fromError=e.fromError),Xt(t);case"remove_caller":return t.remove_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},Xt(t);case"connect_values":return t.connect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},Xt(t);case"disconnect_values":return t.disconnect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},Xt(t);case"update":{const i=`{
208
+ \`\`\``}function D6(n,e){let t={};switch(n){case"add_caller":return t.add_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},e.fromError&&(t.add_caller.fromError=e.fromError),Qt(t);case"remove_caller":return t.remove_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},Qt(t);case"connect_values":return t.connect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},Qt(t);case"disconnect_values":return t.disconnect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},Qt(t);case"update":{const i=`{
203
209
  "update": {
204
210
  "entityId": "${e.entityId}",
205
211
  "data": {
206
212
  ...All the properties you want to update
207
213
  }
208
214
  }
209
- }`;return Xt(i)}default:return""}}function Xg(n,e){const t=JSON.parse(JSON.stringify(n)),i=[];if($e.includes(e.type))i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
215
+ }`;return Qt(i)}default:return""}}function rv(n,e){const t=JSON.parse(JSON.stringify(n)),i=[];if($e.includes(e.type))i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
210
216
  Entry-point entities can only be referenced as 'calledByEntry'.
211
- ${ua}
217
+ ${ca}
212
218
  We have moved the reference to 'calledByEntry' for you.`,issue:null})),t.calledByEntry.push(e.id),t.calledBySuccess=t.calledBySuccess.filter(a=>a!==e.id);else if(Oe.includes(e.type)){const a=e.calledBy||[],s=a.length?`
213
219
 
214
220
  This ${e.type} is called by ${N(a.map(o=>`${o.type} with id "${o.id}"`),", "," and ")} entities. You can reference ${a.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledBySuccess' with id "${e.id}".
215
221
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
216
222
  Termination entities are ${N(Oe,", "," and ")}.${s}`,issue:null}))}else if(!Ne.includes(e.type))i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a pass-through callable entity.
217
- ${Nn}`,issue:null}));else if(!en.includes(e.type))return i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a caller entity.
223
+ ${Mn}`,issue:null}));else if(!en.includes(e.type))return i.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a caller entity.
218
224
  All caller entity types are: ${N(en,", "," and ")}.
219
225
  For the 'calledBySuccess' property, you specifically need to reference a pass-through callable entity.
220
- ${Nn}`,issue:null})),{errors:i,modifiedData:t};return{errors:i,modifiedData:t}}function Qg(n,e){const t=[];if($e.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
226
+ ${Mn}`,issue:null})),{errors:i,modifiedData:t};return{errors:i,modifiedData:t}}function iv(n,e){const t=[];if($e.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
221
227
  Entry-point entities can only be referenced as 'calledByEntry'.
222
- ${ua}`,issue:null}));else if(Oe.includes(e.type)){const i=e.calledBy||[],a=i.length?`
228
+ ${ca}`,issue:null}));else if(Oe.includes(e.type)){const i=e.calledBy||[],a=i.length?`
223
229
 
224
230
  This ${e.type} is called by ${N(i.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${i.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByError' with id "${e.id}".
225
231
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
226
232
  Termination entities are ${N(Oe,", "," and ")}.${a}`,issue:null}))}else if(!Ne.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a pass-through callable entity.
227
- ${Nn}`,issue:null}));else if(!en.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a caller entity.
233
+ ${Mn}`,issue:null}));else if(!en.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a caller entity.
228
234
  All caller entity types are: ${N(en,", "," and ")}.
229
235
  For the 'calledByError' property, you specifically need to reference a pass-through callable entity.
230
- ${Nn}`,issue:null})),t;return t}function Kg(n,e){const t=[];if(Oe.includes(e.type)){const i=e.calledBy||[],a=i.length?`
236
+ ${Mn}`,issue:null})),t;return t}function av(n,e){const t=[];if(Oe.includes(e.type)){const i=e.calledBy||[],a=i.length?`
231
237
 
232
238
  This ${e.type} is called by ${N(i.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${i.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByEntry' with id "${e.id}".
233
239
  ${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
234
240
  Termination entities are ${N(Oe,", "," and ")}.${a}`,issue:null}))}else if(Ne.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that is a pass-through callable entity, not an entry-point entity.
235
- ${Nn}.
236
- ${ua}.
241
+ ${Mn}.
242
+ ${ca}.
237
243
 
238
244
  We have moved the reference to 'calledBySuccess' for you.`,issue:null}));else if(!en.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that isn't a caller entity.
239
245
  All caller entity types are: ${N(en,", "," and ")}.
240
246
  For the 'calledByEntry' property, you specifically need to reference a pass-through callable entity.
241
- ${Nn}`,issue:null})),t;return t}function ev(n,e){const t=[];let i=JSON.parse(JSON.stringify(n));if(En.includes(i.type)){if(i.calledBySuccess){const s=Qs(i,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=Xg(i,o.entityState);i=u.modifiedData,t.push(...u.errors)}):t.push(...s.errors)}if(i.calledByError){const s=Qs(i,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=Qg(i,o.entityState);t.push(...u)}):t.push(...s.errors)}if(i.calledByEntry){const s=Qs(i,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=Kg(i,o.entityState);t.push(...u)}),t.push(...t)):t.push(...s.errors)}const a=[...i.calledBySuccess||[],...i.calledByError||[],...i.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${i.id}--${y.DuplicateReference}`,code:y.DuplicateReference,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=ht(i,e);i.type===r.ReturnStatement&&o&&!$e.includes(o.type)?t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${N($e,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${eo}`,issue:null})):i.type===r.ContinueStatement&&o&&o.type!==r.Loop?t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${eo}`,issue:null})):i.type===r.BreakStatement&&o&&o.type!==r.Loop&&t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${eo}`,issue:null}));const u=[],p=[];let h=null;if(s.forEach(m=>{const T=e.get(m);if(!T){t.push(new E({id:`${i.id}--${m}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity with id "${m}" that doesn't exist in the project.`,issue:null}));return}const b=ht(T,e);if(o)ha(o,b,e)?(Oe.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===T.id)?(T.successCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
247
+ ${Mn}`,issue:null})),t;return t}function sv(n,e){const t=[];let i=JSON.parse(JSON.stringify(n));if(Tn.includes(i.type)){if(i.calledBySuccess){const s=Ks(i,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=rv(i,o.entityState);i=u.modifiedData,t.push(...u.errors)}):t.push(...s.errors)}if(i.calledByError){const s=Ks(i,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=iv(i,o.entityState);t.push(...u)}):t.push(...s.errors)}if(i.calledByEntry){const s=Ks(i,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const u=av(i,o.entityState);t.push(...u)}),t.push(...t)):t.push(...s.errors)}const a=[...i.calledBySuccess||[],...i.calledByError||[],...i.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${i.id}--${y.DuplicateReference}`,code:y.DuplicateReference,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=ht(i,e);i.type===r.ReturnStatement&&o&&!$e.includes(o.type)?t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${N($e,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${to}`,issue:null})):i.type===r.ContinueStatement&&o&&o.type!==r.Loop?t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${to}`,issue:null})):i.type===r.BreakStatement&&o&&o.type!==r.Loop&&t.push(new E({id:`${i.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" has an explicitly set parent, but it isn't a '${r.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${to}`,issue:null}));const u=[],p=[];let h=null;if(s.forEach(m=>{const T=e.get(m);if(!T){t.push(new E({id:`${i.id}--${m}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity with id "${m}" that doesn't exist in the project.`,issue:null}));return}const b=ht(T,e);if(o)pa(o,b,e)?(Oe.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===T.id)?(T.successCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
242
248
  The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(i.calledByError||[]).find(C=>C===T.id)?(T.errorCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
243
249
  The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(i.calledByEntry||[]).find(C=>C===T.id)&&(T.calls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
244
- The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),u.push({caller:T,scope:b})):p.push({caller:T,scope:b,errors:[new E({id:`${i.id}--${T.id}--${y.CallerWithIncompatibleScope}`,code:y.CallerWithIncompatibleScope,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!h)h=b;else{const{compatible:I}=ha(h,b,e);I?(Oe.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===T.id)?(T.successCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
250
+ The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),u.push({caller:T,scope:b})):p.push({caller:T,scope:b,errors:[new E({id:`${i.id}--${T.id}--${y.CallerWithIncompatibleScope}`,code:y.CallerWithIncompatibleScope,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!h)h=b;else{const{compatible:I}=pa(h,b,e);I?(Oe.includes(i.type)&&((i.calledBySuccess||[]).find(C=>C===T.id)?(T.successCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
245
251
  The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(i.calledByError||[]).find(C=>C===T.id)?(T.errorCalls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
246
252
  The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(i.calledByEntry||[]).find(C=>C===T.id)&&(T.calls||[]).find(J=>Oe.includes(J.type))&&t.push(new E({id:`${i.id}--${T.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Error,message:`Entity of type "${i.type}" with id "${i.id}" is being called by an entity of type "${T.type}" with id "${T.id}" that already calls a termination statement.
247
- The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),u.push({caller:T,scope:b})):p.push({caller:T,scope:b,errors:[new E({id:`${i.id}--${T.id}--${y.CallerWithIncompatibleScope}`,code:y.CallerWithIncompatibleScope,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${T.type}" with id "${T.id}" is in a different scope than caller of type "${h.type}" with id "${h.id}". All callers should be in the same scope or a higher valid scope. Or all callers should share the global project scope.`,issue:null})]})}}),p.length)p.forEach(m=>{t.push(...m.errors)});else if(u.length&&!o&&Ro.includes(i.type)){const m=u.filter(T=>T.scope!==e);if(m.length){const T=Mv(m.map(b=>b.scope));i.parent=T.id}else i.parent=e.id}}else{let s=`Entity of type "${i.type}" with id "${i.id}" isn't called by any other entity. Callable entities only get executed if they have a list of references from either 'calledByEntry', 'calledBySuccess' or 'calledByError'.
253
+ The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),u.push({caller:T,scope:b})):p.push({caller:T,scope:b,errors:[new E({id:`${i.id}--${T.id}--${y.CallerWithIncompatibleScope}`,code:y.CallerWithIncompatibleScope,severity:f.Warning,message:`Entity of type "${i.type}" with id "${i.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${T.type}" with id "${T.id}" is in a different scope than caller of type "${h.type}" with id "${h.id}". All callers should be in the same scope or a higher valid scope. Or all callers should share the global project scope.`,issue:null})]})}}),p.length)p.forEach(m=>{t.push(...m.errors)});else if(u.length&&!o&&mo.includes(i.type)){const m=u.filter(T=>T.scope!==e);if(m.length){const T=Fv(m.map(b=>b.scope));i.parent=T.id}else i.parent=e.id}}else{let s=`Entity of type "${i.type}" with id "${i.id}" isn't called by any other entity. Callable entities only get executed if they have a list of references from either 'calledByEntry', 'calledBySuccess' or 'calledByError'.
248
254
  To add a caller, use the 'add_caller' action with the properties: 'callerEntityId', a 'calleeEntityId', and optionally a boolean 'fromError' (if the caller calls when an error occured in its execution).`;i.type===r.ReturnStatement?s+=`
249
255
  Return statements need to have a caller when created, since their purpose is to terminate a call chain.`:i.type===r.ContinueStatement?s+=`
250
256
  Continue statements need to have a caller when created, since they are used to skip the rest of the current iteration of a loop and can't be detached from a call chain.`:i.type===r.BreakStatement&&(s+=`
251
257
  Break statements need to have a caller when created, since they are used to exit a loop and can't be detached from a call chain.`),s+=`
252
- ${zg}`,Oe.includes(i.type)||(s+=`
253
- It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${i.id}--${v.MissingCaller}`,code:v.MissingCaller,severity:Oe.includes(i.type)?f.Error:f.Warning,message:s,issue:null}))}}return{errors:t,modifiedData:i}}function ud(n,e){const t=[];if(e.type===r.PrimitiveValue){const o=e.parent;let u=!1;if(o.type===r.InputMap)t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
258
+ ${tv}`,Oe.includes(i.type)||(s+=`
259
+ It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${i.id}--${v.MissingCaller}`,code:v.MissingCaller,severity:Oe.includes(i.type)?f.Error:f.Warning,message:s,issue:null}))}}return{errors:t,modifiedData:i}}function fd(n,e){const t=[];if(e.type===r.PrimitiveValue){const o=e.parent;let u=!1;if(o.type===r.InputMap)t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
254
260
  All value writting entity types are: ${N(Se,", "," and ")}.
255
261
 
256
262
  This primitive-value entity belongs to an input map entity with id "${o.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(o.type===r.DataType){const p=o,h=p.parent;Se.includes(h.type)?t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
@@ -262,29 +268,29 @@ All value writting entity types are: ${N(Se,", "," and ")}.
262
268
 
263
269
  This data type entity belongs to a ${o.type} entity with id "${o.id}". ${o.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
264
270
  All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}))}else Se.includes(e.type)||t.push(new E({id:`${n.id}--${e.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that isn't a value writting entity.
265
- All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}));const i=ht(n,e.project),a=ht(e,e.project);if(i){const s=ha(i,e,e.project);if(!s.compatible){const{type:o}=s;let u="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${i.type}' (${A(i,e.project)}) with id '${i.id}', and the writter is in the scope of the '${a.type}' (${A(a,e.project)}) with id '${a.id}'.`;o===po.ParallelInCommonParent?(u=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${A(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,u+=`
266
- ${p}`):o===po.ParallelInProject&&(u="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",u+=`
271
+ All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}));const i=ht(n,e.project),a=ht(e,e.project);if(i){const s=pa(i,e,e.project);if(!s.compatible){const{type:o}=s;let u="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${i.type}' (${A(i,e.project)}) with id '${i.id}', and the writter is in the scope of the '${a.type}' (${A(a,e.project)}) with id '${a.id}'.`;o===yo.ParallelInCommonParent?(u=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${A(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,u+=`
272
+ ${p}`):o===yo.ParallelInProject&&(u="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",u+=`
267
273
  ${p}`),u+=`
268
274
  Two value holding entities need to be in the same scope or in scopes nested inside of eachother to be able to read and write to each other.`,t.push(new E({id:`${n.id}--${e.id}--${y.IncompatibleScope}`,code:y.IncompatibleScope,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" with an incompatible scope.
269
- ${u}`,issue:null}))}}return t}function Ge(n,e,t,i=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(n));if(!i){if(Fn.includes(o.type)){if(o.readsValue){const h=id(o,{key:"readsValue",types:Se},t);if(h.errors.length===0){const m=ud(o,h.entityState);a.push(...m)}else a.push(...h.errors);delete s.readsValue}}else o.readsValue&&(Se.includes(o.type)?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Fn,", "," and ")}.
270
- ${Ks}`,issue:null})):r.Property===o.type?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Fn,", "," and ")}.
271
- ${cd}`,issue:null})):a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Fn,", "," and ")}.
272
- ${ld}`,issue:null})),delete s.readsValue);o.writesValues&&(Se.includes(o.type)?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
273
- ${dd}`,issue:null})):a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
274
- ${Ks}
275
- ${dd}`,issue:null})),delete s.writesValues);const p=ev(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const u=Object.entries(s);for(const[p,h]of u){const m=h.types,T=h.optional,b=o[p];if(!b){T||a.push(new E({id:`${o.id}--${p}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${N(m,", "," or ")}`,issue:null}));continue}if(h.list)if(Array.isArray(b))for(const I of b){const C=ad(o,{key:p,types:m,optional:T},t);a.push(...C)}else{a.push(new E({id:`${o.id}--${p}--${y.ContainsSingleButShouldBeReferenceList}`,code:y.ContainsSingleButShouldBeReferenceList,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${y.ContainsListButShouldReferenceSingle}`,code:y.ContainsListButShouldReferenceSingle,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const I=ad(o,{key:p,types:m,optional:T},t);a.push(...I)}}return{errors:a,modifiedData:o}}function E6(n,e,t="calledBy"){const i=[];if(!n)return[];const a=e.get(n);if(!a)return i.push(new E({id:`${n}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),i;if([...Ne,...$e].includes(a.type))return[];if(Oe.includes(a.type)){const s=a.calledBy||[],o=s.length?`
275
+ ${u}`,issue:null}))}}return t}function Ge(n,e,t,i=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(n));if(!i){if(Gn.includes(o.type)){if(o.readsValue){const h=ld(o,{key:"readsValue",types:Se},t);if(h.errors.length===0){const m=fd(o,h.entityState);a.push(...m)}else a.push(...h.errors);delete s.readsValue}}else o.readsValue&&(Se.includes(o.type)?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Gn,", "," and ")}.
276
+ ${eo}`,issue:null})):r.Property===o.type?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Gn,", "," and ")}.
277
+ ${yd}`,issue:null})):a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${N(Gn,", "," and ")}.
278
+ ${pd}`,issue:null})),delete s.readsValue);o.writesValues&&(Se.includes(o.type)?a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
279
+ ${hd}`,issue:null})):a.push(new E({id:`${o.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
280
+ ${eo}
281
+ ${hd}`,issue:null})),delete s.writesValues);const p=sv(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const u=Object.entries(s);for(const[p,h]of u){const m=h.types,T=h.optional,b=o[p];if(!b){T||a.push(new E({id:`${o.id}--${p}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${N(m,", "," or ")}`,issue:null}));continue}if(h.list)if(Array.isArray(b))for(const I of b){const C=cd(o,{key:p,types:m,optional:T},t);a.push(...C)}else{a.push(new E({id:`${o.id}--${p}--${y.ContainsSingleButShouldBeReferenceList}`,code:y.ContainsSingleButShouldBeReferenceList,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${y.ContainsListButShouldReferenceSingle}`,code:y.ContainsListButShouldReferenceSingle,severity:f.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const I=cd(o,{key:p,types:m,optional:T},t);a.push(...I)}}return{errors:a,modifiedData:o}}function A6(n,e,t="calledBy"){const i=[];if(!n)return[];const a=e.get(n);if(!a)return i.push(new E({id:`${n}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),i;if([...Ne,...$e].includes(a.type))return[];if(Oe.includes(a.type)){const s=a.calledBy||[],o=s.length?`
276
282
 
277
283
  This ${a.type} is called by ${N(s.map(u=>`${u.type} with id "${u.id}"`),", "," and ")} entities. You can reference ${s.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
278
284
  ${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
279
285
  Termination entities are ${N(Oe,", "," and ")}.${o}`,issue:null}))}else i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
280
- All caller entity types are: ${N(en,", "," and ")}.`,issue:null}));return i}function R6(n,e,t="calledByError"){const i=[];if(!n)return[];const a=e.get(n);if(!a)return i.push(new E({id:`${n}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),i;if(Ne.includes(a.type))return[];if(Oe.includes(a.type)){const s=a.calledBy||[],o=s.length?`
286
+ All caller entity types are: ${N(en,", "," and ")}.`,issue:null}));return i}function S6(n,e,t="calledByError"){const i=[];if(!n)return[];const a=e.get(n);if(!a)return i.push(new E({id:`${n}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),i;if(Ne.includes(a.type))return[];if(Oe.includes(a.type)){const s=a.calledBy||[],o=s.length?`
281
287
 
282
288
  This ${a.type} is called by ${N(s.map(u=>`${u.type} with id "${u.id}"`),", "," and ")} entities. You can reference ${s.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
283
289
  ${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
284
290
  Termination entities are ${N(Oe,", "," and ")}.${o}`,issue:null}))}else $e.includes(a.type)?i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is an entry-point entity and doesn't thrown errors.
285
- ${ua}`,issue:null})):i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
291
+ ${ca}`,issue:null})):i.push(new E({id:`last-action--${a.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
286
292
  For any error branch caller, for the 'calledByError' property of an entity, you specifically need to reference a pass-through callable entity.
287
- ${Nn}`,issue:null}));return i}function b6(n,e){const t=[],i=e.get(n);if(!i)t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The 'readsValue' property references an entity with id '${n}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(i.type===r.PrimitiveValue){const s=i.parent;let o=!1;if(s.type===r.InputMap)t.push(new E({id:`last-action--${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`The 'readsValue' property references an entity with id "${i.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
293
+ ${Mn}`,issue:null}));return i}function O6(n,e){const t=[],i=e.get(n);if(!i)t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The 'readsValue' property references an entity with id '${n}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(i.type===r.PrimitiveValue){const s=i.parent;let o=!1;if(s.type===r.InputMap)t.push(new E({id:`last-action--${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`The 'readsValue' property references an entity with id "${i.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
288
294
  All value writting entity types are: ${N(Se,", "," and ")}.
289
295
 
290
296
  This primitive-value entity belongs to an input map entity with id "${s.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(s.type===r.DataType){const u=s,p=u.parent;Se.includes(p.type)?t.push(new E({id:`last-action--${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`The 'readsValue' property references an entity with id "${i.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
@@ -296,37 +302,37 @@ All value writting entity types are: ${N(Se,", "," and ")}.
296
302
 
297
303
  This data type entity belongs to a ${s.type} entity with id "${s.id}". ${s.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):t.push(new E({id:`last-action--${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`The 'readsValue' property references an entity with id "${i.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
298
304
  All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}))}else Se.includes(i.type)||t.push(new E({id:`last-action--${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`The 'readsValue' property references an entity with id "${i.id}" that isn't a value writting entity.
299
- All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}));return t}function tv(n){return n.functions.length?`All global 'function-declaration' entity ids are:
305
+ All value writting entity types are: ${N(Se,", "," and ")}.`,issue:null}));return t}function ov(n){return n.functions.length?`All global 'function-declaration' entity ids are:
300
306
  - ${n.functions.map(t=>`${t.id} (${A(t,n)})`).join(`
301
- - `)}.`:"The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities."}function to(n){return`All reserved action decriptor ids for '${r.GlobalEvent}' entities are:
307
+ - `)}.`:"The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities."}function no(n){return`All reserved action decriptor ids for '${r.GlobalEvent}' entities are:
302
308
  - ${n.globalEventActionDescriptors.map(e=>`${e.id} (${A(e,n)})`).join(`
303
- - `)}`}function no(n){return`All reserved action decriptor ids for '${r.Loop}' entities are:
309
+ - `)}`}function ro(n){return`All reserved action decriptor ids for '${r.Loop}' entities are:
304
310
  - ${n.loopDeclarations.map(e=>`${e.id} (${A(e,n)})`).join(`
305
- - `)}`}function g6(n){return`All reserved action decriptor ids for '${r.Operation}' entities are:
311
+ - `)}`}function C6(n){return`All reserved action decriptor ids for '${r.Operation}' entities are:
306
312
  - ${n.operationDeclarations.map(e=>`${e.id} (${A(e,n)})`).join(`
307
- - `)}`}function ro(n){return`All reserved action decriptor ids for '${r.Condition}' entities are:
313
+ - `)}`}function io(n){return`All reserved action decriptor ids for '${r.Condition}' entities are:
308
314
  - ${n.conditionDeclarations.map(e=>`${e.id} (${A(e,n)})`).join(`
309
- - `)}`}function nv(n,e){const t=[];if(!n)return[];const i=e.get(n),a=tv(e);if(!i)t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else if(i.type===r.ActionDescriptor)t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${n}' which is of type '${i.type}' entity. If you meant to reference an 'action-descriptor', you can use the 'implement_operation' generation action instead.
315
+ - `)}`}function lv(n,e){const t=[];if(!n)return[];const i=e.get(n),a=ov(e);if(!i)t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else if(i.type===r.ActionDescriptor)t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${n}' which is of type '${i.type}' entity. If you meant to reference an 'action-descriptor', you can use the 'implement_operation' generation action instead.
310
316
  Otherwise, if you were trying to implement a 'function-call' from a globally declarated 'function-declaration':
311
317
  ${a}`,issue:null}));else if(i.type!==r.FunctionDeclaration)t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The 'functionDeclarationId' reference is pointing to entity with id '${n}' which is of type '${i.type}' entity. Only 'function-declaration' entities can be implemented as function calls.
312
- ${a}`,issue:null}));else if(i.parent.type===r.CustomEntity){const o=Gn(i.parent).filter(p=>!p.interactive);let u="";o.length&&(u=`
318
+ ${a}`,issue:null}));else if(i.parent.type===r.CustomEntity){const o=Ln(i.parent).filter(p=>!p.interactive);let u="";o.length&&(u=`
313
319
  Furthermore, the specific 'custom-entity' extends or implements non-interactive built-in-base-entities ${o.length>1?`entities with ids '${N(o.map(h=>h.id),"', '","' and '")}'`:`entity with id '${o[0].id}'`}.
314
- ${Vn}`),t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The function declaration entity with id '${n}' is a method of the 'custom-entity' with id '${i.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
320
+ ${$n}`),t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The function declaration entity with id '${n}' is a method of the 'custom-entity' with id '${i.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
315
321
  If you want to call a method of a custom entity, use a '${r.InternalCall}' entity on any variable which is an instance of that custom entity.
316
322
  ${a}${u}`,issue:null}))}else i.parent.type===r.Loop?t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The function declaration entity with id '${n}' is the body of the 'loop' with id '${i.parent.id}'. Only globally declared, standalone functions can be implemented as function calls.
317
323
  If you want to execute the logic of a loop's body you can call the loop entity itself anf the body will be executed once for each iteration.
318
- ${a}`,issue:null})):i.parent.type!==r.Project&&t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The function declaration entity with id '${n}' has a 'parent' entity which isn't the root project. Only globally declared, standalone functions can be implemented as function calls.${a}`,issue:null}));return t}function rv(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
324
+ ${a}`,issue:null})):i.parent.type!==r.Project&&t.push(new E({id:`last-action--${y.InvalidFunctionDeclarationForFunctionCall}`,code:y.InvalidFunctionDeclarationForFunctionCall,severity:f.Error,message:`The function declaration entity with id '${n}' has a 'parent' entity which isn't the root project. Only globally declared, standalone functions can be implemented as function calls.${a}`,issue:null}));return t}function cv(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
319
325
  All built-in 'action-descriptor' entities that define 'operation' entity, are (IDs):
320
326
  - ${e.operationDeclarations.map(s=>`${s.id} (${A(s,e)}).`).join(`
321
327
  - `)}
322
- `;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.operationDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function v6(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
328
+ `;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.operationDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function B6(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
323
329
  All built-in 'action-descriptor' entities that define 'condition' entity, are (IDs):
324
330
  - ${e.conditionDeclarations.map(s=>`${s.id} (${A(s,e)}).`).join(`
325
331
  - `)}
326
- `;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForCondition}`,code:y.InvalidActionDescriptorForCondition,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.conditionDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed condition descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForCondition}`,code:y.InvalidActionDescriptorForCondition,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function I6(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
332
+ `;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForCondition}`,code:y.InvalidActionDescriptorForCondition,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.conditionDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed condition descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForCondition}`,code:y.InvalidActionDescriptorForCondition,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function w6(n,e){const t=[];if(!n)return[];const i=e.getBuiltIn(n),a=`
327
333
  All built-in 'action-descriptor' entities that define 'loop' entity, are (IDs):
328
334
  - ${e.loopDeclarations.map(s=>`${s.id} (${A(s,e)}).`).join(`
329
- - `)}`;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForLoop}`,code:y.InvalidActionDescriptorForLoop,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.loopDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed loop descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForLoop}`,code:y.InvalidActionDescriptorForLoop,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function iv(n,e,t){var p,h,m,T;if(t.compatible)return"";const i=`entity of type "${n.type}" with id "${n.id}"`,a=`entity with id "${n.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,u=bs(`${i} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===wt.AIsListBIsNot?`${u}
335
+ - `)}`;return i?i.type===r.FunctionDeclaration?t.push(new E({id:`last-action--${y.InvalidActionDescriptorForLoop}`,code:y.InvalidActionDescriptorForLoop,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):i.type===r.ActionDescriptor?e.loopDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${y.InvalidActionDescriptorForOperation}`,code:y.InvalidActionDescriptorForOperation,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity but it isn't one of the allowed loop descriptors.${a}`,issue:null})):i.type!==r.ActionDescriptor&&t.push(new E({id:`last-action--${y.InvalidActionDescriptorForLoop}`,code:y.InvalidActionDescriptorForLoop,severity:f.Error,message:`The entity with id '${n}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):t.push(new E({id:`last-action--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function dv(n,e,t){var p,h,m,T;if(t.compatible)return"";const i=`entity of type "${n.type}" with id "${n.id}"`,a=`entity with id "${n.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,u=Js(`${i} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===wt.AIsListBIsNot?`${u}
330
336
  ${a} is a list, but ${o} is not. A list can't be connected to a single value.`:t.type===wt.BIsListAIsNot?`${u}
331
337
  ${a} is not a list, but ${o} is. A single value can't be connected to a list.`:t.type===wt.AIsNullableBIsNot?`${u}
332
338
  ${a} is nullable, but ${o} is not. A nullable value can't be connected to a non-nullable value since an empty value might be incorrectly provided.`:t.type===wt.BIsNullableAIsNot?`${u}
@@ -336,27 +342,21 @@ ${a} is not a template, but ${o} is. A data type that provides an entity as a "t
336
342
  Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${r.CustomEntity}' or a '${r.PrimitiveEntity}'.`:t.type===wt.IncompatibleCustomEntities?`${u}
337
343
  Both point to custom entities, but they are not compatible to be connected. They must be either the same custom entity, or a custom entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type===wt.IncompatiblePrimitiveEntities?`${u}
338
344
  ${a} is of primitive type '${((p=n.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((h=e.getDataType())==null?void 0:h.entity).name}'. They must be of the same primitive type to be connected.`:t.type===wt.IncompatibleBuiltInBaseEntities?`${u}
339
- Both point to a built-in-base-entity. But${a} is of built-in base type '${((m=n.getDataType())==null?void 0:m.entity).name}' and ${o} is of built-in base type '${((T=e.getDataType())==null?void 0:T.entity).name}'. They must be of the same built-in base type to be connected.`:u}function pa(n,e){const t=[];if(n.readsValue){const i=e.project.get(D(n.readsValue));if(e.project.getBuiltIn(D(n.readsValue)))t.push(new E({id:`${e.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${n.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!i)t.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=vr(i);if(s)t.push(new E({id:`${e.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=ud({...e.toGenerationTarget(),...n},i);t.push(...o);const u=Os(e.getDataType(),i.getDataType());u.compatible||t.push(new E({id:`${e.id}--${v.ReaderWriterIncompatibleDataType}`,code:v.ReaderWriterIncompatibleDataType,severity:f.Error,message:iv(e,i,u),issue:null}))}}}return{errors:t,modifiedData:n}}function mn(n){const e=[];if(n.parent===n.project)n.calledBy.length||e.push(new Qn({id:`${n.id}--${M.DisconnectedCallableEntity}`,code:M.DisconnectedCallableEntity,severity:f.Warning,message:`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is globally declared and isn't called by any other entity.
345
+ Both point to a built-in-base-entity. But${a} is of built-in base type '${((m=n.getDataType())==null?void 0:m.entity).name}' and ${o} is of built-in base type '${((T=e.getDataType())==null?void 0:T.entity).name}'. They must be of the same built-in base type to be connected.`:u}function da(n,e){const t=[];if(n.readsValue){const i=e.project.get(D(n.readsValue));if(e.project.getBuiltIn(D(n.readsValue)))t.push(new E({id:`${e.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${n.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!i)t.push(new E({id:`${e.id}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=vr(i);if(s)t.push(new E({id:`${e.id}--${y.InvalidBuiltInEntityReference}`,code:y.InvalidBuiltInEntityReference,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${A(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=fd({...e.toGenerationTarget(),...n},i);t.push(...o);const u=Ws(e.getDataType(),i.getDataType());u.compatible||t.push(new E({id:`${e.id}--${v.ReaderWriterIncompatibleDataType}`,code:v.ReaderWriterIncompatibleDataType,severity:f.Error,message:dv(e,i,u),issue:null}))}}}return{errors:t,modifiedData:n}}function mn(n){const e=[];if(n.parent===n.project)n.calledBy.length||e.push(new Xn({id:`${n.id}--${M.DisconnectedCallableEntity}`,code:M.DisconnectedCallableEntity,severity:f.Warning,message:`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is globally declared and isn't called by any other entity.
340
346
  Globally declared callable entities will not be part of any logic execution when the project is published.
341
347
  To useful to the project when it is published, entities need to be called by a chain of logic that traces itself back to an entry point. Entry points can be either '${r.GlobalEvent}' or '${r.FunctionDeclaration}'.
342
348
  The only use for declaring global callable entities is for a 'variable-declaration' entity to be available globally in the project's scope, since its instances can be used inside lower scopes.
343
- Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:n}));else{const t=Id(n);if(!t.reachable){let i=`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${A(n,n.project)}".`;i+=`
349
+ Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:n}));else{const t=Sd(n);if(!t.reachable){let i=`This '${n.type}' entity "${A(n,n.project)}" with id "${n.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${A(n,n.project)}".`;i+=`
344
350
  This is because there are termination statements in the call chain before reaching this '${n.type}'.
345
351
  If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
346
- This '${n.type}' is blocked `;t.blocks.forEach((s,o)=>{const u=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${A(u,n.project)}" with id "${u.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new Qn({id:`${n.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Warning,message:`${i}${a}`,issue:null,entity:n}))}}return Z(n.errors,e)}function P6(n){var o;const e=u8(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];return Z(n.errors,s)}const ge=class ge{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.FunctionCall);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"process",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=D(i.declaration);if(o){const u=nv(o,t);a.push(...u)}else{const u=t.functions.length?`
352
+ This '${n.type}' is blocked `;t.blocks.forEach((s,o)=>{const u=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${A(u,n.project)}" with id "${u.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new Xn({id:`${n.id}--${v.UnreachableEntity}`,code:v.UnreachableEntity,severity:f.Warning,message:`${i}${a}`,issue:null,entity:n}))}}return X(n.errors,e)}function _6(n){var o;const e=q4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(u=>u.validate()),n.outputs.forEach(u=>u.validate()),(o=n.error)==null||o.validate();const s=[...mn(n)];return X(n.errors,s)}const ge=class ge{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"x");l(this,"y");l(this,"type",r.FunctionCall);l(this,"successCalls",[]);l(this,"errorCalls",[]);l(this,"process",null);l(this,"declaration");l(this,"inputs",[]);l(this,"outputs",[]);l(this,"calledBySuccess",[]);l(this,"calledByError",[]);l(this,"calledByEntry",[]);l(this,"error",null);l(this,"parent");l(this,"errors",[]);l(this,"project");l(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const T=D(e.parent);i=t.get(T)}const a=D(e.declaration),s=t.get(a),o=e.calledByEntry.map(T=>{const b=D(T);return t.get(b)}),u=e.calledBySuccess.map(T=>{const b=D(T);return t.get(b)}),p=e.calledByError.map(T=>{const b=D(T);return t.get(b)}),h={id:e.id,version:1,type:r.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:u,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},m=R(h,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ge(i,{parent:{list:!1,types:[...st,r.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,...Pe(i));const o=D(i.declaration);if(o){const u=lv(o,t);a.push(...u)}else{const u=t.functions.length?`
347
353
  All global 'function-declaration' entity ids are:
348
354
  - ${t.functions.map(p=>`${p.id} (${A(p,t)})`).join(`
349
355
  - `)}.`:`
350
356
  The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new E({id:`${i.id}--${y.InvalidReference}`,code:y.InvalidReference,severity:f.Error,message:`Entity of type "${r.FunctionCall}" with id "${i.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'function-declaration' entity.
351
357
  References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${u}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
352
358
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
353
- You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addFunctionCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=D(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initOutputs(),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this}initOutputs(){const e=[];this.outputs=this.initialData.outputs.map(s=>{const o=R(s,this.project);return e.push(o.index),o.setParent(this),o.initChildren(),o});const i=md(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));i.sort((s,o)=>s.index-o.index);const a=i.map((s,o)=>{const u=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:G.uuid(),type:r.OutputMap,version:1,declaration:s,index:u,parent:this,writesValues:[]},h=R(p,this.project);return h.setParent(this),h.initChildren(),h});return this.outputs.push(...a),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,version:this.version,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=P6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ge(this.toJSON(),this.project)}};l(ge,"MUTABLE_BASE_PROPERTIES",[]),l(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"MUTABLE_META_PROPERTIES",["x","y"]),l(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),l(ge,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),l(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),l(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Rr=ge;function av(n){var e,t,i;switch(n.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(m=>!!m.implements.find(T=>T.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(m=>!!m.properties.find(T=>{var b;return T.implements&&T.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=T.getDefaultValue())==null?void 0:b.value)===!0}))){const T=a[0].properties.find(I=>I.implements&&I.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=T==null?void 0:T.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(T!=null&&T.dataType){const I=(t=T==null?void 0:T.dataType)==null?void 0:t.id.split("-id")[0],C=R({id:I+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:T==null?void 0:T.dataType.toReference()},n.project);return C.setParent(T==null?void 0:T.dataType),C.initChildren(),C.addSelfToProject(),{newEntities:[C]}}return{newEntities:[]}}const o=n.project.get(Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),u=io(o,"Main database");if(u.errors.length>0)return{newEntities:[]};const p=u.implemented.properties.find(m=>m.implements&&m.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),h=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(h)h.value=!0;else if(p!=null&&p.dataType){const m=p==null?void 0:p.dataType.id.split("-id")[0],T=R({id:m+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},n.project);T.setParent(p==null?void 0:p.dataType),T.initChildren(),T.addSelfToProject()}return{newEntities:[u.implemented]}}}return{newEntities:[]}}function sv(n){return n.implements.filter(t=>t.type===r.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(h=>h.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(h=>{var m;return h.implements&&h.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((m=h.getDefaultValue())==null?void 0:m.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),u=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!u){const p=o==null?void 0:o.dataType.id.split("-id")[0],h=R({id:p+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return h.setParent(o==null?void 0:o.dataType),h.initChildren(),h.addSelfToProject(),{newEntities:[h]}}return{newEntities:[]}}}}),{newEntities:[]}}function io(n,e,t){const i=t||Qt(e,r.CustomEntity,n.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:r.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},u=fo(o,n.project);if(u.length>0)return{errors:u,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=av(n),h=R(o,n.project);h.setParent(n.project),h.initChildren();const m=n.properties.map(I=>{const C=s+"-"+Qt(A(I,n.project),r.Property,n.project),L=I.clone(h,C);return L.abstract=!1,L.implements=I,L.setParent(h),h.addProperty(L),L}),T=n.abstractMethods.map(I=>{const C=s+Qt(I.name,r.FunctionDeclaration,n.project),L=I.implementAsFunctionDeclaration(C),J={id:C+"-parent-ref-id",type:r.GenericReference,entityId:i,entityType:r.CustomEntity},Ut={...L,implements:I,parent:J},Le=R(Ut,n.project);return h.addMethod(Le),Le.setParent(h),Le.initChildren(),Le.implements=I,Le});o.properties=m,o.methods=T;const b=sv(h);return{implemented:h,errors:[],entitiesChanges:{new:[h,...p.newEntities,...b.newEntities],updated:[h],deleted:[]}}}function ao(n,e){const t=gr(n);if(t.length===0)return{list:[],last:null};let i=null;return{list:t.flatMap(s=>{if(s===e)return i=s,[s];const o=ao(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function ov(n,e,t=new Set){const i=Ln(n),a=Ln(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),u=s.reduce((p,h)=>t.has(h.id)?p:(t.add(h.id),S([...p,...ov(h,e,t)])),[]);return S([...o,...u])}function ya(n,e){const t=ao(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function D6(n,e){return!!ao(n,e).last}function A6(n){if($e.includes(n.type))return n;if([...En,r.VariableDeclaration].includes(n.type)){const e=n.parent;return $e.includes(e.type)?e:null}return null}function pd(n,e){if(!n||!e)throw new Error("Both entities must be defined to find a common ancestor");if(n===e)return n;const t=n.parent;if(t){if(t===e)return e;if(t.type===r.Project)return null}else return null;const i=e.parent;if(i){if(i===n)return n;if(i.type===r.Project)return null}else return null;return pd(t,i)}function He(n){if(bo.includes(n.type)){if(n.type===r.FunctionDeclaration){const e=n.parent;if(e.type===r.CustomEntity)return e}return n}else{const e=n.parent;return e?He(e):null}}function S6(n){return n.type===r.VariableDeclaration?[n]:Ne.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===r.ReturnStatement?n.outputs:Ar.includes(n.type)||n.type===r.FunctionDeclaration?n.inputs:[]}function O6(n){const e=Ln(n),t=[],i=[];Nd.includes(n.type)&&t.push(...yd(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:En.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>ya(o,s)?-1:0),i.sort((s,o)=>ya(o,s)?-1:0),[...t,...i,...a]}function lv(n){return[...n].sort((e,t)=>ya(t,e)?-1:0)}function C6(n){const e=lv(n),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];ya(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function _t(n){const e=n.map(t=>He(t));return S(e)}function yd(n){return Ne.includes(n.type)?[..._t(n.successCalls),..._t(n.errorCalls)]:$e.includes(n.type)?_t(n.calls):[]}function B6(n,e){return yd(n).includes(e)}function hd(n){return n.writesValues||[]}function w6(n,e){return hd(n).includes(e)}function cv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function _6(n){return n.writesValues}function dv(n=[]){return n.map(cv).filter(e=>!!e)}function so(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function uv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function pv(n){return Fe.includes(n.type)?n:null}function yv(n){return n.writesValues.map(pv).filter(e=>!!e)}function hv(n=[]){return n.reduce((e,t)=>t.type===r.OutputMap?[...e,...yv(t)]:e,[])}function Me(n){return Ne.includes(n.type)?[...br(_t(n.successCalls)),...br(_t(n.errorCalls))]:$e.includes(n.type)?br(_t(n.calls)):[]}function fv(n,e=new Set){return n.writesValues.filter(i=>Fe.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...z(a,e)],[])}function mv(n,e=new Set){var i;return(((i=n.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...z(s,e)],[])}function z(n,e=new Set){if(e.has(n.id))return[];if(n.type===r.ReturnStatement)return uv(n.outputs).reduce((i,a)=>[...i,...z(a,e)],[]);if(n.type===r.FunctionCall||n.type===r.Operation||n.type===r.Condition)return[...Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]),...dv(n.inputs),...hv(n.outputs)].reduce((s,o)=>[...s,...z(o,e)],[]);if(Ar.includes(n.type)){const t=so(n.inputs),a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o,e)],[])}if(n.type===r.FunctionDeclaration){const t=[...so(n.inputs)],a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const i=Me(n).reduce((a,s)=>{const o=He(s);return[...a,...z(o||s,e)]},[]);return[n,...i,...mv(n,e),...fv(n,e)]}return[]}function gt(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...Ln(n).reduce((a,s)=>[...a,s,...gt(s,e)],[])])}function br(n){return n.reduce((e,t)=>t.type===r.ReturnStatement||t.type===r.ContinueStatement||t.type===r.BreakStatement?e:[...e,t,...Me(t)],[])}function Tv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],i=e.reduce((p,h)=>[...p,...h.properties],[]),a=e.reduce((p,h)=>[...p,...h.methods],[]),s=a.reduce((p,h)=>[...p,...so(h.inputs),...br(_t(h.calls)),...h.returnStatements],[]),o=n.functions.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]),u=n.events.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]);return[...t,...i,...a,...s,...o,...u]}function Ev(n,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case r.FunctionCall:return i.inputs.find(a=>a.id===n.id)!==void 0||i.outputs.find(a=>a.id===n.id)!==void 0;case r.Condition:return i.successCalls.find(a=>a.id===n.id)!==void 0||i.errorCalls.find(a=>a.id===n.id)!==void 0||i.inputs.find(a=>a.id===n.id)!==void 0;case r.Operation:return i.outputs.find(a=>a.id===n.id)!==void 0;case r.VariableDeclaration:return Ne.includes(n.type)?Rv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case r.CustomEntity:return i.properties.find(a=>a.id===n.id)!==void 0||i.methods.find(a=>a.id===n.id)!==void 0;case r.FunctionDeclaration:return i.inputs.find(a=>a.id===n.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function M6(n){const e=Tv(n.project);return Ev(n,e)}function gr(n){const e=[];if(En.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const i=[...n.inputs||[],...n.outputs||[]].map(a=>Td(a)).filter(a=>a!==null);e.push(...S(i))}if(Fe.includes(n.type)){const t=Td(n);t&&e.push(t)}return S(e)}function fd(n){return n.type===r.FunctionCall||n.type===r.InternalCall?n.declaration.inputs:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===r.FunctionDeclaration||Ar.includes(n.type)?n.inputs:n.type===r.Search?n.inputsDeclarations:[]}function N6(n,e){return e.type===r.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===r.FunctionCall||e.type===r.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function Rv(n){return Ne.includes(n.type)?n.inputs:[]}function md(n){var e;return n.type===r.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===r.Search?n.outputsDeclarations:Oe.includes(n.type)?n.outputs:[]}function $6(n,e){return e.type===r.Condition?null:e.type===r.FunctionCall||e.type===r.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function V6(n){return n.type===r.Condition?[]:Ne.includes(n.type)?n.outputs:[]}function Td(n){const e=n.readsValue;return e?He(e):null}function bv(n){const e=n.internalCalls||[];return S(_t(S(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function ui(n){const e=hd(n),t=[];return e.forEach(i=>{if(Fe.includes(i.type))t.push(i);else if(i.type===r.InputMap){const a=i.parent;if(a.type===r.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[r.ActionDescriptor].includes(i.parent.type)||t.push(i.parent)}),t}function S(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Ln(n,e=!1){const t=[];if(n.type===r.Project&&t.push(...(n==null?void 0:n.entities)||[],...(n==null?void 0:n.functions)||[],...(n==null?void 0:n.variableDeclarations)||[],...(n==null?void 0:n.variableInstances)||[],...(n==null?void 0:n.searches)||[],...(n==null?void 0:n.loops)||[],...(n==null?void 0:n.operations)||[],...(n==null?void 0:n.conditions)||[],...(n==null?void 0:n.functionCalls)||[],...(n==null?void 0:n.events)||[],...(n==null?void 0:n.projects)||[]),st.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===r.CustomEntity){const i=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:Ln(a));t.push(...i)}if(n.type===r.Condition){const i=n.successCalls.map(s=>He(s)),a=n.errorCalls.map(s=>He(s));t.push(...i,...a)}if(Ar.includes(n.type)){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ui(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}if(Ne.includes(n.type)&&n.type!==r.Condition){const i=n==null?void 0:n.outputs.map(o=>ui(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...S(i),...a,...s)}if(Fe.includes(n.type)){const i=ui(n),a=bv(n);t.push(...i,...a)}if(n.type===r.Loop){const i=n.outputs.map(o=>ui(o)).flat();if(n.body){const o=Ln(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...S(i),...s,...a)}if(n.type===r.FunctionDeclaration){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ui(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}return S(t)}function gv(n,e=!1){const t=Ln(n,e),i=[...t,...t.reduce((a,s)=>[...a,...gv(s,e)],[])];return S(i)}function vv(n){const e=gr(n),t=[...e,...e.reduce((i,a)=>[...i,...vv(a)],[])];return S(t)}function oo(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...oo(t),...lo(t)]:[...e,t.name],[])}function lo(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...lo(t),...oo(t)]:[...e,t.name],[])}function Ed(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Ed(t),...Rd(t)]:[...e,t],[])}function Rd(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Rd(t),...Ed(t)]:[...e,t],[])}function Iv(n){return[...lo(n),...oo(n)].filter((t,i,a)=>a.indexOf(t)===i)}function Pv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(i=>i.type===r.BuiltInBaseEntity&&i.name===w.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((i,a)=>{if(a.type===r.CustomEntity){const s=Pv(a);if(s)return s}return i},null)}function L6(n){const e=n.extends.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function G6(n){const e=n.implements.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function Dv(n){const e=n.extends.find(t=>t.type===r.CustomEntity);return e&&e.type===r.CustomEntity?e:null}function Gn(n){const e=[...n.implements,...n.extends].reduce((t,i)=>i.type===r.BuiltInBaseEntity?[...t,i]:i.type===r.CustomEntity?[...t,...Gn(i)]:t,[]);return S(e)}function Av(n){return n.type===r.PrimitiveEntity?!0:n.type===r.BuiltInBaseEntity?n.interactive:!Gn(n).find(i=>!i.interactive)}function F6(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function bd(n){return n.parent!==n.project?!1:r.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):r.VariableInstance===n.type?n.project.variableInstances.includes(n):r.FunctionCall===n.type?n.project.functionCalls.includes(n):r.Condition===n.type?n.project.conditions.includes(n):r.Operation===n.type?n.project.operations.includes(n):r.Loop===n.type?n.project.loops.includes(n):r.Search===n.type?n.project.searches.includes(n):!1}function Sv(n){if([...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||bd(n))return!1;const e=gr(n);return e.length===0?!0:e.some(t=>Sv(t))}function gd(n){return[...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||bd(n)?!1:gr(n).length===0}function Ov(n,e=0){if(gd(n)){const t=gr(n);return t.length===0?n:t.map(a=>Ov(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function Cv(n){const e=[];if(gd(n))e.push(n);else return[];return gr(n).forEach(i=>{e.push(...Cv(i))}),e}function Bv(n){return n.type===r.FunctionDeclaration&&n.parent!==n.project&&!![r.CustomEntity,r.Loop,r.InstalledProject].includes(n.parent.type)}function wv(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function co(n){switch(n){case r.CustomEntity:return Pr;case r.FunctionDeclaration:return lr;case r.VariableDeclaration:return pr;case r.VariableInstance:return yr;case r.FunctionCall:return Rr;case r.Operation:return cr;case r.Condition:return ur;case r.ReturnStatement:return Tr;case r.Loop:return dr;case r.Search:return hr;case r.InputMap:return hn;case r.OutputMap:return fn;case r.ArgumentDeclaration:return mr;case r.ReturnDeclaration:return Ot;case r.Property:return or;case r.InstalledProject:return fr;case r.Project:return Dr;case r.BuiltInBaseEntity:return xt;default:return null}}function ht(n,e){if(st.includes(n.type))return n;if(Sr.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===r.GenericReference){const i=D(t);if(!i)return null;const a=e.get(i);return a?ht(a,e):null}else return t===e?e:ht(t,e)}function vd(n,e){if(Sr.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const i=Mt(n.parent,e);return i?i===e?st.includes(n.type)?n:null:i.type===r.CustomEntity?n:vd(i,e):null}function uo(n,e,t){if(n===e||e===t||n===t)return!1;const i=ht(e.parent,t);return i===n?!0:uo(i,e,t)}var po=(n=>(n.SameBothLocal="same-both-local",n.AInB="a-in-b",n.BInA="b-in-a",n.ParallelInCommonParent="parallel-in-common-parent",n.ParallelInProject="parallel-in-project",n.AIsGlobalBIsNot="a-is-global-b-is-not",n.BIsGlobalAIsNot="b-is-global-a-is-not",n.SameBothGlobal="same-both-global",n))(po||{});function ha(n,e,t){const i=ht(n,t),a=ht(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+n.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==r.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===r.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===r.Project&&a.type!==r.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==r.Project&&a.type===r.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(uo(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if(uo(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const u=pd(i,a);return u===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:u}:u?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ht(u,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function _v(n,e,t){const i=ha(n,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(n===e)return n;let a=ht(n.parent,t);if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;a=ht(a.parent,t)}let s=ht(e.parent,t);if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;s=ht(s.parent,t)}return null}function Mv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,i)=>{const a=_v(t,i,i.project);return!a||a===i?t:i},n[0])}function Mt(n,e){let t;return typeof n=="string"?t=n:n.type===r.GenericReference?t=D(n):t=n.id,t===e.id?e:e.get(t)}function vr(n){if(Sr.includes(n.type))return n;if(n.type===r.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===r.Project?null:vr(t)}function fa(n,e){var t;if(n.readsValue){const i=Mt(n.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function Id(n){const e=[];function t(o,u){return e.some(p=>p.blockedByCaller===o&&p.blockedByCalling===u)}function i(o,u){t(o,u)||e.push({blockedByCaller:o,blockedByCalling:u})}const a=vd(n,n.project);return n.calledBy.forEach(o=>{if([...o.calls||[],...o.successCalls||[],...o.errorCalls||[]].forEach(h=>{Oe.includes(h.type)&&i(o,h)}),o===a)return;let p;if(Ne.includes(o.type))p=o;else if(o.type===r.FunctionDeclaration){const h=He(o);if(h.type===r.CustomEntity)return;h.type===r.Loop&&(p=h)}if(p){const h=Id(p);h.reachable||(Oe.includes(n.type)?h.blocks.forEach(m=>{i(o,m.blockedByCalling)}):Me(n).find(b=>b===o)||h.blocks.forEach(b=>{i(o,b.blockedByCalling)}))}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function x6(n){return bo.includes(n.type)?n.type===r.FunctionDeclaration?!Bv(n):!0:!1}function U6(n){if(r.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return r.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return r.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return r.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return r.Condition}return n.type}function j6(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function k6(n){return n.split(/\s+/).map(i=>i[0].toUpperCase()+i.slice(1).toLowerCase()).join("")}function Nv(n){var e;return(e=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function yo(n){return Nv(n).toLowerCase()}function Ir(n,e=!0){if(!(n!=null&&n.dataType))return"Any data type";if(!n.dataType.entity)return n.dataType.isList?"List of an unknown data type":"Unknown data type";if(n.dataType.entity.type===r.PrimitiveEntity){let t=n.dataType.entity.name;switch(n.dataType.entity.name){case g.String:t="Text";break;case g.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=n.dataType.entity.name;break}return n.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function $v(n){return Ir(n.declaration)}function q6(n){return n.type===r.VariableInstance?$v(n):Ir(n)}function Vv(n){if(!n)return"Any data type";if(!n.entity)return"Inherited";if(n.entity.type===r.PrimitiveEntity){const e=n.entity.name===g.String?"Text":n.entity.name;return n.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.entity.type===r.CustomEntity){const e=Dd(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.entity.type===r.BuiltInBaseEntity){const e=Pd(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.isList?`List of ${n.entity.name} entities`:`${n.entity.name.slice(0,1).toUpperCase()+n.entity.name.slice(1)} entity`}function Lv(n){if(!n.dataType)return"Any data type";if(!n.dataType.entity)return"Inherited";if(n.dataType.entity.type===r.PrimitiveEntity){const e=n.dataType.entity.name===g.String?"Text":n.dataType.entity.name;return n.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.dataType.entity.type===r.CustomEntity){const e=Dd(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.dataType.entity.type===r.BuiltInBaseEntity){const e=Pd(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function Gv(n){switch(n.type){case r.Property:return Lv(n);case r.VariableDeclaration:return Ir(n);case r.ArgumentDeclaration:return Ir(n,!1);case r.InputMap:{const e=n.declaration;return e?Gv(e):"Unknown data type"}case r.ReturnDeclaration:return Ir(n,!1);case r.OutputMap:{const e=n.declaration;return Ir(e,!1)}}return"Unknown data type"}function ho(n){switch(n.declaration.id){case Ae.Equal:return"is equal to";case Ae.NotEqual:return"is not equal to";case Ae.MoreThan:return"is greater than";case Ae.MoreThanOrEqual:return"is greater than or equal to";case Ae.LessThan:return"is less than";case Ae.LessThanOrEqual:return"is less than or equal to";case Ae.And:return"and";case Ae.Or:return"or";case Ct.Empty:return"is empty";case Ct.NotEmpty:return"is not empty"}}function Fv(n){return n.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":n.includes(w.PERSISTED_ENTITY)?"Persisted entity":n.includes(w.CRON_JOB)?"Scheduled execution":n.includes(w.RELATIONAL_DATABASE)?"Relational database":"Entity"}function Pd(n){switch(n.name){case w.HTTP_ENDPOINT:return"HTTP endpoint";case w.PERSISTED_ENTITY:return"Persisted entity";case w.CRON_JOB:return"Scheduled execution";case w.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function Dd(n){const e=Dv(n);if(!e){const t=Iv(n);return t.includes(w.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(w.PERSISTED_ENTITY)?"Persisted entity":t.includes(w.CRON_JOB)?"Scheduled execution":t.includes(w.RELATIONAL_DATABASE)?"Relational database":A(n,n.project)+" entity"}return A(e,n.project)+" entity"}function xv(n){let e="Find ";return n.outputsDeclarations.forEach((t,i)=>{const a=Ec(t),s=tb(a&&a.entity?A(a.entity,n.project):"unstructured data");i===0?e+=`${s} `:i===n.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function Uv(n){switch(n.name){case g.String:return"Text";case g.Number:return"Number";case g.Boolean:return"Boolean";case g.JSON:return"Data structure";case g.UUID:return"Unique identifier";case g.Date:return"Date";case g.EntityTemplate:return"Entity as template";case g.Enum:return"Enumeration";case g.File:return"File";case g.Null:return"Empty";case g.ActionDescriptor:return"Action descriptor";default:return n.name}}function jv(n){switch(n.id){case je.List:return"Loop over list items";case je.ManualFlow:return"Manual flow control loop";case je.ObjectKeys:return"Loop over object keys";case je.ObjectValues:return"Loop over object values";case je.Counted:return"Loop given number of times";case je.String:return"Loop over text characters";case at.Addition:return"Sum numbers";case at.Substraction:return"Subtract numbers";case at.Multiplication:return"Multiply numbers";case at.Division:return"Divide numbers";case at.Remainder:return"Get remainder of numbers";case at.Exponentiation:return"Get exponent of numbers";case ve.AddIndex:return"Add at index position";case ve.DeleteFirst:return"Delete first character";case ve.DeleteLast:return"Delete last character";case ve.DeleteIndex:return"Delete at index position";case ve.Join:return"Join texts";case ve.ReplaceAllMatches:return"Replace all matches";case ve.ReplaceFirst:return"Replace first match";case ve.ReplaceLast:return"Replace last match";case ve.Split:return"Split text";case ve.ReplaceIndex:return"Replace at index position";case ve.ReplaceSingleMatch:return"Replace single match";case ve.GetFirst:return"Get first character";case ve.GetLast:return"Get last character";case ve.GetIndex:return"Get at index position";case ve.Append:return"Add at the end";case ve.Prepend:return"Add at the start";case Ie.Wait:return"Wait";case Ie.Parallel:return"Run in parallel";case Ie.Sequential:return"Run in sequence";case Ye.HttpRequest:return"HTTP request";case Ze.CreateNewInstance:return"Create new copy of entity";case j.AddIndex:return"Add item at index position";case j.DeleteFirst:return"Delete first item";case j.DeleteLast:return"Delete last item";case j.DeleteIndex:return"Delete item at index position";case j.Join:return"Join lists";case j.ReplaceAllMatches:return"Replace all matches";case j.ReplaceFirst:return"Replace first match";case j.ReplaceLast:return"Replace last match";case j.Split:return"Split list";case j.ReplaceIndex:return"Replace at index position";case j.ReplaceSingleMatch:return"Replace single match";case j.GetFirst:return"Get first item";case j.GetLast:return"Get last item";case j.GetIndex:return"Get item at index position";case j.Append:return"Add item at the end";case j.Prepend:return"Add item at the start";case Kt.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(n.name.slice(0,1).toUpperCase()+n.name.slice(1)).replaceAll("-"," ")}}function A(n,e){var t;if(r.FunctionDeclaration===n.type){const i=n.name;if(Object.values(vt).includes(i))switch(i){case vt.AbortExecution:return"Abort execution";case vt.DeletePersistedEntity:return"Delete persisted entity";case vt.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return bs(n.type).replaceAll("-"," ")}return i}if(r.BuiltInBaseEntity===n.type)return Fv([n.name]);if($d.includes(n.type)&&n.type!==r.ActionDescriptor)return n.name;switch(n.type){case r.Search:return xv(n);case r.Operation:case r.InternalCall:case r.Loop:const i=Mt(n.declaration,e);return A(i,e);case r.ActionDescriptor:return jv(n);case r.BreakStatement:const a=Mt(n.parent,e);return`Stop loop ${A(a,e)}`;case r.ContinueStatement:const s=Mt(n.parent,e);return`Execute next iteration of ${A(s,e)}`;case r.FunctionCall:return Mt(n.declaration,e).name;case r.Condition:{const u=n;if((t=n.inputs)!=null&&t.length){const p=A(u.inputs[0],u.project);if(u.inputs[1]){const h=u.inputs[1].declaration.name;return`If ${p} ${ho(u)} ${h}`}return`If ${p} ${ho(u)}`}else return`If ${ho(u)}`}case r.ReturnStatement:{const u=Mt(n.parent,e);return`Output of ${A(u,e)}`}case r.InputMap:if(n.declaration){const u=Mt(n.declaration,e);return A(u,e)||""}else return n.name||"";case r.VariableInstance:{const u=Mt(n.declaration,e);return A(u,e)||""}case r.OutputMap:if(n.declaration){const u=Mt(n.declaration,e);return(u==null?void 0:u.name)||""}else return"";case r.PrimitiveEntity:case r.PrimitiveValue:return Uv(n);default:return bs(n.type).replaceAll("-"," ")}}function fo(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=e.entities.filter(a=>a.name===n.name);return i.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in the project. Entity with id "${i[0].id}" has the same name.
354
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null})),t}function Ad(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=n.parent?D(n.parent):null;let a=e;i&&(a=e.get(i));const s=[];a.type===r.CustomEntity?s.push(...a.methods.map(u=>u)):a.type===r.Project?s.push(...a.functions.map(u=>u)):a.type===r.Loop?a.body&&s.push(a.body):a.type===r.InstalledProject&&s.push(...a.functions.map(u=>u));const o=s.filter(u=>u.name===n.name);return o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in ${a.type===r.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
355
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null})),t}function Sd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=n.parent&&Mt(n.parent,e)||e;if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${n.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const s=nd(i).filter(o=>o.name===n.name);s.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
356
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}return t}function Od(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
357
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function Cd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=fd(a).filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
358
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function Bd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${v.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:f.Error,code:v.EmptyName,issue:null}));const i=D(n.parent);if(!i)t.push(new E({id:`${n.id}--parent-reference--${y.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:f.Error,code:y.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${n.id}--parent-reference--${y.ReferencedEntityNotFound}`,message:`The entity with id '${i}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:f.Error,code:y.ReferencedEntityNotFound,issue:null}));else{const o=md(a).filter(u=>u.name===n.name);o.length&&t.push(new E({id:`${n.id}--${v.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
359
- Please provide a unique 'name' string.`,severity:f.Error,code:v.NameNotUniqueInScope,issue:null}))}}return t}function J6(n,e){switch(n.type){case r.CustomEntity:return fo(n,e);case r.FunctionDeclaration:return Ad(n,e);case r.VariableDeclaration:return Sd(n,e);case r.Property:return Od(n,e);case r.ArgumentDeclaration:return Cd(n,e);case r.ReturnDeclaration:return Bd(n,e);default:return[]}}const Tn=class Tn{uuid(){return Tn.instance||(Tn.instance=pl()),Tn.instance.uuid()}fromUUID(e){return Tn.instance||(Tn.instance=pl()),Tn.instance.fromUUID(e)}};l(Tn,"instance",null);let mo=Tn;const G=new mo;function Qt(n,e,t){const a=`${yo(n)}-${e}-id`;return t.instances[a]?G.uuid():a}function wd(n,e){let t="",i=null;if(n.parent){const s=e.get(n.parent);s&&(i=s)}let a="";return i&&(a=`${yo(A(i,e))}-`),t=`${a}${yo(A(n,e))}-id`,e.instances[t]?G.uuid():t}function W6(n){const e=kU(),t=n.toJSON();e.safeParse(t).success;const a=n.implements.flatMap(m=>z6(n,m)),s=n.extends.flatMap(m=>Z6(n,m)),o=Q6(n),u=X6(n);n.methods.flatMap(m=>m.validate());const p=[...a,...s,...o,...u];return Z(n.errors,p)}function H6(n,e){const t=e.properties.filter(s=>s.abstract),i=[];let a=[...n.properties];return t.forEach(s=>{const o=a.find(u=>{var p;return((p=u.implements)==null?void 0:p.id)===s.id});o?a=a.filter(u=>u.id!==o.id):i.push(s)}),i}function Y6(n,e){const t=e.abstractMethods,i=[];let a=[...n.methods];return t.forEach(s=>{const o=a.find(u=>{var p;return((p=u.implements)==null?void 0:p.id)===s.id});o?a=a.filter(u=>u.id!==o.id):i.push(s)}),i}function z6(n,e){const t=[];if(!e.abstract){const m=H({id:n.id+"--"+M.ImplementingNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:M.ImplementingNonAbstractEntity,entity:n});return t.push(m.error),t}const i=e.properties.filter(m=>m.abstract),a=[];let s=[...n.properties];i.forEach(m=>{const T=s.find(b=>{var I;return((I=b.implements)==null?void 0:I.id)===m.id});T?s=s.filter(b=>b.id!==T.id):a.push(m)}),a.length&&a.forEach(m=>{const T=H({id:n.id+"--"+M.MissingPropertyImplementation+"--"+m.id,message:`Property "${m.name}" with id "${m.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:f.Error,code:M.MissingPropertyImplementation,entity:n});t.push(T.error)});const o=[];let u=[...n.methods];e.abstractMethods.forEach(m=>{const T=u.find(b=>{var I;return((I=b.implements)==null?void 0:I.id)===m.id});T?u=u.filter(b=>b.id!==T.id):o.push(m)}),o.length&&o.forEach(m=>{const T=H({id:n.id+"--"+M.MissingMethodImplementation+"--"+m.id,message:`Method "${m.name}" with id "${m.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:f.Error,code:M.MissingMethodImplementation,entity:n});t.push(T.error)});const p=[];e.properties.forEach(m=>{const T=s.find(b=>b.name===m.name);T&&p.push([T,m])}),p.length&&p.forEach(([m])=>{const T=H({id:n.id+"--"+v.PropertyOverwrite+"--"+m.id,message:`Property "${m.name}" with id "${m.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.PropertyOverwrite,entity:n});t.push(T.error)});const h=[];return e.methods.forEach(m=>{const T=u.find(b=>b.name===m.name);T&&h.push([T,m])}),h.length&&h.forEach(([m])=>{const T=H({id:n.id+"--"+v.MethodOverwrite+"--"+m.id,message:`Method "${m.name}" with id "${m.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.MethodOverwrite,entity:n});t.push(T.error)}),t}function Z6(n,e){const t=[],i=[];if(e.abstract){const s=H({id:n.id+"--"+M.ExtendingAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:M.ExtendingAbstractEntity,entity:n});return t.push(s.error),t}n.properties.forEach(s=>{var u;const o=e.properties.find(p=>p.name===s.name);((u=s.implements)==null?void 0:u.id)!==(o==null?void 0:o.id)&&o&&i.push(s)}),i.length&&i.forEach(s=>{const o=H({id:n.id+"--"+v.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.PropertyOverwrite,entity:n});t.push(o.error)});const a=[];return n.methods.forEach(s=>{var u;const o=e.methods.find(p=>p.name===s.name);((u=s.implements)==null?void 0:u.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=H({id:n.id+"--"+v.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:f.Error,code:v.MethodOverwrite,entity:n});t.push(o.error)}),t}function X6(n){const e=[];if(!n.properties.length){const t=H({id:n.id+"--"+M.NoProperties,message:"No properties implemented",issue:null,severity:f.Warning,code:M.NoProperties,entity:n});e.push(t.error)}return n.properties.forEach(t=>{t.validate()}),e}function Q6(n){const e=[];if(n.abstract){if(n.methods.length){const t=H({id:n.id+"--"+M.AbstractEntityWithNonAbstractMethods,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:f.Error,code:M.AbstractEntityWithNonAbstractMethods,entity:n});e.push(t.error)}if(n.properties.some(t=>!t.abstract)){const t=H({id:n.id+"--"+M.AbstractEntityWithNonAbstractProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:f.Error,code:M.AbstractEntityWithNonAbstractProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.abstract){const a=H({id:n.id+"--"+M.StaticEntityWithNonStaticProperties+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:f.Error,code:M.StaticEntityWithNonStaticProperties,entity:n});e.push(a.error)}})}}else{if(n.abstractMethods.length){const t=H({id:n.id+"--"+M.AbstractPropertyInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract methods`,issue:null,severity:f.Error,code:M.AbstractPropertyInNonAbstractEntity,entity:n});e.push(t.error)}if(n.properties.some(t=>t.abstract)){const t=H({id:n.id+"--"+M.AbstractMethodInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract properties`,issue:null,severity:f.Error,code:M.AbstractMethodInNonAbstractEntity,entity:n});e.push(t.error),n.properties.forEach(i=>{if(i.abstract){const a=H({id:n.id+"--"+M.AbstractMethodInNonAbstractEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:f.Error,code:M.AbstractMethodInNonAbstractEntity,entity:n});e.push(a.error)}})}}if(n.static&&n.properties.some(t=>!t.static)){const t=H({id:n.id+"--"+M.StaticEntityWithNonStaticProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as static but has non-static properties`,issue:null,severity:f.Error,code:M.StaticEntityWithNonStaticProperties,entity:n});e.push(t.error),n.properties.forEach(i=>{if(!i.static){const a=H({id:n.id+"--"+M.NonStaticPropertyInStaticEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${n.name}" with id "${n.id}" is not marked as static but the entity is marked as static`,issue:null,severity:f.Error,code:M.NonStaticPropertyInStaticEntity,entity:n});e.push(a.error)}})}return e}function K6(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const i=e.get(n.parent);i?[r.Project,r.DataType].includes(i.type)||t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return n.implements&&Array.isArray(n.implements)?n.implements.forEach(i=>{if(n.id===i){t.push(new E({id:`${n.id}--${i}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at one of the 'implements' references. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));return}const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' property that isn't an array.`,issue:null})),n.extends&&Array.isArray(n.extends)&&n.extends.forEach(i=>{const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to a non-abstract entity. Did you want to use the property 'implements', which holds a list of references to absract entities, instead?`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const ue=class ue{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"static");l(this,"abstract");l(this,"type",r.CustomEntity);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"implements",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestedProperties",[]);l(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let i=t;if(e.parent){const p=D(e.parent);i=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const s=[];e.extends&&e.extends.forEach(p=>{s.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:1,name:e.name,type:r.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},u=R(o,t);return u.setParent(i),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=K6(i,t),o=fo(i,t);a.push(...s,...o,...Pe(i));const u=i.parent?t.get(i.parent):null;if(u&&u.type===r.DataType){const p=u;p.entity&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${p.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
359
+ You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addFunctionCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=D(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initOutputs(),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this}initOutputs(){const e=[];this.outputs=this.initialData.outputs.map(s=>{const o=R(s,this.project);return e.push(o.index),o.setParent(this),o.initChildren(),o});const i=bd(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));i.sort((s,o)=>s.index-o.index);const a=i.map((s,o)=>{const u=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:$.UUID.uuid(),type:r.OutputMap,version:1,declaration:s,index:u,parent:this,writesValues:[]},h=R(p,this.project);return h.setParent(this),h.initChildren(),h});return this.outputs.push(...a),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,version:this.version,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=_6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ge(this.toJSON(),this.project)}};l(ge,"MUTABLE_BASE_PROPERTIES",[]),l(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"MUTABLE_META_PROPERTIES",["x","y"]),l(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),l(ge,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),l(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),l(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Rr=ge;function uv(n){var e,t,i;switch(n.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(m=>!!m.implements.find(T=>T.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(m=>!!m.properties.find(T=>{var b;return T.implements&&T.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=T.getDefaultValue())==null?void 0:b.value)===!0}))){const T=a[0].properties.find(I=>I.implements&&I.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=T==null?void 0:T.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(T!=null&&T.dataType){const I=(t=T==null?void 0:T.dataType)==null?void 0:t.id.split("-id")[0],C=R({id:I+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:T==null?void 0:T.dataType.toReference()},n.project);return C.setParent(T==null?void 0:T.dataType),C.initChildren(),C.addSelfToProject(),{newEntities:[C]}}return{newEntities:[]}}const o=n.project.get(Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),u=ao(o,"Main database");if(u.errors.length>0)return{newEntities:[]};const p=u.implemented.properties.find(m=>m.implements&&m.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),h=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(h)h.value=!0;else if(p!=null&&p.dataType){const m=p==null?void 0:p.dataType.id.split("-id")[0],T=R({id:m+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},n.project);T.setParent(p==null?void 0:p.dataType),T.initChildren(),T.addSelfToProject()}return{newEntities:[u.implemented]}}}return{newEntities:[]}}function pv(n){return n.implements.filter(t=>t.type===r.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(h=>h.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(h=>{var m;return h.implements&&h.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((m=h.getDefaultValue())==null?void 0:m.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),u=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!u){const p=o==null?void 0:o.dataType.id.split("-id")[0],h=R({id:p+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return h.setParent(o==null?void 0:o.dataType),h.initChildren(),h.addSelfToProject(),{newEntities:[h]}}return{newEntities:[]}}}}),{newEntities:[]}}function ao(n,e,t){const i=t||Xt(e,r.CustomEntity,n.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:r.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},u=Zs(o,n.project);if(u.length>0)return{errors:u,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=uv(n),h=R(o,n.project);h.setParent(n.project),h.initChildren();const m=n.properties.map(I=>{const C=s+"-"+Xt(A(I,n.project),r.Property,n.project),G=I.clone(h,C);return G.abstract=!1,G.implements=I,G.setParent(h),h.addProperty(G),G}),T=n.abstractMethods.map(I=>{const C=s+Xt(I.name,r.FunctionDeclaration,n.project),G=I.implementAsFunctionDeclaration(C),J={id:C+"-parent-ref-id",type:r.GenericReference,entityId:i,entityType:r.CustomEntity},xt={...G,implements:I,parent:J},Le=R(xt,n.project);return h.addMethod(Le),Le.setParent(h),Le.initChildren(),Le.implements=I,Le});o.properties=m,o.methods=T;const b=pv(h);return{implemented:h,errors:[],entitiesChanges:{new:[h,...p.newEntities,...b.newEntities],updated:[h],deleted:[]}}}function so(n,e){const t=gr(n);if(t.length===0)return{list:[],last:null};let i=null;return{list:t.flatMap(s=>{if(s===e)return i=s,[s];const o=so(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function yv(n,e,t=new Set){const i=Vn(n),a=Vn(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),u=s.reduce((p,h)=>t.has(h.id)?p:(t.add(h.id),S([...p,...yv(h,e,t)])),[]);return S([...o,...u])}function ua(n,e){const t=so(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function M6(n,e){return!!so(n,e).last}function N6(n){if($e.includes(n.type))return n;if([...Tn,r.VariableDeclaration].includes(n.type)){const e=n.parent;return $e.includes(e.type)?e:null}return null}function md(n,e){if(!n||!e)throw new Error("Both entities must be defined to find a common ancestor");if(n===e)return n;const t=n.parent;if(t){if(t===e)return e;if(t.type===r.Project)return null}else return null;const i=e.parent;if(i){if(i===n)return n;if(i.type===r.Project)return null}else return null;return md(t,i)}function He(n){if(To.includes(n.type)){if(n.type===r.FunctionDeclaration){const e=n.parent;if(e.type===r.CustomEntity)return e}return n}else{const e=n.parent;return e?He(e):null}}function $6(n){return n.type===r.VariableDeclaration?[n]:Ne.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===r.ReturnStatement?n.outputs:Pr.includes(n.type)||n.type===r.FunctionDeclaration?n.inputs:[]}function V6(n){const e=Vn(n),t=[],i=[];Bd.includes(n.type)&&t.push(...Td(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:Tn.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>ua(o,s)?-1:0),i.sort((s,o)=>ua(o,s)?-1:0),[...t,...i,...a]}function hv(n){return[...n].sort((e,t)=>ua(t,e)?-1:0)}function L6(n){const e=hv(n),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];ua(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function _t(n){const e=n.map(t=>He(t));return S(e)}function Td(n){return Ne.includes(n.type)?[..._t(n.successCalls),..._t(n.errorCalls)]:$e.includes(n.type)?_t(n.calls):[]}function G6(n,e){return Td(n).includes(e)}function Ed(n){return n.writesValues||[]}function F6(n,e){return Ed(n).includes(e)}function fv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function U6(n){return n.writesValues}function mv(n=[]){return n.map(fv).filter(e=>!!e)}function oo(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function Tv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function Ev(n){return Fe.includes(n.type)?n:null}function Rv(n){return n.writesValues.map(Ev).filter(e=>!!e)}function bv(n=[]){return n.reduce((e,t)=>t.type===r.OutputMap?[...e,...Rv(t)]:e,[])}function Me(n){return Ne.includes(n.type)?[...br(_t(n.successCalls)),...br(_t(n.errorCalls))]:$e.includes(n.type)?br(_t(n.calls)):[]}function gv(n,e=new Set){return n.writesValues.filter(i=>Fe.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...z(a,e)],[])}function vv(n,e=new Set){var i;return(((i=n.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...z(s,e)],[])}function z(n,e=new Set){if(e.has(n.id))return[];if(n.type===r.ReturnStatement)return Tv(n.outputs).reduce((i,a)=>[...i,...z(a,e)],[]);if(n.type===r.FunctionCall||n.type===r.Operation||n.type===r.Condition)return[...Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]),...mv(n.inputs),...bv(n.outputs)].reduce((s,o)=>[...s,...z(o,e)],[]);if(Pr.includes(n.type)){const t=oo(n.inputs),a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o,e)],[])}if(n.type===r.FunctionDeclaration){const t=[...oo(n.inputs)],a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const i=Me(n).reduce((a,s)=>{const o=He(s);return[...a,...z(o||s,e)]},[]);return[n,...i,...vv(n,e),...gv(n,e)]}return[]}function gt(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...Vn(n).reduce((a,s)=>[...a,s,...gt(s,e)],[])])}function br(n){return n.reduce((e,t)=>t.type===r.ReturnStatement||t.type===r.ContinueStatement||t.type===r.BreakStatement?e:[...e,t,...Me(t)],[])}function Iv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],i=e.reduce((p,h)=>[...p,...h.properties],[]),a=e.reduce((p,h)=>[...p,...h.methods],[]),s=a.reduce((p,h)=>[...p,...oo(h.inputs),...br(_t(h.calls)),...h.returnStatements],[]),o=n.functions.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]),u=n.events.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]);return[...t,...i,...a,...s,...o,...u]}function Pv(n,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case r.FunctionCall:return i.inputs.find(a=>a.id===n.id)!==void 0||i.outputs.find(a=>a.id===n.id)!==void 0;case r.Condition:return i.successCalls.find(a=>a.id===n.id)!==void 0||i.errorCalls.find(a=>a.id===n.id)!==void 0||i.inputs.find(a=>a.id===n.id)!==void 0;case r.Operation:return i.outputs.find(a=>a.id===n.id)!==void 0;case r.VariableDeclaration:return Ne.includes(n.type)?Dv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case r.CustomEntity:return i.properties.find(a=>a.id===n.id)!==void 0||i.methods.find(a=>a.id===n.id)!==void 0;case r.FunctionDeclaration:return i.inputs.find(a=>a.id===n.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function x6(n){const e=Iv(n.project);return Pv(n,e)}function gr(n){const e=[];if(Tn.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const i=[...n.inputs||[],...n.outputs||[]].map(a=>gd(a)).filter(a=>a!==null);e.push(...S(i))}if(Fe.includes(n.type)){const t=gd(n);t&&e.push(t)}return S(e)}function Rd(n){return n.type===r.FunctionCall||n.type===r.InternalCall?n.declaration.inputs:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===r.FunctionDeclaration||Pr.includes(n.type)?n.inputs:n.type===r.Search?n.inputsDeclarations:[]}function j6(n,e){return e.type===r.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===r.FunctionCall||e.type===r.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function Dv(n){return Ne.includes(n.type)?n.inputs:[]}function bd(n){var e;return n.type===r.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===r.Search?n.outputsDeclarations:Oe.includes(n.type)?n.outputs:[]}function k6(n,e){return e.type===r.Condition?null:e.type===r.FunctionCall||e.type===r.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function q6(n){return n.type===r.Condition?[]:Ne.includes(n.type)?n.outputs:[]}function gd(n){const e=n.readsValue;return e?He(e):null}function Av(n){const e=n.internalCalls||[];return S(_t(S(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function ci(n){const e=Ed(n),t=[];return e.forEach(i=>{if(Fe.includes(i.type))t.push(i);else if(i.type===r.InputMap){const a=i.parent;if(a.type===r.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[r.ActionDescriptor].includes(i.parent.type)||t.push(i.parent)}),t}function S(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Vn(n,e=!1){const t=[];if(n.type===r.Project&&t.push(...(n==null?void 0:n.entities)||[],...(n==null?void 0:n.functions)||[],...(n==null?void 0:n.variableDeclarations)||[],...(n==null?void 0:n.variableInstances)||[],...(n==null?void 0:n.searches)||[],...(n==null?void 0:n.loops)||[],...(n==null?void 0:n.operations)||[],...(n==null?void 0:n.conditions)||[],...(n==null?void 0:n.functionCalls)||[],...(n==null?void 0:n.events)||[],...(n==null?void 0:n.projects)||[]),st.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===r.CustomEntity){const i=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:Vn(a));t.push(...i)}if(n.type===r.Condition){const i=n.successCalls.map(s=>He(s)),a=n.errorCalls.map(s=>He(s));t.push(...i,...a)}if(Pr.includes(n.type)){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ci(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}if(Ne.includes(n.type)&&n.type!==r.Condition){const i=n==null?void 0:n.outputs.map(o=>ci(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...S(i),...a,...s)}if(Fe.includes(n.type)){const i=ci(n),a=Av(n);t.push(...i,...a)}if(n.type===r.Loop){const i=n.outputs.map(o=>ci(o)).flat();if(n.body){const o=Vn(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...S(i),...s,...a)}if(n.type===r.FunctionDeclaration){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ci(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}return S(t)}function Sv(n,e=!1){const t=Vn(n,e),i=[...t,...t.reduce((a,s)=>[...a,...Sv(s,e)],[])];return S(i)}function Ov(n){const e=gr(n),t=[...e,...e.reduce((i,a)=>[...i,...Ov(a)],[])];return S(t)}function lo(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...lo(t),...co(t)]:[...e,t.name],[])}function co(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...co(t),...lo(t)]:[...e,t.name],[])}function vd(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...vd(t),...Id(t)]:[...e,t],[])}function Id(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Id(t),...vd(t)]:[...e,t],[])}function Cv(n){return[...co(n),...lo(n)].filter((t,i,a)=>a.indexOf(t)===i)}function Bv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(i=>i.type===r.BuiltInBaseEntity&&i.name===w.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((i,a)=>{if(a.type===r.CustomEntity){const s=Bv(a);if(s)return s}return i},null)}function J6(n){const e=n.extends.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function W6(n){const e=n.implements.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function wv(n){const e=n.extends.find(t=>t.type===r.CustomEntity);return e&&e.type===r.CustomEntity?e:null}function Ln(n){const e=[...n.implements,...n.extends].reduce((t,i)=>i.type===r.BuiltInBaseEntity?[...t,i]:i.type===r.CustomEntity?[...t,...Ln(i)]:t,[]);return S(e)}function _v(n){return n.type===r.PrimitiveEntity?!0:n.type===r.BuiltInBaseEntity?n.interactive:!Ln(n).find(i=>!i.interactive)}function H6(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function Pd(n){return n.parent!==n.project?!1:r.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):r.VariableInstance===n.type?n.project.variableInstances.includes(n):r.FunctionCall===n.type?n.project.functionCalls.includes(n):r.Condition===n.type?n.project.conditions.includes(n):r.Operation===n.type?n.project.operations.includes(n):r.Loop===n.type?n.project.loops.includes(n):r.Search===n.type?n.project.searches.includes(n):!1}function Mv(n){if([...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Pd(n))return!1;const e=gr(n);return e.length===0?!0:e.some(t=>Mv(t))}function Dd(n){return[...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Pd(n)?!1:gr(n).length===0}function Nv(n,e=0){if(Dd(n)){const t=gr(n);return t.length===0?n:t.map(a=>Nv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function $v(n){const e=[];if(Dd(n))e.push(n);else return[];return gr(n).forEach(i=>{e.push(...$v(i))}),e}function Vv(n){return n.type===r.FunctionDeclaration&&n.parent!==n.project&&!![r.CustomEntity,r.Loop,r.InstalledProject].includes(n.parent.type)}function Lv(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function uo(n){switch(n){case r.CustomEntity:return Ir;case r.FunctionDeclaration:return lr;case r.VariableDeclaration:return pr;case r.VariableInstance:return yr;case r.FunctionCall:return Rr;case r.Operation:return cr;case r.Condition:return ur;case r.ReturnStatement:return Tr;case r.Loop:return dr;case r.Search:return hr;case r.InputMap:return hn;case r.OutputMap:return fn;case r.ArgumentDeclaration:return mr;case r.ReturnDeclaration:return Ot;case r.Property:return or;case r.InstalledProject:return fr;case r.Project:return $;case r.BuiltInBaseEntity:return Ut;default:return null}}function ht(n,e){if(st.includes(n.type))return n;if(Dr.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===r.GenericReference){const i=D(t);if(!i)return null;const a=e.get(i);return a?ht(a,e):null}else return t===e?e:ht(t,e)}function Ad(n,e){if(Dr.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const i=Mt(n.parent,e);return i?i===e?st.includes(n.type)?n:null:i.type===r.CustomEntity?n:Ad(i,e):null}function po(n,e,t){if(n===e||e===t||n===t)return!1;const i=ht(e.parent,t);return i===n?!0:po(i,e,t)}var yo=(n=>(n.SameBothLocal="same-both-local",n.AInB="a-in-b",n.BInA="b-in-a",n.ParallelInCommonParent="parallel-in-common-parent",n.ParallelInProject="parallel-in-project",n.AIsGlobalBIsNot="a-is-global-b-is-not",n.BIsGlobalAIsNot="b-is-global-a-is-not",n.SameBothGlobal="same-both-global",n))(yo||{});function pa(n,e,t){const i=ht(n,t),a=ht(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+n.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==r.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===r.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===r.Project&&a.type!==r.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==r.Project&&a.type===r.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(po(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if(po(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const u=md(i,a);return u===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:u}:u?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ht(u,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function Gv(n,e,t){const i=pa(n,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(n===e)return n;let a=ht(n.parent,t);if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;a=ht(a.parent,t)}let s=ht(e.parent,t);if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;s=ht(s.parent,t)}return null}function Fv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,i)=>{const a=Gv(t,i,i.project);return!a||a===i?t:i},n[0])}function Mt(n,e){let t;return typeof n=="string"?t=n:n.type===r.GenericReference?t=D(n):t=n.id,t===e.id?e:e.get(t)}function vr(n){if(Dr.includes(n.type))return n;if(n.type===r.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===r.Project?null:vr(t)}function ya(n,e){var t;if(n.readsValue){const i=Mt(n.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function Sd(n){const e=[];function t(o,u){return e.some(p=>p.blockedByCaller===o&&p.blockedByCalling===u)}function i(o,u){t(o,u)||e.push({blockedByCaller:o,blockedByCalling:u})}const a=Ad(n,n.project);return n.calledBy.forEach(o=>{if([...o.calls||[],...o.successCalls||[],...o.errorCalls||[]].forEach(h=>{Oe.includes(h.type)&&i(o,h)}),o===a)return;let p;if(Ne.includes(o.type))p=o;else if(o.type===r.FunctionDeclaration){const h=He(o);if(h.type===r.CustomEntity)return;h.type===r.Loop&&(p=h)}if(p){const h=Sd(p);h.reachable||(Oe.includes(n.type)?h.blocks.forEach(m=>{i(o,m.blockedByCalling)}):Me(n).find(b=>b===o)||h.blocks.forEach(b=>{i(o,b.blockedByCalling)}))}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Y6(n){return To.includes(n.type)?n.type===r.FunctionDeclaration?!Vv(n):!0:!1}function z6(n){if(r.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return r.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return r.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return r.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return r.Condition}return n.type}function Z6(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const i=e.get(n.parent);i?[r.Project,r.DataType].includes(i.type)||t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return n.implements&&Array.isArray(n.implements)?n.implements.forEach(i=>{if(n.id===i){t.push(new E({id:`${n.id}--${i}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at one of the 'implements' references. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));return}const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' property that isn't an array.`,issue:null})),n.extends&&Array.isArray(n.extends)&&n.extends.forEach(i=>{const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to a non-abstract entity. Did you want to use the property 'implements', which holds a list of references to absract entities, instead?`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const pe=class pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"static");l(this,"abstract");l(this,"type",r.CustomEntity);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"implements",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestedProperties",[]);l(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let i=t;if(e.parent){const p=D(e.parent);i=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const s=[];e.extends&&e.extends.forEach(p=>{s.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:1,name:e.name,type:r.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},u=R(o,t);return u.setParent(i),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Z6(i,t),o=Zs(i,t);a.push(...s,...o,...Pe(i));const u=i.parent?t.get(i.parent):null;if(u&&u.type===r.DataType){const p=u;p.entity&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${p.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
360
360
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
361
- ${Xt({describe_entity:p.entity.id})}
362
- Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return{errors:a,modifiedData:i}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){if(this.parent.type===r.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.properties=this.initialData.properties.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{H6(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),Y6(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),u=R(o,this.project);if(u.suggestion=!0,u.setParent(this),u.initChildren(),u.inputs.forEach(p=>{p.suggestion=!0}),u.returnStatements.length){const p=u.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(u)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.static=e.static||this.static,this.abstract=e.abstract||this.abstract,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.properties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.methods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.properties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(i=>i.toFlat(e)),...this.implements.flatMap(i=>i.toFlat(e)),...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(i=>i.toFlatIds(e)),...this.implements.flatMap(i=>i.toFlatIds(e)),...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e)),...this.implements.flatMap(i=>i.toFlatJSON(e)),...this.extends.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,static:this.static,abstract:this.abstract,extends:this.extends.map(t=>t.id),implements:this.implements.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){return this.errors=W6(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new ue(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return io(this,e,t)}};l(ue,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(ue,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"x","y"]),l(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),l(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),l(ue,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),l(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Pr=ue;function e3(n){const e=NU(),t=n.toJSON();e.safeParse(t).success;const a=[];return Z(n.errors,a)}class Nt{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=e3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Nt(this.toJSON(),this.project)}}function t3(n){const e=BU(),t=n.toJSON();e.safeParse(t).success;const a=[];return Z(n.errors,a)}class xt{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(this,"project");this.initialData=this.initialData||e,this.project=this.project||t,this.id=this.id||e.id,this.version=this.version||e.version,this.name=this.name||e.name,this.static=this.static||e.static,this.interactive=this.interactive||e.interactive,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof xt){const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...i)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove(e={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e)),...this.extends.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e)),...this.extends.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=t3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new xt(this.toJSON(),this.project)}implement(e,t){return io(this,e,t)}}function ma(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new ci(n,e);case r.CustomEntity:return t||new Pr(n,e);case r.PrimitiveEntity:return t||new Nt(n,e);case r.FunctionDeclaration:return t||new lr(n,e);case r.GlobalEvent:return t||new oi(n,e);case r.DataType:return t||new si(n,e);case r.Property:return t||new or(n,e);case r.FunctionCall:return t||new Rr(n,e);case r.Condition:return t||new ur(n,e);case r.Operation:return t||new cr(n,e);case r.VariableDeclaration:return t||new pr(n,e);case r.VariableInstance:return t||new yr(n,e);case r.OutputMap:return t||new fn(n,e);case r.ReturnDeclaration:return t||new Ot(n,e);case r.ArgumentDeclaration:return t||new mr(n,e);case r.InputMap:return t||new hn(n,e);case r.Project:return t||new Dr(n);case r.InstalledProject:return t||new fr(n,e);case r.ActionDescriptor:return t||new _e(n,e);case r.ReturnStatement:return t||new Tr(n,e);case r.Loop:return t||new dr(n,e);case r.Search:return t||new hr(n,e);case r.ValueDescriptor:return t||new Er(n,e);case r.BuiltInBaseEntity:return t||new xt(n,e);case r.InternalCall:return t||new li(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new di(n,e);default:throw new Error("Invalid entity type: "+n.type)}}function R(n,e){if(!n)throw new Error("Entity is null");const t=ma(n,e);return t.subscribe(),t}function n3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return ci.fromGenerationTarget(n,e);case r.CustomEntity:return Pr.fromGenerationTarget(n,e);case r.FunctionDeclaration:return lr.fromGenerationTarget(n,e);case r.GlobalEvent:return oi.fromGenerationTarget(n,e);case r.DataType:return si.fromGenerationTarget(n,e);case r.Property:return or.fromGenerationTarget(n,e);case r.FunctionCall:return Rr.fromGenerationTarget(n,e);case r.Condition:return ur.fromGenerationTarget(n,e);case r.Operation:return cr.fromGenerationTarget(n,e);case r.VariableDeclaration:return pr.fromGenerationTarget(n,e);case r.VariableInstance:return yr.fromGenerationTarget(n,e);case r.OutputMap:return fn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ot.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return mr.fromGenerationTarget(n,e);case r.InputMap:return hn.fromGenerationTarget(n,e);case r.InstalledProject:return fr.fromGenerationTarget(n,e);case r.ReturnStatement:return Tr.fromGenerationTarget(n,e);case r.Loop:return dr.fromGenerationTarget(n,e);case r.Search:return hr.fromGenerationTarget(n,e);case r.ActionDescriptor:return _e.fromGenerationTarget(n,e);case r.ValueDescriptor:return Er.fromGenerationTarget(n,e);case r.InternalCall:return li.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return di.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const pe=class pe{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",r.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);this.initialData=e,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=0,this.y=0}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async i=>{await t.init(this),i(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(){return this.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),this}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeBuiltInInstance(e){return(!this.builtInInstances[e.id]||this.builtInInstances[e.id]!==e)&&(this.builtInInstances[e.id]=e),this}subscribe(){return this}unsubscribe(){return this}unsubscribeInstance(e){return delete this.instances[e.id],this}findSubscribedInstance(e){return this.instances[e.id]||null}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getManaged(e){return this.instances[e]||null}getBuiltIn(e){return this.builtInInstances[e]||null}findSubscribedInstanceFromReference(e){return this.instances[e.entityId]||null}findSubscribedBuiltInInstanceFromReference(e){return this.builtInInstances[e.entityId]||null}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e}={ignoreUpstream:!1}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}getAllBuiltInIds(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlatIds(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlatIds(e)),...this.operationDeclarations.flatMap(t=>t.toFlatIds(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlatIds(e)),...this.loopDeclarations.flatMap(t=>t.toFlatIds(e)),...this.conditionDeclarations.flatMap(t=>t.toFlatIds(e)),...this.valueDescriptors.flatMap(t=>t.toFlatIds(e)),...this.dataTypes.flatMap(t=>t.toFlatIds(e))]}getAllBuiltIn(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlat(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlat(e)),...this.operationDeclarations.flatMap(t=>t.toFlat(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlat(e)),...this.loopDeclarations.flatMap(t=>t.toFlat(e)),...this.conditionDeclarations.flatMap(t=>t.toFlat(e)),...this.valueDescriptors.flatMap(t=>t.toFlat(e)),...this.dataTypes.flatMap(t=>t.toFlat(e))]}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlat(e)),...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e)),...this.projects.flatMap(i=>i.toFlat(e)),...this.variableDeclarations.flatMap(i=>i.toFlat(e)),...this.variableInstances.flatMap(i=>i.toFlat(e)),...this.conditions.flatMap(i=>i.toFlat(e)),...this.operations.flatMap(i=>i.toFlat(e)),...this.functionCalls.flatMap(i=>i.toFlat(e)),...this.loops.flatMap(i=>i.toFlat(e)),...this.searches.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+G.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatJSON(e)),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e)),...this.projects.flatMap(i=>i.toFlatJSON(e)),...this.variableDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.variableInstances.flatMap(i=>i.toFlatJSON(e)),...this.conditions.flatMap(i=>i.toFlatJSON(e)),...this.operations.flatMap(i=>i.toFlatJSON(e)),...this.functionCalls.flatMap(i=>i.toFlatJSON(e)),...this.loops.flatMap(i=>i.toFlatJSON(e)),...this.searches.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e)),...this.projects.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(i=>i.toFlatGenerationTarget(e)),...this.conditions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.operations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.loops.flatMap(i=>i.toFlatGenerationTarget(e)),...this.searches.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.entities.forEach(e=>e.clearErrors()),this.projects.forEach(e=>e.clearErrors()),this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this.variableDeclarations.forEach(e=>e.clearErrors()),this.variableInstances.forEach(e=>e.clearErrors()),this.conditions.forEach(e=>e.clearErrors()),this.operations.forEach(e=>e.clearErrors()),this.functionCalls.forEach(e=>e.clearErrors()),this.loops.forEach(e=>e.clearErrors()),this.searches.forEach(e=>e.clearErrors()),this}validate(){const e=m8(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new pe(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(i=>i.id===e.id);if(t>-1){const i=this.entities[t];return this.entities.splice(t,1),i}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(i=>i.id===e.id);if(t>-1){const i=this.functions[t];return this.functions.splice(t,1),i}return null}removeExternalProject(e){const t=this.projects.findIndex(i=>i.id===e.id);if(t>-1){const i=this.projects[t];return this.projects.splice(t,1),i}return null}removeGlobalEvent(e){const t=this.events.findIndex(i=>i.id===e.id);if(t>-1){const i=this.events[t];return this.events.splice(t,1),i}return null}removeTopLevelVariableDeclaration(e){if(e.type!==r.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(i=>i.id===e.id);if(t>-1){const i=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),i}return null}getEntryPoints(){return[...this.functions,...this.events,...this.entities.flatMap(t=>t.methods)]}getFunctionDeclaration(e){return this.functions.find(t=>t.id===e)||null}getConditions(){return[...this.conditions,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=z(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(i=>{if(!i.declaration){const a=i.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(u=>u.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===w.PERSISTED_ENTITY)||null}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Dr=pe;class kv extends _e{constructor(t){super($t,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",$t);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async()=>{});this.project=t,this.fixedArguments=$t.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=$t.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=$t.error?R($t.error,this.project):null}}class qv extends _e{constructor(t){super(ot,t);l(this,"id",ot.id);l(this,"name",ot.name);l(this,"description",ot.description);l(this,"version",ot.version);l(this,"autoexecutable",!1);l(this,"initialData",ot);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[0])=>{const i=t[0];return[new Promise(s=>{setTimeout(()=>{s()},i)})]});this.project=t,this.fixedArguments=ot.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ot.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ot.error?R(ot.error,this.project):null}}class Jv extends _e{constructor(t){super(tn,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",tn);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[[]])=>[[]]);this.project=t,this.fixedArguments=tn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=tn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=tn.error?R(tn.error,this.project):null}}function r3(n){const e=[new Jv(n),new kv(n),new qv(n),new _e(mi,n),new _e(Cr,n),new _e(jn,n),new _e(ga,n),new _e(Do,n),new _e(Oo,n),new _e(So,n),new _e(Ea,n),new _e(hi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class Wv extends xt{constructor(t){super(Be,t);l(this,"initialData");l(this,"id",w.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",w.PERSISTED_ENTITY);l(this,"description",Be.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",Be.abstract);l(this,"static",Be.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Be,this.project=t,this.id=Be.id,this.version=Be.version,this.name=Be.name,this.static=Be.static,this.abstract=Be.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function i3(n){const e=[new Wv(n),new xt(Ca,n),new xt(bn,n),new xt(Jo,n),new xt(Oa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function a3(n){const e=[new Nt(F,n),new Nt(xn,n),new Nt(Ce,n),new Nt(Xe,n),new Nt(Rn,n),new Nt(Or,n),new Nt(Ta,n),new Nt(go,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function s3(n){const e=[new _e(Na,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function o3(n){const e=[new _e(kn,n),new _e(Fo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function l3(n){const e=[new Er(zo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function c3(n){const e=[new _e(qn,n),new _e(wr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const pi={},To={};async function d3(n,e={}){const t={...eb};return t.id=n.id,e.empty?{data:{id:n.id,type:r.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function Hv(n){const e=new Dr(n);return a3(e),i3(e),r3(e),s3(e),o3(e),l3(e),c3(e),e.initChildren(),e}async function u3(n,e={}){try{if(n.id&&pi[n.id])return pi[n.id];if(n.id&&To[n.id])return await To[n.id],pi[n.id];const t=d3(n,e);n.id&&(To[n.id]=t);const i=await t;if(i.data){const a=Hv(i.data);return pi[n.id]=a,n.id&&delete To[n.id],a}return null}catch(t){return console.error("Error fetching project",t),null}}function p3(n){return pi[n.id]&&delete pi[n.id],null}const y3="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=dd,d.ActionDescriptorState=_e,d.ActionDescriptorValuesType=V,d.ActionInputMapState=e6,d.ActionOutputMapState=r6,d.AppendToListOperationInputIds=op,d.AppendToListOperationOutputIds=lp,d.ArgumentDeclarationState=mr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=sd,d.BUILT_IN_BASE_ENTITY_IDS=Ve,d.BUILT_IN_ENTITY_TYPES=Sr,d.BaseCanvasDraggableState=G9,d.BaseEntityNames=w,d.BaseState=L9,d.BaseValueDescriptorIds=$o,d.BreakStatementState=di,d.BuiltInBaseEntityState=xt,d.CALLABLE_ENTITIES_EXPLANATION=f6,d.CALLABLE_TYPES=En,d.CALLER_ENTITIES_EXPLANATION=zg,d.CALLER_TYPES=en,d.CALLS_UPDATE_EXPLANATION=$n,d.COMPARISON_CONDITIONS=im,d.CONDITIONS=gI,d.CUSTOM_ENTITY_OPERATIONS=vy,d.CallableEntityClass=x9,d.CallerEntityClass=ed,d.ChildEntityState=F9,d.ComparisonOperatorTypes=Ae,d.ConditionState=ur,d.ContinueStatementState=yt,d.CreateNewInputIds=Qp,d.CreateNewOutputIds=Kp,d.CustomEntityState=Pr,d.DRAGGABLE_CALLABLE_TYPES=Ro,d.DRAGGABLE_CALLER_TYPES=Nd,d.DRAGGABLE_ELEMENT_TYPES=bo,d.DRAGGABLE_EXECUTABLE_TYPES=Zv,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Eo,d.DataTypeCompatibilityTypes=wt,d.DataTypeParentChildRelation=qe,d.DataTypeState=si,d.ENTITIES_WITH_VALLUES_EXPLANATION=Ks,d.ENTITY_TYPES=Xv,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,d.ENTITY_WITH_NAMES_TYPES=$d,d.ENTITY_WITH_VALUE_TYPES=Md,d.ENTRY_POINT_ENTITIES_EXPLANATION=ua,d.ENTRY_POINT_TYPES=$e,d.EVENT_TYPES=Ar,d.EXECUTABLE_TYPES=zv,d.EXECUTION_OPERATIONS=Xp,d.EntityError=Qn,d.EntityErrorSeverity=f,d.EntityGenerationError=E,d.EntityGenerationErrorCode=y,d.EntityInstanceErrorCode=M,d.EntityOperations=Ze,d.EntityType=r,d.EntityWithLogicScopeClass=q9,d.EntityWithValueClass=k9,d.EntryPointEntityClass=U9,d.ExecutionOperations=Ie,d.FunctionCallState=Rr,d.FunctionDeclarationState=lr,d.GLOBAL_EVENT_DECLARATIONS=vI,d.GetLastInListOperationInputIds=zu,d.GetLastInListOperationOutputIds=Zu,d.GlobalEventNames=Kt,d.GlobalEventState=oi,d.HTTPOperations=Ye,d.HTTP_OPERATIONS=nh,d.InputMapState=hn,d.InstalledProjectState=fr,d.InternalCallState=li,d.JoinListOperationInputIds=fu,d.JoinListOperationOutputIds=mu,d.JoinStringOperationInputIds=tu,d.JoinStringOperationOutputIds=nu,d.LIST_OPERATIONS=gp,d.ListOperations=j,d.LoopState=dr,d.LoopTypes=je,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Vn,d.NUMBER_OPERATIONS=eu,d.NumberAdditionOperationInputIds=Ud,d.NumberAdditionOperationOutputIds=jd,d.NumberOperations=at,d.OPERATION_DECLARATIONS=Kv,d.OperationState=cr,d.OutputMapParentChildRelation=_d,d.OutputMapState=fn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=eo,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Nn,d.PASS_THROUGH_CALLABLE_TYPES=Ne,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=cd,d.ParallelExecutionOperation=kv,d.ParallelExecutionOperationInputIds=vp,d.ParallelExecutionOperationOutputIds=Ip,d.PassThroughCallableEntityClass=j9,d.PersistedEntity=Wv,d.PersistedEntityMethods=vt,d.PrimitiveEntityState=Nt,d.PrimitiveTypes=g,d.PrimitiveValueState=ci,d.ProjectState=Dr,d.PropertyState=or,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=m6,d.ReturnDeclarationState=Ot,d.ReturnStatementState=Tr,d.STANDALONE_CONDITIONS=Qf,d.STRING_OPERATIONS=hu,d.ScopeCompatibilityType=po,d.SearchState=hr,d.SequentialExecutionOperation=Jv,d.SequentialExecutionOperationInputIds=xp,d.SequentialExecutionOperationOutputIds=Up,d.SharedEntityErrorCode=v,d.SharedStateFunctionality=Wg,d.SplitListOperationInputIds=wu,d.SplitListOperationOutputIds=_u,d.StandaloneOperatorTypes=Ct,d.StringOperations=ve,d.TERMINATION_TYPES=Oe,d.USER_MANAGED_ENTITY_TYPES=Qv,d.UUID=G,d.UUIDInstance=mo,d.UserManagedEntityStateFunctionality=V9,d.VALUE_READING_ENTITIES_EXPLANATION=ld,d.VALUE_READING_TYPES=Fn,d.VALUE_WRITING_ENTITIES_EXPLANATION=Zg,d.VALUE_WRITING_TYPES=Se,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=od,d.VARIABLE_TYPES=Fe,d.ValidationInputIds=ly,d.ValidationOutputIds=cy,d.ValueAutogenerationType=Ue,d.ValueDescriptorParentChildRelation=O,d.ValueDescriptorState=Er,d.ValueReadingEntityClass=ca,d.ValueWritingEntityClass=da,d.VariableDeclarationState=pr,d.VariableInputMapState=K9,d.VariableInstanceState=yr,d.VariableOutputMapState=n6,d.WaitOperation=qv,d.WaitOperationInputIds=Mp,d.WaitOperationOutputIds=Np,d.appendToListOperation=ga,d.appendToListOperationElementToAppendArgument=Bo,d.appendToListOperationElementToAppendArgumentParentRef=mp,d.appendToListOperationElementToAppendArgumentRef=up,d.appendToListOperationError=bp,d.appendToListOperationErrorParentRef=Rp,d.appendToListOperationListArgument=Co,d.appendToListOperationListArgumentParentRef=fp,d.appendToListOperationListArgumentRef=cp,d.appendToListOperationListDataType=dp,d.appendToListOperationResultListDataType=hp,d.appendToListOperationResultListReturn=Ep,d.appendToListOperationResultListReturnParentRef=Tp,d.appendToListOperationResultListReturnRef=yp,d.appendToListOperationSecondListDataType=pp,d.asGenerationActionExample=Xt,d.baseHttpRequestFunctionDeclaration=mi,d.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Go,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=th,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=eh,d.baseHttpRequestFunctionDeclarationRef=Zy,d.baseHttpRequestFunctionDeclarationRefEight=Qy,d.baseHttpRequestFunctionDeclarationRefFive=Yy,d.baseHttpRequestFunctionDeclarationRefFour=Hy,d.baseHttpRequestFunctionDeclarationRefNine=Ky,d.baseHttpRequestFunctionDeclarationRefSeven=Xy,d.baseHttpRequestFunctionDeclarationRefSix=zy,d.baseHttpRequestFunctionDeclarationRefThree=Wy,d.baseHttpRequestFunctionDeclarationRefTwo=Jy,d.booleanPrototype=xn,d.capitalizeFirstLetter=bs,d.checkAreCustomEntitiesCompatibleAsDataType=pg,d.checkAreDataTypesCompatible=Os,d.checkArePropertiesCompatibleAsDataType=ug,d.checkIsBranchDependentButNotDirectlyOnBranch=ya,d.checkIsBranchDependentOnBranch=D6,d.checkIsCallableEntityReachable=Id,d.checkIsCanvasEntity=x6,d.checkIsDetachedBranch=Sv,d.checkIsDetachedBranchShallow=gd,d.checkIsGlobalVariable=F6,d.checkIsGloballyDeclared=bd,d.checkIsMethod=Bv,d.checkIsNestedScope=uo,d.checkScopeCompatibility=ha,d.createEntityError=H,d.createNewInstanceOperation=Cr,d.createNewInstanceOperationEntityToInstanciateArgument=ry,d.createNewInstanceOperationEntityToInstanciateArgumentRef=ey,d.createNewInstanceOperationEntityToInstanciateDataType=ty,d.createNewInstanceOperationError=oy,d.createNewInstanceOperationErrorParentRef=sy,d.createNewInstanceOperationOutputEntityDeclaration=ay,d.createNewInstanceOperationOutputEntityDeclarationParentRef=iy,d.createNewInstanceOperationRef=ny,d.createSemanticId=Qt,d.createStateFromGenerationTargetType=n3,d.createStateFromType=ma,d.createStateFromTypeAndSubscribe=R,d.cronJobBuiltInBaseEntity=Jo,d.cronJobBuiltInBaseEntityExpressionProperty=Yf,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=EI,d.cronJobBuiltInBaseEntityExpressionPropertyRef=Wf,d.cronJobBuiltInBaseEntityRef=Hf,d.cronJobTriggeredFunctionDeclarationBlueprint=qo,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=qf,d.customEntityToZodSchema=vm,d.dataTypeCompatibilityToErrorExplanation=iv,d.datePrototype=Or,d.dateValueAutogenerationSchema=Jc,d.deletePersistedEntityMethod=ko,d.deletePersistedEntityMethodParentRef=vf,d.deleteRootProject=p3,d.endpointBuiltInBaseEntity=Ca,d.endpointBuiltInBaseEntityRef=Ih,d.endpointBuiltInBaseEntityRefFour=pf,d.endpointBuiltInBaseEntityRefThree=_h,d.endpointBuiltInBaseEntityRefTwo=Oh,d.endpointBuiltInCorsProperty=Ph,d.endpointBuiltInCorsPropertyDataType=vh,d.endpointBuiltInCorsPropertyDataTypeRef=bh,d.endpointBuiltInCorsPropertyRef=gh,d.endpointBuiltInMethodProperty=Uo,d.endpointBuiltInMethodPropertyDataType=wh,d.endpointBuiltInMethodPropertyDataTypeRef=Ch,d.endpointBuiltInMethodPropertyRef=Bh,d.endpointBuiltInPathProperty=xo,d.endpointBuiltInPathPropertyDataType=Sh,d.endpointBuiltInPathPropertyDataTypeRef=Dh,d.endpointBuiltInPathPropertyRef=Ah,d.endpointPathParamsArgumentDeclaration=Hh,d.endpointPathParamsArgumentDeclarationRef=jh,d.endpointPathParamsVariableDataType=kh,d.endpointPathParamsVariableDataTypeRef=Uh,d.endpointReachedTriggerActionDescriptor=jo,d.endpointReachedTriggerActionDescriptorRef=qh,d.endpointReachedTriggerActionDescriptorRefFour=Zh,d.endpointReachedTriggerActionDescriptorRefThree=Yh,d.endpointReachedTriggerActionDescriptorRefTwo=Wh,d.endpointRequestBodyArgumentDeclaration=Xh,d.endpointRequestBodyArgumentDeclarationRef=Vh,d.endpointRequestBodyVariableDataType=Lh,d.endpointRequestHeadersArgumentDeclaration=Jh,d.endpointRequestHeadersArgumentDeclarationRef=Nh,d.endpointRequestHeadersVariableDataType=$h,d.endpointRequestHeadersVariableDataTypeRef=Mh,d.endpointRequestQueryParamsArgumentDeclaration=zh,d.endpointRequestQueryParamsArgumentDeclarationRef=Fh,d.endpointRequestQueryParamsVariableDataType=xh,d.endpointRequestQueryParamsVariableDataTypeRef=Gh,d.endpointResponseBodyDataType=cf,d.endpointResponseBodyReturnDeclaration=uf,d.endpointResponseBodyReturnDeclarationRef=lf,d.endpointResponseCodeDataType=Kh,d.endpointResponseCodeReturnDeclaration=tf,d.endpointResponseCodeReturnDeclarationRef=Qh,d.endpointResponseHeadersDataType=af,d.endpointResponseHeadersDataTypeRef=nf,d.endpointResponseHeadersReturnDeclaration=of,d.endpointResponseHeadersReturnDeclarationRef=rf,d.endpointReturnStatementRef=ef,d.endpointReturnStatementRefThree=df,d.endpointReturnStatementRefTwo=sf,d.enumOptionsProperty=xd,d.enumOptionsPropertyDataType=Gd,d.enumOptionsPropertyDataTypeRef=Vd,d.enumOptionsPropertyRef=Ld,d.enumPrototype=Rn,d.enumPrototypeRef=Fd,d.executionBuiltInEntity=Ho,d.executionBuiltInEntityAbortMethod=Wo,d.executionBuiltInEntityAbortMethodParentRef=zf,d.filterOutDuplicateEntities=S,d.filterOutDuplicateErrors=YF,d.findReferenceToSelfInList=Ev,d.findReferencesToSelfInProject=M6,d.flattenCalls=br,d.flattenCanvasAncestorsUntil=ao,d.flattenCustomEntityExtensionAndImplementationTypes=Iv,d.flattenCustomEntityExtensionTypes=lo,d.flattenCustomEntityExtensions=Ed,d.flattenCustomEntityImplementations=Rd,d.flattenCustomEntityImplementionTypes=oo,d.flattenDerivedCanvasEntities=gt,d.flattenDetachedBranch=Cv,d.flattenElementCalls=Me,d.flattenProjectElements=Tv,d.flattenRelatedCanvasElementsOnTheLeft=vv,d.flattenRelatedCanvasElementsOnTheRight=gv,d.flattenVariableReads=mv,d.flattenVariableWrites=fv,d.flattenVariables=z,d.fromZodParseToEntityGenerationErrors=rd,d.generate=RD,d.generateActionExample=T6,d.generateExecutionDataType=yg,d.generateMutablePropertiesExplanation=Zs,d.generateRandomBoolean=Ym,d.generateRandomDate=Am,d.generateRandomDateAfter=Im,d.generateRandomDateBefore=Pm,d.generateRandomDateBetweenRange=Dm,d.generateRandomNumber=km,d.generateRandomNumberAfter=xm,d.generateRandomNumberBefore=Um,d.generateRandomNumberBetweenRange=jm,d.generateRandomText=Hm,d.generateRandomTextAfter=qm,d.generateRandomTextBefore=Jm,d.generateRandomTextBetweenRange=Wm,d.generateUniqueUUID=Fm,d.getAllActionDescriptorsForConditions=ro,d.getAllActionDescriptorsForGlobalEvents=to,d.getAllActionDescriptorsForLoops=no,d.getAllActionDescriptorsForOperations=g6,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=tv,d.getBaseBuiltInEntities=Gn,d.getBaseSchemaBasedOnType=Hg,d.getBuiltInEntityOwner=vr,d.getCallableEntityReferenceSchema=ke,d.getCallableEntityTypeSchema=jg,d.getCallerEntityReferenceSchema=X8,d.getCallerEntityTypeSchema=Z8,d.getCalls=yd,d.getCanvasEntitiesDerivedFromInternalCalls=bv,d.getCanvasEntitiesDerivedFromWrites=ui,d.getCanvasEntityDerivedFromValueReadingEntity=Td,d.getCanvasEntityReferenceSchema=h9,d.getCanvasEntityTypeSchema=y9,d.getChildrenEntityWithValues=S6,d.getCommonAncestor=pd,d.getCommonChildren=ov,d.getDeclaration=td,d.getDeepestScope=Mv,d.getDraggableCallableEntityReferenceSchema=qg,d.getDraggableCallableEntityTypeSchema=kg,d.getDraggableCallerEntityReferenceSchema=K8,d.getDraggableCallerEntityTypeSchema=Q8,d.getDraggableExecutableEntityReferenceSchema=r9,d.getDraggableExecutableEntityTypeSchema=n9,d.getDraggablePassThroughCallableEntityReferenceSchema=zs,d.getDraggablePassThroughCallableEntityTypeSchema=Ys,d.getDraggablePlayableEntityReferenceSchema=l9,d.getDraggablePlayableEntityTypeSchema=o9,d.getEntityArgumentDeclarations=fd,d.getEntityInputMaps=Rv,d.getEntityOutputMaps=V6,d.getEntityReferenceSchema=p9,d.getEntityReturnDeclarations=md,d.getEntityTypeSchema=u9,d.getEntityWithLogicScopeReferenceSchema=pn,d.getEntityWithLogicScopeTypeSchema=i9,d.getEntityWithValueReferenceSchema=Ug,d.getEntityWithValueTypeSchema=z8,d.getEntryPointEntityReferenceSchema=xe,d.getEntryPointEntityTypeSchema=Mn,d.getEventEntityReferenceSchema=Ws,d.getEventEntityTypeSchema=Js,d.getExecutableEntityReferenceSchema=t9,d.getExecutableEntityTypeSchema=e9,d.getExtendedBuiltInEntity=L6,d.getExtendedCustomEntity=Dv,d.getGenerationTargetSchemaBasedOnType=Yg,d.getHeadIfPartOfDetachedBranch=Ov,d.getHighestScope=_v,d.getImplementedBuiltInEntity=G6,d.getIsInteractive=Av,d.getLastInListOperation=Oo,d.getLastInListOperationError=sp,d.getLastInListOperationErrorParentRef=ap,d.getLastInListOperationInputListArgument=np,d.getLastInListOperationInputListArgumentParentRef=tp,d.getLastInListOperationInputListArgumentRef=Xu,d.getLastInListOperationInputListDataType=Qu,d.getLastInListOperationOutputElementDataType=ep,d.getLastInListOperationOutputElementReturn=ip,d.getLastInListOperationOutputElementReturnParentRef=rp,d.getLastInListOperationOutputElementReturnRef=Ku,d.getLinkedEntitiesFromArgumentDeclaration=_6,d.getLowestPersistedEntityImplementation=Pv,d.getParentCanvasEntities=_t,d.getParentCanvasEntity=He,d.getParentEntryPoint=A6,d.getPassThroughCallableEntityReferenceSchema=ye,d.getPassThroughCallableEntityTypeSchema=Hs,d.getPlayableEntityReferenceSchema=s9,d.getPlayableEntityTypeSchema=a9,d.getProject=u3,d.getPrototypeByType=co,d.getReferenceEntityId=D,d.getReferencedEntitiesStateOrErrors=Qs,d.getReferencedEntityStateOrErrors=id,d.getRelatedCanvasElementsOnTheLeft=gr,d.getRelatedCanvasElementsOnTheRight=Ln,d.getRootEntryPointScopeOwner=vd,d.getScopeOwner=ht,d.getTerminationReferenceSchema=d9,d.getTerminationTypeSchema=c9,d.getUsedArgFromDeclaration=N6,d.getUsedReturnFromDeclaration=$6,d.getValueReadingEntityReferenceSchema=xg,d.getValueReadingEntityTypeSchema=un,d.getValueWritingEntityReferenceSchema=Y8,d.getValueWritingEntityTypeSchema=la,d.getVariableFromInputMapping=cv,d.getVariableFromReturnVariablePointer=pv,d.getVariableReferenceSchema=_n,d.getVariableTypeSchema=ar,d.getVariablesFromArgumentDeclarations=so,d.getVariablesFromInputMaps=dv,d.getVariablesFromOutputMapping=yv,d.getVariablesFromOutputMaps=hv,d.getVariablesFromReturnDeclarations=uv,d.getVariablesInSameOrHigherScope=nd,d.getWrites=hd,d.groupCallsBasedOnParallelizableExecution=C6,d.handleAfterEntityImplementationSideEffects=sv,d.handleBeforeEntityImplementationSideEffects=av,d.httpRequestBodyArgument=Da,d.httpRequestBodyArgumentRef=$y,d.httpRequestBodyDataType=Vy,d.httpRequestHeadersArgument=Pa,d.httpRequestHeadersArgumentRef=My,d.httpRequestHeadersDataType=Ny,d.httpRequestMethodArgument=va,d.httpRequestMethodArgumentRef=wy,d.httpRequestMethodDataType=_y,d.httpRequestMethodDataTypeRef=Cy,d.httpRequestQueryParamsArgument=Vo,d.httpRequestQueryParamsArgumentRef=Sy,d.httpRequestQueryParamsDataType=Oy,d.httpRequestVariableURLArgument=Ia,d.httpRequestVariableURLArgumentRef=Dy,d.httpRequestVariableURLDataType=Ay,d.httpRequestVariableURLDataTypeRef=Iy,d.httpResponseBodyReturnDataType=qy,d.httpResponseBodyReturnDataTypeRef=jy,d.httpResponseBodyReturnReturn=fi,d.httpResponseBodyReturnReturnRef=ky,d.httpResponseCodeDataType=Gy,d.httpResponseCodeReturn=Lo,d.httpResponseCodeReturnRef=Ly,d.httpResponseHeadersDataType=Uy,d.httpResponseHeadersDataTypeRef=Fy,d.httpResponseHeadersReturn=Aa,d.httpResponseHeadersReturnRef=xy,d.implement=io,d.inferArgumentDeclarationDataType=hg,d.inferDataType=Cs,d.inferInputMapDataType=fg,d.inferOutputMapDataType=Eg,d.inferVariableDeclarationDataType=Tg,d.inferVariableInstanceDataType=mg,d.initProject=Hv,d.iterateOverListActionDescriptor=kn,d.iterateOverListActionDescriptorListArgumentDeclaration=ch,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=oh,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=sh,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=lh,d.iterateOverListActionDescriptorReturnDeclaration=ah,d.iterateOverListActionDescriptorReturnDeclarationParentRef=ih,d.joinListOperation=Do,d.joinListOperationError=Bu,d.joinListOperationErrorParentRef=Cu,d.joinListOperationFirstListArgument=Pu,d.joinListOperationFirstListArgumentParentRef=Iu,d.joinListOperationFirstListArgumentRef=Tu,d.joinListOperationFirstListDataType=Eu,d.joinListOperationResultListDataType=vu,d.joinListOperationResultListReturn=Ou,d.joinListOperationResultListReturnParentRef=Su,d.joinListOperationResultListReturnRef=gu,d.joinListOperationSecondListArgument=Au,d.joinListOperationSecondListArgumentParentRef=Du,d.joinListOperationSecondListArgumentRef=Ru,d.joinListOperationSecondListDataType=bu,d.joinListWithLastSeparator=N,d.joinStringOperation=hi,d.joinStringOperationError=yu,d.joinStringOperationErrorParentRef=pu,d.joinStringOperationFirstStringArgument=Ra,d.joinStringOperationFirstStringArgumentParentRef=cu,d.joinStringOperationFirstStringArgumentRef=ru,d.joinStringOperationFirstStringDataType=iu,d.joinStringOperationResultStringDataType=lu,d.joinStringOperationResultStringReturn=yi,d.joinStringOperationResultStringReturnParentRef=uu,d.joinStringOperationResultStringReturnRef=ou,d.joinStringOperationSecondStringArgument=ba,d.joinStringOperationSecondStringArgumentParentRef=du,d.joinStringOperationSecondStringArgumentRef=au,d.joinStringOperationSecondStringDataType=su,d.jsonPrototype=go,d.keyValueParamBuiltInBaseEntity=Oa,d.keyValueParamBuiltInBaseEntityNameProperty=mh,d.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=tI,d.keyValueParamBuiltInBaseEntityNamePropertyParentRef=fh,d.keyValueParamBuiltInBaseEntityNamePropertyRef=hh,d.keyValueParamBuiltInBaseEntityValueProperty=Rh,d.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=rI,d.keyValueParamBuiltInBaseEntityValuePropertyParentRef=Eh,d.keyValueParamBuiltInBaseEntityValuePropertyRef=Th,d.lowercaseFirstLetter=tb,d.manualFlowActionDescriptor=Fo,d.manualFlowActionDescriptorDeclarationReturnDeclaration=yh,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=uh,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=dh,d.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=ph,d.mapActionDescriptorToTypeItRepresents=U6,d.mergeEntityErrorsList=zF,d.mergeListOfEntities=wv,d.methodDefaultValue=By,d.mockClientProject=eb,d.moreThanOrEqualCondition=wr,d.moreThanOrEqualConditionLeftHandArgument=tm,d.moreThanOrEqualConditionLeftHandArgumentParentRef=em,d.moreThanOrEqualConditionRightHandArgument=rm,d.moreThanOrEqualConditionRightHandArgumentParentRef=nm,d.notEmptyCondition=qn,d.notEmptyConditionArgument=Xf,d.notEmptyConditionRef=Zf,d.numberAdditionOperation=Ea,d.numberAdditionOperationError=Kd,d.numberAdditionOperationErrorParentRef=Qd,d.numberAdditionOperationFirstNumberArgument=vo,d.numberAdditionOperationFirstNumberArgumentRef=kd,d.numberAdditionOperationFirstNumberDataType=qd,d.numberAdditionOperationRef=zd,d.numberAdditionOperationRefThree=Xd,d.numberAdditionOperationRefTwo=Zd,d.numberAdditionOperationResultNumberDataType=Yd,d.numberAdditionOperationResultNumberReturn=Po,d.numberAdditionOperationResultNumberReturnRef=Hd,d.numberAdditionOperationSecondNumberArgument=Io,d.numberAdditionOperationSecondNumberArgumentRef=Jd,d.numberAdditionOperationSecondNumberDataType=Wd,d.numberPrototype=Ce,d.numberValueAutogenerationSchema=qc,d.parallelExecutionOperation=$t,d.parallelExecutionOperationError=_p,d.parallelExecutionOperationErrorParentRef=wp,d.parallelExecutionOperationListOfExecutionResultsDataType=Op,d.parallelExecutionOperationListOfExecutionResultsReturn=_o,d.parallelExecutionOperationListOfExecutionResultsReturnRef=Sp,d.parallelExecutionOperationListOfFunctionsArgument=wo,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=Ap,d.parallelExecutionOperationListOfFunctionsArgumentRef=Dp,d.parallelExecutionOperationListOfFunctionsBlueprint=Pp,d.parallelExecutionOperationRef=Cp,d.parallelExecutionOperationRefThree=Bp,d.persistedBuiltInBaseEntity=Be,d.persistedBuiltInBaseEntityCreatedAtProperty=Ff,d.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Lf,d.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=mI,d.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Gf,d.persistedBuiltInBaseEntityCreatedAtPropertyRef=Vf,d.persistedBuiltInBaseEntityDatabaseProperty=Ei,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=pI,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=Sf,d.persistedBuiltInBaseEntityDatabasePropertyRef=Af,d.persistedBuiltInBaseEntityDeletedAtProperty=$f,d.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Mf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=fI,d.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Nf,d.persistedBuiltInBaseEntityDeletedAtPropertyRef=_f,d.persistedBuiltInBaseEntityIdentifierProperty=wf,d.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Of,d.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Bf,d.persistedBuiltInBaseEntityIdentifierPropertyRef=Cf,d.persistedBuiltInBaseEntityUpdatedAtProperty=kf,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Uf,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=TI,d.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=jf,d.persistedBuiltInBaseEntityUpdatedAtPropertyRef=xf,d.processOutputGlobalValueDescriptorDataType=sm,d.processOutputGlobalValueDescriptorReturn=zo,d.processOutputGlobalValueDescriptorReturnRef=am,d.projectPublicationCompletedGlobalEvent=Na,d.propertyToZodSchema=gm,d.relationalDatabaseBuiltInBaseEntity=bn,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=gf,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=Rf,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=bf,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Ba,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=yf,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=hf,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ma,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=Tf,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=Ef,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=_a,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=lI,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=mf,d.relationalDatabaseBuiltInBaseEntityRef=Br,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=wa,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=sI,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=ff,d.resolveActionDescriptorName=jv,d.resolveBaseEntityName=Fv,d.resolveBuiltInBaseEntityDataTypeLabel=Pd,d.resolveConditionOperatorLabel=ho,d.resolveCustomEntityDataTypeLabel=Dd,d.resolveDataType=Ec,d.resolveDataTypeLabel=Vv,d.resolveEntityDataTypeLabel=Gv,d.resolveEntityName=A,d.resolveFirstCallsSecond=B6,d.resolveFirstWritesSecond=w6,d.resolvePrimitiveEntityName=Uv,d.resolvePropertyDataTypeLabel=Lv,d.resolveSearchName=xv,d.resolveVariableDataTypeLabel=q6,d.resolveVariableDeclarationDataTypeLabel=Ir,d.resolveVariableInstanceDataTypeLabel=$v,d.resolveVariableScope=Q9,d.sequentialExecutionOperation=tn,d.sequentialExecutionOperationError=Zp,d.sequentialExecutionOperationErrorParentRef=zp,d.sequentialExecutionOperationListOfExecutionResultsDataType=Wp,d.sequentialExecutionOperationListOfExecutionResultsReturn=No,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Yp,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=Jp,d.sequentialExecutionOperationListOfFunctionsArgument=Mo,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=qp,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Hp,d.sequentialExecutionOperationListOfFunctionsArgumentRef=kp,d.sequentialExecutionOperationListOfFunctionsBlueprint=jp,d.softDeletePersistedEntityMethod=Pf,d.softDeletePersistedEntityMethodParentRef=If,d.sortCallsBasedOnExecutionDependencies=lv,d.sortChildrenEntitiesBasedOnExecutionDependencies=O6,d.splitListOperation=So,d.splitListOperationError=Yu,d.splitListOperationErrorParentRef=Hu,d.splitListOperationFirstOutputListDataType=Lu,d.splitListOperationFirstOutputListReturn=ku,d.splitListOperationFirstOutputListReturnParentRef=ju,d.splitListOperationFirstOutputListReturnRef=Ao,d.splitListOperationInputListArgument=Fu,d.splitListOperationInputListArgumentParentRef=Gu,d.splitListOperationInputListArgumentRef=Mu,d.splitListOperationInputListDataType=Nu,d.splitListOperationSecondOutputListDataType=qu,d.splitListOperationSecondOutputListReturn=Wu,d.splitListOperationSecondOutputListReturnParentRef=Ju,d.splitListOperationSplitIndexArgument=Uu,d.splitListOperationSplitIndexArgumentParentRef=xu,d.splitListOperationSplitIndexArgumentRef=$u,d.splitListOperationSplitIndexDataType=Vu,d.stringPrototype=F,d.stringValueAutogenerationSchema=kc,d.suggestNewIdForEntity=wd,d.test_primitive_entities_export=y3,d.toCamelCase=j6,d.toEntityState=Mt,d.toKebabCase=Nv,d.toLowerCaseKebabCase=yo,d.toPascalCase=k6,d.untypedObjectPrototype=Xe,d.updateErrorsList=Z,d.updateValueReader=fa,d.urlDefaultValue=Py,d.uuidPrototype=Ta,d.validateArgumentDeclarationName=Cd,d.validateCalledByErrorIdInAction=R6,d.validateCalledByIdInAction=E6,d.validateCallers=ev,d.validateConditionEntityDeclaration=v6,d.validateCustomEntityName=fo,d.validateDataOperation=jn,d.validateDataOperationDataToValidateArgument=yy,d.validateDataOperationDataToValidateArgumentParentRef=py,d.validateDataOperationDataToValidateArgumentRef=dy,d.validateDataOperationDataToValidateDataType=uy,d.validateDataOperationEntityToMatchTypeArgument=Ty,d.validateDataOperationEntityToMatchTypeArgumentParentRef=my,d.validateDataOperationEntityToMatchTypeArgumentRef=hy,d.validateDataOperationEntityToMatchTypeDataType=fy,d.validateDataOperationError=gy,d.validateDataOperationErrorParentRef=by,d.validateDataOperationOutputEntityDeclaration=Ry,d.validateDataOperationOutputEntityDeclarationParentRef=Ey,d.validateEntryCaller=Kg,d.validateErrorCaller=Qg,d.validateFunctionCallDeclaration=nv,d.validateFunctionDeclarationName=Ad,d.validateGeneratedEntityParentIsNotBuiltInEntity=h6,d.validateGeneration=p6,d.validateGenerationTarget=Pe,d.validateGenerationUpdate=y6,d.validateLoopEntityDeclaration=I6,d.validateName=J6,d.validateOperationEntityDeclaration=rv,d.validatePropertyName=Od,d.validateReachability=mn,d.validateReadsValueInActionPayload=b6,d.validateReferenceObject=Xs,d.validateReferenceToOne=ad,d.validateReferences=Ge,d.validateReturnDeclarationName=Bd,d.validateSuccessCaller=Xg,d.validateValueReaderGenerationUpdate=pa,d.validateValueWritter=ud,d.validateVariableDeclarationName=Sd,d.valueAutogenerationCurrentDateAndTimeSchema=Ag,d.valueAutogenerationGenericSchema=Fs,d.valueAutogenerationOptions=Wc,d.valueAutogenerationOptionsSchema=Dg,d.valueAutogenerationRandomBooleanSchema=jc,d.valueAutogenerationRandomDateBetweenSchema=$g,d.valueAutogenerationRandomDateFromSchema=Mg,d.valueAutogenerationRandomDateSchema=js,d.valueAutogenerationRandomDateUntilSchema=Ng,d.valueAutogenerationRandomNumberBetweenSchema=Cg,d.valueAutogenerationRandomNumberFromSchema=Sg,d.valueAutogenerationRandomNumberSchema=xs,d.valueAutogenerationRandomNumberUntilSchema=Og,d.valueAutogenerationRandomSchema=oa,d.valueAutogenerationRandomTextBetweenSchema=_g,d.valueAutogenerationRandomTextFromSchema=Bg,d.valueAutogenerationRandomTextSchema=Us,d.valueAutogenerationRandomTextUntilSchema=wg,d.valueAutogenerationRangeValueTypesSchema=sa,d.valueAutogenerationUniqueSchema=Uc,d.waitOperation=ot,d.waitOperationMillisecondsNumberArgument=Un,d.waitOperationMillisecondsNumberArgumentRef=$p,d.waitOperationMillisecondsNumberDataType=Vp,d.waitOperationOperationError=Fp,d.waitOperationOperationErrorParentRef=Gp,d.waitOperationRef=Lp,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
361
+ ${Qt({describe_entity:p.entity.id})}
362
+ Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return{errors:a,modifiedData:i}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){if(this.parent.type===r.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.properties=this.initialData.properties.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{Mx(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),Nx(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),u=R(o,this.project);if(u.suggestion=!0,u.setParent(this),u.initChildren(),u.inputs.forEach(p=>{p.suggestion=!0}),u.returnStatements.length){const p=u.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(u)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.static=e.static||this.static,this.abstract=e.abstract||this.abstract,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.properties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.methods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.properties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(i=>i.toFlat(e)),...this.implements.flatMap(i=>i.toFlat(e)),...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(i=>i.toFlatIds(e)),...this.implements.flatMap(i=>i.toFlatIds(e)),...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e)),...this.implements.flatMap(i=>i.toFlatJSON(e)),...this.extends.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,static:this.static,abstract:this.abstract,extends:this.extends.map(t=>t.id),implements:this.implements.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){return this.errors=_x(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new pe(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ao(this,e,t)}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Ir=pe;function X6(n){const e=e4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Nt{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=X6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Nt(this.toJSON(),this.project)}}function Q6(n){const e=c4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Ut{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(this,"project");this.initialData=this.initialData||e,this.project=this.project||t,this.id=this.id||e.id,this.version=this.version||e.version,this.name=this.name||e.name,this.static=this.static||e.static,this.interactive=this.interactive||e.interactive,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof Ut){const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...i)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove(e={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e)),...this.extends.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e)),...this.extends.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=Q6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Ut(this.toJSON(),this.project)}implement(e,t){return ao(this,e,t)}}function ha(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new oi(n,e);case r.CustomEntity:return t||new Ir(n,e);case r.PrimitiveEntity:return t||new Nt(n,e);case r.FunctionDeclaration:return t||new lr(n,e);case r.GlobalEvent:return t||new ai(n,e);case r.DataType:return t||new ii(n,e);case r.Property:return t||new or(n,e);case r.FunctionCall:return t||new Rr(n,e);case r.Condition:return t||new ur(n,e);case r.Operation:return t||new cr(n,e);case r.VariableDeclaration:return t||new pr(n,e);case r.VariableInstance:return t||new yr(n,e);case r.OutputMap:return t||new fn(n,e);case r.ReturnDeclaration:return t||new Ot(n,e);case r.ArgumentDeclaration:return t||new mr(n,e);case r.InputMap:return t||new hn(n,e);case r.Project:return t||new $(n);case r.InstalledProject:return t||new fr(n,e);case r.ActionDescriptor:return t||new _e(n,e);case r.ReturnStatement:return t||new Tr(n,e);case r.Loop:return t||new dr(n,e);case r.Search:return t||new hr(n,e);case r.ValueDescriptor:return t||new Er(n,e);case r.BuiltInBaseEntity:return t||new Ut(n,e);case r.InternalCall:return t||new si(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new li(n,e);default:throw new Error("Invalid entity type: "+n.type)}}function R(n,e){if(!n)throw new Error("Entity is null");const t=ha(n,e);return t.subscribe(),t}function K6(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return oi.fromGenerationTarget(n,e);case r.CustomEntity:return Ir.fromGenerationTarget(n,e);case r.FunctionDeclaration:return lr.fromGenerationTarget(n,e);case r.GlobalEvent:return ai.fromGenerationTarget(n,e);case r.DataType:return ii.fromGenerationTarget(n,e);case r.Property:return or.fromGenerationTarget(n,e);case r.FunctionCall:return Rr.fromGenerationTarget(n,e);case r.Condition:return ur.fromGenerationTarget(n,e);case r.Operation:return cr.fromGenerationTarget(n,e);case r.VariableDeclaration:return pr.fromGenerationTarget(n,e);case r.VariableInstance:return yr.fromGenerationTarget(n,e);case r.OutputMap:return fn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ot.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return mr.fromGenerationTarget(n,e);case r.InputMap:return hn.fromGenerationTarget(n,e);case r.InstalledProject:return fr.fromGenerationTarget(n,e);case r.ReturnStatement:return Tr.fromGenerationTarget(n,e);case r.Loop:return dr.fromGenerationTarget(n,e);case r.Search:return hr.fromGenerationTarget(n,e);case r.ActionDescriptor:return _e.fromGenerationTarget(n,e);case r.ValueDescriptor:return Er.fromGenerationTarget(n,e);case r.InternalCall:return si.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return li.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Z=class Z{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",r.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);this.initialData=e,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=0,this.y=0}static injectUUIDModule(e){Z.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async i=>{await t.init(this),i(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(){return this.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),this}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeBuiltInInstance(e){return(!this.builtInInstances[e.id]||this.builtInInstances[e.id]!==e)&&(this.builtInInstances[e.id]=e),this}subscribe(){return this}unsubscribe(){return this}unsubscribeInstance(e){return delete this.instances[e.id],this}findSubscribedInstance(e){return this.instances[e.id]||null}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getManaged(e){return this.instances[e]||null}getBuiltIn(e){return this.builtInInstances[e]||null}findSubscribedInstanceFromReference(e){return this.instances[e.entityId]||null}findSubscribedBuiltInInstanceFromReference(e){return this.builtInInstances[e.entityId]||null}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e}={ignoreUpstream:!1}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}getAllBuiltInIds(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlatIds(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlatIds(e)),...this.operationDeclarations.flatMap(t=>t.toFlatIds(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlatIds(e)),...this.loopDeclarations.flatMap(t=>t.toFlatIds(e)),...this.conditionDeclarations.flatMap(t=>t.toFlatIds(e)),...this.valueDescriptors.flatMap(t=>t.toFlatIds(e)),...this.dataTypes.flatMap(t=>t.toFlatIds(e))]}getAllBuiltIn(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlat(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlat(e)),...this.operationDeclarations.flatMap(t=>t.toFlat(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlat(e)),...this.loopDeclarations.flatMap(t=>t.toFlat(e)),...this.conditionDeclarations.flatMap(t=>t.toFlat(e)),...this.valueDescriptors.flatMap(t=>t.toFlat(e)),...this.dataTypes.flatMap(t=>t.toFlat(e))]}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlat(e)),...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e)),...this.projects.flatMap(i=>i.toFlat(e)),...this.variableDeclarations.flatMap(i=>i.toFlat(e)),...this.variableInstances.flatMap(i=>i.toFlat(e)),...this.conditions.flatMap(i=>i.toFlat(e)),...this.operations.flatMap(i=>i.toFlat(e)),...this.functionCalls.flatMap(i=>i.toFlat(e)),...this.loops.flatMap(i=>i.toFlat(e)),...this.searches.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+Z.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatJSON(e)),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e)),...this.projects.flatMap(i=>i.toFlatJSON(e)),...this.variableDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.variableInstances.flatMap(i=>i.toFlatJSON(e)),...this.conditions.flatMap(i=>i.toFlatJSON(e)),...this.operations.flatMap(i=>i.toFlatJSON(e)),...this.functionCalls.flatMap(i=>i.toFlatJSON(e)),...this.loops.flatMap(i=>i.toFlatJSON(e)),...this.searches.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e)),...this.projects.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(i=>i.toFlatGenerationTarget(e)),...this.conditions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.operations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.loops.flatMap(i=>i.toFlatGenerationTarget(e)),...this.searches.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.entities.forEach(e=>e.clearErrors()),this.projects.forEach(e=>e.clearErrors()),this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this.variableDeclarations.forEach(e=>e.clearErrors()),this.variableInstances.forEach(e=>e.clearErrors()),this.conditions.forEach(e=>e.clearErrors()),this.operations.forEach(e=>e.clearErrors()),this.functionCalls.forEach(e=>e.clearErrors()),this.loops.forEach(e=>e.clearErrors()),this.searches.forEach(e=>e.clearErrors()),this}validate(){const e=Ax(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Z(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(i=>i.id===e.id);if(t>-1){const i=this.entities[t];return this.entities.splice(t,1),i}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(i=>i.id===e.id);if(t>-1){const i=this.functions[t];return this.functions.splice(t,1),i}return null}removeExternalProject(e){const t=this.projects.findIndex(i=>i.id===e.id);if(t>-1){const i=this.projects[t];return this.projects.splice(t,1),i}return null}removeGlobalEvent(e){const t=this.events.findIndex(i=>i.id===e.id);if(t>-1){const i=this.events[t];return this.events.splice(t,1),i}return null}removeTopLevelVariableDeclaration(e){if(e.type!==r.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(i=>i.id===e.id);if(t>-1){const i=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),i}return null}getEntryPoints(){return[...this.functions,...this.events,...this.entities.flatMap(t=>t.methods)]}getFunctionDeclaration(e){return this.functions.find(t=>t.id===e)||null}getConditions(){return[...this.conditions,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=z(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(i=>{if(!i.declaration){const a=i.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(u=>u.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===w.PERSISTED_ENTITY)||null}};l(Z,"UUID",$m()),l(Z,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),l(Z,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),l(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let $=Z;class Uv extends _e{constructor(t){super($t,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",$t);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async()=>{});this.project=t,this.fixedArguments=$t.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=$t.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=$t.error?R($t.error,this.project):null}}class xv extends _e{constructor(t){super(ot,t);l(this,"id",ot.id);l(this,"name",ot.name);l(this,"description",ot.description);l(this,"version",ot.version);l(this,"autoexecutable",!1);l(this,"initialData",ot);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[0])=>{const i=t[0];return[new Promise(s=>{setTimeout(()=>{s()},i)})]});this.project=t,this.fixedArguments=ot.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ot.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ot.error?R(ot.error,this.project):null}}class jv extends _e{constructor(t){super(tn,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",tn);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[[]])=>[[]]);this.project=t,this.fixedArguments=tn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=tn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=tn.error?R(tn.error,this.project):null}}function e3(n){const e=[new jv(n),new Uv(n),new xv(n),new _e(hi,n),new _e(Sr,n),new _e(xn,n),new _e(Ra,n),new _e(vo,n),new _e(Do,n),new _e(Po,n),new _e(ma,n),new _e(pi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class kv extends Ut{constructor(t){super(Be,t);l(this,"initialData");l(this,"id",w.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",w.PERSISTED_ENTITY);l(this,"description",Be.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",Be.abstract);l(this,"static",Be.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Be,this.project=t,this.id=Be.id,this.version=Be.version,this.name=Be.name,this.static=Be.static,this.abstract=Be.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function t3(n){const e=[new kv(n),new Ut(Sa,n),new Ut(Rn,n),new Ut(jo,n),new Ut(Aa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function n3(n){const e=[new Nt(F,n),new Nt(Fn,n),new Nt(Ce,n),new Nt(Xe,n),new Nt(En,n),new Nt(Ar,n),new Nt(fa,n),new Nt(Eo,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function r3(n){const e=[new _e(_a,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function i3(n){const e=[new _e(jn,n),new _e(Vo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function a3(n){const e=[new Er(Wo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function s3(n){const e=[new _e(kn,n),new _e(Cr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const di={},ho={};async function o3(n,e={}){const t={...XR};return t.id=n.id,e.empty?{data:{id:n.id,type:r.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function qv(n){const e=new $(n);return n3(e),t3(e),e3(e),r3(e),i3(e),a3(e),s3(e),e.initChildren(),e}async function l3(n,e={}){try{if(n.id&&di[n.id])return di[n.id];if(n.id&&ho[n.id])return await ho[n.id],di[n.id];const t=o3(n,e);n.id&&(ho[n.id]=t);const i=await t;if(i.data){const a=qv(i.data);return di[n.id]=a,n.id&&delete ho[n.id],a}return null}catch(t){return console.error("Error fetching project",t),null}}function c3(n){return di[n.id]&&delete di[n.id],null}const d3="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=hd,d.ActionDescriptorState=_e,d.ActionDescriptorValuesType=L,d.ActionInputMapState=l6,d.ActionOutputMapState=u6,d.AppendToListOperationInputIds=rp,d.AppendToListOperationOutputIds=ip,d.ArgumentDeclarationState=mr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=dd,d.BUILT_IN_BASE_ENTITY_IDS=Ve,d.BUILT_IN_ENTITY_TYPES=Dr,d.BaseCanvasDraggableState=H9,d.BaseEntityNames=w,d.BaseState=W9,d.BaseValueDescriptorIds=_o,d.BreakStatementState=li,d.BuiltInBaseEntityState=Ut,d.CALLABLE_ENTITIES_EXPLANATION=I6,d.CALLABLE_TYPES=Tn,d.CALLER_ENTITIES_EXPLANATION=tv,d.CALLER_TYPES=en,d.CALLS_UPDATE_EXPLANATION=Nn,d.COMPARISON_CONDITIONS=em,d.CONDITIONS=EI,d.CUSTOM_ENTITY_OPERATIONS=Ey,d.CallableEntityClass=z9,d.CallerEntityClass=sd,d.ChildEntityState=Y9,d.ComparisonOperatorTypes=Ae,d.ConditionState=ur,d.ContinueStatementState=yt,d.CreateNewInputIds=Yp,d.CreateNewOutputIds=zp,d.CustomEntityState=Ir,d.DRAGGABLE_CALLABLE_TYPES=mo,d.DRAGGABLE_CALLER_TYPES=Bd,d.DRAGGABLE_ELEMENT_TYPES=To,d.DRAGGABLE_EXECUTABLE_TYPES=Hv,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=fo,d.DataTypeCompatibilityTypes=wt,d.DataTypeParentChildRelation=qe,d.DataTypeState=ii,d.ENTITIES_WITH_VALLUES_EXPLANATION=eo,d.ENTITY_TYPES=Yv,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,d.ENTITY_WITH_NAMES_TYPES=wd,d.ENTITY_WITH_VALUE_TYPES=Cd,d.ENTRY_POINT_ENTITIES_EXPLANATION=ca,d.ENTRY_POINT_TYPES=$e,d.EVENT_TYPES=Pr,d.EXECUTABLE_TYPES=Wv,d.EXECUTION_OPERATIONS=Hp,d.EntityError=Xn,d.EntityErrorSeverity=f,d.EntityGenerationError=E,d.EntityGenerationErrorCode=y,d.EntityInstanceErrorCode=M,d.EntityOperations=Ze,d.EntityType=r,d.EntityWithLogicScopeClass=K9,d.EntityWithValueClass=Q9,d.EntryPointEntityClass=Z9,d.ExecutionOperations=Ie,d.FunctionCallState=Rr,d.FunctionDeclarationState=lr,d.GLOBAL_EVENT_DECLARATIONS=RI,d.GetLastInListOperationInputIds=Ju,d.GetLastInListOperationOutputIds=Wu,d.GlobalEventNames=Kt,d.GlobalEventState=ai,d.HTTPOperations=Ye,d.HTTP_OPERATIONS=Qy,d.InputMapState=hn,d.InstalledProjectState=fr,d.InternalCallState=si,d.JoinListOperationInputIds=uu,d.JoinListOperationOutputIds=pu,d.JoinStringOperationInputIds=Xd,d.JoinStringOperationOutputIds=Qd,d.LIST_OPERATIONS=Tp,d.ListOperations=j,d.LoopState=dr,d.LoopTypes=je,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=$n,d.NUMBER_OPERATIONS=Zd,d.NumberAdditionOperationInputIds=Ld,d.NumberAdditionOperationOutputIds=Gd,d.NumberOperations=at,d.OPERATION_DECLARATIONS=Zv,d.OperationState=cr,d.OutputMapParentChildRelation=Od,d.OutputMapState=fn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=to,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Mn,d.PASS_THROUGH_CALLABLE_TYPES=Ne,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=yd,d.ParallelExecutionOperation=Uv,d.ParallelExecutionOperationInputIds=Ep,d.ParallelExecutionOperationOutputIds=Rp,d.PassThroughCallableEntityClass=X9,d.PersistedEntity=kv,d.PersistedEntityMethods=vt,d.PrimitiveEntityState=Nt,d.PrimitiveTypes=g,d.PrimitiveValueState=oi,d.ProjectState=$,d.PropertyState=or,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=P6,d.ReturnDeclarationState=Ot,d.ReturnStatementState=Tr,d.STANDALONE_CONDITIONS=Yf,d.STRING_OPERATIONS=du,d.ScopeCompatibilityType=yo,d.SearchState=hr,d.SequentialExecutionOperation=jv,d.SequentialExecutionOperationInputIds=Vp,d.SequentialExecutionOperationOutputIds=Lp,d.SharedEntityErrorCode=v,d.SharedStateFunctionality=Qg,d.SplitListOperationInputIds=Su,d.SplitListOperationOutputIds=Ou,d.StandaloneOperatorTypes=Ct,d.StringOperations=ve,d.TERMINATION_TYPES=Oe,d.USER_MANAGED_ENTITY_TYPES=zv,d.UserManagedEntityStateFunctionality=J9,d.VALUE_READING_ENTITIES_EXPLANATION=pd,d.VALUE_READING_TYPES=Gn,d.VALUE_WRITING_ENTITIES_EXPLANATION=nv,d.VALUE_WRITING_TYPES=Se,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=ud,d.VARIABLE_TYPES=Fe,d.ValidationInputIds=iy,d.ValidationOutputIds=ay,d.ValueAutogenerationType=xe,d.ValueDescriptorParentChildRelation=O,d.ValueDescriptorState=Er,d.ValueReadingEntityClass=oa,d.ValueWritingEntityClass=la,d.VariableDeclarationState=pr,d.VariableInputMapState=o6,d.VariableInstanceState=yr,d.VariableOutputMapState=d6,d.WaitOperation=xv,d.WaitOperationInputIds=Cp,d.WaitOperationOutputIds=Bp,d.appendToListOperation=Ra,d.appendToListOperationElementToAppendArgument=So,d.appendToListOperationElementToAppendArgumentParentRef=pp,d.appendToListOperationElementToAppendArgumentRef=op,d.appendToListOperationError=mp,d.appendToListOperationErrorParentRef=fp,d.appendToListOperationListArgument=Ao,d.appendToListOperationListArgumentParentRef=up,d.appendToListOperationListArgumentRef=ap,d.appendToListOperationListDataType=sp,d.appendToListOperationResultListDataType=dp,d.appendToListOperationResultListReturn=hp,d.appendToListOperationResultListReturnParentRef=yp,d.appendToListOperationResultListReturnRef=cp,d.appendToListOperationSecondListDataType=lp,d.asGenerationActionExample=Qt,d.baseHttpRequestFunctionDeclaration=hi,d.baseHttpRequestFunctionDeclarationErrorValueDescriptor=$o,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=Xy,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=Zy,d.baseHttpRequestFunctionDeclarationRef=Wy,d.baseHttpRequestFunctionDeclarationRefEight=Yy,d.baseHttpRequestFunctionDeclarationRefFive=qy,d.baseHttpRequestFunctionDeclarationRefFour=ky,d.baseHttpRequestFunctionDeclarationRefNine=zy,d.baseHttpRequestFunctionDeclarationRefSeven=Hy,d.baseHttpRequestFunctionDeclarationRefSix=Jy,d.baseHttpRequestFunctionDeclarationRefThree=jy,d.baseHttpRequestFunctionDeclarationRefTwo=xy,d.booleanPrototype=Fn,d.capitalizeFirstLetter=Js,d.checkAreCustomEntitiesCompatibleAsDataType=Vg,d.checkAreDataTypesCompatible=Ws,d.checkArePropertiesCompatibleAsDataType=$g,d.checkIsBranchDependentButNotDirectlyOnBranch=ua,d.checkIsBranchDependentOnBranch=M6,d.checkIsCallableEntityReachable=Sd,d.checkIsCanvasEntity=Y6,d.checkIsDetachedBranch=Mv,d.checkIsDetachedBranchShallow=Dd,d.checkIsGlobalVariable=H6,d.checkIsGloballyDeclared=Pd,d.checkIsMethod=Vv,d.checkIsNestedScope=po,d.checkScopeCompatibility=pa,d.createEntityError=H,d.createNewInstanceOperation=Sr,d.createNewInstanceOperationEntityToInstanciateArgument=Kp,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Zp,d.createNewInstanceOperationEntityToInstanciateDataType=Xp,d.createNewInstanceOperationError=ry,d.createNewInstanceOperationErrorParentRef=ny,d.createNewInstanceOperationOutputEntityDeclaration=ty,d.createNewInstanceOperationOutputEntityDeclarationParentRef=ey,d.createNewInstanceOperationRef=Qp,d.createSemanticId=Xt,d.createStateFromGenerationTargetType=K6,d.createStateFromType=ha,d.createStateFromTypeAndSubscribe=R,d.cronJobBuiltInBaseEntity=jo,d.cronJobBuiltInBaseEntityExpressionProperty=qf,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=fI,d.cronJobBuiltInBaseEntityExpressionPropertyRef=jf,d.cronJobBuiltInBaseEntityRef=kf,d.cronJobTriggeredFunctionDeclarationBlueprint=xo,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Uf,d.customEntityToZodSchema=Em,d.dataTypeCompatibilityToErrorExplanation=dv,d.datePrototype=Ar,d.dateValueAutogenerationSchema=Wl,d.deletePersistedEntityMethod=Uo,d.deletePersistedEntityMethodParentRef=Ef,d.deleteRootProject=c3,d.endpointBuiltInBaseEntity=Sa,d.endpointBuiltInBaseEntityRef=Rh,d.endpointBuiltInBaseEntityRefFour=lf,d.endpointBuiltInBaseEntityRefThree=Oh,d.endpointBuiltInBaseEntityRefTwo=Ph,d.endpointBuiltInCorsProperty=bh,d.endpointBuiltInCorsPropertyDataType=Eh,d.endpointBuiltInCorsPropertyDataTypeRef=mh,d.endpointBuiltInCorsPropertyRef=Th,d.endpointBuiltInMethodProperty=Go,d.endpointBuiltInMethodPropertyDataType=Sh,d.endpointBuiltInMethodPropertyDataTypeRef=Dh,d.endpointBuiltInMethodPropertyRef=Ah,d.endpointBuiltInPathProperty=Lo,d.endpointBuiltInPathPropertyDataType=Ih,d.endpointBuiltInPathPropertyDataTypeRef=gh,d.endpointBuiltInPathPropertyRef=vh,d.endpointPathParamsArgumentDeclaration=kh,d.endpointPathParamsArgumentDeclarationRef=Gh,d.endpointPathParamsVariableDataType=Fh,d.endpointPathParamsVariableDataTypeRef=Lh,d.endpointReachedTriggerActionDescriptor=Fo,d.endpointReachedTriggerActionDescriptorRef=Uh,d.endpointReachedTriggerActionDescriptorRefFour=Wh,d.endpointReachedTriggerActionDescriptorRefThree=qh,d.endpointReachedTriggerActionDescriptorRefTwo=jh,d.endpointRequestBodyArgumentDeclaration=Hh,d.endpointRequestBodyArgumentDeclarationRef=_h,d.endpointRequestBodyVariableDataType=Mh,d.endpointRequestHeadersArgumentDeclaration=xh,d.endpointRequestHeadersArgumentDeclarationRef=Bh,d.endpointRequestHeadersVariableDataType=wh,d.endpointRequestHeadersVariableDataTypeRef=Ch,d.endpointRequestQueryParamsArgumentDeclaration=Jh,d.endpointRequestQueryParamsArgumentDeclarationRef=$h,d.endpointRequestQueryParamsVariableDataType=Vh,d.endpointRequestQueryParamsVariableDataTypeRef=Nh,d.endpointResponseBodyDataType=af,d.endpointResponseBodyReturnDeclaration=of,d.endpointResponseBodyReturnDeclarationRef=rf,d.endpointResponseCodeDataType=zh,d.endpointResponseCodeReturnDeclaration=Xh,d.endpointResponseCodeReturnDeclarationRef=Yh,d.endpointResponseHeadersDataType=ef,d.endpointResponseHeadersDataTypeRef=Qh,d.endpointResponseHeadersReturnDeclaration=nf,d.endpointResponseHeadersReturnDeclarationRef=Kh,d.endpointReturnStatementRef=Zh,d.endpointReturnStatementRefThree=sf,d.endpointReturnStatementRefTwo=tf,d.enumOptionsProperty=Vd,d.enumOptionsPropertyDataType=Nd,d.enumOptionsPropertyDataTypeRef=_d,d.enumOptionsPropertyRef=Md,d.enumPrototype=En,d.enumPrototypeRef=$d,d.executionBuiltInEntity=qo,d.executionBuiltInEntityAbortMethod=ko,d.executionBuiltInEntityAbortMethodParentRef=Jf,d.filterOutDuplicateEntities=S,d.filterOutDuplicateErrors=JF,d.findReferenceToSelfInList=Pv,d.findReferencesToSelfInProject=x6,d.flattenCalls=br,d.flattenCanvasAncestorsUntil=so,d.flattenCustomEntityExtensionAndImplementationTypes=Cv,d.flattenCustomEntityExtensionTypes=co,d.flattenCustomEntityExtensions=vd,d.flattenCustomEntityImplementations=Id,d.flattenCustomEntityImplementionTypes=lo,d.flattenDerivedCanvasEntities=gt,d.flattenDetachedBranch=$v,d.flattenElementCalls=Me,d.flattenProjectElements=Iv,d.flattenRelatedCanvasElementsOnTheLeft=Ov,d.flattenRelatedCanvasElementsOnTheRight=Sv,d.flattenVariableReads=vv,d.flattenVariableWrites=gv,d.flattenVariables=z,d.fromZodParseToEntityGenerationErrors=od,d.generate=mD,d.generateActionExample=D6,d.generateExecutionDataType=Lg,d.generateMutablePropertiesExplanation=Xs,d.generateRandomBoolean=Jm,d.generateRandomDate=vm,d.generateRandomDateAfter=Rm,d.generateRandomDateBefore=bm,d.generateRandomDateBetweenRange=gm,d.generateRandomNumber=Um,d.generateRandomNumberAfter=Lm,d.generateRandomNumberBefore=Gm,d.generateRandomNumberBetweenRange=Fm,d.generateRandomText=qm,d.generateRandomTextAfter=xm,d.generateRandomTextBefore=jm,d.generateRandomTextBetweenRange=km,d.generateUniqueUUID=Vm,d.getAllActionDescriptorsForConditions=io,d.getAllActionDescriptorsForGlobalEvents=no,d.getAllActionDescriptorsForLoops=ro,d.getAllActionDescriptorsForOperations=C6,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=ov,d.getBaseBuiltInEntities=Ln,d.getBaseSchemaBasedOnType=Kg,d.getBuiltInEntityOwner=vr,d.getCallableEntityReferenceSchema=ke,d.getCallableEntityTypeSchema=vb,d.getCallerEntityReferenceSchema=ZU,d.getCallerEntityTypeSchema=zU,d.getCalls=Td,d.getCanvasEntitiesDerivedFromInternalCalls=Av,d.getCanvasEntitiesDerivedFromWrites=ci,d.getCanvasEntityDerivedFromValueReadingEntity=gd,d.getCanvasEntityReferenceSchema=yx,d.getCanvasEntityTypeSchema=px,d.getChildrenEntityWithValues=$6,d.getCommonAncestor=md,d.getCommonChildren=yv,d.getDeclaration=Zc,d.getDeepestScope=Fv,d.getDraggableCallableEntityReferenceSchema=Pb,d.getDraggableCallableEntityTypeSchema=Ib,d.getDraggableCallerEntityReferenceSchema=QU,d.getDraggableCallerEntityTypeSchema=XU,d.getDraggableExecutableEntityReferenceSchema=nx,d.getDraggableExecutableEntityTypeSchema=tx,d.getDraggablePassThroughCallableEntityReferenceSchema=Ls,d.getDraggablePassThroughCallableEntityTypeSchema=Vs,d.getDraggablePlayableEntityReferenceSchema=ox,d.getDraggablePlayableEntityTypeSchema=sx,d.getEntityArgumentDeclarations=Rd,d.getEntityInputMaps=Dv,d.getEntityOutputMaps=q6,d.getEntityReferenceSchema=ux,d.getEntityReturnDeclarations=bd,d.getEntityTypeSchema=dx,d.getEntityWithLogicScopeReferenceSchema=un,d.getEntityWithLogicScopeTypeSchema=rx,d.getEntityWithValueReferenceSchema=gb,d.getEntityWithValueTypeSchema=YU,d.getEntryPointEntityReferenceSchema=Ue,d.getEntryPointEntityTypeSchema=Bn,d.getEventEntityReferenceSchema=Ns,d.getEventEntityTypeSchema=Ms,d.getExecutableEntityReferenceSchema=ex,d.getExecutableEntityTypeSchema=KU,d.getExtendedBuiltInEntity=J6,d.getExtendedCustomEntity=wv,d.getGenerationTargetSchemaBasedOnType=ev,d.getHeadIfPartOfDetachedBranch=Nv,d.getHighestScope=Gv,d.getImplementedBuiltInEntity=W6,d.getIsInteractive=_v,d.getLastInListOperation=Do,d.getLastInListOperationError=np,d.getLastInListOperationErrorParentRef=tp,d.getLastInListOperationInputListArgument=Qu,d.getLastInListOperationInputListArgumentParentRef=Xu,d.getLastInListOperationInputListArgumentRef=Hu,d.getLastInListOperationInputListDataType=Yu,d.getLastInListOperationOutputElementDataType=Zu,d.getLastInListOperationOutputElementReturn=ep,d.getLastInListOperationOutputElementReturnParentRef=Ku,d.getLastInListOperationOutputElementReturnRef=zu,d.getLinkedEntitiesFromArgumentDeclaration=U6,d.getLowestPersistedEntityImplementation=Bv,d.getParentCanvasEntities=_t,d.getParentCanvasEntity=He,d.getParentEntryPoint=N6,d.getPassThroughCallableEntityReferenceSchema=ye,d.getPassThroughCallableEntityTypeSchema=$s,d.getPlayableEntityReferenceSchema=ax,d.getPlayableEntityTypeSchema=ix,d.getProject=l3,d.getPrototypeByType=uo,d.getReferenceEntityId=D,d.getReferencedEntitiesStateOrErrors=Ks,d.getReferencedEntityStateOrErrors=ld,d.getRelatedCanvasElementsOnTheLeft=gr,d.getRelatedCanvasElementsOnTheRight=Vn,d.getRootEntryPointScopeOwner=Ad,d.getScopeOwner=ht,d.getTerminationReferenceSchema=cx,d.getTerminationTypeSchema=lx,d.getUsedArgFromDeclaration=j6,d.getUsedReturnFromDeclaration=k6,d.getValueReadingEntityReferenceSchema=bb,d.getValueReadingEntityTypeSchema=dn,d.getValueWritingEntityReferenceSchema=HU,d.getValueWritingEntityTypeSchema=Xi,d.getVariableFromInputMapping=fv,d.getVariableFromReturnVariablePointer=Ev,d.getVariableReferenceSchema=Cn,d.getVariableTypeSchema=er,d.getVariablesFromArgumentDeclarations=oo,d.getVariablesFromInputMaps=mv,d.getVariablesFromOutputMapping=Rv,d.getVariablesFromOutputMaps=bv,d.getVariablesFromReturnDeclarations=Tv,d.getVariablesInSameOrHigherScope=Xc,d.getWrites=Ed,d.groupCallsBasedOnParallelizableExecution=L6,d.handleAfterEntityImplementationSideEffects=pv,d.handleBeforeEntityImplementationSideEffects=uv,d.httpRequestBodyArgument=Ia,d.httpRequestBodyArgumentRef=wy,d.httpRequestBodyDataType=_y,d.httpRequestHeadersArgument=va,d.httpRequestHeadersArgumentRef=Cy,d.httpRequestHeadersDataType=By,d.httpRequestMethodArgument=ba,d.httpRequestMethodArgumentRef=Sy,d.httpRequestMethodDataType=Oy,d.httpRequestMethodDataTypeRef=Dy,d.httpRequestQueryParamsArgument=Mo,d.httpRequestQueryParamsArgumentRef=Iy,d.httpRequestQueryParamsDataType=Py,d.httpRequestVariableURLArgument=ga,d.httpRequestVariableURLArgumentRef=gy,d.httpRequestVariableURLDataType=vy,d.httpRequestVariableURLDataTypeRef=Ry,d.httpResponseBodyReturnDataType=Uy,d.httpResponseBodyReturnDataTypeRef=Gy,d.httpResponseBodyReturnReturn=yi,d.httpResponseBodyReturnReturnRef=Fy,d.httpResponseCodeDataType=Ny,d.httpResponseCodeReturn=No,d.httpResponseCodeReturnRef=My,d.httpResponseHeadersDataType=Ly,d.httpResponseHeadersDataTypeRef=$y,d.httpResponseHeadersReturn=Pa,d.httpResponseHeadersReturnRef=Vy,d.implement=ao,d.inferArgumentDeclarationDataType=Gg,d.inferDataType=Hs,d.inferInputMapDataType=Fg,d.inferOutputMapDataType=jg,d.inferVariableDeclarationDataType=xg,d.inferVariableInstanceDataType=Ug,d.initProject=qv,d.iterateOverListActionDescriptor=jn,d.iterateOverListActionDescriptorListArgumentDeclaration=ah,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=rh,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=nh,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=ih,d.iterateOverListActionDescriptorReturnDeclaration=th,d.iterateOverListActionDescriptorReturnDeclarationParentRef=eh,d.joinListOperation=vo,d.joinListOperationError=Au,d.joinListOperationErrorParentRef=Du,d.joinListOperationFirstListArgument=bu,d.joinListOperationFirstListArgumentParentRef=Ru,d.joinListOperationFirstListArgumentRef=yu,d.joinListOperationFirstListDataType=hu,d.joinListOperationResultListDataType=Eu,d.joinListOperationResultListReturn=Pu,d.joinListOperationResultListReturnParentRef=Iu,d.joinListOperationResultListReturnRef=Tu,d.joinListOperationSecondListArgument=vu,d.joinListOperationSecondListArgumentParentRef=gu,d.joinListOperationSecondListArgumentRef=fu,d.joinListOperationSecondListDataType=mu,d.joinListWithLastSeparator=N,d.joinStringOperation=pi,d.joinStringOperationError=cu,d.joinStringOperationErrorParentRef=lu,d.joinStringOperationFirstStringArgument=Ta,d.joinStringOperationFirstStringArgumentParentRef=au,d.joinStringOperationFirstStringArgumentRef=Kd,d.joinStringOperationFirstStringDataType=eu,d.joinStringOperationResultStringDataType=iu,d.joinStringOperationResultStringReturn=ui,d.joinStringOperationResultStringReturnParentRef=ou,d.joinStringOperationResultStringReturnRef=ru,d.joinStringOperationSecondStringArgument=Ea,d.joinStringOperationSecondStringArgumentParentRef=su,d.joinStringOperationSecondStringArgumentRef=tu,d.joinStringOperationSecondStringDataType=nu,d.jsonPrototype=Eo,d.keyValueParamBuiltInBaseEntity=Aa,d.keyValueParamBuiltInBaseEntityNameProperty=ph,d.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=Qv,d.keyValueParamBuiltInBaseEntityNamePropertyParentRef=uh,d.keyValueParamBuiltInBaseEntityNamePropertyRef=dh,d.keyValueParamBuiltInBaseEntityValueProperty=fh,d.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=eI,d.keyValueParamBuiltInBaseEntityValuePropertyParentRef=hh,d.keyValueParamBuiltInBaseEntityValuePropertyRef=yh,d.lowercaseFirstLetter=Ng,d.manualFlowActionDescriptor=Vo,d.manualFlowActionDescriptorDeclarationReturnDeclaration=ch,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=oh,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=sh,d.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=lh,d.mapActionDescriptorToTypeItRepresents=z6,d.mergeEntityErrorsList=WF,d.mergeListOfEntities=Lv,d.methodDefaultValue=Ay,d.mockClientProject=XR,d.moreThanOrEqualCondition=Cr,d.moreThanOrEqualConditionLeftHandArgument=Xf,d.moreThanOrEqualConditionLeftHandArgumentParentRef=Zf,d.moreThanOrEqualConditionRightHandArgument=Kf,d.moreThanOrEqualConditionRightHandArgumentParentRef=Qf,d.notEmptyCondition=kn,d.notEmptyConditionArgument=Hf,d.notEmptyConditionRef=Wf,d.numberAdditionOperation=ma,d.numberAdditionOperationError=zd,d.numberAdditionOperationErrorParentRef=Yd,d.numberAdditionOperationFirstNumberArgument=Ro,d.numberAdditionOperationFirstNumberArgumentRef=Fd,d.numberAdditionOperationFirstNumberDataType=Ud,d.numberAdditionOperationRef=Jd,d.numberAdditionOperationRefThree=Hd,d.numberAdditionOperationRefTwo=Wd,d.numberAdditionOperationResultNumberDataType=qd,d.numberAdditionOperationResultNumberReturn=go,d.numberAdditionOperationResultNumberReturnRef=kd,d.numberAdditionOperationSecondNumberArgument=bo,d.numberAdditionOperationSecondNumberArgumentRef=xd,d.numberAdditionOperationSecondNumberDataType=jd,d.numberPrototype=Ce,d.numberValueAutogenerationSchema=Jl,d.parallelExecutionOperation=$t,d.parallelExecutionOperationError=Op,d.parallelExecutionOperationErrorParentRef=Sp,d.parallelExecutionOperationListOfExecutionResultsDataType=Pp,d.parallelExecutionOperationListOfExecutionResultsReturn=Co,d.parallelExecutionOperationListOfExecutionResultsReturnRef=Ip,d.parallelExecutionOperationListOfFunctionsArgument=Oo,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=vp,d.parallelExecutionOperationListOfFunctionsArgumentRef=gp,d.parallelExecutionOperationListOfFunctionsBlueprint=bp,d.parallelExecutionOperationRef=Dp,d.parallelExecutionOperationRefThree=Ap,d.persistedBuiltInBaseEntity=Be,d.persistedBuiltInBaseEntityCreatedAtProperty=$f,d.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Mf,d.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=yI,d.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Nf,d.persistedBuiltInBaseEntityCreatedAtPropertyRef=_f,d.persistedBuiltInBaseEntityDatabaseProperty=mi,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=cI,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=If,d.persistedBuiltInBaseEntityDatabasePropertyRef=vf,d.persistedBuiltInBaseEntityDeletedAtProperty=wf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Cf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=pI,d.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Bf,d.persistedBuiltInBaseEntityDeletedAtPropertyRef=Of,d.persistedBuiltInBaseEntityIdentifierProperty=Sf,d.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Pf,d.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Af,d.persistedBuiltInBaseEntityIdentifierPropertyRef=Df,d.persistedBuiltInBaseEntityUpdatedAtProperty=Ff,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Lf,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=hI,d.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Gf,d.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Vf,d.processOutputGlobalValueDescriptorDataType=nm,d.processOutputGlobalValueDescriptorReturn=Wo,d.processOutputGlobalValueDescriptorReturnRef=tm,d.projectPublicationCompletedGlobalEvent=_a,d.propertyToZodSchema=Tm,d.relationalDatabaseBuiltInBaseEntity=Rn,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=Tf,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=ff,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=mf,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Oa,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=cf,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=df,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=wa,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=yf,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=hf,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Ba,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=aI,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=pf,d.relationalDatabaseBuiltInBaseEntityRef=Or,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Ca,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=rI,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=uf,d.resolveActionDescriptorName=Xg,d.resolveBaseEntityName=Yg,d.resolveBuiltInBaseEntityDataTypeLabel=Qc,d.resolveConditionOperatorLabel=zs,d.resolveCustomEntityDataTypeLabel=Kc,d.resolveDataType=zc,d.resolveDataTypeLabel=Jg,d.resolveEntityDataTypeLabel=Hg,d.resolveEntityName=A,d.resolveFirstCallsSecond=G6,d.resolveFirstWritesSecond=F6,d.resolvePrimitiveEntityName=Zg,d.resolvePropertyDataTypeLabel=Wg,d.resolveSearchName=zg,d.resolveVariableDataTypeLabel=B9,d.resolveVariableDeclarationDataTypeLabel=sr,d.resolveVariableInstanceDataTypeLabel=qg,d.resolveVariableScope=S9,d.sequentialExecutionOperation=tn,d.sequentialExecutionOperationError=Wp,d.sequentialExecutionOperationErrorParentRef=Jp,d.sequentialExecutionOperationListOfExecutionResultsDataType=jp,d.sequentialExecutionOperationListOfExecutionResultsReturn=wo,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=qp,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=xp,d.sequentialExecutionOperationListOfFunctionsArgument=Bo,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Up,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=kp,d.sequentialExecutionOperationListOfFunctionsArgumentRef=Fp,d.sequentialExecutionOperationListOfFunctionsBlueprint=Gp,d.softDeletePersistedEntityMethod=bf,d.softDeletePersistedEntityMethodParentRef=Rf,d.sortCallsBasedOnExecutionDependencies=hv,d.sortChildrenEntitiesBasedOnExecutionDependencies=V6,d.splitListOperation=Po,d.splitListOperationError=qu,d.splitListOperationErrorParentRef=ku,d.splitListOperationFirstOutputListDataType=Mu,d.splitListOperationFirstOutputListReturn=Fu,d.splitListOperationFirstOutputListReturnParentRef=Gu,d.splitListOperationFirstOutputListReturnRef=Io,d.splitListOperationInputListArgument=$u,d.splitListOperationInputListArgumentParentRef=Nu,d.splitListOperationInputListArgumentRef=Cu,d.splitListOperationInputListDataType=Bu,d.splitListOperationSecondOutputListDataType=Uu,d.splitListOperationSecondOutputListReturn=ju,d.splitListOperationSecondOutputListReturnParentRef=xu,d.splitListOperationSplitIndexArgument=Lu,d.splitListOperationSplitIndexArgumentParentRef=Vu,d.splitListOperationSplitIndexArgumentRef=wu,d.splitListOperationSplitIndexDataType=_u,d.stringPrototype=F,d.stringValueAutogenerationSchema=ql,d.suggestNewIdForEntity=ad,d.test_primitive_entities_export=d3,d.toCamelCase=O9,d.toEntityState=Mt,d.toKebabCase=kg,d.toLowerCaseKebabCase=Ys,d.toPascalCase=C9,d.untypedObjectPrototype=Xe,d.updateErrorsList=X,d.updateValueReader=ya,d.urlDefaultValue=by,d.uuidPrototype=fa,d.validateArgumentDeclarationName=rd,d.validateCalledByErrorIdInAction=S6,d.validateCalledByIdInAction=A6,d.validateCallers=sv,d.validateConditionEntityDeclaration=B6,d.validateCustomEntityName=Zs,d.validateDataOperation=xn,d.validateDataOperationDataToValidateArgument=cy,d.validateDataOperationDataToValidateArgumentParentRef=ly,d.validateDataOperationDataToValidateArgumentRef=sy,d.validateDataOperationDataToValidateDataType=oy,d.validateDataOperationEntityToMatchTypeArgument=yy,d.validateDataOperationEntityToMatchTypeArgumentParentRef=py,d.validateDataOperationEntityToMatchTypeArgumentRef=dy,d.validateDataOperationEntityToMatchTypeDataType=uy,d.validateDataOperationError=Ty,d.validateDataOperationErrorParentRef=my,d.validateDataOperationOutputEntityDeclaration=fy,d.validateDataOperationOutputEntityDeclarationParentRef=hy,d.validateEntryCaller=av,d.validateErrorCaller=iv,d.validateFunctionCallDeclaration=lv,d.validateFunctionDeclarationName=ed,d.validateGeneratedEntityParentIsNotBuiltInEntity=v6,d.validateGeneration=b6,d.validateGenerationTarget=Pe,d.validateGenerationUpdate=g6,d.validateLoopEntityDeclaration=w6,d.validateName=w9,d.validateOperationEntityDeclaration=cv,d.validatePropertyName=nd,d.validateReachability=mn,d.validateReadsValueInActionPayload=O6,d.validateReferenceObject=Qs,d.validateReferenceToOne=cd,d.validateReferences=Ge,d.validateReturnDeclarationName=id,d.validateSuccessCaller=rv,d.validateValueReaderGenerationUpdate=da,d.validateValueWritter=fd,d.validateVariableDeclarationName=td,d.valueAutogenerationCurrentDateAndTimeSchema=KR,d.valueAutogenerationGenericSchema=Es,d.valueAutogenerationOptions=Hl,d.valueAutogenerationOptionsSchema=QR,d.valueAutogenerationRandomBooleanSchema=kl,d.valueAutogenerationRandomDateBetweenSchema=lb,d.valueAutogenerationRandomDateFromSchema=sb,d.valueAutogenerationRandomDateSchema=gs,d.valueAutogenerationRandomDateUntilSchema=ob,d.valueAutogenerationRandomNumberBetweenSchema=nb,d.valueAutogenerationRandomNumberFromSchema=eb,d.valueAutogenerationRandomNumberSchema=Rs,d.valueAutogenerationRandomNumberUntilSchema=tb,d.valueAutogenerationRandomSchema=Wi,d.valueAutogenerationRandomTextBetweenSchema=ab,d.valueAutogenerationRandomTextFromSchema=rb,d.valueAutogenerationRandomTextSchema=bs,d.valueAutogenerationRandomTextUntilSchema=ib,d.valueAutogenerationRangeValueTypesSchema=Ji,d.valueAutogenerationUniqueSchema=jl,d.waitOperation=ot,d.waitOperationMillisecondsNumberArgument=Un,d.waitOperationMillisecondsNumberArgumentRef=wp,d.waitOperationMillisecondsNumberDataType=_p,d.waitOperationOperationError=$p,d.waitOperationOperationErrorParentRef=Np,d.waitOperationRef=Mp,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});