@elyx-code/project-logic-tree 0.0.6041 → 0.0.6043

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 (3) hide show
  1. package/dist/index.js +1132 -1131
  2. package/dist/index.umd.cjs +42 -42
  3. package/package.json +1 -1
@@ -1,25 +1,25 @@
1
- (function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var xk=Object.defineProperty;var jk=(u,n,L)=>n in u?xk(u,n,{enumerable:!0,configurable:!0,writable:!0,value:L}):u[n]=L;var c=(u,n,L)=>(jk(u,typeof n!="symbol"?n+"":n,L),L);var n=(r=>(r.CustomEntity="custom-entity",r.BuiltInBaseEntity="built-in-base-entity",r.Project="project",r.InstalledProject="installed-project",r.GlobalEvent="global-event",r.DataType="data-type",r.FunctionCall="function-call",r.FunctionDeclaration="function-declaration",r.ActionDescriptor="action-descriptor",r.ValueDescriptor="value-descriptor",r.ArgumentDeclaration="argument-declaration",r.InputMap="input-map",r.ReturnStatement="return-statement",r.BreakStatement="break-statement",r.ContinueStatement="continue-statement",r.ReturnDeclaration="return-declaration",r.OutputMap="output-map",r.PrimitiveEntity="primitive-entity",r.PrimitiveValue="primitive-value",r.Property="property",r.Operation="operation",r.Condition="condition",r.VariableDeclaration="variable-declaration",r.VariableInstance="variable-instance",r.Search="search",r.Loop="loop",r.InternalCall="internal-call",r.GenericReference="generic-reference",r))(n||{}),L=(r=>(r.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",r.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",r.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",r.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",r.EXECUTION="BUILT_IN_EXECUTION_ENTITY",r.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",r))(L||{}),qe=(r=>(r.CurrentDateAndTime="current-date-and-time",r.Unique="unique",r.Random="random",r))(qe||{}),St=(r=>(r.DeletePersistedEntity="base-delete-persisted-entity",r.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",r.AbortExecution="base-abort-execution",r))(St||{}),M=(r=>(r.Fixed="fixed",r.None="none",r.Dynamic="dynamic",r.Any="any",r.FixedThenDynamic="fixed-then-dynamic",r.FixedThenAny="fixed-then-any",r))(M||{}),B=(r=>(r.FixedArguments="fixed-arguments",r.FixedReturns="fixed-returns",r.ReturnedError="returned-error",r.OngoingProcessExecution="ongoing-process-execution",r))(B||{}),I=(r=>(r.EntityTemplate="entity-template",r.ActionDescriptor="action-descriptor",r.String="string",r.Number="number",r.Boolean="boolean",r.Null="null",r.Enum="enum",r.JSON="json",r.Date="date",r.UUID="uuid",r.File="file",r))(I||{}),ct=(r=>(r.Addition="addition",r.Substraction="substraction",r.Multiplication="multiplication",r.Division="division",r.Remainder="remainder",r.Exponentiation="exponentiation",r))(ct||{}),Ce=(r=>(r.Join="string-join",r.Split="stringSsplit",r.DeleteLast="string-delete-last",r.DeleteFirst="string-delete-first",r.DeleteIndex="string-delete-index",r.AddIndex="string-add-index",r.ReplaceFirst="string-replace-first",r.ReplaceLast="string-replace-last",r.ReplaceIndex="string-replace-index",r.ReplaceSingleMatch="string-replace-single-match",r.ReplaceAllMatches="string-replace-all-matches",r.GetIndex="string-get-index",r.GetFirst="string-get-first",r.GetLast="string-get-last",r.Append="string-append",r.Prepend="string-prepend",r))(Ce||{}),Y=(r=>(r.Join="list-join",r.Split="list-split",r.DeleteLast="list-delete-last",r.DeleteFirst="list-delete-first",r.DeleteIndex="list-delete-index",r.AddIndex="list-add-index",r.ReplaceFirst="list-replace-first",r.ReplaceLast="list-replace-last",r.ReplaceIndex="list-replace-index",r.ReplaceSingleMatch="list-replace-single-match",r.ReplaceAllMatches="list-replace-all-matches",r.GetIndex="list-get-index",r.GetFirst="list-get-first",r.GetLast="list-get-last",r.Append="list-append",r.Prepend="list-prepend",r))(Y||{}),we=(r=>(r.Parallel="parallel",r.Sequential="sequential",r.Wait="wait",r))(we||{}),Xe=(r=>(r.CreateNewInstance="create-new-instance",r.Validate="validate",r))(Xe||{}),Qe=(r=>(r.HttpRequest="base-http-request",r))(Qe||{}),Me=(r=>(r.Equal="equal",r.NotEqual="not-equal",r.And="and",r.Or="or",r.LessThan="less-than",r.MoreThan="more-than",r.LessThanOrEqual="less-than-or-equal",r.MoreThanOrEqual="more-than-or-equal",r))(Me||{}),Mt=(r=>(r.Empty="empty",r.NotEmpty="not-empty",r))(Mt||{}),q=(r=>(r.ManualFlow="manual-flow-loop",r.Counted="counted-loop",r.List="list-loop",r.ObjectKeys="object-keys-loop",r.ObjectValues="object-values-loop",r.String="string-loop",r))(q||{}),je=(r=>(r.OrDataTypeGroup="or-data-type-group",r.AndDataTypeGroup="and-data-type-group",r.DynamicArgumentTypes="dynamic-argument-types",r.DynamicReturnTypes="dynamic-return-types",r))(je||{}),on=(r=>(r.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",r))(on||{}),Cu=(r=>(r.Error="error",r.Task="task",r.Return="return",r))(Cu||{});const An=[n.VariableDeclaration,n.VariableInstance,n.InputMap,n.ReturnDeclaration],$e=[n.VariableDeclaration,n.VariableInstance,n.ArgumentDeclaration,n.OutputMap],Bu=[...An,...$e],ke=[n.VariableDeclaration,n.VariableInstance],Fr=[n.GlobalEvent],Ge=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.InternalCall,n.Loop],xo=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.Loop],Ve=[n.FunctionDeclaration,...Fr],On=[...Ge,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],jo=[...xo,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],ln=[...Ge,...Ve],wu=[...xo,...Ve],WD=[...On,...Ve],HD=[...jo,...Ve],dt=[...Ve,n.Loop],Le=[n.ReturnStatement,n.BreakStatement,n.ContinueStatement],YD=[n.CustomEntity,n.BuiltInBaseEntity,n.Project,n.InstalledProject,n.GlobalEvent,n.DataType,n.FunctionCall,n.FunctionDeclaration,n.ActionDescriptor,n.ValueDescriptor,n.ArgumentDeclaration,n.InputMap,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.ReturnDeclaration,n.OutputMap,n.PrimitiveEntity,n.PrimitiveValue,n.Property,n.Operation,n.Condition,n.VariableDeclaration,n.VariableInstance,n.Search,n.Loop,n.InternalCall],ko=[n.CustomEntity,n.GlobalEvent,n.FunctionDeclaration,n.FunctionCall,n.VariableDeclaration,n.VariableInstance,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.InstalledProject,n.Loop,n.Search],_u=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor],Ur=[n.BuiltInBaseEntity,n.PrimitiveEntity],zD=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.GlobalEvent,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor,n.InputMap,n.OutputMap,n.FunctionCall,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.VariableInstance,n.PrimitiveValue,n.InternalCall];var qo=(r=>(r.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",r))(qo||{});const G={[n.PrimitiveEntity]:{[I.String]:{id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",properties:{}},[I.Boolean]:{id:"f596545d-1565-4faa-9969-d95fa5edfea4",properties:{}},[I.Number]:{id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",properties:{}},[I.JSON]:{id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",properties:{}},[I.Enum]:{id:"9542b8b4-2642-4eee-9db9-def7963a17a0",properties:{options:{id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",dataType:{id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",defaultValue:{id:"enum-options-property-data-type-default-value-id"}}}}},[I.UUID]:{id:"4a6234aa-c0f6-4731-b4dd-750388029226",properties:{}},[I.Date]:{id:"dc58f38b-d574-4956-aac6-32ce9529b937",properties:{}}},[n.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[n.BuiltInBaseEntity]:{[L.KEY_VALUE_PARAM]:{id:L.KEY_VALUE_PARAM},[L.HTTP_ENDPOINT]:{id:L.HTTP_ENDPOINT,properties:{method:{id:"http-endpoint-built-in-method-property-id"},path:{id:"http-endpoint-built-in-path-property-id"},cors:{id:"http-endpoint-built-in-cors-property-id"}}},[L.PERSISTED_ENTITY]:{id:L.PERSISTED_ENTITY,properties:{database:{id:"persisted-built-in-base-entity-database-property-id"},identifier:{id:"persisted-built-in-base-entity-identifier-property-id"}}},[L.RELATIONAL_DATABASE]:{id:L.RELATIONAL_DATABASE,properties:{identifier:{id:"relational-database-built-in-base-entity-identifier-property-id"},username:{id:"relational-database-built-in-base-entity-username-property-id"},password:{id:"relational-database-built-in-base-entity-password-property-id"},minSize:{id:"relational-database-built-in-base-entity-min-size-property-id"},default:{id:"relational-database-built-in-base-entity-default-property-id"},autoscaling:{id:"relational-database-built-in-base-entity-autoscaling-property-id"}}},[L.CRON_JOB]:{id:L.CRON_JOB,properties:{expression:{id:"cron-job-built-in-base-entity-expression-property-id"}}}},[n.Operation]:{[Ce.Join]:{id:Ce.Join,inputs:{first:{id:"join-string-first-string-input-id"},second:{id:"join-string-second-string-input-id"}},outputs:{result:{id:"join-string-result-string-return-delaration-id"},error:{id:"join-string-error-return-delaration-id"}}},[Qe.HttpRequest]:{id:Qe.HttpRequest,inputs:{url:{id:"http-request-url-input-id"},query:{id:"http-request-query-input-id"},method:{id:"http-request-method-input-id"},headers:{id:"http-request-headers-input-id"},body:{id:"http-request-body-string-input-id"}},outputs:{code:{id:"http-response-code-return-delaration-id"},body:{id:"http-response-body-return-delaration-id"},headers:{id:"http-response-headers-return-delaration-id"},error:{id:"http-request-error-return-delaration-id"}}}},[n.Loop]:{[q.List]:{id:q.List,inputs:{list:{id:"iterate-over-list-loop-list-input-id"}},outputs:{results:{id:"iterate-over-list-loop-output-id"}},body:{id:"iterate-over-list-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-list-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-list-loop-current-value-input-id"}}}},[q.String]:{id:q.String,inputs:{string:{id:"iterate-over-string-loop-string-input-id"}},outputs:{results:{id:"iterate-over-string-loop-output-id"}},body:{id:"iterate-over-string-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-string-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-string-loop-current-value-input-id"}}}},[q.ObjectKeys]:{id:q.ObjectKeys,inputs:{object:{id:"iterate-over-object-keys-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-keys-loop-output-id"}},body:{id:"iterate-over-object-keys-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-keys-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-keys-loop-current-value-input-id"}}}},[q.ObjectValues]:{id:q.ObjectValues,inputs:{object:{id:"iterate-over-object-values-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-values-loop-output-id"}},body:{id:"iterate-over-object-values-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-values-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-values-loop-current-value-input-id"}}}},[q.ManualFlow]:{id:q.ManualFlow,inputs:{},outputs:{results:{id:"manual-flow-loop-output-id"}},body:{id:"manual-flow-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-manual-flow-loop-iteration-number-input-id"}}}},[q.Counted]:{id:q.Counted,inputs:{number:{id:"iterate-over-counted-loop-number-input-id"}},outputs:{results:{id:"iterate-over-counted-loop-output-id"}},body:{id:"iterate-over-counted-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-counted-loop-iteration-number-input-id"}}}}},[n.Condition]:{[Me.MoreThanOrEqual]:{id:Me.MoreThanOrEqual,inputs:{leftHand:{id:"condition-more-than-or-equal-left-hand-input-id"},rightHand:{id:"condition-more-than-or-equal-right-hand-input-id"}}},[Mt.NotEmpty]:{id:Mt.NotEmpty,inputs:{leftHand:{id:"condition-not-empty-input-id"}}}},[n.GlobalEvent]:{[on.PROJECT_PUBLICATION_COMPLETED]:{id:on.PROJECT_PUBLICATION_COMPLETED}}},Yt=G["primitive-entity"],x={type:n.PrimitiveEntity,id:Yt.string.id,description:"A string of characters.",version:1,name:I.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Sn={type:n.PrimitiveEntity,id:Yt.boolean.id,description:"A 'true' or 'false' value.",version:1,name:I.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},te={type:n.PrimitiveEntity,id:Yt.number.id,description:"A number value.",version:1,name:I.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ye={type:n.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:I.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Nu={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:n.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:n.DataType},Mu={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:n.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:n.Property},Vu={like:!1,inferred:!1,id:Yt.enum.properties.options.dataType.id,version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:{id:Yt.enum.properties.options.dataType.defaultValue.id,type:n.PrimitiveValue,version:1,name:I.JSON,autogeneration:null,value:[],valueAsType:null,parent:Nu},parent:Mu},Lu={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:n.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:n.PrimitiveEntity},$u={hidden:!1,required:!0,id:Yt.enum.properties.options.id,name:"Options",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Vu,description:"Options for the enum. Each option is a text value.",parent:Lu},Cn={type:n.PrimitiveEntity,id:Yt.enum.id,description:"A set of text options to choose from.",version:1,name:I.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[$u],methods:[]},cn={type:n.PrimitiveEntity,id:Yt.date.id,description:"A date and time value.",version:1,name:I.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ga={type:n.PrimitiveEntity,id:Yt.uuid.id,description:"A unique identifier in the form of a 36-character string.",version:1,name:I.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[x],properties:[],methods:[]},Jo={type:n.PrimitiveEntity,id:Yt.json.id,description:"A complex data structure with any combination of properties with names and values.",version:1,name:I.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Gu=(r=>(r.FirstInputNumber="number-addition-first-number-argument-declaration",r.SecondInputNumber="number-addition-second-number-argument-declaration",r))(Gu||{}),Fu=(r=>(r.ResultNumber="number-addition-result-number-return-delaration",r.Error="number-addition-error-return-delaration",r))(Fu||{});const Uu={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:n.ValueDescriptor},xu={like:!1,inferred:!1,id:"number-addition-first-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Uu},ju={type:n.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:n.ValueDescriptor},ku={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ju},qu={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:n.ValueDescriptor},Ju={like:!1,inferred:!1,id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qu},Wu={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:ct.Addition,entityType:n.ActionDescriptor},Wo={id:"number-addition-first-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:xu,required:!0,parentRelationType:B.FixedArguments,index:0,parent:Wu},Hu={type:n.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:ct.Addition,entityType:n.ActionDescriptor},Ho={id:"number-addition-second-number-argument-declaration",type:n.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:ku,required:!0,parentRelationType:B.FixedArguments,index:1,parent:Hu},Yu={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:ct.Addition,entityType:n.ActionDescriptor},Yo={parentRelationType:B.FixedReturns,id:"number-addition-result-number-return-delaration",type:n.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:Ju,required:!0,index:0,parent:Yu},zu={type:n.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:ct.Addition,entityType:n.ActionDescriptor},Zu={parentRelationType:B.FixedReturns,id:"number-addition-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:zu},Fa={id:ct.Addition,type:n.ActionDescriptor,description:"Add two numbers together",version:1,name:ct.Addition,fixedArguments:[Wo,Ho],error:Zu,fixedReturns:[Yo],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ku={[ct.Addition]:Fa};var Xu=(r=>(r.FirstInputString="join-string-first-string-argument-declaration",r.SecondInputString="join-string-second-string-argument-declaration",r))(Xu||{}),Qu=(r=>(r.ResultString="join-string-result-string-return-delaration",r.Error="join-string-error-return-delaration",r))(Qu||{});const ep={type:n.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:n.ValueDescriptor},tp={like:!1,inferred:!1,id:"join-string-first-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ep},np={type:n.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:n.ValueDescriptor},rp={like:!1,inferred:!1,id:"join-string-second-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:np},ip={type:n.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:n.ValueDescriptor},ap={like:!1,inferred:!1,id:"join-string-result-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ip},sp={type:n.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},Ua={id:"join-string-first-string-argument-declaration",type:n.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:tp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:sp},op={type:n.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},xa={id:"join-string-second-string-argument-declaration",type:n.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:rp,parentRelationType:B.FixedArguments,required:!0,index:1,parent:op},lp={type:n.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},vi={parentRelationType:B.FixedReturns,id:"join-string-result-string-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:ap,required:!0,index:0,parent:lp},cp={type:n.GenericReference,id:"join-string-operation-error-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},dp={parentRelationType:B.FixedReturns,id:"join-string-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:cp},Ii={id:Ce.Join,type:n.ActionDescriptor,version:1,name:Ce.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Ua,xa],fixedReturns:[vi],error:dp,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},up={[Ce.Join]:Ii};var pp=(r=>(r.FirstInputList="join-list-first-list-argument-declaration",r.SecondInputList="join-list-second-list-argument-declaration",r))(pp||{}),yp=(r=>(r.ResultList="join-list-result-list-return-delaration",r.Error="join-list-error-return-delaration",r))(yp||{});const hp={type:n.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:n.ValueDescriptor},fp={like:!1,inferred:!1,id:"join-list-first-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:hp},mp={type:n.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:n.ValueDescriptor},Tp={like:!1,inferred:!1,id:"join-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:mp},Ep={type:n.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:n.ValueDescriptor},bp={like:!1,inferred:!1,id:"join-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ep},Rp={type:n.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},gp={id:"join-list-first-list-argument-declaration",type:n.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:fp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Rp},vp={type:n.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Ip={id:"join-list-second-list-argument-declaration",type:n.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:Tp,parentRelationType:B.FixedArguments,required:!0,index:1,parent:vp},Dp={type:n.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Pp={parentRelationType:B.FixedReturns,id:"join-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:bp,required:!0,index:0,parent:Dp},Ap={type:n.GenericReference,id:"join-list-operation-error-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Op={parentRelationType:B.FixedReturns,id:"join-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ap},zo={id:Y.Join,type:n.ActionDescriptor,version:1,name:Y.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[gp,Ip],error:Op,fixedReturns:[Pp],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Sp=(r=>(r.InputList="list-to-split-argument-declaration",r.SplitIndex="split-list-index-argument-declaration",r))(Sp||{}),Cp=(r=>(r.FirstOutputList="split-list-first-output-list-return-delaration",r.SecondOutputList="split-list-second-output-list-return-delaration",r.Error="split-list-error-return-delaration",r))(Cp||{});const Bp={type:n.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:n.ValueDescriptor},wp={like:!1,inferred:!1,id:"split-list-operation-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Bp},_p={type:n.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:n.ValueDescriptor},Np={like:!1,inferred:!1,id:"split-list-operation-split-index-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_p},Zo={type:n.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:n.ValueDescriptor},Mp={like:!1,inferred:!1,id:"split-list-operation-first-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zo},Vp={type:n.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Lp={id:"list-to-split-argument-declaration",type:n.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:wp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Vp},$p={type:n.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Gp={id:"split-list-index-argument-declaration",type:n.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:Np,parentRelationType:B.FixedArguments,required:!0,index:1,parent:$p},Fp={type:n.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Up={parentRelationType:B.FixedReturns,id:"split-list-first-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:Mp,required:!0,index:0,parent:Fp},xp={like:!1,inferred:!1,id:"split-list-operation-second-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zo},jp={type:n.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},kp={parentRelationType:B.FixedReturns,id:"split-list-second-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:xp,required:!0,index:0,parent:jp},qp={type:n.GenericReference,id:"split-list-operation-error-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Jp={parentRelationType:B.FixedReturns,id:"split-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:qp},Ko={id:Y.Split,type:n.ActionDescriptor,version:1,name:Y.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:[Lp,Gp],fixedReturns:[Up,kp],error:Jp,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Wp=(r=>(r.InputList="get-last-in-list-input-list-argument-declaration",r))(Wp||{}),Hp=(r=>(r.OutputElement="get-last-in-list-output-element-return-delaration",r.Error="get-last-in-list-error-return-delaration",r))(Hp||{});const Yp={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:n.ValueDescriptor},zp={like:!1,inferred:!1,id:"get-last-in-list-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Yp},Zp={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:n.ValueDescriptor},Kp={like:!1,inferred:!1,id:"get-last-in-list-output-element-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zp},Xp={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},Qp={id:"get-last-in-list-input-list-argument-declaration",type:n.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:zp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Xp},ey={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},ty={parentRelationType:B.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:n.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:Kp,required:!0,index:0,parent:ey},ny={type:n.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},ry={parentRelationType:B.FixedReturns,id:"get-last-in-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ny},Xo={id:Y.GetLast,type:n.ActionDescriptor,version:1,name:Y.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[Qp],fixedReturns:[ty],error:ry,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var iy=(r=>(r.List="append-to-list-lsit-argument-declaration",r.ElementToAppend="append-to-list-element-to-append-argument-declaration",r))(iy||{}),ay=(r=>(r.ResultList="append-to-list-result-list-return-delaration",r.Error="append-to-list-error-return-delaration",r))(ay||{});const sy={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:n.ValueDescriptor},oy={like:!1,inferred:!1,id:"append-to-list-lsit-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:sy},ly={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:n.ValueDescriptor},cy={like:!1,inferred:!1,id:"append-to-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ly},dy={type:n.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:n.ValueDescriptor},uy={like:!1,inferred:!1,id:"append-to-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:dy},py={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},Qo={id:"append-to-list-lsit-argument-declaration",type:n.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:oy,parentRelationType:B.FixedArguments,required:!0,index:0,parent:py},yy={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},el={id:"append-to-list-element-to-append-argument-declaration",type:n.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:cy,parentRelationType:B.FixedArguments,required:!0,index:1,parent:yy},hy={type:n.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},fy={parentRelationType:B.FixedReturns,id:"append-to-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:uy,required:!0,index:0,parent:hy},my={type:n.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},Ty={parentRelationType:B.FixedReturns,id:"append-to-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:my},ja={id:Y.Append,type:n.ActionDescriptor,version:1,name:Y.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[Qo,el],error:Ty,fixedReturns:[fy],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ey={[Y.Join]:zo,[Y.Split]:Ko,[Y.GetLast]:Xo,[Y.Append]:ja};var by=(r=>(r.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",r))(by||{}),Ry=(r=>(r.ListOfExecutionResults="parallel-execution-result-return-delaration",r.Error="parallel-execution-error-return-delaration",r))(Ry||{});const gy={id:"parallel-execution-list-of-functions-blueprint-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},vy={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},Iy={like:!1,inferred:!1,id:"parallel-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:gy,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:vy},Dy={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:n.ValueDescriptor},Py={like:!1,inferred:!1,id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Dy},Ay={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:we.Parallel,entityType:n.ActionDescriptor},tl={id:"parallel-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Iy,required:!0,index:0,parent:Ay,parentRelationType:B.FixedArguments},Oy={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:we.Parallel,entityType:n.ActionDescriptor},nl={id:"parallel-execution-result-return-delaration",type:n.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:Py,required:!0,index:0,parent:Oy,parentRelationType:B.FixedReturns},Sy={type:n.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:we.Parallel,entityType:n.ActionDescriptor},Cy={id:"parallel-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Sy,parentRelationType:B.ReturnedError},xt={id:we.Parallel,type:n.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:we.Parallel,fixedArguments:[tl],fixedReturns:[nl],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Cy,parent:null};var By=(r=>(r.MillisecondsNumber="wait-milliseconds-number-argument-declaration",r))(By||{}),wy=(r=>(r.Error="wait-operation-error-return-delaration",r))(wy||{});const _y={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:n.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},Ny={like:!1,inferred:!1,id:"wait-milliseconds-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_y},My={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:n.ActionDescriptor,entityId:we.Wait},Xn={id:"wait-milliseconds-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:Ny,required:!0,index:0,parent:My,parentRelationType:B.FixedArguments},Vy={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:we.Wait,entityType:n.ActionDescriptor},Ly={id:"wait-operation-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Vy,parentRelationType:B.ReturnedError},ut={id:we.Wait,type:n.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:we.Wait,fixedArguments:[Xn],fixedReturns:[],error:Ly,argumentsType:M.Fixed,returnsType:M.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var $y=(r=>(r.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",r))($y||{}),Gy=(r=>(r.ListOfExecutionResults="sequential-execution-result-return-delaration",r.Error="sequential-execution-error-return-delaration",r))(Gy||{});const Fy={id:"sequential-execution-list-of-functions-blueprint-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Uy={type:n.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},xy={like:!1,inferred:!1,id:"sequential-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Fy,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Uy},jy={type:n.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:n.ValueDescriptor},ky={like:!1,inferred:!1,id:"sequential-execution-list-of-execution-results-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:jy},qy={type:n.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},rl={id:"sequential-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:xy,required:!0,index:0,parent:qy,parentRelationType:B.FixedArguments},Jy={type:n.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},il={id:"sequential-execution-result-return-delaration",type:n.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:ky,required:!0,index:0,parent:Jy,parentRelationType:B.FixedReturns},Wy={type:n.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},Hy={id:"sequential-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Wy,parentRelationType:B.ReturnedError},dn={id:we.Sequential,type:n.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:we.Sequential,fixedArguments:[rl],fixedReturns:[il],error:Hy,returnsType:M.Fixed,argumentsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Yy={[we.Parallel]:xt,[we.Wait]:ut,[we.Sequential]:dn};var zy=(r=>(r.EntityToInstanciate="entity-to-instanciate-argument-declaration",r.NewEntityData="new-entity-data-argument-declaration",r))(zy||{}),Zy=(r=>(r.Error="create-new-instance-error-return-delaration",r))(Zy||{});const Ky={type:n.GenericReference,id:"new-entity-data-argument-declaration-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},Xy={type:n.GenericReference,id:"new-entity-data-argument-data-type-parent-ref",entityId:"new-entity-data-argument-declaration",entityType:n.ValueDescriptor},Qy={like:!1,inferred:!1,id:"new-entity-data-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Xy},eh={id:"new-entity-data-argument-declaration",type:n.ValueDescriptor,version:1,name:"Data for new entity",description:"The data to be used to create the new entity, with all the required properties",dataType:Qy,required:!0,parentRelationType:B.FixedArguments,index:1,parent:Ky},th={type:n.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},nh={like:!1,inferred:!1,id:"entity-to-instanciate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:th},rh={type:n.GenericReference,id:"create-new-instance-operation-ref",entityType:n.ActionDescriptor,entityId:Xe.CreateNewInstance},ih={id:"entity-to-instanciate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:nh,required:!0,parentRelationType:B.FixedArguments,index:0,parent:rh},ah={type:n.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},sh={parentRelationType:B.FixedReturns,id:"create-new-instance-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:ah,required:!0,index:0},oh={type:n.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},lh={parentRelationType:B.FixedReturns,id:"create-new-instance-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:oh},Qn={id:Xe.CreateNewInstance,type:n.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:Xe.CreateNewInstance,fixedArguments:[ih,eh],fixedReturns:[sh],error:lh,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var ch=(r=>(r.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",r.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",r))(ch||{}),dh=(r=>(r.Error="validate-data-error-return-delaration",r.OutputEntity="validate-data-output-entity-declaration",r))(dh||{});const uh={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},ph={like:!1,inferred:!1,id:"validate-data-operation-data-to-validate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uh},yh={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Xe.Validate},hh={id:"validate-data-operation-data-to-validate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:ph,required:!0,parentRelationType:B.FixedArguments,index:0,parent:yh},fh={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},mh={like:!1,inferred:!1,id:"validate-data-operation-entity-to-match-type-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fh},Th={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Xe.Validate},Eh={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:mh,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Th},bh={type:n.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Xe.Validate,entityType:n.ActionDescriptor},Rh={id:"validate-data-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:bh,required:!0,index:0,parentRelationType:B.FixedReturns},gh={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:Xe.Validate,entityType:n.ActionDescriptor},vh={id:"validate-data-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:gh,parentRelationType:B.ReturnedError},er={id:Xe.Validate,type:n.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Xe.Validate,fixedArguments:[Eh,hh],fixedReturns:[Rh],error:vh,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ih={[Xe.CreateNewInstance]:Qn,[Xe.Validate]:er},ze=G[n.Operation]["base-http-request"],Dh={type:n.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:n.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},Ph={id:"http-request-url-default-value-id",type:n.PrimitiveValue,version:1,value:"https://some-url.com",name:I.String,valueAsType:null,parent:Dh,autogeneration:null},Ah={type:n.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:ze.inputs.url.id,entityType:n.ValueDescriptor},Oh={like:!1,inferred:!1,id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:Ph,constant:!1,parent:Ah},Sh={type:n.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:ze.inputs.query.id,entityType:n.ValueDescriptor},Ch={like:!1,inferred:!1,id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Sh},Bh={type:n.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:n.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},wh={id:"http-request-method-default-value-id",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,valueAsType:null,parent:Bh,autogeneration:null},_h={type:n.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:ze.inputs.method.id,entityType:n.ValueDescriptor},Nh={like:!1,inferred:!1,id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:wh,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:_h},Mh={type:n.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:ze.inputs.headers.id,entityType:n.ValueDescriptor},Vh={like:!1,inferred:!1,id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Mh},Lh={type:n.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:ze.inputs.body.id,entityType:n.ValueDescriptor},$h={like:!1,inferred:!1,id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Lh},Gh={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:ze.outputs.code.id},Fh={like:!1,inferred:!1,id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Gh},Uh={type:n.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:n.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},xh={type:n.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:n.ValueDescriptor,entityId:ze.outputs.headers.id},jh={like:!1,inferred:!1,id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:I.JSON,parent:Uh,valueAsType:null,autogeneration:null},constant:!1,parent:xh},kh={type:n.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:n.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},qh={type:n.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:n.ValueDescriptor,entityId:ze.outputs.body.id},Jh={like:!1,inferred:!1,id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:I.JSON,parent:kh,valueAsType:null,autogeneration:null},constant:!1,parent:qh},Wh={type:n.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},ka={id:ze.inputs.method.id,type:n.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:Nh,required:!1,index:0,parentRelationType:B.FixedArguments,parent:Wh},Hh={type:n.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},qa={id:ze.inputs.url.id,type:n.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:Oh,required:!1,index:1,parentRelationType:B.FixedArguments,parent:Hh},Yh={type:n.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},al={id:ze.inputs.query.id,type:n.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:Ch,required:!1,index:2,parentRelationType:B.FixedArguments,parent:Yh},zh={type:n.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Ja={id:ze.inputs.headers.id,type:n.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:Vh,required:!1,index:3,parent:zh,parentRelationType:B.FixedArguments},Zh={type:n.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Wa={id:ze.inputs.body.id,type:n.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:$h,required:!1,index:4,parentRelationType:B.FixedArguments,parent:Zh},Kh={type:n.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},sl={id:ze.outputs.code.id,type:n.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:Fh,required:!0,index:0,parentRelationType:B.FixedReturns,parent:Kh},Xh={type:n.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Ha={parentRelationType:B.FixedReturns,id:ze.outputs.headers.id,type:n.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:jh,required:!0,index:1,parent:Xh},Qh={type:n.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Di={parentRelationType:B.FixedReturns,id:ze.outputs.body.id,type:n.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:Jh,required:!0,index:2,parent:Qh},ef={type:n.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},tf={type:n.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:n.ValueDescriptor,entityId:ze.outputs.error.id},nf={like:!1,inferred:!1,id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:tf},ol={parentRelationType:B.ReturnedError,id:ze.outputs.error.id,type:n.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:nf,required:!0,index:0,parent:ef},Pi={type:n.ActionDescriptor,id:Qe.HttpRequest,name:Qe.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:[ka,qa,al,Ja,Wa],fixedReturns:[sl,Ha,Di],argumentsType:M.Fixed,returnsType:M.Fixed,error:ol,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},rf={[Qe.HttpRequest]:Pi},ZD={...up,...Ku,...Ey,...Yy,...Ih,...rf},ll={id:q.ManualFlow,type:n.ActionDescriptor,version:1,name:q.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:[],argumentsType:M.None,returnsType:M.Any,error:null,parent:null},cl=G[n.Loop]["manual-flow-loop"],af={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"manual-flow-loop-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},sf={like:!1,inferred:!1,id:"manual-flow-loop-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:af},of={id:"manual-flow-loop-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:cl.body.id,entityType:n.ActionDescriptor},dl={id:cl.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the manual flow loop. Keeps track of the number of iterations that have been executed.",dataType:sf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:of},ul={id:cl.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the manual flow loop.",fixedArguments:[dl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},KD=G[n.Loop]["list-loop"],lf={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:n.ValueDescriptor},cf={like:!1,inferred:!1,id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:lf},df={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.List,entityType:n.ActionDescriptor},uf={id:KD.inputs.list.id,type:n.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:cf,index:0,parent:df,parentRelationType:B.FixedArguments},tr={id:q.List,type:n.ActionDescriptor,version:1,name:q.List,description:"Iterates over a list of entities",fixedArguments:[uf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ai=G[n.Loop]["list-loop"],pf={id:"iterate-over-list-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},yf={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:pf},hf={id:"iterate-over-list-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Ai.body.id,entityType:n.ActionDescriptor},Ya={id:Ai.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the list that is being iterated over. This value is passed to the child actions.",dataType:yf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:hf},ff={id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},mf={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:ff},Tf={id:"iterate-over-list-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Ai.body.id,entityType:n.ActionDescriptor},Ef={id:Ai.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the list loop. Keeps track of the number of iterations that have been executed.",dataType:mf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Tf},za={id:Ai.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the list loop.",fixedArguments:[Ef,Ya],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},XD=G[n.Loop]["string-loop"],bf={id:"iterate-over-string-loop-string-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-string-argument-declaration-id",entityType:n.ValueDescriptor},Rf={like:!1,inferred:!1,id:"iterate-over-string-loop-string-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:bf},gf={id:"iterate-over-string-loop-string-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.String,entityType:n.ActionDescriptor},vf={id:XD.inputs.string.id,type:n.ValueDescriptor,version:1,name:"Texts",description:"The text to iterate over the characters of",required:!0,dataType:Rf,index:0,parent:gf,parentRelationType:B.FixedArguments},Za={id:q.String,type:n.ActionDescriptor,version:1,name:q.String,description:"Iterates over a string of entities",fixedArguments:[vf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Oi=G[n.Loop]["string-loop"],If={id:"iterate-over-string-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Df={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:If},Pf={id:"iterate-over-string-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Oi.body.id,entityType:n.ActionDescriptor},pl={id:Oi.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the string that is being iterated over. This value is passed to the child actions.",dataType:Df,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Pf},Af={id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},Of={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Af},Sf={id:"iterate-over-string-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Oi.body.id,entityType:n.ActionDescriptor},yl={id:Oi.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",dataType:Of,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Sf},hl={id:Oi.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",fixedArguments:[yl,pl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},QD=G[n.Loop]["object-keys-loop"],Cf={id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-object-argument-declaration-id",entityType:n.ValueDescriptor},Bf={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:null,parent:Cf},wf={id:"iterate-over-object-keys-loop-object-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.ObjectKeys,entityType:n.ActionDescriptor},_f={id:QD.inputs.object.id,type:n.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,dataType:Bf,index:0,parent:wf,parentRelationType:B.FixedArguments},Si={id:q.ObjectKeys,type:n.ActionDescriptor,version:1,name:q.ObjectKeys,description:"Iterates over a object of entities",fixedArguments:[_f],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ci=G[n.Loop]["object-keys-loop"],Nf={id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Mf={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:Nf},Vf={id:"iterate-over-object-keys-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Ci.body.id,entityType:n.ActionDescriptor},fl={id:Ci.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-keys that is being iterated over. This value is passed to the child actions.",dataType:Mf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Vf},Lf={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},$f={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Lf},Gf={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Ci.body.id,entityType:n.ActionDescriptor},Ff={id:Ci.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-keys loop. Keeps track of the number of iterations that have been executed.",dataType:$f,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Gf},Uf={id:Ci.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-keys loop.",fixedArguments:[Ff,fl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},eP=G[n.Loop]["object-values-loop"],xf={id:"iterate-over-object-values-loop-object-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-object-argument-declaration-id",entityType:n.ValueDescriptor},jf={like:!1,inferred:!1,id:"iterate-over-object-values-loop-object-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:null,parent:xf},kf={id:"iterate-over-object-values-loop-object-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.ObjectValues,entityType:n.ActionDescriptor},qf={id:eP.inputs.object.id,type:n.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,dataType:jf,index:0,parent:kf,parentRelationType:B.FixedArguments},Bi={id:q.ObjectValues,type:n.ActionDescriptor,version:1,name:q.ObjectValues,description:"Iterates over a object of entities",fixedArguments:[qf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},wi=G[n.Loop]["object-values-loop"],Jf={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Wf={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:null,isNullable:!1,constant:!1,entity:null,asType:null,like:!1,inferred:!1,defaultValue:null,parent:Jf},Hf={id:"iterate-over-object-values-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:wi.body.id,entityType:n.ActionDescriptor},ml={id:wi.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-values that is being iterated over. This value is passed to the child actions.",dataType:Wf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Hf},Yf={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},zf={like:!1,inferred:!1,id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Yf},Zf={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:wi.body.id,entityType:n.ActionDescriptor},Kf={id:wi.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-values loop. Keeps track of the number of iterations that have been executed.",dataType:zf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Zf},Xf={id:wi.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-values loop.",fixedArguments:[Kf,ml],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},tP=G[n.Loop]["counted-loop"],Qf={id:"iterate-over-counted-loop-string-argument-declaration-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-string-argument-declaration-data-type-id",entityType:n.DataType},em={id:"iterate-over-counted-loop-string-argument-declaration-data-type-default-value-id",type:n.PrimitiveValue,name:I.Number,version:1,value:5,valueAsType:null,autogeneration:null,parent:Qf},tm={id:"iterate-over-counted-loop-string-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-string-argument-declaration-id",entityType:n.ValueDescriptor},nm={like:!1,inferred:!1,id:"iterate-over-counted-loop-string-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:em,parent:tm},rm={id:"iterate-over-counted-loop-string-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.Counted,entityType:n.ActionDescriptor},im={id:tP.inputs.number.id,type:n.ValueDescriptor,version:1,name:"Number of iterations",description:"The number of iterations to perform",required:!0,dataType:nm,index:0,parent:rm,parentRelationType:B.FixedArguments},Ka={id:q.Counted,type:n.ActionDescriptor,version:1,name:q.Counted,description:"Iterates a given number of times",fixedArguments:[im],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Tl=G[n.Loop]["counted-loop"],am={id:"iterate-over-counted-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},sm={like:!1,inferred:!1,id:"iterate-over-counted-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:am},om={id:"iterate-over-counted-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Tl.body.id,entityType:n.ActionDescriptor},El={id:Tl.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",dataType:sm,required:!0,index:0,parentRelationType:B.FixedArguments,parent:om},bl={id:Tl.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",fixedArguments:[El],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},Xa=G[n.BuiltInBaseEntity][L.KEY_VALUE_PARAM],nP={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:n.DataType},lm={id:"key-value-param-built-in-base-entity-name-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:n.Property},rP={like:!1,inferred:!1,id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:lm},cm={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:n.GenericReference,entityId:Xa.id,entityType:n.BuiltInBaseEntity},dm={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:rP,description:"The name of the path parameter",parent:cm},iP={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:n.DataType},um={id:"key-value-param-built-in-base-entity-value-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:n.Property},aP={like:!1,inferred:!1,id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:um},pm={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:n.GenericReference,entityId:Xa.id,entityType:n.BuiltInBaseEntity},ym={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:aP,description:"The value of the path parameter",parent:pm},Qa={id:Xa.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Xa.id,type:n.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[dm,ym],abstractMethods:[],methods:[],extends:[]},_i=G[n.BuiltInBaseEntity][L.HTTP_ENDPOINT].properties,hm={id:"endpointBuiltInCorsPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},fm={id:"endpointBuiltInCorsPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:_i.cors.id},mm={like:!1,inferred:!1,id:"endpointBuiltInCorsPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:["*"],parent:hm,autogeneration:null,valueAsType:null},parent:fm},Tm={id:"endpointBuiltInBaseEntityRef",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Em={hidden:!0,required:!0,id:_i.cors.id,name:"Allowed origins",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:mm,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:Tm},bm={id:"endpointBuiltInPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Rm={id:"endpointBuiltInPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:_i.path.id},gm={like:!1,inferred:!1,id:"endpointBuiltInPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.String,value:"/",parent:bm,autogeneration:null,valueAsType:null},parent:Rm},vm={id:"endpointBuiltInBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Rl={hidden:!1,required:!0,id:_i.path.id,name:"Path",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:gm,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:vm},Im={id:"endpointBuiltInMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Dm={id:"endpointBuiltInMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"endpointBuiltInMethodProperty"},Pm={like:!1,inferred:!1,id:"endpointBuiltInMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Cn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,parent:Im,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Dm},Am={id:"endpointBuiltInBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},gl={hidden:!1,required:!0,id:_i.method.id,name:"Method",version:1,type:n.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Pm,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Am},Om={id:"endpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestHeadersVariableDataType"},Sm={id:"endpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},Cm={like:!1,inferred:!1,id:"endpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:Om,autogeneration:null,valueAsType:null},parent:Sm},Bm={id:"endpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},wm={like:!1,inferred:!1,id:"endpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:Bm},_m={id:"endpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Nm={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Mm={like:!1,inferred:!1,id:"endpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:Qa,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:[],parent:_m,autogeneration:null,valueAsType:null},parent:Nm},Vm={id:"endpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointPathParamsVariableDataType"},Lm={id:"endpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},$m={like:!1,inferred:!1,id:"endpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Qa,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:[],parent:Vm,autogeneration:null,valueAsType:null},parent:Lm},Gm={id:"endpointReachedTriggerActionDescriptorRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},vl={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ValueDescriptor,name:"Request headers",dataType:Cm,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Gm},Fm={id:"endpointReachedTriggerActionDescriptorRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Il={id:"endpointPathParamsArgumentDeclaration",type:n.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:$m,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Fm},Um={id:"endpointReachedTriggerActionDescriptorRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Dl={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:n.ValueDescriptor,name:"Request query params",dataType:Mm,required:!0,index:2,parentRelationType:B.FixedArguments,parent:Um},xm={id:"endpointReachedTriggerActionDescriptorRefFour",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Pl={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ValueDescriptor,name:"Request body",dataType:wm,index:3,required:!0,parentRelationType:B.FixedArguments,parent:xm},jm={id:"endpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},km={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jm},qm={id:"endpointReturnStatementRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Al={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:n.ValueDescriptor,name:"Response code",dataType:km,required:!0,index:0,parentRelationType:B.FixedReturns,parent:qm},Jm={id:"endpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointResponseHeadersDataType"},Wm={id:"endpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},Hm={like:!1,inferred:!1,id:"endpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:Jm,autogeneration:null,valueAsType:null},parent:Wm},Ym={id:"endpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Ol={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ValueDescriptor,name:"Response headers",dataType:Hm,required:!1,index:1,parentRelationType:B.FixedReturns,parent:Ym},zm={id:"endpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},Zm={like:!1,inferred:!1,id:"endpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:zm},Km={id:"endpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Sl={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ValueDescriptor,name:"Response body",dataType:Zm,required:!1,index:2,parentRelationType:B.FixedReturns,parent:Km},Xm={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Cl={id:"endpointReachedTriggerActionDescriptor",type:n.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:M.Fixed,dynamicArgumentTypes:null,fixedArguments:[vl,Il,Dl,Pl],returnsType:M.Fixed,fixedReturns:[Al,Ol,Sl],error:null,dynamicReturnTypes:null,parent:Xm},es={id:L.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:L.HTTP_ENDPOINT,type:n.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Em,Rl,gl],abstractMethods:[Cl],extends:[],methods:[]},Vt=G[n.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,Qm={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},eT={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:Vt.properties.identifier.id,entityType:n.Property},sP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:null,parent:Qm,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:eT},xr={id:"relational-database-built-in-base-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},ts={hidden:!1,required:!0,id:Vt.properties.identifier.id,name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:sP,description:"The name of the main database inside of the server instance where the data will be stored.",parent:xr},oP={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:n.DataType},tT={id:"relational-database-built-in-base-entity-username-property-ref-id",type:n.GenericReference,entityId:Vt.properties.username.id,entityType:n.Property},lP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:n.DataType},autogeneration:null,valueAsType:null},parent:tT},ns={hidden:!1,required:!0,id:Vt.properties.username.id,name:"Username",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:lP,description:"The username that will be used to connect to the database.",parent:xr},cP={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:n.DataType},nT={id:"relational-database-built-in-base-entity-password-property-ref-id",type:n.GenericReference,entityId:Vt.properties.password.id,entityType:n.Property},dP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:nT},rs={hidden:!1,required:!0,id:Vt.properties.password.id,name:"Password",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:dP,description:"The password that will be used to connect to the database.",parent:xr},rT={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:n.DataType},iT={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:n.GenericReference,entityId:Vt.properties.minSize.id,entityType:n.Property},uP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:rT,autogeneration:null,valueAsType:null},parent:iT},is={hidden:!0,required:!0,id:Vt.properties.minSize.id,name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:uP,description:"The minimum size of the database in GB.",parent:xr},aT={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:n.DataType},sT={id:"relational-database-built-in-base-entity-default-property-ref-id",type:n.GenericReference,entityId:Vt.properties.default.id,entityType:n.Property},pP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Sn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!1,parent:aT,autogeneration:null,valueAsType:null},parent:sT},Bl={hidden:!0,required:!0,id:Vt.properties.default.id,name:"Default",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:pP,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:xr},oT={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:n.GenericReference,entityId:Vt.properties.autoscaling.id,entityType:n.Property},lT={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",entityType:n.DataType},yP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Sn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!1,parent:lT,autogeneration:null,valueAsType:null},parent:oT},cT={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},wl={hidden:!0,required:!0,id:Vt.properties.autoscaling.id,name:"Auto-scaling",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:yP,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:cT},Bn={id:L.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:L.RELATIONAL_DATABASE,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[ts,ns,rs,is,Bl,wl],abstractMethods:[],methods:[],extends:[]},dT={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:St.DeletePersistedEntity},_l={type:n.FunctionDeclaration,id:St.DeletePersistedEntity,name:St.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:dT,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},uT={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:St.SoftDeletePersistedEntity},pT={type:n.FunctionDeclaration,id:St.SoftDeletePersistedEntity,name:St.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:uT,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},yT=G[n.BuiltInBaseEntity][L.PERSISTED_ENTITY].properties,hP={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:n.DataType},hT={id:"persisted-built-in-base-entity-database-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:n.Property},fP={like:!1,inferred:!1,id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Bn,asType:!1,defaultValue:null,parent:hT},fT={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Ni={hidden:!0,required:!0,id:yT.database.id,name:"Database",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:fP,description:"The database that the entity belongs to.",parent:fT},mT={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},TT={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:n.Property},mP={like:!1,inferred:!1,id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ga,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.UUID,value:null,parent:mT,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:TT},ET={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},bT={hidden:!1,required:!0,id:yT.identifier.id,name:"Identifier",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:mP,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:ET},TP={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:n.DataType},RT={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:n.Property},gT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:cn,asType:!1,defaultValue:null,parent:RT},vT={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},IT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:gT,description:"The date and time when the entity was deleted.",parent:vT},EP={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:n.DataType},DT={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:n.Property},PT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:cn,asType:!1,defaultValue:null,parent:DT},AT={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},OT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:PT,description:"The date and time when the entity was created.",parent:AT},bP={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:n.DataType},ST={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:n.Property},CT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:cn,asType:!1,defaultValue:null,parent:ST},BT={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},wT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:n.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:CT,description:"The date and time when the entity was last updated.",parent:BT},Fe={id:L.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:L.PERSISTED_ENTITY,type:n.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[Ni,bT,IT,OT,wT],methods:[_l,pT],extends:[]},_T={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Nl={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:n.ActionDescriptor,argumentsType:M.None,returnsType:M.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:_T},NT=G[n.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,RP={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:n.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:n.DataType},MT={id:"cron-job-built-in-base-entity-expression-property-ref",type:n.GenericReference,entityId:NT.properties.expression.id,entityType:n.Property},gP={like:!1,inferred:!1,id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:MT},VT={id:"cron-job-built-in-base-entity-ref",type:n.GenericReference,entityId:L.CRON_JOB,entityType:n.BuiltInBaseEntity},LT={hidden:!1,required:!0,id:NT.properties.expression.id,name:"Cron expression",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:gP,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:VT},Ml={id:L.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:L.CRON_JOB,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[LT],methods:[],abstractMethods:[Nl],extends:[]},$T={type:n.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:n.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Vl={id:"execution-built-in-entity-abort-method-id",type:n.FunctionDeclaration,version:1,name:St.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:$T},Ll={id:L.EXECUTION,type:n.BuiltInBaseEntity,version:1,name:L.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:[Vl],abstractMethods:[]},vP=G[n.Condition]["not-empty"],GT={type:n.GenericReference,id:"not-empty-condition-ref",entityType:n.ActionDescriptor,entityId:Mt.NotEmpty},FT={id:vP.inputs.leftHand.id,type:n.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:0,parent:GT},nr={type:n.ActionDescriptor,id:Mt.NotEmpty,version:1,name:Mt.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[FT],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:M.Fixed,returnsType:M.None,error:null},UT={[Mt.NotEmpty]:nr},xT=G[n.Condition]["more-than-or-equal"],jT={type:n.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Me.MoreThanOrEqual},kT={id:xT.inputs.leftHand.id,type:n.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:0,parent:jT},qT={type:n.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Me.MoreThanOrEqual},JT={id:xT.inputs.rightHand.id,type:n.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:1,parent:qT},jr={type:n.ActionDescriptor,id:Me.MoreThanOrEqual,version:1,name:Me.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[kT,JT],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:M.Fixed,returnsType:M.None,error:null},WT={[Me.MoreThanOrEqual]:jr},IP={...UT,...WT},as={type:n.ActionDescriptor,id:on.PROJECT_PUBLICATION_COMPLETED,version:1,name:on.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:M.None,returnsType:M.None,error:null},DP={[on.PROJECT_PUBLICATION_COMPLETED]:as},$l=G[n.ValueDescriptor][qo.ActionOngoingProcessOutputValue],HT={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:$l.id},YT={like:!1,inferred:!1,id:$l.dataType.id,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ll,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:HT},Gl={id:$l.id,type:n.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:YT,required:!0,index:0,parent:null,parentRelationType:B.OngoingProcessExecution};var ee;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.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},r.find=(a,s)=>{for(const o of a)if(s(o))return o},r.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)}r.joinValues=i,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(ee||(ee={}));var Fl;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Fl||(Fl={}));const $=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wn=r=>{switch(typeof r){case"undefined":return $.undefined;case"string":return $.string;case"number":return isNaN(r)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":return Array.isArray(r)?$.array:r===null?$.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?$.promise:typeof Map<"u"&&r instanceof Map?$.map:typeof Set<"u"&&r instanceof Set?$.set:typeof Date<"u"&&r instanceof Date?$.date:$.object;default:return $.unknown}},C=ee.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"]),PP=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class gt 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 l=i,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(l[y]=l[y]||{_errors:[]},l[y]._errors.push(t(o))):l[y]=l[y]||{_errors:[]},l=l[y],p++}}};return a(this),i}static assert(e){if(!(e instanceof gt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.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()}}gt.create=r=>new gt(r);const kr=(r,e)=>{let t;switch(r.code){case C.invalid_type:r.received===$.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,ee.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${ee.joinValues(r.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ee.joinValues(r.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${ee.joinValues(r.options)}, received '${r.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:ee.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case C.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case C.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,ee.assertNever(r)}return{message:t}};let zT=kr;function AP(r){zT=r}function ss(){return zT}const os=r=>{const{data:e,path:t,errorMaps:i,issueData:a}=r,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=i.filter(y=>!!y).slice().reverse();for(const y of p)l=y(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},OP=[];function V(r,e){const t=ss(),i=os({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===kr?void 0:kr].filter(a=>!!a)});r.common.issues.push(i)}class nt{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 W;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 nt.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 W;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 W=Object.freeze({status:"aborted"}),qr=r=>({status:"dirty",value:r}),pt=r=>({status:"valid",value:r}),Ul=r=>r.status==="aborted",xl=r=>r.status==="dirty",Mi=r=>r.status==="valid",Vi=r=>typeof Promise<"u"&&r instanceof Promise;function ls(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function ZT(r,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"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(r,t):a?a.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;var U;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(U||(U={}));var Li,$i;class zt{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 KT=(r,e)=>{if(Mi(e))return{success:!0,data:e.value};if(!r.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 gt(r.common.issues);return this._error=t,this._error}}};function K(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:a}=r;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,l)=>{var p,y;const{message:f}=r;return o.code==="invalid_enum_value"?{message:f??l.defaultError}:typeof l.data>"u"?{message:(p=f??i)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:l.defaultError}},description:a}}class X{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 wn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nt,ctx:{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vi(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:wn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return KT(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:wn(e)},a=this._parse({data:e,path:i.path,parent:i}),s=await(Vi(a)?a:Promise.resolve(a));return KT(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),l=()=>s.addIssue({code:C.custom,...i(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!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 qt({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Kt.create(this,this._def)}nullable(){return Vn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Yr.create(this,this._def)}or(e){return xi.create([this,e],this._def)}and(e){return ji.create(this,e,this._def)}transform(e){return new qt({...K(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Hi({...K(this._def),innerType:this,defaultValue:t,typeName:J.ZodDefault})}brand(){return new ql({typeName:J.ZodBranded,type:this,...K(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Yi({...K(this._def),innerType:this,catchValue:t,typeName:J.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return zi.create(this,e)}readonly(){return Zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SP=/^c[^\s-]{8,}$/i,CP=/^[0-9a-z]+$/,BP=/^[0-9A-HJKMNP-TV-Z]{26}$/,wP=/^[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,_P=/^[a-z0-9_-]{21}$/i,NP=/^[-+]?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)?)??$/,MP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jl;const LP=/^(?:(?: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])$/,$P=/^(([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})))$/,GP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XT="((\\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])))",FP=new RegExp(`^${XT}$`);function QT(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function UP(r){return new RegExp(`^${QT(r)}$`)}function eE(r){let e=`${XT}T${QT(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xP(r,e){return!!((e==="v4"||!e)&&LP.test(r)||(e==="v6"||!e)&&$P.test(r))}class jt extends X{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_type,expected:$.string,received:s.parsedType}),W}const i=new nt;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:C.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),V(a,{code:C.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,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?V(a,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&V(a,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")MP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"email",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")jl||(jl=new RegExp(VP,"u")),jl.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"emoji",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")wP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"uuid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")_P.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"nanoid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")SP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")CP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid2",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")BP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ulid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),V(a,{validation:"url",code:C.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),V(a,{validation:"regex",code:C.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),V(a,{code:C.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),V(a,{code:C.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?eE(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?FP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?UP(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?NP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"duration",code:C.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?xP(e.data,s.version)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ip",code:C.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?GP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"base64",code:C.invalid_string,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(a=>e.test(a),{validation:t,code:C.invalid_string,...U.errToObj(i)})}_addCheck(e){return new jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.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,...U.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,...U.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...U.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jt({...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}}jt.create=r=>{var e;return new jt({checks:[],typeName:J.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...K(r)})};function jP(r,e){const t=(r.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=t>i?t:i,s=parseInt(r.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class _n extends X{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 V(s,{code:C.invalid_type,expected:$.number,received:s.parsedType}),W}let i;const a=new nt;for(const s of this._def.checks)s.kind==="int"?ee.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),V(i,{code:C.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),V(i,{code:C.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),V(i,{code:C.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?jP(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),V(i,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),V(i,{code:C.not_finite,message:s.message}),a.dirty()):ee.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,i,a){return new _n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:U.toString(a)}]})}_addCheck(e){return new _n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.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"&&ee.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)}}_n.create=r=>new _n({checks:[],typeName:J.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...K(r)});class Nn extends X{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 V(s,{code:C.invalid_type,expected:$.bigint,received:s.parsedType}),W}let i;const a=new nt;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),V(i,{code:C.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),V(i,{code:C.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),V(i,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):ee.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,i,a){return new Nn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:U.toString(a)}]})}_addCheck(e){return new Nn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.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}}Nn.create=r=>{var e;return new Nn({checks:[],typeName:J.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...K(r)})};class Gi extends X{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==$.boolean){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.boolean,received:i.parsedType}),W}return pt(e.data)}}Gi.create=r=>new Gi({typeName:J.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...K(r)});class rr extends X{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_type,expected:$.date,received:s.parsedType}),W}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_date}),W}const i=new nt;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:C.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),V(a,{code:C.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ee.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.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}}rr.create=r=>new rr({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:J.ZodDate,...K(r)});class cs extends X{_parse(e){if(this._getType(e)!==$.symbol){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.symbol,received:i.parsedType}),W}return pt(e.data)}}cs.create=r=>new cs({typeName:J.ZodSymbol,...K(r)});class Fi extends X{_parse(e){if(this._getType(e)!==$.undefined){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.undefined,received:i.parsedType}),W}return pt(e.data)}}Fi.create=r=>new Fi({typeName:J.ZodUndefined,...K(r)});class Ui extends X{_parse(e){if(this._getType(e)!==$.null){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.null,received:i.parsedType}),W}return pt(e.data)}}Ui.create=r=>new Ui({typeName:J.ZodNull,...K(r)});class Jr extends X{constructor(){super(...arguments),this._any=!0}_parse(e){return pt(e.data)}}Jr.create=r=>new Jr({typeName:J.ZodAny,...K(r)});class ir extends X{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pt(e.data)}}ir.create=r=>new ir({typeName:J.ZodUnknown,...K(r)});class un extends X{_parse(e){const t=this._getOrReturnCtx(e);return V(t,{code:C.invalid_type,expected:$.never,received:t.parsedType}),W}}un.create=r=>new un({typeName:J.ZodNever,...K(r)});class ds extends X{_parse(e){if(this._getType(e)!==$.undefined){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.void,received:i.parsedType}),W}return pt(e.data)}}ds.create=r=>new ds({typeName:J.ZodVoid,...K(r)});class kt extends X{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==$.array)return V(t,{code:C.invalid_type,expected:$.array,received:t.parsedType}),W;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(V(t,{code:o?C.too_big:C.too_small,minimum:l?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&&(V(t,{code:C.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&&(V(t,{code:C.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,l)=>a.type._parseAsync(new zt(t,o,t.path,l)))).then(o=>nt.mergeArray(i,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new zt(t,o,t.path,l)));return nt.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new kt({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new kt({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new kt({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}kt.create=(r,e)=>new kt({type:r,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...K(e)});function Wr(r){if(r instanceof xe){const e={};for(const t in r.shape){const i=r.shape[t];e[t]=Kt.create(Wr(i))}return new xe({...r._def,shape:()=>e})}else return r instanceof kt?new kt({...r._def,type:Wr(r.element)}):r instanceof Kt?Kt.create(Wr(r.unwrap())):r instanceof Vn?Vn.create(Wr(r.unwrap())):r instanceof Zt?Zt.create(r.items.map(e=>Wr(e))):r}class xe extends X{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=ee.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==$.object){const y=this._getOrReturnCtx(e);return V(y,{code:C.invalid_type,expected:$.object,received:y.parsedType}),W}const{status:i,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof un&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||l.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new zt(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof un){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of l)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")l.length>0&&(V(a,{code:C.unrecognized_keys,keys:l}),i.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of l){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new zt(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>nt.mergeObjectSync(i,y)):nt.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var a,s,o,l;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:(l=U.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new xe({...this._def,unknownKeys:"strip"})}passthrough(){return new xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xe({...this._def,catchall:e})}pick(e){const t={};return ee.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new xe({...this._def,shape:()=>t})}omit(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new xe({...this._def,shape:()=>t})}deepPartial(){return Wr(this)}partial(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];e&&!e[i]?t[i]=a:t[i]=a.optional()}),new xe({...this._def,shape:()=>t})}required(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Kt;)s=s._def.innerType;t[i]=s}}),new xe({...this._def,shape:()=>t})}keyof(){return tE(ee.objectKeys(this.shape))}}xe.create=(r,e)=>new xe({shape:()=>r,unknownKeys:"strip",catchall:un.create(),typeName:J.ZodObject,...K(e)}),xe.strictCreate=(r,e)=>new xe({shape:()=>r,unknownKeys:"strict",catchall:un.create(),typeName:J.ZodObject,...K(e)}),xe.lazycreate=(r,e)=>new xe({shape:r,unknownKeys:"strip",catchall:un.create(),typeName:J.ZodObject,...K(e)});class xi extends X{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new gt(l.ctx.common.issues));return V(t,{code:C.invalid_union,unionErrors:o}),W}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 y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new gt(p));return V(t,{code:C.invalid_union,unionErrors:l}),W}}get options(){return this._def.options}}xi.create=(r,e)=>new xi({options:r,typeName:J.ZodUnion,...K(e)});const pn=r=>r instanceof qi?pn(r.schema):r instanceof qt?pn(r.innerType()):r instanceof Ji?[r.value]:r instanceof Mn?r.options:r instanceof Wi?ee.objectValues(r.enum):r instanceof Hi?pn(r._def.innerType):r instanceof Fi?[void 0]:r instanceof Ui?[null]:r instanceof Kt?[void 0,...pn(r.unwrap())]:r instanceof Vn?[null,...pn(r.unwrap())]:r instanceof ql||r instanceof Zi?pn(r.unwrap()):r instanceof Yi?pn(r._def.innerType):[];class us extends X{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.object)return V(t,{code:C.invalid_type,expected:$.object,received:t.parsedType}),W;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}):(V(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}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=pn(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 l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new us({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...K(i)})}}function kl(r,e){const t=wn(r),i=wn(e);if(r===e)return{valid:!0,data:r};if(t===$.object&&i===$.object){const a=ee.objectKeys(e),s=ee.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o={...r,...e};for(const l of s){const p=kl(r[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===$.array&&i===$.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const o=r[s],l=e[s],p=kl(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===$.date&&i===$.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ji extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=(s,o)=>{if(Ul(s)||Ul(o))return W;const l=kl(s.value,o.value);return l.valid?((xl(s)||xl(o))&&t.dirty(),{status:t.value,value:l.data}):(V(i,{code:C.invalid_intersection_types}),W)};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}))}}ji.create=(r,e,t)=>new ji({left:r,right:e,typeName:J.ZodIntersection,...K(t)});class Zt extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==$.array)return V(i,{code:C.invalid_type,expected:$.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return V(i,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(V(i,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new zt(i,o,i.path,l)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>nt.mergeArray(t,o)):nt.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Zt({...this._def,rest:e})}}Zt.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:r,typeName:J.ZodTuple,rest:null,...K(e)})};class ki extends X{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 V(i,{code:C.invalid_type,expected:$.object,received:i.parsedType}),W;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in i.data)a.push({key:s._parse(new zt(i,l,i.path,l)),value:o._parse(new zt(i,i.data[l],i.path,l)),alwaysSet:l in i.data});return i.common.async?nt.mergeObjectAsync(t,a):nt.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof X?new ki({keyType:e,valueType:t,typeName:J.ZodRecord,...K(i)}):new ki({keyType:jt.create(),valueType:e,typeName:J.ZodRecord,...K(t)})}}class ps extends X{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 V(i,{code:C.invalid_type,expected:$.map,received:i.parsedType}),W;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([l,p],y)=>({key:a._parse(new zt(i,l,i.path,[y,"key"])),value:s._parse(new zt(i,p,i.path,[y,"value"]))}));if(i.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return W;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return W;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}}}}ps.create=(r,e,t)=>new ps({valueType:e,keyType:r,typeName:J.ZodMap,...K(t)});class ar extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==$.set)return V(i,{code:C.invalid_type,expected:$.set,received:i.parsedType}),W;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(V(i,{code:C.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&&(V(i,{code:C.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 y=new Set;for(const f of p){if(f.status==="aborted")return W;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const l=[...i.data.values()].map((p,y)=>s._parse(new zt(i,p,i.path,y)));return i.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new ar({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new ar({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ar.create=(r,e)=>new ar({valueType:r,minSize:null,maxSize:null,typeName:J.ZodSet,...K(e)});class Hr extends X{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.function)return V(t,{code:C.invalid_type,expected:$.function,received:t.parsedType}),W;function i(l,p){return os({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ss(),kr].filter(y=>!!y),issueData:{code:C.invalid_arguments,argumentsError:p}})}function a(l,p){return os({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ss(),kr].filter(y=>!!y),issueData:{code:C.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Yr){const l=this;return pt(async function(...p){const y=new gt([]),f=await l._def.args.parseAsync(p,s).catch(v=>{throw y.addIssue(i(p,v)),y}),m=await Reflect.apply(o,this,f);return await l._def.returns._def.type.parseAsync(m,s).catch(v=>{throw y.addIssue(a(m,v)),y})})}else{const l=this;return pt(function(...p){const y=l._def.args.safeParse(p,s);if(!y.success)throw new gt([i(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=l._def.returns.safeParse(f,s);if(!m.success)throw new gt([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Hr({...this._def,args:Zt.create(e).rest(ir.create())})}returns(e){return new Hr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Hr({args:e||Zt.create([]).rest(ir.create()),returns:t||ir.create(),typeName:J.ZodFunction,...K(i)})}}class qi extends X{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})}}qi.create=(r,e)=>new qi({getter:r,typeName:J.ZodLazy,...K(e)});class Ji extends X{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ji.create=(r,e)=>new Ji({value:r,typeName:J.ZodLiteral,...K(e)});function tE(r,e){return new Mn({values:r,typeName:J.ZodEnum,...K(e)})}class Mn extends X{constructor(){super(...arguments),Li.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{expected:ee.joinValues(i),received:t.parsedType,code:C.invalid_type}),W}if(ls(this,Li,"f")||ZT(this,Li,new Set(this._def.values),"f"),!ls(this,Li,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{received:t.data,code:C.invalid_enum_value,options:i}),W}return pt(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 Mn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Mn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Li=new WeakMap,Mn.create=tE;class Wi extends X{constructor(){super(...arguments),$i.set(this,void 0)}_parse(e){const t=ee.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==$.string&&i.parsedType!==$.number){const a=ee.objectValues(t);return V(i,{expected:ee.joinValues(a),received:i.parsedType,code:C.invalid_type}),W}if(ls(this,$i,"f")||ZT(this,$i,new Set(ee.getValidEnumValues(this._def.values)),"f"),!ls(this,$i,"f").has(e.data)){const a=ee.objectValues(t);return V(i,{received:i.data,code:C.invalid_enum_value,options:a}),W}return pt(e.data)}get enum(){return this._def.values}}$i=new WeakMap,Wi.create=(r,e)=>new Wi({values:r,typeName:J.ZodNativeEnum,...K(e)});class Yr extends X{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.promise&&t.common.async===!1)return V(t,{code:C.invalid_type,expected:$.promise,received:t.parsedType}),W;const i=t.parsedType===$.promise?t.data:Promise.resolve(t.data);return pt(i.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yr.create=(r,e)=>new Yr({type:r,typeName:J.ZodPromise,...K(e)});class qt extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.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=>{V(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 l=>{if(t.value==="aborted")return W;const p=await this._def.schema._parseAsync({data:l,path:i.path,parent:i});return p.status==="aborted"?W:p.status==="dirty"||t.value==="dirty"?qr(p.value):p});{if(t.value==="aborted")return W;const l=this._def.schema._parseSync({data:o,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"||t.value==="dirty"?qr(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,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 l};if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?W:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>l.status==="aborted"?W:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.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(!Mi(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Mi(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);ee.assertNever(a)}}qt.create=(r,e,t)=>new qt({schema:r,typeName:J.ZodEffects,effect:e,...K(t)}),qt.createWithPreprocess=(r,e,t)=>new qt({schema:e,effect:{type:"preprocess",transform:r},typeName:J.ZodEffects,...K(t)});class Kt extends X{_parse(e){return this._getType(e)===$.undefined?pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kt.create=(r,e)=>new Kt({innerType:r,typeName:J.ZodOptional,...K(e)});class Vn extends X{_parse(e){return this._getType(e)===$.null?pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vn.create=(r,e)=>new Vn({innerType:r,typeName:J.ZodNullable,...K(e)});class Hi extends X{_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}}Hi.create=(r,e)=>new Hi({innerType:r,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class Yi extends X{_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 Vi(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Yi.create=(r,e)=>new Yi({innerType:r,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class ys extends X{_parse(e){if(this._getType(e)!==$.nan){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}}ys.create=r=>new ys({typeName:J.ZodNaN,...K(r)});const kP=Symbol("zod_brand");class ql extends X{_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 zi extends X{_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"?W:s.status==="dirty"?(t.dirty(),qr(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"?W: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 zi({in:e,out:t,typeName:J.ZodPipeline})}}class Zi extends X{_parse(e){const t=this._def.innerType._parse(e),i=a=>(Mi(a)&&(a.value=Object.freeze(a.value)),a);return Vi(t)?t.then(a=>i(a)):i(t)}unwrap(){return this._def.innerType}}Zi.create=(r,e)=>new Zi({innerType:r,typeName:J.ZodReadonly,...K(e)});function nE(r,e={},t){return r?Jr.create().superRefine((i,a)=>{var s,o;if(!r(i)){const l=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...y,fatal:p})}}):Jr.create()}const qP={object:xe.lazycreate};var J;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(J||(J={}));const JP=(r,e={message:`Input not instance of ${r.name}`})=>nE(t=>t instanceof r,e),hs=jt.create,Jl=_n.create,WP=ys.create,HP=Nn.create,Wl=Gi.create,rE=rr.create,YP=cs.create,zP=Fi.create,iE=Ui.create,ZP=Jr.create,fs=ir.create,KP=un.create,XP=ds.create,QP=kt.create,aE=xe.create,eA=xe.strictCreate,tA=xi.create,nA=us.create,rA=ji.create,iA=Zt.create,sE=ki.create,aA=ps.create,sA=ar.create,oA=Hr.create,lA=qi.create,cA=Ji.create,oE=Mn.create,dA=Wi.create,uA=Yr.create,lE=qt.create,pA=Kt.create,yA=Vn.create,hA=qt.createWithPreprocess,fA=zi.create;var d=Object.freeze({__proto__:null,defaultErrorMap:kr,setErrorMap:AP,getErrorMap:ss,makeIssue:os,EMPTY_PATH:OP,addIssueToContext:V,ParseStatus:nt,INVALID:W,DIRTY:qr,OK:pt,isAborted:Ul,isDirty:xl,isValid:Mi,isAsync:Vi,get util(){return ee},get objectUtil(){return Fl},ZodParsedType:$,getParsedType:wn,ZodType:X,datetimeRegex:eE,ZodString:jt,ZodNumber:_n,ZodBigInt:Nn,ZodBoolean:Gi,ZodDate:rr,ZodSymbol:cs,ZodUndefined:Fi,ZodNull:Ui,ZodAny:Jr,ZodUnknown:ir,ZodNever:un,ZodVoid:ds,ZodArray:kt,ZodObject:xe,ZodUnion:xi,ZodDiscriminatedUnion:us,ZodIntersection:ji,ZodTuple:Zt,ZodRecord:ki,ZodMap:ps,ZodSet:ar,ZodFunction:Hr,ZodLazy:qi,ZodLiteral:Ji,ZodEnum:Mn,ZodNativeEnum:Wi,ZodPromise:Yr,ZodEffects:qt,ZodTransformer:qt,ZodOptional:Kt,ZodNullable:Vn,ZodDefault:Hi,ZodCatch:Yi,ZodNaN:ys,BRAND:kP,ZodBranded:ql,ZodPipeline:zi,ZodReadonly:Zi,custom:nE,Schema:X,ZodSchema:X,late:qP,get ZodFirstPartyTypeKind(){return J},coerce:{string:r=>jt.create({...r,coerce:!0}),number:r=>_n.create({...r,coerce:!0}),boolean:r=>Gi.create({...r,coerce:!0}),bigint:r=>Nn.create({...r,coerce:!0}),date:r=>rr.create({...r,coerce:!0})},any:ZP,array:QP,bigint:HP,boolean:Wl,date:rE,discriminatedUnion:nA,effect:lE,enum:oE,function:oA,instanceof:JP,intersection:rA,lazy:lA,literal:cA,map:aA,nan:WP,nativeEnum:dA,never:KP,null:iE,nullable:yA,number:Jl,object:aE,oboolean:()=>Wl().optional(),onumber:()=>Jl().optional(),optional:pA,ostring:()=>hs().optional(),pipeline:fA,preprocess:hA,promise:uA,record:sE,set:sA,strictObject:eA,string:hs,symbol:YP,transformer:lE,tuple:iA,undefined:zP,union:tA,unknown:fs,void:XP,NEVER:W,ZodIssueCode:C,quotelessJson:PP,ZodError:gt});function cE(r){var a,s,o;if(!(r!=null&&r.dataType))return fs();const e=r.dataType.isNullable||!1,t=r.dataType.isList||!1;let i=fs();if(((a=r.dataType.entity)==null?void 0:a.type)===n.PrimitiveEntity)switch(r.dataType.entity.name){case I.String:i=hs();break;case I.JSON:i=sE(fs());break;case I.Number:i=Jl();break;case I.Boolean:i=Wl();break;case I.Date:i=rE();break;case I.Enum:{const l=r.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${r.name} has no options`);i=oE(l);break}case I.Null:i=iE();break;case I.UUID:i=hs().uuid();break}else if(((s=r.dataType.entity)==null?void 0:s.type)===n.CustomEntity)i=dE(r.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=r.dataType.entity)==null?void 0:o.type}`);return e&&(i=i.nullable()),t&&(i=i.array()),i}function dE(r){const e=aE({});for(const t of r.properties){const i=cE(t);e.shape[t.name]=i}return e}function uE(r){const e=r.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function pE(r){const e=r.rangeEnd;return new Date(Math.random()*e.getTime())}function yE(r){const e=r.rangeStart,t=r.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function hE(r){return r.rangeStart&&r.rangeEnd?yE(r):r.rangeStart?uE(r):r.rangeEnd?pE(r):new Date}function mA(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fE={},ms={},Ts={};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.default=EA;let Es;const TA=new Uint8Array(16);function EA(){if(!Es&&(Es=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Es))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Es(TA)}var Ln={},sr={},bs={};Object.defineProperty(bs,"__esModule",{value:!0}),bs.default=void 0;var bA=/^(?:[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;bs.default=bA,Object.defineProperty(sr,"__esModule",{value:!0}),sr.default=void 0;var RA=gA(bs);function gA(r){return r&&r.__esModule?r:{default:r}}function vA(r){return typeof r=="string"&&RA.default.test(r)}var IA=vA;sr.default=IA,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.default=void 0,Ln.unsafeStringify=mE;var DA=PA(sr);function PA(r){return r&&r.__esModule?r:{default:r}}const et=[];for(let r=0;r<256;++r)et.push((r+256).toString(16).slice(1));function mE(r,e=0){return et[r[e+0]]+et[r[e+1]]+et[r[e+2]]+et[r[e+3]]+"-"+et[r[e+4]]+et[r[e+5]]+"-"+et[r[e+6]]+et[r[e+7]]+"-"+et[r[e+8]]+et[r[e+9]]+"-"+et[r[e+10]]+et[r[e+11]]+et[r[e+12]]+et[r[e+13]]+et[r[e+14]]+et[r[e+15]]}function AA(r,e=0){const t=mE(r,e);if(!(0,DA.default)(t))throw TypeError("Stringified UUID is invalid");return t}var OA=AA;Ln.default=OA,Object.defineProperty(ms,"__esModule",{value:!0}),ms.default=void 0;var SA=BA(Ts),CA=Ln;function BA(r){return r&&r.__esModule?r:{default:r}}let TE,Hl,Yl=0,zl=0;function wA(r,e,t){let i=e&&t||0;const a=e||new Array(16);r=r||{};let s=r.node||TE,o=r.clockseq!==void 0?r.clockseq:Hl;if(s==null||o==null){const b=r.random||(r.rng||SA.default)();s==null&&(s=TE=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=Hl=(b[6]<<8|b[7])&16383)}let l=r.msecs!==void 0?r.msecs:Date.now(),p=r.nsecs!==void 0?r.nsecs:zl+1;const y=l-Yl+(p-zl)/1e4;if(y<0&&r.clockseq===void 0&&(o=o+1&16383),(y<0||l>Yl)&&r.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yl=l,zl=p,Hl=o,l+=122192928e5;const f=((l&268435455)*1e4+p)%4294967296;a[i++]=f>>>24&255,a[i++]=f>>>16&255,a[i++]=f>>>8&255,a[i++]=f&255;const m=l/4294967296*1e4&268435455;a[i++]=m>>>8&255,a[i++]=m&255,a[i++]=m>>>24&15|16,a[i++]=m>>>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,CA.unsafeStringify)(a)}var _A=wA;ms.default=_A;var Rs={},$n={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var NA=MA(sr);function MA(r){return r&&r.__esModule?r:{default:r}}function VA(r){if(!(0,NA.default)(r))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(r.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 LA=VA;Ki.default=LA,Object.defineProperty($n,"__esModule",{value:!0}),$n.URL=$n.DNS=void 0,$n.default=xA;var $A=Ln,GA=FA(Ki);function FA(r){return r&&r.__esModule?r:{default:r}}function UA(r){r=unescape(encodeURIComponent(r));const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}const EE="6ba7b810-9dad-11d1-80b4-00c04fd430c8";$n.DNS=EE;const bE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";$n.URL=bE;function xA(r,e,t){function i(a,s,o,l){var p;if(typeof a=="string"&&(a=UA(a)),typeof s=="string"&&(s=(0,GA.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 y=new Uint8Array(16+a.length);if(y.set(s),y.set(a,s.length),y=t(y),y[6]=y[6]&15|e,y[8]=y[8]&63|128,o){l=l||0;for(let f=0;f<16;++f)o[l+f]=y[f];return o}return(0,$A.unsafeStringify)(y)}try{i.name=r}catch{}return i.DNS=EE,i.URL=bE,i}var gs={};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=void 0;function jA(r){if(typeof r=="string"){const e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(let t=0;t<e.length;++t)r[t]=e.charCodeAt(t)}return kA(qA(JA(r),r.length*8))}function kA(r){const e=[],t=r.length*32,i="0123456789abcdef";for(let a=0;a<t;a+=8){const s=r[a>>5]>>>a%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(s&15),16);e.push(o)}return e}function RE(r){return(r+64>>>9<<4)+14+1}function qA(r,e){r[e>>5]|=128<<e%32,r[RE(e)-1]=e;let t=1732584193,i=-271733879,a=-1732584194,s=271733878;for(let o=0;o<r.length;o+=16){const l=t,p=i,y=a,f=s;t=rt(t,i,a,s,r[o],7,-680876936),s=rt(s,t,i,a,r[o+1],12,-389564586),a=rt(a,s,t,i,r[o+2],17,606105819),i=rt(i,a,s,t,r[o+3],22,-1044525330),t=rt(t,i,a,s,r[o+4],7,-176418897),s=rt(s,t,i,a,r[o+5],12,1200080426),a=rt(a,s,t,i,r[o+6],17,-1473231341),i=rt(i,a,s,t,r[o+7],22,-45705983),t=rt(t,i,a,s,r[o+8],7,1770035416),s=rt(s,t,i,a,r[o+9],12,-1958414417),a=rt(a,s,t,i,r[o+10],17,-42063),i=rt(i,a,s,t,r[o+11],22,-1990404162),t=rt(t,i,a,s,r[o+12],7,1804603682),s=rt(s,t,i,a,r[o+13],12,-40341101),a=rt(a,s,t,i,r[o+14],17,-1502002290),i=rt(i,a,s,t,r[o+15],22,1236535329),t=it(t,i,a,s,r[o+1],5,-165796510),s=it(s,t,i,a,r[o+6],9,-1069501632),a=it(a,s,t,i,r[o+11],14,643717713),i=it(i,a,s,t,r[o],20,-373897302),t=it(t,i,a,s,r[o+5],5,-701558691),s=it(s,t,i,a,r[o+10],9,38016083),a=it(a,s,t,i,r[o+15],14,-660478335),i=it(i,a,s,t,r[o+4],20,-405537848),t=it(t,i,a,s,r[o+9],5,568446438),s=it(s,t,i,a,r[o+14],9,-1019803690),a=it(a,s,t,i,r[o+3],14,-187363961),i=it(i,a,s,t,r[o+8],20,1163531501),t=it(t,i,a,s,r[o+13],5,-1444681467),s=it(s,t,i,a,r[o+2],9,-51403784),a=it(a,s,t,i,r[o+7],14,1735328473),i=it(i,a,s,t,r[o+12],20,-1926607734),t=at(t,i,a,s,r[o+5],4,-378558),s=at(s,t,i,a,r[o+8],11,-2022574463),a=at(a,s,t,i,r[o+11],16,1839030562),i=at(i,a,s,t,r[o+14],23,-35309556),t=at(t,i,a,s,r[o+1],4,-1530992060),s=at(s,t,i,a,r[o+4],11,1272893353),a=at(a,s,t,i,r[o+7],16,-155497632),i=at(i,a,s,t,r[o+10],23,-1094730640),t=at(t,i,a,s,r[o+13],4,681279174),s=at(s,t,i,a,r[o],11,-358537222),a=at(a,s,t,i,r[o+3],16,-722521979),i=at(i,a,s,t,r[o+6],23,76029189),t=at(t,i,a,s,r[o+9],4,-640364487),s=at(s,t,i,a,r[o+12],11,-421815835),a=at(a,s,t,i,r[o+15],16,530742520),i=at(i,a,s,t,r[o+2],23,-995338651),t=st(t,i,a,s,r[o],6,-198630844),s=st(s,t,i,a,r[o+7],10,1126891415),a=st(a,s,t,i,r[o+14],15,-1416354905),i=st(i,a,s,t,r[o+5],21,-57434055),t=st(t,i,a,s,r[o+12],6,1700485571),s=st(s,t,i,a,r[o+3],10,-1894986606),a=st(a,s,t,i,r[o+10],15,-1051523),i=st(i,a,s,t,r[o+1],21,-2054922799),t=st(t,i,a,s,r[o+8],6,1873313359),s=st(s,t,i,a,r[o+15],10,-30611744),a=st(a,s,t,i,r[o+6],15,-1560198380),i=st(i,a,s,t,r[o+13],21,1309151649),t=st(t,i,a,s,r[o+4],6,-145523070),s=st(s,t,i,a,r[o+11],10,-1120210379),a=st(a,s,t,i,r[o+2],15,718787259),i=st(i,a,s,t,r[o+9],21,-343485551),t=Gn(t,l),i=Gn(i,p),a=Gn(a,y),s=Gn(s,f)}return[t,i,a,s]}function JA(r){if(r.length===0)return[];const e=r.length*8,t=new Uint32Array(RE(e));for(let i=0;i<e;i+=8)t[i>>5]|=(r[i/8]&255)<<i%32;return t}function Gn(r,e){const t=(r&65535)+(e&65535);return(r>>16)+(e>>16)+(t>>16)<<16|t&65535}function WA(r,e){return r<<e|r>>>32-e}function vs(r,e,t,i,a,s){return Gn(WA(Gn(Gn(e,r),Gn(i,s)),a),t)}function rt(r,e,t,i,a,s,o){return vs(e&t|~e&i,r,e,a,s,o)}function it(r,e,t,i,a,s,o){return vs(e&i|t&~i,r,e,a,s,o)}function at(r,e,t,i,a,s,o){return vs(e^t^i,r,e,a,s,o)}function st(r,e,t,i,a,s,o){return vs(t^(e|~i),r,e,a,s,o)}var HA=jA;gs.default=HA,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.default=void 0;var YA=gE($n),zA=gE(gs);function gE(r){return r&&r.__esModule?r:{default:r}}var ZA=(0,YA.default)("v3",48,zA.default);Rs.default=ZA;var Is={},Ds={};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=void 0;var KA={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Ds.default=KA,Object.defineProperty(Is,"__esModule",{value:!0}),Is.default=void 0;var vE=IE(Ds),XA=IE(Ts),QA=Ln;function IE(r){return r&&r.__esModule?r:{default:r}}function eO(r,e,t){if(vE.default.randomUUID&&!e&&!r)return vE.default.randomUUID();r=r||{};const i=r.random||(r.rng||XA.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,QA.unsafeStringify)(i)}var tO=eO;Is.default=tO;var Ps={},As={};Object.defineProperty(As,"__esModule",{value:!0}),As.default=void 0;function nO(r,e,t,i){switch(r){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 Zl(r,e){return r<<e|r>>>32-e}function rO(r){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){const o=unescape(encodeURIComponent(r));r=[];for(let l=0;l<o.length;++l)r.push(o.charCodeAt(l))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);const i=r.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=r[o*64+p*4]<<24|r[o*64+p*4+1]<<16|r[o*64+p*4+2]<<8|r[o*64+p*4+3];s[o]=l}s[a-1][14]=(r.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(r.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let v=0;v<16;++v)l[v]=s[o][v];for(let v=16;v<80;++v)l[v]=Zl(l[v-3]^l[v-8]^l[v-14]^l[v-16],1);let p=t[0],y=t[1],f=t[2],m=t[3],b=t[4];for(let v=0;v<80;++v){const P=Math.floor(v/20),O=Zl(p,5)+nO(P,y,f,m)+b+e[P]+l[v]>>>0;b=m,m=f,f=Zl(y,30)>>>0,y=p,p=O}t[0]=t[0]+p>>>0,t[1]=t[1]+y>>>0,t[2]=t[2]+f>>>0,t[3]=t[3]+m>>>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 iO=rO;As.default=iO,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=void 0;var aO=DE($n),sO=DE(As);function DE(r){return r&&r.__esModule?r:{default:r}}var oO=(0,aO.default)("v5",80,sO.default);Ps.default=oO;var Os={};Object.defineProperty(Os,"__esModule",{value:!0}),Os.default=void 0;var lO="00000000-0000-0000-0000-000000000000";Os.default=lO;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.default=void 0;var cO=dO(sr);function dO(r){return r&&r.__esModule?r:{default:r}}function uO(r){if(!(0,cO.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var pO=uO;Ss.default=pO,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return o.default}});var e=f(ms),t=f(Rs),i=f(Is),a=f(Ps),s=f(Os),o=f(Ss),l=f(sr),p=f(Ln),y=f(Ki);function f(m){return m&&m.__esModule?m:{default:m}}}(fE);function Kl(r,e){if(!r||!e||!r.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=r,this.dstAlphabet=e}Kl.prototype.convert=function(r){var e,t,i,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=r.length,p=typeof r=="string"?"":[];if(!this.isValid(r))throw new Error('Number "'+r+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return r;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(r[e]);do{for(t=0,i=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[i++]=parseInt(t/o,10),t=t%o):i>0&&(a[i++]=0);l=i,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(i!==0);return p},Kl.prototype.isValid=function(r){for(var e=0;e<r.length;++e)if(this.srcAlphabet.indexOf(r[e])===-1)return!1;return!0};var yO=Kl,hO=yO;function Xi(r,e){var t=new hO(r,e);return function(i){return t.convert(i)}}Xi.BIN="01",Xi.OCT="01234567",Xi.DEC="0123456789",Xi.HEX="0123456789abcdef";var fO=Xi;const{v4:Xl,validate:mO}=fE,Cs=fO,Ql={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},TO={consistentLength:!0};let ec;const PE=(r,e,t)=>{const i=e(r.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?i:i.padStart(t.shortIdLength,t.paddingChar)},AE=(r,e)=>{const i=e(r).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("-")},EO=r=>Math.ceil(Math.log(2**128)/Math.log(r));var bO=(()=>{const r=(e,t)=>{const i=e||Ql.flickrBase58,a={...TO,...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=EO(i.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:i[0]},l=Cs(Cs.HEX,i),p=Cs(i,Cs.HEX),y=()=>PE(Xl(),l,o),m={alphabet:i,fromUUID:b=>PE(b,l,o),maxLength:s,generate:y,new:y,toUUID:b=>AE(b,p),uuid:Xl,validate:(b,v=!1)=>{if(!b||typeof b!="string")return!1;const P=a.consistentLength?b.length===s:b.length<=s,O=b.split("").every(A=>i.includes(A));return v===!1?P&&O:P&&O&&mO(AE(b,p))}};return Object.freeze(m),m};return r.constants=Ql,r.uuid=Xl,r.generate=()=>(ec||(ec=r(Ql.flickrBase58).generate),ec()),r})();const Bs=mA(bO);function OE(){return Bs().uuid()}function SE(r){return r.rangeStart+Math.random()}function CE(r){const e=r.rangeEnd;return Math.random()*e}function BE(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random()*(t-e)+e}function wE(r){return r.rangeStart&&r.rangeEnd?BE(r):r.rangeStart?SE(r):r.rangeEnd?CE(r):Math.random()}function _E(r){const e=r.rangeStart;return Math.random().toString(36).substring(e)}function NE(r){const e=r.rangeEnd;return Math.random().toString(36).substring(0,e)}function ME(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random().toString(36).substring(e,t)}function VE(r){return r.rangeStart&&r.rangeEnd?ME(r):r.rangeStart?_E(r):r.rangeEnd?NE(r):Math.random().toString(36)}function LE(r){return Math.random()>=.5}function RO(r){if(!r||!r.autogeneration)return null;switch(r.autogeneration.type){case qe.CurrentDateAndTime:if(r.name===I.Date)return new Date;case qe.Random:{if(r.name===I.Date)return hE(r.autogeneration);if(r.name===I.Number)return wE(r.autogeneration);if(r.name===I.String)return VE(r.autogeneration);if(r.name===I.Boolean)return LE(r.autogeneration)}case qe.Unique:if(r.name===I.UUID)return OE();default:throw new Error(`Generating a ${r.autogeneration.type} value for a ${r.name} is not supported`)}}const z="e7eb5382-3d99-44fd-972a-b8b1e819f6be",tc="global-user-variable-id",$E="last-executed-timestamp-variable-id",gO={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},vO={id:"alternative-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:n.Property},IO={like:!1,inferred:!1,id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:null,parent:gO,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:vO},ws={id:"alternative-relational-database-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},DO={hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:ts,static:!0,index:0,dataType:IO,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ws};n.GenericReference,n.DataType;const PO={id:"alternative-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:n.Property},AO={like:!1,inferred:!1,id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:PO},OO={hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:ns,static:!0,index:1,dataType:AO,description:"The username that will be used to connect to the database.",parent:ws};n.GenericReference,n.DataType;const SO={id:"alternative-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:n.Property},CO={like:!1,inferred:!1,id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:SO},BO={hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:rs,static:!0,index:2,dataType:CO,description:"The password that will be used to connect to the database.",parent:ws},wO={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},_O={id:"alternative-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:n.Property},NO={like:!1,inferred:!1,id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:wO,autogeneration:null,valueAsType:null},parent:_O},MO={hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:is,static:!0,index:3,dataType:NO,description:"The minimum size of the database in GB.",parent:ws},VO={id:"alternative-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},GE={id:"alternative-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[DO,OO,BO,MO],methods:[],abstractMethods:[],extends:[],implements:[Bn],x:0,y:0,parent:VO},LO={id:"animal-prototype-database-property-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-id",entityType:n.Property},$O={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:n.DataType},GO={like:!1,inferred:!1,id:"animal-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:GE,autogeneration:null,parent:$O},parent:LO},FO={id:"animal-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},UO={hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:GO,description:"The database that the entity belongs to.",parent:FO},xO={type:n.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:n.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},jO={like:!1,inferred:!1,id:"c1930577-9e79-48a6-8905-be24611015c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xO},kO={type:n.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},qO={hidden:!1,required:!0,type:n.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:jO,abstract:!1,parent:kO},JO={type:n.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:n.Project,entityId:z},WO={type:n.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:[UO,qO],methods:[],extends:[],implements:[Fe],x:0,y:0,parent:JO},HO={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},YO={id:"default-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:n.Property},zO={like:!1,inferred:!1,id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"main",parent:HO,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:YO},zr={id:"default-relational-database-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},ZO={hidden:!1,required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:ts,static:!0,index:0,dataType:zO,description:"The name of the main database inside of the server instance where the data will be stored.",parent:zr};n.GenericReference,n.DataType;const KO={id:"default-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:n.Property},XO={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-username-property-data-type-id",entityType:n.DataType},QO={like:!1,inferred:!1,id:"default-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"root",parent:XO,autogeneration:null,valueAsType:null},parent:KO},eS={hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:ns,static:!0,index:1,dataType:QO,description:"The username that will be used to connect to the database.",parent:zr};n.GenericReference,n.DataType;const tS={id:"default-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:n.Property},nS={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-password-property-data-type-id",entityType:n.DataType},rS={like:!1,inferred:!1,id:"default-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"password",parent:nS,autogeneration:null,valueAsType:null},parent:tS},iS={hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:rs,static:!0,index:2,dataType:rS,description:"The password that will be used to connect to the database.",parent:zr},aS={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},sS={id:"default-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:n.Property},oS={like:!1,inferred:!1,id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:aS,autogeneration:null,valueAsType:null},parent:sS},lS={hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:is,static:!0,index:3,dataType:oS,description:"The minimum size of the database in GB.",parent:zr},cS={id:"default-relational-database-entity-default-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-default-property-data-type-id",entityType:n.DataType},dS={id:"default-relational-database-entity-default-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:n.Property},uS={like:!1,inferred:!1,id:"default-relational-database-entity-default-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!0,parent:cS,autogeneration:null,valueAsType:null},parent:dS},pS={hidden:!0,required:!0,id:"default-relational-database-entity-default-property-id",name:"Default",version:1,type:n.Property,private:!1,abstract:!1,implements:Bl,static:!0,index:4,dataType:uS,description:"Whether this database is automatically picked by other entities as the default database.",parent:zr},yS={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-data-type-id",entityType:n.DataType},hS={id:"default-relational-database-entity-autoscaling-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:n.Property},fS={like:!1,inferred:!1,id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!0,parent:yS,autogeneration:null,valueAsType:null},parent:hS},mS={hidden:!1,required:!0,id:"default-relational-database-entity-autoscaling-property-id",name:"Auto-scaling",version:1,type:n.Property,private:!1,abstract:!1,implements:wl,static:!0,index:5,dataType:fS,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:zr},TS={id:"default-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},nc={id:"default-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[pS,mS,ZO,eS,iS,lS],methods:[],abstractMethods:[],extends:[],implements:[Bn],x:0,y:0,parent:TS},ES={id:"user-prototype-database-property-data-type-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:n.DataType},bS={id:"user-prototype-database-property-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-id",entityType:n.Property},RS={like:!1,inferred:!1,id:"user-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:nc,autogeneration:null,parent:ES},parent:bS},gS={id:"user-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},vS={hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:RS,description:"The database that the entity belongs to.",parent:gS},IS={type:n.GenericReference,id:"user-prototype-parent-ref-id",entityType:n.Project,entityId:z},rc={type:n.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Fe],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[vS],methods:[],x:0,y:0,parent:IS},DS={type:n.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:n.Property,entityId:"person-date-of-birth-property-id"},PS={like:!1,inferred:!1,id:"person-date-of-birth-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:cn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:DS},AS={type:n.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},OS={hidden:!1,required:!0,type:n.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:PS,abstract:!1,parent:AS},SS={type:n.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:n.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},CS={like:!1,inferred:!1,id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:SS},BS={type:n.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},wS={hidden:!1,required:!0,type:n.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:CS,abstract:!1,parent:BS},_S={type:n.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:n.Project,entityId:z},yt={type:n.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:[wS,OS],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[rc],x:0,y:0,parent:_S},NS={type:n.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},MS={type:n.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:n.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},VS={type:n.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},LS={type:n.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:n.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},$S={like:!1,inferred:!1,id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LS},ic={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:n.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:$S,implements:null,readsValue:VS,required:!0,index:0,parent:MS},GS={type:n.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},FS={type:n.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},FE={type:n.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[ic],calledByError:[],calledByEntry:[GS],calledBySuccess:[],throws:null,x:0,y:0,parent:FS},US={type:n.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},xS={like:!1,inferred:!1,id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:US},UE={id:"500dee3a-3435-4453-9699-0d053f646523",type:n.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:xS,implements:null,required:!0,writesValues:[ic],index:0,parent:NS},jS={type:n.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},xE={type:n.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[UE],calls:[FE],returnStatements:[FE],index:0,collapsed:!1,private:!1,x:0,y:0,parent:jS},kS={type:n.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:n.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},qS={like:!1,inferred:!1,id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kS},JS={type:n.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:n.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},WS={type:n.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},HS={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:n.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:qS,readsValue:JS,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:WS},YS={type:n.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},zS={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:n.OutputMap,version:1,declaration:ic,writesValues:[HS],index:0,parent:YS},ZS={type:n.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},KS={type:n.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},XS={type:n.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},QS={like:!1,inferred:!1,id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XS},eC={type:n.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},tC={type:n.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},nC={type:n.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},rC={type:n.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},jE={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:n.InputMap,version:1,declaration:UE,name:null,description:null,readsValue:rC,defaultValue:null,index:0,parent:nC},iC={type:n.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:QS,readsValue:eC,writesValues:[jE],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:tC},aC={type:n.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:xE,inputs:[jE],outputs:[zS],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[ZS],calledBySuccess:[],parent:KS,error:null,x:0,y:0},sC={type:n.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},oC={like:!1,inferred:!1,id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sC},lC={type:n.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},cC={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:n.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:oC,implements:null,required:!0,index:0,writesValues:[iC],parent:lC},dC={type:n.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},uC={type:n.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[cC],collapsed:!0,returnStatements:[],calls:[aC],private:!1,index:0,implements:null,x:0,y:0,parent:dC},pC={type:n.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:n.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},yC={like:!1,inferred:!1,id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:pC},hC={type:n.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},fC={hidden:!1,required:!0,type:n.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:yC,abstract:!1,parent:hC},mC={type:n.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:n.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},TC={like:!1,inferred:!1,id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:mC},EC={type:n.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},bC={hidden:!1,required:!0,type:n.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:TC,implements:null,static:!1,private:!0,abstract:!1,parent:EC},RC={type:n.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:n.Project,entityId:z},Zr={type:n.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[fC,bC],methods:[xE,uC],extends:[],implements:[Fe],x:0,y:0,parent:RC},Qi="bitcoin-api-response-id",kE="time-property-id",qE="disclamer-property-id",JE="chart-name-property-id",WE="bpi-property-id",_s="bpi-entity-id",HE="usd-property-id",YE="gbp-property-id",zE="eur-property-id",Kr="currency-entity-id",ZE="currency-code-property-id",KE="currency-symbol-property-id",XE="currency-rate-property-id",QE="currency-description-property-id",eb="currency-rate-number-property-id",gC={type:n.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:n.Property,entityId:ZE},vC={like:!1,inferred:!1,id:"code-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:gC},IC={type:n.GenericReference,id:"code-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},DC={hidden:!1,required:!0,type:n.Property,id:ZE,version:1,name:"code",description:null,dataType:vC,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:IC},PC={type:n.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:n.Property,entityId:KE},AC={like:!1,inferred:!1,id:"symbol-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:PC},OC={type:n.GenericReference,id:"symbol-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},SC={hidden:!1,required:!0,type:n.Property,id:KE,version:1,name:"symbol",description:null,index:0,dataType:AC,implements:null,static:!1,private:!1,abstract:!1,parent:OC},CC={type:n.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:n.Property,entityId:XE},BC={like:!1,inferred:!1,id:"rate-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CC},wC={type:n.GenericReference,id:"rate-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},_C={hidden:!1,required:!0,type:n.Property,id:XE,version:1,name:"rate",description:null,index:0,dataType:BC,implements:null,static:!1,private:!1,abstract:!1,parent:wC},NC={type:n.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:n.Property,entityId:QE},MC={like:!1,inferred:!1,id:"description-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:NC},VC={type:n.GenericReference,id:"description-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},LC={hidden:!1,required:!0,type:n.Property,id:QE,version:1,name:"description",description:null,dataType:MC,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:VC},$C={type:n.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:n.Property,entityId:eb},GC={like:!1,inferred:!1,id:"rate-number-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$C},FC={type:n.GenericReference,id:"rate-number-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},UC={hidden:!1,required:!0,type:n.Property,id:eb,version:1,name:"rate_float",description:null,dataType:GC,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:FC},xC={type:n.GenericReference,id:"currency-prototype-parent-ref-id",entityType:n.Project,entityId:z},Ns={type:n.CustomEntity,id:Kr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[DC,SC,_C,LC,UC],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:xC},jC={type:n.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:n.Property,entityId:HE},kC={like:!1,inferred:!1,id:"usd-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jC},qC={type:n.GenericReference,id:"usd-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},JC={hidden:!1,required:!0,id:HE,type:n.Property,version:1,name:"USD",description:null,index:0,dataType:kC,implements:null,static:!1,private:!1,abstract:!1,parent:qC},WC={type:n.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:n.Property,entityId:YE},HC={like:!1,inferred:!1,id:"gbp-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WC},YC={type:n.GenericReference,id:"gbp-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},zC={hidden:!1,required:!0,id:YE,type:n.Property,version:1,name:"GBP",description:null,index:0,dataType:HC,implements:null,static:!1,private:!1,abstract:!1,parent:YC},ZC={type:n.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:n.Property,entityId:zE},KC={like:!1,inferred:!1,id:"eur-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZC},XC={type:n.GenericReference,id:"eur-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},QC={hidden:!1,required:!0,id:zE,type:n.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:KC,private:!1,abstract:!1,parent:XC},eB={type:n.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:n.Project,entityId:z},tb={type:n.CustomEntity,id:_s,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[JC,zC,QC],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:eB},tB={type:n.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:n.Property,entityId:kE},nB={like:!1,inferred:!1,id:"time-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Jo,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tB},rB={type:n.GenericReference,id:"time-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},iB={hidden:!1,required:!0,type:n.Property,id:kE,version:1,name:"time",description:null,index:0,dataType:nB,implements:null,static:!1,private:!1,abstract:!1,parent:rB},aB={type:n.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:n.Property,entityId:qE},sB={like:!1,inferred:!1,id:"disclamer-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aB},oB={type:n.GenericReference,id:"disclamer-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},lB={hidden:!1,required:!0,type:n.Property,id:qE,version:1,name:"disclamer",description:null,index:0,dataType:sB,implements:null,static:!1,private:!1,abstract:!1,parent:oB},cB={type:n.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:n.Property,entityId:JE},dB={like:!1,inferred:!1,id:"chart-name-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cB},uB={type:n.GenericReference,id:"chart-name-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},pB={hidden:!1,required:!0,type:n.Property,id:JE,version:1,name:"chartName",description:null,index:0,dataType:dB,implements:null,static:!1,private:!1,abstract:!1,parent:uB},yB={type:n.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:n.Property,entityId:WE},hB={like:!1,inferred:!1,id:"bpi-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:tb,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yB},fB={type:n.GenericReference,id:"bpi-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},mB={hidden:!1,required:!0,type:n.Property,id:WE,version:1,name:"bpi",description:null,implements:null,index:0,dataType:hB,static:!1,private:!1,abstract:!1,parent:fB},TB={type:n.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:n.Project,entityId:z},nb={type:n.CustomEntity,id:Qi,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[iB,lB,pB,mB],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:TB},EB={type:n.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},bB={like:!1,inferred:!1,id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:EB},RB={type:n.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:n.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},gB={type:n.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:n.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},vB={like:!1,inferred:!1,id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gB},IB={type:n.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},rb={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",implements:null,dataType:vB,readsValue:IB,required:!0,index:0,parent:RB},DB={type:n.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},PB={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:n.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,implements:null,dataType:bB,writesValues:[rb],required:!0,index:0,parent:DB},AB={type:n.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},OB={type:n.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},SB={type:n.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},ib={type:n.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[rb],calledByError:[],calledByEntry:[OB],calledBySuccess:[],throws:null,x:0,y:0,parent:SB},CB={type:n.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:[PB],calls:[ib],index:0,collapsed:!1,implements:null,returnStatements:[ib],private:!1,x:0,y:0,parent:AB},BB={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},wB={type:n.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},_B={type:n.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:n.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},NB={type:n.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},MB={type:n.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:n.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},VB={like:!1,inferred:!1,id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MB},ac={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:n.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:VB,implements:null,readsValue:NB,required:!0,index:0,parent:_B},LB={type:n.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},sc={type:n.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[ac],calledByError:[],calledByEntry:[],calledBySuccess:[BB,LB],throws:null,x:0,y:0,parent:wB},$B={type:n.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},GB={type:n.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},ab={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:al,name:null,description:null,readsValue:GB,defaultValue:null,parent:$B,index:2},FB={type:n.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},UB={like:!1,inferred:!1,id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FB},xB={type:n.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},jB={type:n.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:n.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},kB={type:n.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:n.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},sb={type:n.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:UB,readsValue:jB,writesValues:[ac],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[kB],successCalls:[sc],errorCalls:[],internalCalls:[],x:0,y:0,parent:xB},qB={type:n.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:n.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},JB={type:n.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},WB={type:n.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:qa,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:I.String,valueAsType:null,parent:qB,autogeneration:null},index:1,parent:JB},HB={type:n.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},YB={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:n.OutputMap,version:1,declaration:Di,index:2,writesValues:[sb],parent:HB},zB={type:n.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},ZB={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:n.InputMap,version:1,declaration:ka,name:null,description:null,readsValue:null,index:0,defaultValue:null,parent:zB},KB={type:n.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},XB={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:n.InputMap,version:1,name:null,description:null,declaration:Ja,index:3,readsValue:null,defaultValue:null,parent:KB},QB={type:n.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},ew={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:n.InputMap,version:1,declaration:Wa,name:null,description:null,readsValue:null,index:4,defaultValue:null,parent:QB},tw={type:n.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},nw={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:n.OutputMap,version:1,declaration:Ha,index:1,writesValues:[],parent:tw},rw={type:n.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},iw={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:n.OutputMap,version:1,declaration:Di,index:0,writesValues:[],parent:rw},aw={type:n.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},sw={type:n.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},ow={type:n.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},lw={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},cw={type:n.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:n.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},dw={like:!1,inferred:!1,id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cw},uw={type:n.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:n.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},ob={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:n.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:dw,implements:null,required:!0,readsValue:null,index:0,parent:uw},pw={type:n.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lw],throws:ob,x:0,y:0,parent:ow},yw={type:n.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},hw={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:n.OutputMap,declaration:ol,version:1,writesValues:[ob],index:0,parent:yw},fw={type:n.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Pi,inputs:[ZB,WB,ab,XB,ew],outputs:[iw,nw,YB],process:null,calledByError:[],calledByEntry:[aw],calledBySuccess:[],successCalls:[sc,sb],errorCalls:[pw],error:hw,x:0,y:0,parent:sw},mw={type:n.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:n.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},Tw={type:n.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Ew={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:Ua,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"?name=",name:I.String,parent:mw,valueAsType:null,autogeneration:null},index:0,parent:Tw},bw={type:n.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Rw={type:n.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},gw={type:n.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},vw={like:!1,inferred:!1,id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gw},Iw={type:n.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:n.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},Dw={type:n.GenericReference,id:"assembled-query-string-called-by-ref",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},lb={type:n.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:vw,readsValue:Iw,writesValues:[ab],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Dw],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:Rw},Pw={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:n.OutputMap,version:1,writesValues:[lb],declaration:vi,index:0,parent:bw},Aw={type:n.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Ow={type:n.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Sw={type:n.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:n.ArgumentDeclaration},Cw={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},cb={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:n.InputMap,declaration:xa,name:null,description:null,readsValue:Sw,defaultValue:null,index:1,parent:Cw},Bw={type:n.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Ii,version:1,inputs:[Ew,cb],outputs:[Pw],process:null,calledByError:[],calledByEntry:[Aw],calledBySuccess:[],successCalls:[lb],errorCalls:[],error:null,x:0,y:0,parent:Ow},ww={type:n.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:n.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},_w={like:!1,inferred:!1,id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ww},Nw={type:n.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},db={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:n.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:_w,implements:null,required:!1,writesValues:[cb],index:0,parent:Nw},Mw={type:n.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:n.Project,entityId:z},ub={type:n.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:[db],calls:[Bw,fw],returnStatements:[sc],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:Mw},Vw={type:n.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},Lw={type:n.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},$w={type:n.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},Gw={type:n.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},pb={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:n.InputMap,declaration:db,name:null,description:null,readsValue:$w,defaultValue:null,index:0,parent:Gw},Fw={type:n.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Uw={type:n.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:n.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},xw={like:!1,inferred:!1,id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Uw},jw={type:n.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:n.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},kw={type:n.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},qw={type:n.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},yb={type:n.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:xw,readsValue:jw,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[qw],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:kw},Jw={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.OutputMap,version:1,declaration:ac,writesValues:[yb],index:0,parent:Fw},Ww={type:n.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:ub,inputs:[pb],outputs:[Jw],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[Vw],successCalls:[yb],errorCalls:[],error:null,x:0,y:0,parent:Lw},Hw={type:n.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Yw={type:n.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},zw={type:n.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},Zw={type:n.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},hb={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:n.InputMap,declaration:nr.fixedArguments[0],name:null,description:null,readsValue:zw,defaultValue:null,index:0,parent:Zw},Kw={type:n.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:nr,inputs:[hb],calledByError:[],calledByEntry:[Hw],calledBySuccess:[],successCalls:[Ww],errorCalls:[],x:0,y:0,parent:Yw},Xw={type:n.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Qw={type:n.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:n.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},e_={like:!1,inferred:!1,id:"d64152ea-831f-4426-9506-a39bfa170513",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Qw},t_={type:n.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},n_={type:n.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},r_={type:n.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},fb={type:n.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:e_,readsValue:n_,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[r_],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:t_},i_={type:n.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},a_={like:!1,inferred:!1,id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:i_},s_={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:n.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:a_,implements:null,required:!0,index:1,writesValues:[fb],parent:Xw},o_={type:n.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},l_={type:n.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},c_={type:n.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},d_={like:!1,inferred:!1,id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:c_},u_={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:n.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:d_,implements:null,required:!0,index:0,writesValues:[hb,pb],parent:l_},p_={type:n.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:[u_,s_],calls:[Kw,fb],index:1,private:!1,implements:null,x:0,y:0,parent:o_},y_={type:n.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},h_={type:n.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-manager-property-id"},f_={like:!1,inferred:!1,id:"employee-manager-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:y_,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:h_},m_={type:n.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},T_={hidden:!1,required:!0,type:n.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:f_,abstract:!1,parent:m_},E_={type:n.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-start-date-property-id"},b_={like:!1,inferred:!1,id:"employee-start-date-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:cn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:E_},R_={type:n.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},g_={hidden:!1,required:!0,type:n.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:b_,abstract:!1,parent:R_},v_={type:n.GenericReference,id:"employee-department-property-ref-id",entityType:n.Property,entityId:"employee-department-property-id"},I_={like:!1,inferred:!1,id:"employee-department-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:v_},D_={type:n.GenericReference,id:"employee-department-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},P_={hidden:!1,required:!0,type:n.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:I_,abstract:!1,parent:D_},A_={type:n.GenericReference,id:"employee-prototype-parent-ref-id",entityType:n.Project,entityId:z},Ct={type:n.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[P_,g_,T_],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[yt],x:0,y:0,parent:A_},O_={type:n.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:n.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},S_={like:!1,inferred:!1,id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:O_},C_={type:n.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},B_={hidden:!1,required:!0,type:n.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:S_,abstract:!1,parent:C_},w_={type:n.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:n.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},__={like:!1,inferred:!1,id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:w_},N_={type:n.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},oc={hidden:!1,required:!0,type:n.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:__,abstract:!1,parent:N_},M_={type:n.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:n.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},V_={like:!1,inferred:!1,id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:M_},L_={type:n.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},$_={hidden:!1,required:!0,type:n.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:V_,private:!0,abstract:!1,parent:L_},G_={type:n.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:n.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},F_={like:!1,inferred:!1,id:"ad44250b-40c2-48f7-a480-381fa938f562",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:G_},U_={type:n.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},x_={hidden:!1,required:!0,type:n.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:F_,implements:null,private:!0,static:!1,abstract:!1,parent:U_},j_={type:n.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:n.Project,entityId:z},vt={type:n.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[B_,oc,$_,x_],static:!1,abstract:!1,abstractMethods:[],methods:[CB,p_],extends:[],implements:[Fe],x:0,y:0,parent:j_},k_={type:n.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:n.Project,entityId:z},lc={type:n.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:k_};n.GenericReference,n.DataType;const q_={id:"cron-job-entity-expression-property-ref-id",type:n.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:n.Property},J_={like:!1,inferred:!1,id:"cron-job-entity-expression-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:q_},W_={id:"cron-job-entity-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},H_={hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:n.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:J_,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:W_},Y_={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:n.GenericReference,entityId:"show-popup-func-decl-id",entityType:n.FunctionDeclaration},z_={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:n.FunctionDeclaration},Z_={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:n.FunctionCall,declaration:lc,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[Y_],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:z_},K_={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},X_={id:"cron-job-entity-trigger-func-decl-id",version:1,type:n.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Nl,calls:[Z_],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:K_},Q_={id:"cron-job-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},eN={id:"cron-job-entity-id",version:1,type:n.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[H_],static:!0,abstract:!1,abstractMethods:[],extends:[Ml],implements:[],methods:[X_],x:0,y:0,parent:Q_},tN={type:n.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:n.Project,entityId:z},nN={type:n.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:[es],x:0,y:0,parent:tN},mb="f558fbf8-67de-4545-9804-6ae621e0b2d4",rN={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},iN={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},aN={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:rN,autogeneration:null,valueAsType:null},parent:iN},sN={id:"getCompanyByIdEndpointReachedEntityEventRef",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},oN={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},lN={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},cN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:oN,autogeneration:null,valueAsType:null},parent:lN},dN={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:cN,implements:vl,required:!0,index:0,parent:sN},uN={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},pN={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:n.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:aN,implements:Il,required:!0,index:1,parent:uN},yN={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},hN={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},fN={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},mN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:x,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:hN,autogeneration:null,valueAsType:null},parent:fN},TN={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:n.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:mN,implements:Dl,required:!0,index:2,parent:yN},EN={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},bN={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},RN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:bN},gN={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:RN,implements:Pl,index:3,required:!0,parent:EN},vN={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},IN={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vN},DN={id:"getCompanyByIdEndpointReturnStatementRef",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},PN={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:n.ReturnDeclaration,name:"Response code",dataType:IN,implements:Al,readsValue:null,required:!0,index:0,parent:DN},AN={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},ON={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},SN={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:AN,autogeneration:null,valueAsType:null},parent:ON},CN={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},BN={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ReturnDeclaration,name:"Response headers",dataType:SN,implements:Ol,readsValue:null,required:!0,index:1,parent:CN},wN={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},_N={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:wN},NN={id:"getCompanyByIdEndpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},MN={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ReturnDeclaration,name:"Response body",implements:Sl,dataType:_N,readsValue:null,required:!0,index:2,parent:NN},VN={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:n.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:n.FunctionDeclaration},LN={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},$N={id:"getCompanyByIdEndpointReturnStatement",type:n.ReturnStatement,version:1,outputs:[PN,BN,MN],calledByError:[],calledByEntry:[VN],calledBySuccess:[],throws:null,x:0,y:0,parent:LN},GN={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:mb},FN={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:n.FunctionDeclaration,inputs:[dN,pN,TN,gN],returnStatements:[$N],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:Cl,index:0,private:!1,x:0,y:0,parent:GN},UN={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},xN={id:"getCompanyByIdEndpointPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointPathProperty"},jN={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.String,value:"/company/{id}",parent:UN,valueAsType:null,autogeneration:null},parent:xN},kN={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},qN={hidden:!1,required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:Rl,dataType:jN,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:kN},JN={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},WN={id:"getCompanyByIdEndpointMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointMethodProperty"},HN={like:!1,inferred:!1,id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Cn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,parent:JN,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:WN},YN={id:"getCompanyByIdEndpointBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},zN={hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:gl,index:0,dataType:HN,description:null,parent:YN},ZN={type:n.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:n.Project,entityId:z},KN={type:n.CustomEntity,id:mb,version:1,name:"Get given company data by id",description:null,properties:[qN,zN],methods:[FN],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[es],x:0,y:0,parent:ZN},XN={id:"product-prototype-database-property-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-id",entityType:n.Property},QN={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:n.DataType},eM={like:!1,inferred:!1,id:"product-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:nc,autogeneration:null,parent:QN},parent:XN},tM={id:"product-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},nM={hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:eM,description:"The database that the entity belongs to.",parent:tM},rM={type:n.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:n.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},iM={like:!1,inferred:!1,id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:rM},aM={type:n.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:n.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},sM={hidden:!1,required:!0,type:n.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:iM,abstract:!1,parent:aM},oM={type:n.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:n.Project,entityId:z},lM={type:n.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Fe],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[nM,sM],methods:[],x:0,y:0,parent:oM},ea="project-loaded-event-id",Xt="get-bitcoin-price-http-call-operation-id",Tb="get-bitcoin-price-http-call-response-body-id",Ms="validate-bitcoin-price-response-operation-ids",cM={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Tb},dM={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:n.Operation,entityId:Ms},Eb={id:"validate-bitcoin-data-to-validate-input-map-id",type:n.InputMap,version:1,declaration:er.fixedArguments[1],name:null,description:null,readsValue:cM,defaultValue:null,index:0,parent:dM},uM={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},pM={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:n.Operation,entityId:Ms},yM={id:"validate-bitcoin-type-to-match-input-map-id",type:n.InputMap,version:1,declaration:er.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:n.PrimitiveValue,version:1,name:I.EntityTemplate,valueAsType:nb,value:null,parent:uM,autogeneration:null},index:0,parent:pM},hM={type:n.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:n.Operation,entityId:Ms},fM={id:"validate-bitcoin-validated-entity-output-map-id",type:n.OutputMap,version:1,declaration:er.fixedReturns[0],writesValues:[],index:0,parent:hM},mM={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:n.GlobalEvent,entityId:ea},TM={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:n.Operation,entityId:Xt},EM={type:n.Operation,id:Ms,version:1,declaration:er,inputs:[yM,Eb],outputs:[fM],process:null,successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[TM],parent:mM},bM={type:n.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:n.FunctionCall,entityId:Xt},RM={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:n.InputMap,declaration:ka,name:null,description:null,readsValue:null,defaultValue:null,index:0,parent:bM},gM={type:n.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:n.FunctionCall,entityId:Xt},vM={type:n.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:n.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},IM={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:n.InputMap,declaration:qa,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:I.String,parent:vM,valueAsType:null,autogeneration:null},index:1,parent:gM},DM={type:n.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:n.FunctionCall,entityId:Xt},PM={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:n.InputMap,declaration:Ja,name:null,description:null,readsValue:null,defaultValue:null,index:2,parent:DM},AM={type:n.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:n.FunctionCall,entityId:Xt},OM={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:n.InputMap,declaration:Wa,name:null,description:null,readsValue:null,defaultValue:null,index:3,parent:AM},SM={type:n.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:n.FunctionCall,entityId:Xt},CM={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:n.OutputMap,declaration:Ha,writesValues:[],index:1,parent:SM},BM={type:n.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:n.FunctionCall,entityId:Xt},wM={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:n.OutputMap,declaration:sl,writesValues:[],index:0,parent:BM},_M={type:n.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:n.FunctionCall,entityId:Xt},NM={id:Tb,type:n.OutputMap,version:1,declaration:Di,writesValues:[Eb],index:2,parent:_M},MM={type:n.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:n.FunctionDeclaration,entityId:Xt},VM={type:n.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:n.GlobalEvent,entityId:ea},LM={type:n.Operation,id:Xt,version:1,declaration:Pi,inputs:[RM,IM,PM,OM],outputs:[wM,CM,NM],process:null,parent:VM,calledByError:[],calledByEntry:[MM],calledBySuccess:[],successCalls:[EM],errorCalls:[],error:null,x:0,y:0},$M={type:n.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:n.GlobalEvent,entityId:ea},GM={type:n.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:n.GlobalEvent,entityId:ea},FM={process:null,type:n.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:lc,inputs:[],outputs:[],calledByError:[],calledByEntry:[$M],calledBySuccess:[],parent:GM,successCalls:[],errorCalls:[],error:null,x:0,y:0},UM={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:n.GenericReference,entityType:n.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},xM={type:n.GlobalEvent,id:ea,version:1,name:on.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:as,parent:UM,inputs:[],calls:[FM,LM],x:0,y:0},Lt="abort-execution-func-declaration-id",ta="abort-execution-func-exec-var-declaration-id",Vs="abort-execution-func-small-wait-op-id",cc="abort-execution-func-long-wait-op-id",bb="abort-execution-func-long-wait-process-output-id",Rb="abort-execution-func-exec-var-instance-write-id",gb="abort-execution-func-long-wait-return-stmt-id",vb="abort-execution-func-small-wait-return-stmt-id",jM="abort-execution-func-exec-var-instance-abort-call-id",dc="abort-execution-func-exec-var-instance-abort-internal-call-id",Ib="abort-execution-func-exec-second-wait-op-id",kM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},qM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},JM={like:!1,inferred:!1,id:"short-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:qM},constant:!1,parent:kM},WM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:vb},HM={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",dataType:JM,implements:null,readsValue:null,required:!0,index:0,parent:WM},YM={type:n.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Vs},zM={type:n.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},Db={type:n.ReturnStatement,id:vb,version:1,outputs:[HM],calledByError:[],calledByEntry:[],calledBySuccess:[YM],throws:null,x:0,y:0,parent:zM},ZM={type:n.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"second-wait-argument-map-id"},KM={type:n.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:Ib},XM={id:"second-wait-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:I.Number,parent:ZM},index:0,parent:KM},QM={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},e0={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.InternalCall,entityId:dc},t0={id:Ib,type:n.Operation,version:1,declaration:ut,inputs:[XM],outputs:[],process:null,successCalls:[Db],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[e0],error:null,parent:QM},n0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:n.VariableInstance,entityId:Rb},r0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:n.Operation,entityId:Vs},i0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},a0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ta},s0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:n.InternalCall,entityId:dc},o0={id:jM,type:n.VariableInstance,version:1,declaration:a0,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[s0],parent:i0},Pb={id:dc,type:n.InternalCall,version:1,inputs:[],outputs:[],declaration:Vl,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[n0,r0],successCalls:[t0],errorCalls:[],error:null,index:0,parent:o0},l0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},c0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:ta},d0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:Lt},u0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ta},p0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:n.OutputMap,entityId:bb},uc={id:Rb,type:n.VariableInstance,version:1,declaration:u0,inputs:[],outputs:[],calledByError:[],calledByEntry:[d0],calledBySuccess:[c0],successCalls:[Pb],errorCalls:[],x:0,y:0,readsValue:p0,writesValues:[],internalCalls:[],parent:l0},y0={type:n.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:ta};n.GenericReference,n.DataType;const h0={like:!1,inferred:!1,id:"abort-exec-func-var-decl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Ll,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:y0,defaultValue:null},f0={type:n.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},m0={type:n.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},T0={id:ta,type:n.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:h0,inputs:[],outputs:[],calledByError:[],calledByEntry:[m0],calledBySuccess:[],successCalls:[uc],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:f0},E0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},b0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},R0={like:!1,inferred:!1,id:"long-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:b0},constant:!1,parent:E0},g0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:gb},v0={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",implements:null,dataType:R0,readsValue:null,required:!0,index:0,parent:g0},I0={type:n.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:cc},D0={type:n.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},Ab={type:n.ReturnStatement,id:gb,version:1,outputs:[v0],calledByError:[],calledByEntry:[],calledBySuccess:[I0],throws:null,x:0,y:0,parent:D0},P0={type:n.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"long-argument-map-id"},Ob={type:n.GenericReference,id:"long-argument-map-parent-ref-id",entityType:n.Operation,entityId:cc},A0={id:"long-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:n.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:I.Number,parent:P0},index:0,parent:Ob},O0={type:n.GenericReference,id:"long-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},S0={type:n.GenericReference,id:"long-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},C0={id:bb,type:n.OutputMap,version:1,declaration:Gl,writesValues:[uc],index:0,parent:Ob},B0={id:cc,type:n.Operation,version:1,declaration:ut,inputs:[A0],outputs:[],process:C0,successCalls:[Ab],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[S0],calledBySuccess:[],error:null,parent:O0},w0={type:n.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"small-wait-argument-map-id"},_0={type:n.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:Vs},N0={id:"small-wait-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:I.Number,parent:w0},index:0,parent:_0},M0={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},V0={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},L0={id:Vs,type:n.Operation,version:1,declaration:ut,inputs:[N0],outputs:[],process:null,successCalls:[Pb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[V0],calledBySuccess:[],error:null,parent:M0},$0={type:n.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:n.Project,entityId:z},Sb={id:"abort-execution-func-decl-id",type:n.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[Ab,Db],calls:[L0,T0,uc,B0],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:$0},G0={type:n.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:n.Project,entityId:z},F0={id:"call-execution-abort-func-id",type:n.FunctionCall,version:1,declaration:Sb,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:G0},pc="manual-hello-world-loop-func-decl-id",Cb="manual-hello-world-loop-func-return-statement-id",Qt="manual-hello-world-loop-id",na="manual-hello-world-loop-body-id",yc="manual-hello-world-loop-break-statement-id",ra="manual-hello-world-loop-current-iteration-number-output-map-id",hc="manual-hello-world-loop-previous-iterations-results-output-map-id",fc="assembled-hello-world-text-output-id",Bb="assembled-hello-world-list-output-id",ia="iteration-number-is-equal-or-greater-than-10-condition-id",Ls="join-hello-world-and-number-operation-id",$s="append-string-to-list-operation-id",wb="hello-world-loop-output-map-id",U0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:n.ReturnStatement,entityId:Cb},x0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:n.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},j0={like:!1,inferred:!1,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:x0},k0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:n.OutputMap,entityId:wb},_b={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:n.ReturnDeclaration,name:"Results",description:null,dataType:j0,implements:null,readsValue:k0,required:!0,index:0,parent:U0},q0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:n.Loop,entityId:Qt},J0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:n.FunctionDeclaration,entityId:pc},Nb={type:n.ReturnStatement,id:Cb,version:1,outputs:[_b],calledByError:[],calledByEntry:[],calledBySuccess:[q0],parent:J0,throws:null,x:0,y:0},W0={type:n.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:n.BreakStatement,entityId:yc},H0={type:n.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:fc},Mb={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,dataType:null,readsValue:H0,implements:null,required:!0,index:0,parent:W0},Y0={type:n.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:ra},z0={type:n.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:n.BreakStatement,entityId:yc},Vb={isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration counter",description:null,implements:null,dataType:null,readsValue:Y0,required:!0,index:1,parent:z0},Z0={type:n.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:n.Condition,entityId:ia},K0={type:n.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:n.Loop,entityId:Qt},Lb={type:n.BreakStatement,id:yc,version:1,outputs:[Mb,Vb],calledByError:[],calledByEntry:[],calledBySuccess:[Z0],parent:K0,throws:null,x:0,y:0},X0={type:n.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:n.ContinueStatement,entityId:"hello-world-loop-continue-statement"},Q0={type:n.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:n.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},e1={like:!1,inferred:!1,id:"hello-world-loop-continue-statement-output-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Q0},t1={type:n.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:fc},$b={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,implements:null,dataType:e1,readsValue:t1,required:!0,index:0,parent:X0},n1={type:n.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:n.Condition,entityId:ia},r1={type:n.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:n.Loop,entityId:Qt},Gb={type:n.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[$b],calledBySuccess:[],calledByError:[n1],calledByEntry:[],parent:r1,throws:null,x:0,y:0};n.GenericReference,n.InputMap;const i1={type:n.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:n.Operation,entityId:$s},a1={type:n.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:n.OutputMap,entityId:hc},Fb={id:"append-string-to-list-base-string-map-id",type:n.InputMap,version:1,declaration:Qo,name:null,description:null,readsValue:a1,defaultValue:null,index:0,parent:i1},s1={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:$s},o1={id:Bb,type:n.OutputMap,version:1,writesValues:[Mb],declaration:vi,index:0,parent:s1},l1={type:n.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:n.Condition,entityId:ia},c1={type:n.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Bb},d1={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:$s},Ub={id:"latest-string-to-add-input-map-id",version:1,type:n.InputMap,declaration:el,name:null,description:null,readsValue:c1,defaultValue:null,index:1,parent:d1},u1={type:n.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Qt},p1={type:n.Operation,id:$s,declaration:ja,version:1,inputs:[Fb,Ub],outputs:[o1],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[l1],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:u1},y1={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:na},h1={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:n.Loop,entityId:Qt},f1={type:n.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:ra},xb={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:n.Condition,entityId:ia},m1={id:"current-iteration-number-to-check-map-id",version:1,type:n.InputMap,declaration:jr.fixedArguments[0],name:null,description:null,readsValue:f1,index:1,defaultValue:null,parent:xb},T1={type:n.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"max-num-iterations-value-map-id"},E1={id:"max-num-iterations-value-map-id",version:1,type:n.InputMap,declaration:jr.fixedArguments[1],name:null,description:null,readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:10,autogeneration:null,valueAsType:null,parent:T1},parent:xb},b1={type:n.Condition,id:ia,version:1,declaration:jr,inputs:[E1,m1],calledByError:[],calledByEntry:[y1],calledBySuccess:[],successCalls:[Lb,p1],errorCalls:[Gb],x:0,y:0,parent:h1},R1={type:n.GenericReference,id:"base-string-map-ref-id",entityType:n.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},g1={type:n.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:n.Operation,entityId:Ls},v1={id:"join-hello-world-and-number-base-string-map-id",type:n.InputMap,version:1,declaration:Ua,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"Hello world ",name:I.String,parent:R1,valueAsType:null,autogeneration:null},index:0,parent:g1},I1={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:Ls},D1={id:fc,type:n.OutputMap,version:1,writesValues:[Ub,$b],declaration:vi,index:0,parent:I1},P1={type:n.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:na},A1={type:n.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:ra},O1={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:Ls},jb={id:"current-iteration-number-input-map-id",version:1,type:n.InputMap,declaration:xa,name:null,description:null,readsValue:A1,defaultValue:null,index:1,parent:O1},S1={type:n.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Qt},C1={type:n.Operation,id:Ls,declaration:Ii,version:1,inputs:[v1,jb],outputs:[D1],process:null,calledByError:[],calledByEntry:[P1],calledBySuccess:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:S1},B1={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:hc,entityType:n.ArgumentDeclaration},w1={like:!1,inferred:!1,id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:B1},_1={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:n.GenericReference,entityId:na,entityType:n.FunctionDeclaration},N1={id:hc,type:n.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:w1,implements:null,writesValues:[Fb],index:1,parent:_1},M1={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:n.GenericReference,entityId:na,entityType:n.FunctionDeclaration},V1={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:ra,entityType:n.ArgumentDeclaration};n.DataType;const L1={id:ra,type:n.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,implements:dl,dataType:null,writesValues:[jb,Vb],index:0,parent:M1},$1={id:"manual-flow-loop-body-parent-ref-id",type:n.GenericReference,entityId:Qt,entityType:n.Loop},G1={id:na,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[L1,N1],calls:[b1,C1],implements:ul,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:$1},F1={type:n.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:n.Loop,entityId:Qt},kb={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:n.ValueDescriptor,name:"Iteration result",description:null,dataType:null,required:!0,index:0,parent:F1},U1={type:n.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:n.Loop,entityId:Qt},x1={type:n.OutputMap,id:wb,version:1,declaration:kb,writesValues:[_b],index:0,parent:U1},j1={id:"manual-hello-world-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},k1={id:"manual-hello-world-loop-called-by-ref-id",type:n.GenericReference,entityId:pc,entityType:n.FunctionDeclaration},q1={id:Qt,type:n.Loop,version:1,declaration:ll,inputs:[],outputsDeclarations:[kb],outputs:[x1],body:G1,successCalls:[Nb],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[k1],calledBySuccess:[],breakStatements:[Lb],continueStatements:[Gb],x:0,y:0,parent:j1},J1={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},qb={type:n.FunctionDeclaration,id:pc,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[q1],returnStatements:[Nb],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:J1},W1={type:n.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:n.Project,entityId:z},H1={id:"call-hello-world-loop-id",type:n.FunctionCall,version:1,declaration:qb,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:W1},yn="company-dto-function-declaration-id",mc="company-dto-func-declaration-argument-dcl-id",en="company-dto-function-company-variable-id",Fn="company-dto-function-company-dto-variable-id",Xr="iterate-over-employee-list-loop-id",Jb="iterate-over-employee-list-loop-employee-dto-output-map-id",Tc="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",aa="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",Wb="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",Y1="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",Hb="iterate-over-employee-list-continue-statement-id",Gs="iterate-over-employee-list-loop-body-id",Yb="company-dto-func-declaration-return-statement-id",zb="company-dto-func-declaration-return-decl-id",Zb="company-dto-func-declaration-company-variable-id-output-map-id",Kb="company-dto-func-declaration-company-variable-employess-output-map-id",Xb="company-dto-func-declaration-company-variable-name-output-map-id",z1="company-dto-func-declaration-company-dto-variable-input-map-id",Z1="company-dto-func-declaration-company-dto-variable-employess-input-map-id",K1="company-dto-func-declaration-company-dto-variable-name-input-map-id",Fs="company-dto-func-declaration-owner-variable-id",X1="company-dto-func-declaration-company-dto-variable-owner-input-map-id",Qb="company-dto-func-declaration-company-variable-owner-output-map-id",eR="company-dto-func-declaration-owner-variable-id-output-map-id",Us="company-dto-func-declaration-bank-account-variable-id",Q1="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",tR="company-dto-func-declaration-company-variable-bank-account-output-map-id",nR="company-dto-func-declaration-bank-account-variable-id-output-map-id",eV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:zb},tV={like:!1,inferred:!1,id:"company-dto-func-returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eV},nV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:Yb},rV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:Fn},rR={isError:!1,id:zb,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",implements:null,dataType:tV,readsValue:rV,required:!0,index:0,parent:nV},iV={type:n.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Fn},aV={type:n.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},Ec={type:n.ReturnStatement,id:Yb,version:1,outputs:[rR],calledByError:[],calledByEntry:[],calledBySuccess:[iV],throws:null,x:0,y:0,parent:aV},sV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:eR},oV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},iR={id:X1,type:n.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,index:5,readsValue:sV,parent:oV},lV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:nR},cV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},aR={id:Q1,type:n.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,index:4,readsValue:lV,parent:cV},dV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Xb},uV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},sR={id:K1,type:n.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,index:3,readsValue:dV,parent:uV},pV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Jb},yV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},oR={id:Z1,type:n.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,index:2,readsValue:pV,parent:yV},hV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Zb},fV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},lR={id:z1,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,index:1,readsValue:hV,parent:fV},mV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},TV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:Us},EV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:n.VariableDeclaration,entityId:Fs},bV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:n.VariableDeclaration,entityId:Xr},bc={id:Fn,type:n.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[TV,EV,bV],successCalls:[Ec],errorCalls:[],readsValue:null,writesValues:[rR],inputs:[lR,sR,aR,iR,oR],outputs:[],internalCalls:[],parent:mV,x:0,y:0},or="employee-dto-func-declaration-id",Rc="employee-dto-func-declaration-argument-dcl-id",cR="employee-dto-func-declaration-return-statement-id",dR="employee-dto-func-declaration-return-decl-id",lr="employee-dto-func-declaration-employee-variable-id",cr="employee-dto-func-declaration-employee-dto-variable-id",xs="employee-dto-func-declaration-manager-variable-id",uR="employee-dto-func-declaration-employee-variable-id-output-map-id",pR="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",yR="employee-dto-func-declaration-employee-variable-department-output-map-id",hR="employee-dto-func-declaration-employee-variable-manager-output-map-id",fR="employee-dto-func-declaration-manager-variable-id-output-map-id",RV="employee-dto-func-declaration-employee-dto-variable-input-map-id",gV="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",vV="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",IV="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",DV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:dR},PV={like:!1,inferred:!1,id:"employee-dto-func-returned-employee-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DV},AV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:cR},OV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:cr},mR={isError:!1,id:dR,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:PV,implements:null,readsValue:OV,required:!0,index:0,parent:AV},SV={type:n.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:cr},CV={type:n.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},gc={type:n.ReturnStatement,id:cR,version:1,outputs:[mR],calledByError:[],calledByEntry:[],calledBySuccess:[SV],throws:null,x:0,y:0,parent:CV},BV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:fR},wV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},TR={id:IV,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:BV,parent:wV},_V={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:yR},NV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},ER={id:vV,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:_V,parent:NV},MV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:pR},VV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},bR={id:gV,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:MV,parent:VV},LV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:uR},$V={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},RR={id:RV,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:LV,parent:$V},GV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},FV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:xs},UV={id:cr,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[FV],successCalls:[gc],errorCalls:[],readsValue:null,writesValues:[mR],inputs:[RR,bR,ER,TR],outputs:[],internalCalls:[],parent:GV,x:0,y:0},xV={type:n.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:xs},jV={id:fR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[TR],parent:xV},kV={type:n.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:xs},qV={like:!1,inferred:!1,id:"employee-dto-func-manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:kV,defaultValue:null},JV={type:n.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:hR},WV={type:n.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or};n.GenericReference,n.VariableDeclaration;const gR={id:xs,type:n.VariableDeclaration,version:1,name:"Manager",dataType:qV,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[UV],errorCalls:[],readsValue:JV,writesValues:[],inputs:[],outputs:[jV],internalCalls:[],parent:WV,x:0,y:0},HV={type:n.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},YV={id:hR,type:n.OutputMap,version:1,declaration:Ct.properties[2],index:3,writesValues:[gR],parent:HV},zV={type:n.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},ZV={id:yR,type:n.OutputMap,version:1,declaration:Ct.properties[0],index:2,writesValues:[ER],parent:zV},KV={type:n.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},XV={id:pR,type:n.OutputMap,version:1,declaration:yt.properties[1],index:1,writesValues:[bR],parent:KV},QV={type:n.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},eL={id:uR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[RR],parent:QV},tL={type:n.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},nL={like:!1,inferred:!1,id:"employee-dto-func-employee-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:tL,defaultValue:null},rL={type:n.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},iL={type:n.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:Rc},aL={type:n.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:or},vR={id:lr,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:nL,description:"A variable holding a company employee",calledByError:[],calledByEntry:[aL],calledBySuccess:[],successCalls:[gR],errorCalls:[],readsValue:iL,writesValues:[],inputs:[],outputs:[eL,XV,ZV,YV],internalCalls:[],parent:rL,x:0,y:0},sL={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Rc,entityType:n.ArgumentDeclaration},oL={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Ct,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,parent:sL,defaultValue:null},lL={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:or,entityType:n.FunctionDeclaration},cL={type:n.ArgumentDeclaration,id:Rc,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,implements:null,dataType:oL,index:0,writesValues:[vR],parent:lL},dL={type:n.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},vc={type:n.FunctionDeclaration,id:or,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[cL],calls:[vR],implements:null,returnStatements:[gc],collapsed:!1,private:!1,x:0,y:0,parent:dL},uL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:Wb,entityType:n.ReturnDeclaration},pL={like:!1,inferred:!1,id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ct,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:uL},yL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:n.GenericReference,entityId:aa,entityType:n.OutputMap},hL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:n.GenericReference,entityId:Hb,entityType:n.ContinueStatement},IR={isError:!1,id:Wb,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:yL,dataType:pL,implements:null,required:!0,index:0,parent:hL},fL={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},mL={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},DR={id:Hb,type:n.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[fL],outputs:[IR],throws:null,x:0,y:0,parent:mL},TL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},EL={id:Y1,type:n.OutputMap,version:1,declaration:gc.outputs[0],writesValues:[IR],index:0,parent:TL},bL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Tc,entityType:n.ArgumentDeclaration},RL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},PR={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:vc.inputs[0],readsValue:bL,index:0,defaultValue:null,parent:RL},gL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},vL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},IL={id:aa,type:n.FunctionCall,version:1,declaration:vc,inputs:[PR],process:null,outputs:[EL],calledByError:[],calledByEntry:[gL],calledBySuccess:[],successCalls:[DR],errorCalls:[],error:null,x:0,y:0,parent:vL},DL={type:n.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Tc,entityType:n.ArgumentDeclaration},PL={like:!1,inferred:!1,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ct,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:DL},AL={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},OL={id:Tc,type:n.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:PL,required:!0,implements:Ya,index:0,writesValues:[PR],parent:AL},SL={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},CL={id:Gs,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[OL],calls:[IL],implements:za,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:SL},BL={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},wL={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Kb,entityType:n.OutputMap},AR={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:tr.fixedArguments[0],defaultValue:null,readsValue:wL,index:0,parent:BL},_L={id:"iterate-over-employee-list-loop-parent-ref-id",type:n.GenericReference,entityId:yn,entityType:n.FunctionDeclaration},NL={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},ML={id:Jb,type:n.OutputMap,version:1,declaration:tr.fixedReturns[0],writesValues:[oR],index:0,parent:NL},VL={type:n.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:n.VariableDeclaration,entityId:en},LL={id:Xr,type:n.Loop,version:1,declaration:tr,inputs:[AR],successCalls:[bc],errorCalls:[],outputsDeclarations:[],outputs:[ML],body:CL,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[VL],breakStatements:[],continueStatements:[DR],error:null,x:0,y:0,parent:_L},$L={type:n.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Us},GL={id:nR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[aR],parent:$L},FL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Us},UL={like:!1,inferred:!1,id:"company-dto-func-bank-account-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:FL,defaultValue:null},xL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:tR},jL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn};n.GenericReference,n.VariableDeclaration;const OR={id:Us,type:n.VariableDeclaration,version:1,name:"Bank account",dataType:UL,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[bc],errorCalls:[],readsValue:xL,writesValues:[],inputs:[],outputs:[GL],internalCalls:[],parent:jL,x:0,y:0},kL={type:n.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fs},qL={id:eR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[iR],parent:kL},JL={type:n.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fs},WL={like:!1,inferred:!1,id:"company-dto-func-owner-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:JL,defaultValue:null},HL={type:n.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:Qb},YL={type:n.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn};n.GenericReference,n.VariableDeclaration;const SR={id:Fs,type:n.VariableDeclaration,version:1,name:"Owner",dataType:WL,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[bc],errorCalls:[],readsValue:HL,writesValues:[],inputs:[],outputs:[qL],internalCalls:[],parent:YL,x:0,y:0},zL={type:n.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},ZL={id:Qb,type:n.OutputMap,version:1,declaration:vt.properties[2],index:4,writesValues:[SR],parent:zL},KL={type:n.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},XL={id:tR,type:n.OutputMap,version:1,declaration:vt.properties[2],index:3,writesValues:[OR],parent:KL},QL={type:n.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},e$={id:Xb,type:n.OutputMap,version:1,declaration:vt.properties[0],index:2,writesValues:[sR],parent:QL},t$={type:n.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},n$={id:Kb,type:n.OutputMap,version:1,declaration:vt.properties[3],index:1,writesValues:[AR],parent:t$},r$={type:n.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},i$={id:Zb,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[lR],parent:r$},a$={type:n.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},s$={like:!1,inferred:!1,id:"company-dto-func-company-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:a$,defaultValue:null},o$={type:n.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},l$={type:n.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:mc},c$={type:n.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:yn},CR={id:en,type:n.VariableDeclaration,version:1,name:"Company",dataType:s$,description:"A variable holding a company",calledByError:[],calledByEntry:[c$],calledBySuccess:[],successCalls:[OR,SR,LL],errorCalls:[],readsValue:l$,writesValues:[],inputs:[],outputs:[i$,n$,e$,XL,ZL],internalCalls:[],parent:o$,x:0,y:0},d$={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:mc,entityType:n.ArgumentDeclaration},u$={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,parent:d$,defaultValue:null},p$={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:yn,entityType:n.FunctionDeclaration},y$={type:n.ArgumentDeclaration,id:mc,version:1,name:"Company",description:"The company to create a DTO for",required:!0,implements:null,dataType:u$,index:0,writesValues:[CR],parent:p$},h$={type:n.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},Ic={type:n.FunctionDeclaration,id:yn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[y$],calls:[CR],implements:null,index:null,returnStatements:[Ec],collapsed:!1,private:!1,x:0,y:0,parent:h$},sa="exec-in-parallel-operation-call-id",oa="exec-sequentially-operation-call-id",ht="concurrency-and-wait-function-declaration-id",BR="concurrency-and-wait-return-statement-id",wR="concurrency-and-wait-return-declaration-id",Dc="exec-in-parallel-argument-map-id",_R="exec-sequentially-argument-map-id",Pc="wait-for-2-seconds-operation-id",NR="wait-for-2-seconds-argument-map-id",Ac="map-company-dto-function-call-id",MR="map-company-dto-function-call-company-dto-output-map-id",la="company-dto-variable-one-id",Oc="company-dto-variable-one-instance-id",f$="company-dto-variable-two-id",m$={type:n.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:wR},T$={like:!1,inferred:!1,id:"returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:m$},E$={type:n.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:BR},b$={type:n.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:la},VR={isError:!1,id:wR,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:T$,implements:null,readsValue:b$,required:!0,index:0,parent:E$},R$={type:n.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Pc},g$={type:n.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},LR={type:n.ReturnStatement,id:BR,version:1,outputs:[VR],calledByError:[],calledByEntry:[],calledBySuccess:[R$],throws:null,x:0,y:0,parent:g$},v$={type:n.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:n.VariableInstance,entityId:Oc},I$={type:n.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:n.VariableInstance,entityId:Oc},D$={type:n.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},$R={id:f$,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[v$],internalCalls:[],writesValues:[VR],readsValue:I$,x:0,y:0,parent:D$},P$={type:n.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:n.VariableDeclaration,entityId:la},A$={type:n.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:la},O$={type:n.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},S$={type:n.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:la},GR={id:Oc,type:n.VariableInstance,version:1,declaration:S$,inputs:[],outputs:[],successCalls:[$R],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[P$],internalCalls:[],writesValues:[$R],readsValue:A$,x:0,y:0,parent:O$},C$={type:n.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:n.FunctionCall,entityId:Ac},B$={type:n.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:n.OutputMap,entityId:MR},w$={type:n.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},FR={id:la,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[GR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[C$],internalCalls:[],writesValues:[GR],readsValue:B$,x:0,y:0,parent:w$},UR={type:n.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:n.FunctionCall,entityId:Ac},_$={id:"map-company-dto-function-call-company-input-map-id",type:n.InputMap,version:1,declaration:Ic.inputs[0],name:null,description:null,defaultValue:null,index:0,readsValue:null,parent:UR},N$={id:MR,type:n.OutputMap,version:1,declaration:Ec.outputs[0],writesValues:[FR],index:0,parent:UR},M$={id:"map-company-dto-function-call-called-by-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ht},V$={id:"map-company-dto-function-call-parent-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ht},L$={id:Ac,type:n.FunctionCall,version:1,declaration:Ic,successCalls:[FR],process:null,errorCalls:[],inputs:[_$],outputs:[N$],calledByError:[],calledByEntry:[M$],calledBySuccess:[],parent:V$,x:0,y:0,error:null},$$={type:n.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:$E},G$={type:n.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:n.DataType,entityId:"last-timestamp-variable-datatype-id"},F$={like:!1,inferred:!1,id:"last-timestamp-variable-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:cn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:$$,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,name:I.Date,value:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:G$,valueAsType:null}},U$={type:n.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:n.Project,entityId:z},Sc={id:$E,type:n.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:F$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:U$},x$={type:n.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:NR},j$={type:n.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:n.Operation,entityId:Pc},k$={id:NR,type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:I.Number,parent:x$},index:0,parent:j$},q$={type:n.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},J$={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:oa},W$={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:sa},xR={id:Pc,type:n.Operation,version:1,declaration:xt,inputs:[k$],outputs:[],process:null,successCalls:[LR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[J$,W$],calledBySuccess:[],error:null,parent:q$},H$={type:n.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"wait-for-random-amount-input-map-id"},Y$={type:n.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:n.Operation,entityId:"wait-for-random-amount-id"},z$={id:"wait-for-random-amount-input-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:n.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:qe.Random,rangeStart:1e3,rangeEnd:4e3},name:I.Number,parent:H$},index:0,parent:Y$},Z$={type:n.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:n.Project,entityId:z},Qr={id:"wait-for-random-amount-id",type:n.Operation,version:1,declaration:xt,inputs:[z$],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:Z$},jR="list-of-functions-variable-id",K$={type:n.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:jR},X$={id:"list-of-functions-variable-action-descriptor-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},Q$={type:n.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:n.DataType,entityId:"list-of-functions-variable-data-type-id"},eG={like:!1,inferred:!1,id:"list-of-functions-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:X$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.ActionDescriptor,value:null,valueAsType:[Qr,Qr,Qr,Qr,Qr],autogeneration:null,parent:Q$},constant:!1,parent:K$},tG={type:n.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht};n.GenericReference,n.InputMap;const nG={type:n.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:n.InputMap,entityId:_R},rG={type:n.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:n.InputMap,entityId:Dc},kR={id:jR,type:n.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:eG,parent:tG,readsValue:null,writesValues:[nG,rG],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},iG={type:n.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:n.Operation,entityId:sa},aG={type:n.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},sG={type:n.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-in-parallel-return-map-id"},oG={type:n.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:n.Operation,entityId:sa},qR={id:"exec-in-parallel-result-variable-id",type:n.VariableInstance,version:1,declaration:Sc,readsValue:sG,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[oG],successCalls:[],errorCalls:[],internalCalls:[],parent:aG,x:0,y:0},lG={id:"exec-in-parallel-return-map-id",type:n.OutputMap,version:1,declaration:nl,writesValues:[qR],index:0,parent:iG},cG={type:n.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:n.Operation,entityId:sa},dG={id:Dc,type:n.InputMap,version:1,declaration:tl,name:null,description:null,readsValue:kR,defaultValue:null,index:0,parent:cG},uG={type:n.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},pG={type:n.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ht},yG={process:null,id:sa,type:n.Operation,version:1,declaration:xt,inputs:[dG],outputs:[lG],successCalls:[xR,qR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[pG],calledBySuccess:[],error:null,parent:uG},hG={type:n.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:n.Operation,entityId:oa},fG={type:n.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},mG={type:n.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-sequentially-return-map-id"},TG={type:n.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:n.Operation,entityId:oa},JR={id:"exec-sequentially-result-variable-id",type:n.VariableInstance,version:1,declaration:Sc,readsValue:mG,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[TG],successCalls:[],errorCalls:[],internalCalls:[],parent:fG,x:0,y:0},EG={id:"exec-sequentially-return-map-id",type:n.OutputMap,version:1,declaration:il,writesValues:[JR],index:0,parent:hG},bG={type:n.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:n.Operation,entityId:oa},RG={id:_R,type:n.InputMap,version:1,declaration:rl,name:null,description:null,readsValue:kR,defaultValue:null,index:0,parent:bG},gG={type:n.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},vG={type:n.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ht},IG={id:oa,type:n.Operation,version:1,declaration:dn,inputs:[RG],process:null,outputs:[EG],successCalls:[xR,JR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[vG],calledBySuccess:[],error:null,parent:gG},DG={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:z},PG={type:n.FunctionDeclaration,id:ht,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:[IG,yG,L$],returnStatements:[LR],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:DG},AG={type:n.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:n.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},OG={like:!1,inferred:!1,id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AG},SG={type:n.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:n.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},CG={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",implements:null,dataType:OG,readsValue:null,required:!0,index:0,parent:SG},BG={type:n.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},wG={type:n.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},WR={type:n.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[CG],calledByError:[],calledByEntry:[wG],calledBySuccess:[],throws:null,x:0,y:0,parent:BG},_G={type:n.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:n.Project,entityId:z},NG={type:n.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[WR],index:null,implements:null,returnStatements:[WR],collapsed:!1,private:!1,x:0,y:0,parent:_G},Cc="get-current-date-and-time-func-decl-id",HR="get-current-date-and-time-return-statement-id",YR="get-current-date-and-time-return-declaration-id",zR="get-current-date-and-time-return-declaration-data-type-id",MG={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:n.DataType,entityId:zR},VG={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:YR},LG={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:zR,version:1,entity:cn,asType:!1,isList:!1,isNullable:!1,like:!1,inferred:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:I.Date,valueAsType:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:MG},constant:!1,parent:VG},$G={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:n.ReturnStatement,entityId:HR};n.ReturnDeclaration;const GG={type:n.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:Cc},FG={type:n.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Cc};n.ReturnStatement;const UG={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:z},xG={type:n.FunctionDeclaration,id:Cc,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:UG},ZR="do-math-return-statement-id",KR="do-math-return-declaration-id",jG={type:n.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:n.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},kG={like:!1,inferred:!1,id:"do-math-func-var-to-return-one-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jG},qG={type:n.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},JG={type:n.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:n.ReturnDeclaration,entityId:KR},WG={type:n.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:kG,readsValue:null,writesValues:[JG],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:qG},HG={type:n.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:n.ReturnStatement,entityId:ZR},YG={type:n.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:n.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},zG={like:!1,inferred:!1,id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YG},ZG={isError:!1,id:KR,version:1,type:n.ReturnDeclaration,name:"Result",description:null,implements:null,dataType:zG,readsValue:WG,required:!0,index:0,parent:HG},KG={type:n.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},XG={type:n.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},XR={type:n.ReturnStatement,id:ZR,version:1,outputs:[ZG],calledByError:[],calledByEntry:[],calledBySuccess:[KG],parent:XG,throws:null,x:0,y:0},QG={type:n.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:n.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},eF={like:!1,inferred:!1,id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:QG},tF={type:n.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},nF={type:n.GenericReference,id:"do-math-func-return-one-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},rF={type:n.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},QR={type:n.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:eF,description:null,readsValue:rF,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[nF],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:tF},iF={type:n.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},aF={type:n.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},sF={type:n.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:n.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},oF={like:!1,inferred:!1,id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sF},lF={type:n.GenericReference,id:"do-math-func-return-two-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},eg={type:n.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lF],successCalls:[],errorCalls:[],dataType:oF,readsValue:aF,writesValues:[],internalCalls:[],parent:iF,x:0,y:0},tg={type:n.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},cF={type:n.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},dF={type:n.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},uF={type:n.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:n.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},ng={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:n.InputMap,declaration:Wo,name:null,description:null,readsValue:uF,defaultValue:null,index:0,parent:dF},pF={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:n.OutputMap,version:1,declaration:Yo,writesValues:[QR,eg],index:0,parent:cF},yF={type:n.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},hF={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:n.GenericReference,entityType:n.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},rg={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:n.InputMap,declaration:Ho,name:null,description:null,readsValue:hF,defaultValue:null,index:1,parent:yF},fF={type:n.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Fa,version:1,inputs:[ng,rg],outputs:[pF],calledByError:[],calledByEntry:[tg],calledBySuccess:[],process:null,successCalls:[XR,QR,eg],errorCalls:[],parent:tg,error:null,x:0,y:0},mF={type:n.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:n.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},TF={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:n.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:n.ArgumentDeclaration},ig={like:!1,inferred:!1,id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:n.PrimitiveValue,version:1,value:1,name:I.Number,parent:mF,valueAsType:null,autogeneration:null},constant:!1,parent:TF},EF={type:n.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:n.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},bF={type:n.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},RF={type:n.GenericReference,id:"do-math-func-var-called-by-ref",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},ag={type:n.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:ig,inputs:[],outputs:[],calledByError:[],calledByEntry:[RF],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:EF,writesValues:[rg],internalCalls:[],x:0,y:0,parent:bF},gF={entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:n.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},vF={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:n.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:ig,implements:null,writesValues:[ag],required:!0,index:1,parent:gF},IF={type:n.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:n.Project,entityId:z},DF={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},PF={type:n.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:n.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},AF={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:n.ArgumentDeclaration},OF={like:!1,inferred:!1,id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:n.PrimitiveValue,version:1,value:5,name:I.Number,parent:PF,valueAsType:null,autogeneration:null},constant:!1,parent:AF},SF={id:"d8895765-f705-457e-85fa-25d130926769",type:n.ArgumentDeclaration,version:1,name:"N",dataType:OF,description:"The number to add",implements:null,writesValues:[ng],required:!0,index:0,parent:DF},CF={type:n.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[SF,vF],calls:[fF,ag],implements:null,index:null,collapsed:!1,returnStatements:[XR],private:!1,x:0,y:0,parent:IF},ft="replace-bank-account-in-company-func-declaration-id",Bc="company-entity-to-modify-arg-declaration-id",wc="account-number-to-create-arg-decl-id",ei="company-main-variable-id",ti="search-person-by-id-id",sg="new-bank-account-owner-arg-decl-id",og="search-person-by-id-output-declaration-id",_c="search-person-by-id-output-entity-map-id",ca="person-not-empty-condition-id",js="create-new-bank-account-instance-operation-id",lg="create-new-bank-account-instance-operation-output-entity-map-id",cg="company-bank-account-output-map-id",Nc="old-bank-account-var-declaration-id",dg="old-bank-account-var-instance-id",ug="company-variable-instance-id",Mc="delete-bank-account-internal-call-id",da="new-bank-account-data-variable-declaration-id",BF={type:n.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},wF={type:n.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:n.InternalCall,entityId:Mc},_F={type:n.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ei},NF={type:n.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:n.VariableInstance,entityId:ug},MF={type:n.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:lg},pg={type:n.InputMap,id:"bank-account-input-map-id",version:1,readsValue:MF,declaration:oc,name:null,description:null,index:0,defaultValue:null,parent:NF},VF={type:n.VariableInstance,id:ug,version:1,declaration:_F,inputs:[pg],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[wF],successCalls:[],errorCalls:[],internalCalls:[],parent:BF,readsValue:null,writesValues:[],x:0,y:0},LF={type:n.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},$F={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,defaultValue:null,parent:LF},GF={type:n.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:cg},FF={type:n.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},UF={type:n.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:ei},xF={type:n.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:n.Operation,entityId:js};n.GenericReference,n.VariableInstance;const jF={type:n.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:n.VariableDeclaration,entityId:Nc},kF={type:n.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:n.VariableDeclaration,entityId:Nc},qF={type:n.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:n.FunctionDeclaration,entityId:ft},JF={type:n.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:n.InternalCall,entityId:Mc},WF={type:n.VariableInstance,id:dg,version:1,declaration:kF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[JF],errorCalls:[],parent:qF,readsValue:null,writesValues:[],x:0,y:0},yg={process:null,type:n.InternalCall,id:Mc,version:1,declaration:_l,index:0,successCalls:[VF],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[xF,jF],parent:WF},hg={type:n.VariableDeclaration,id:Nc,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:$F,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[UF],successCalls:[yg],internalCalls:[],errorCalls:[],parent:FF,readsValue:GF,writesValues:[],x:0,y:0},HF={type:n.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},YF={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,like:!1,inferred:!1,constant:!1,defaultValue:null,parent:HF},zF={type:n.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:Bc},ZF={type:n.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},KF={type:n.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ft},XF={type:n.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},QF={id:cg,version:1,type:n.OutputMap,declaration:oc,index:0,parent:XF,writesValues:[hg]},fg={type:n.VariableDeclaration,id:ei,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:YF,inputs:[],outputs:[QF],calledByError:[],calledByEntry:[KF],calledBySuccess:[],successCalls:[hg],errorCalls:[],parent:ZF,internalCalls:[],readsValue:zF,writesValues:[],x:0,y:0},eU={type:n.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:da},tU={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.OutputMap,entityId:_c},mg={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:n.InputMap,declaration:null,name:"Account owner",description:null,readsValue:tU,index:1,defaultValue:null,parent:eU},nU={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:wc},rU={type:n.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:da},Tg={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:n.InputMap,declaration:null,name:"Account number",description:null,readsValue:nU,defaultValue:null,index:0,parent:rU},Eg={type:n.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:n.Operation,entityId:js},iU={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:n.InputMap,declaration:Qn.fixedArguments[0],name:null,description:null,index:0,readsValue:null,defaultValue:{type:n.PrimitiveValue,name:I.EntityTemplate,value:null,valueAsType:Zr,autogeneration:null},parent:Eg},aU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-entity-data-input-map-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:da},bg={id:"create-new-bank-account-instance-operation-entity-data-input-map-id",version:1,type:n.InputMap,declaration:Qn.fixedArguments[1],name:null,description:null,index:1,readsValue:aU,defaultValue:null,parent:Eg},sU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:n.Operation,entityId:js},oU={id:lg,version:1,type:n.OutputMap,declaration:Qn.fixedReturns[0],index:0,writesValues:[pg],parent:sU},lU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.Condition,entityId:ca},cU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.VariableDeclaration,entityId:da},dU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},Rg={process:null,id:js,type:n.Operation,version:1,declaration:Qn,inputs:[iU,bg],error:null,outputs:[oU],successCalls:[yg],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[cU,lU],parent:dU,x:0,y:0},uU={type:n.GenericReference,id:"new-bank-account-data-variable-declaration-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},pU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.Condition,entityId:ca},yU={id:da,type:n.VariableDeclaration,version:1,inputs:[Tg,mg],dataType:null,name:"New bank Account's data",description:null,readsValue:null,outputs:[],writesValues:[bg],successCalls:[Rg],errorCalls:[],internalCalls:[],calledByError:[],calledBySuccess:[pU],calledByEntry:[],x:0,y:0,parent:uU},hU={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:n.DataType},fU={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:n.ReturnDeclaration};n.DataType,n.PrimitiveValue,I.String;const mU={id:"person-not-found-thrown-error-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:n.ReturnStatement},TU={isError:!0,id:"person-not-found-thrown-error-id",type:n.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:mU,implements:null,required:!0,index:0,readsValue:null},EU={id:"person-not-found-error-return-statement-called-by-ref-id",type:n.GenericReference,entityId:ca,entityType:n.Condition},bU={id:"person-not-found-error-return-statement-parent-ref-id",type:n.GenericReference,entityId:ft,entityType:n.FunctionDeclaration},RU={id:"person-not-found-error-return-statement-id",type:n.ReturnStatement,version:1,throws:TU,outputs:[],calledBySuccess:[],calledByError:[EU],calledByEntry:[],x:0,y:0,parent:bU},gU={type:n.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:n.Search,entityId:ti},vU={type:n.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},IU={type:n.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:_c},DU={type:n.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:n.Condition,entityId:ca},gg={id:"person-entity-to-check-map-id",version:1,type:n.InputMap,declaration:nr.fixedArguments[0],name:null,description:null,readsValue:IU,index:0,defaultValue:null,parent:DU},PU={type:n.Condition,id:ca,version:1,declaration:nr,inputs:[gg],calledByError:[],calledByEntry:[],calledBySuccess:[gU],successCalls:[yU,Rg],errorCalls:[RU],x:0,y:0,parent:vU},AU={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:n.ValueDescriptor,entityId:og},OU={like:!1,inferred:!1,id:"search-person-by-id-output-entity-declaration-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:yt,defaultValue:null,parent:AU},SU={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:n.Search,entityId:ti},vg={id:og,type:n.ValueDescriptor,version:1,dataType:OU,name:"Found person",description:"The person entity that was found",parent:SU,required:!0,index:0},CU={type:n.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:n.Search,entityId:ti},BU={type:n.OutputMap,id:_c,version:1,declaration:vg,parent:CU,writesValues:[gg,mg],index:0},wU={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:n.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:n.ArgumentDeclaration};n.DataType;const _U={type:n.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:n.Search,entityId:ti},Ig={id:"search-person-by-id-input-declaration-id",type:n.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",implements:null,index:0,required:!0,parent:_U,writesValues:[]},NU={type:n.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:n.Search,entityId:ti},MU={id:"search-person-by-id-input-map-reads-value-ref-id",type:n.GenericReference,entityId:sg,entityType:n.ArgumentDeclaration},Dg={type:n.InputMap,id:"search-person-by-id-input-map",version:1,declaration:Ig,name:null,description:null,readsValue:MU,defaultValue:null,parent:NU,index:0},VU={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},LU={type:n.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},$U={type:n.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ft},GU={type:n.Search,id:ti,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:VU,inputsDeclarations:[Ig],inputs:[Dg],outputsDeclarations:[vg],outputs:[BU],calledByError:[],calledByEntry:[$U],calledBySuccess:[],error:null,successCalls:[PU],errorCalls:[],parent:LU,x:0,y:0};n.GenericReference,n.DataType;const FU={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:wc,entityType:n.ArgumentDeclaration},UU={like:!1,inferred:!1,id:"account-number-to-create-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:FU},xU={entityType:n.FunctionDeclaration,entityId:ft,type:n.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},jU={id:wc,type:n.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:UU,implements:null,writesValues:[Tg],required:!0,index:1,parent:xU};n.GenericReference,n.DataType;const kU={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:n.ArgumentDeclaration},qU={like:!1,inferred:!1,id:"new-bank-account-owner-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ga,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:kU},JU={entityType:n.FunctionDeclaration,entityId:ft,type:n.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},WU={id:sg,type:n.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:qU,implements:null,writesValues:[Dg],required:!1,index:1,parent:JU},HU={type:n.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:n.Project,entityId:z},YU={type:n.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:n.FunctionDeclaration,entityId:ft};n.GenericReference,n.DataType;const zU={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:Bc,entityType:n.ArgumentDeclaration},ZU={like:!1,inferred:!1,id:"company-entity-to-modify-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:zU},KU={id:Bc,type:n.ArgumentDeclaration,version:1,name:"Company",dataType:ZU,implements:null,description:"The company to replace the bank account for",writesValues:[fg],required:!0,index:0,parent:YU},XU={type:n.FunctionDeclaration,id:ft,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:[KU,jU,WU],index:null,implements:null,calls:[GU,fg],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:HU},QU={type:n.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},e4={type:n.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:QU,x:0,y:0},t4={type:n.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:n.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},n4={type:n.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},r4={type:n.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[e4],events:[],implements:n4,parent:t4,x:0,y:0},Vc="global-counted-test-loop-id",Pg="global-counted-test-loop-body-id",Ag="global-counted-test-loop-body-current-iteration-argument-declaration-id",i4={type:n.GenericReference,id:"global-counted-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Ag,entityType:n.ArgumentDeclaration},a4={like:!1,inferred:!1,id:"global-counted-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:i4},s4={id:"global-counted-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Pg,entityType:n.FunctionDeclaration},o4={id:Ag,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:a4,implements:El,required:!0,index:0,writesValues:[],parent:s4},l4={id:"global-counted-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:Vc,entityType:n.Loop},c4={id:Pg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[o4],calls:[],implements:bl,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:l4},ni="random-company-employee-test-variable-id",Lc="manager-global-variable-id",Og="global-user-instance-id",hn="employee-mapped-dto-variable-id",Un="employee-mapped-dto-variable-instance-id",Sg="random-employee-id-output-map-id",Cg="random-employee-birth-date-output-map-id",Bg="random-employee-department-output-map-id",wg="random-employee-manager-output-map-id",_g="manager-global-id-output-map-id",Ng="global-user-instance-id-output-map-id",d4="employee-mapped-dto-requester-id-input-map-id",Mg="employee-mapped-dto-now-timestamp-input-map-id",u4="employee-mapped-dto-id-input-map-id",p4="employee-mapped-dto-birth-date-input-map-id",y4="employee-mapped-dto-department-input-map-id",h4="employee-mapped-dto-manager-input-map-id",f4={id:"global-counted-test-loop-iteration-number-input-map-parent-ref-id",type:n.GenericReference,entityId:Vc,entityType:n.Loop},m4={id:"global-counted-test-loop-iteration-number-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},T4={id:"global-counted-test-loop-iteration-number-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Ka.fixedArguments[0],defaultValue:null,readsValue:m4,index:0,parent:f4},E4={id:"global-counted-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},b4={id:"global-counted-test-loop-called-by-success-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},R4={id:Vc,type:n.Loop,version:1,declaration:Ka,inputs:[T4],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:c4,calledByError:[],calledByEntry:[],calledBySuccess:[b4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:E4},$c="global-object-keys-test-loop-id",Vg="global-object-keys-test-loop-body-id",Lg="global-object-keys-test-loop-body-current-iteration-argument-declaration-id",g4={type:n.GenericReference,id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Lg,entityType:n.ArgumentDeclaration},v4={like:!1,inferred:!1,id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:g4},I4={id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Vg,entityType:n.FunctionDeclaration},D4={id:Lg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:v4,implements:fl,required:!0,index:0,writesValues:[],parent:I4},P4={id:"global-object-keys-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:$c,entityType:n.Loop},A4={id:Vg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[D4],calls:[],implements:Si,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:P4},O4={id:"global-object-keys-test-loop-iteration-object-input-map-parent-ref-id",type:n.GenericReference,entityId:$c,entityType:n.Loop},S4={id:"global-object-keys-test-loop-iteration-object-input-map-reads-value-ref-id",type:n.GenericReference,entityId:hn,entityType:n.VariableDeclaration},$g={id:"global-object-keys-test-loop-iteration-object-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Si.fixedArguments[0],defaultValue:null,readsValue:S4,index:0,parent:O4},C4={id:"global-object-keys-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},B4={id:"global-object-keys-test-loop-called-by-success-ref-two-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},w4={id:"global-object-keys-test-loop-called-by-success-ref-one-id",type:n.GenericReference,entityId:hn,entityType:n.VariableDeclaration},Gc={id:$c,type:n.Loop,version:1,declaration:Si,inputs:[$g],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:A4,calledByError:[],calledByEntry:[],calledBySuccess:[w4,B4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:C4},Fc="global-object-values-test-loop-id",Gg="global-object-values-test-loop-body-id",Fg="global-object-values-test-loop-body-current-iteration-argument-declaration-id",_4={type:n.GenericReference,id:"global-object-values-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Fg,entityType:n.ArgumentDeclaration},N4={like:!1,inferred:!1,id:"global-object-values-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:_4},M4={id:"global-object-values-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Gg,entityType:n.FunctionDeclaration},V4={id:Fg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:N4,implements:ml,required:!0,index:0,writesValues:[],parent:M4},L4={id:"global-object-values-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:Fc,entityType:n.Loop},$4={id:Gg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[V4],calls:[],implements:Bi,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:L4},G4={id:"global-object-values-test-loop-iteration-object-input-map-parent-ref-id",type:n.GenericReference,entityId:Fc,entityType:n.Loop},F4={id:"global-object-values-test-loop-iteration-object-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},Ug={id:"global-object-values-test-loop-iteration-object-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Bi.fixedArguments[0],defaultValue:null,readsValue:F4,index:0,parent:G4},U4={id:"global-object-values-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},x4={id:"global-object-values-test-loop-called-by-success-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},xg={id:Fc,type:n.Loop,version:1,declaration:Bi,inputs:[Ug],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:$4,calledByError:[],calledByEntry:[],calledBySuccess:[x4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:U4},Uc="global-test-iterate-over-string-loop-id",xc="global-test-iterate-over-string-loop-body-id",ks="global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-id",jg="global-test-iterate-over-string-loop-iteration-list-input-map-id",j4={type:n.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:ks,entityType:n.ArgumentDeclaration},k4={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:j4},q4={id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:xc,entityType:n.FunctionDeclaration},J4={id:ks,type:n.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",dataType:k4,implements:pl,required:!0,index:1,writesValues:[],parent:q4},W4={type:n.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:ks,entityType:n.ArgumentDeclaration},H4={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:W4},Y4={id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:xc,entityType:n.FunctionDeclaration},z4={id:ks,type:n.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",dataType:H4,implements:yl,required:!0,index:0,writesValues:[],parent:Y4},Z4={id:"global-test-iterate-over-string-loop-body-parent-ref-id",type:n.GenericReference,entityId:Uc,entityType:n.Loop},K4={id:xc,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[z4,J4],calls:[],implements:hl,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:Z4},X4={id:"global-test-iterate-over-string-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:Uc,entityType:n.Loop},Q4={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-parent-ref-id",type:n.GenericReference,entityId:jg,entityType:n.InputMap},ex={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-id",type:n.PrimitiveValue,name:I.String,version:1,value:"Hello",valueAsType:null,autogeneration:{type:qe.Random,rangeStart:4,rangeEnd:5},parent:Q4},tx={id:jg,type:n.InputMap,version:1,name:null,description:null,declaration:Za.fixedArguments[0],defaultValue:ex,readsValue:null,index:0,parent:X4},nx={id:"global-test-iterate-over-string-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},rx={id:Uc,type:n.Loop,version:1,declaration:Za,inputs:[tx],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:K4,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:nx},jc="iterate-over-list-loop-id",kg="iterate-over-list-loop-body-id",qg="iterate-over-list-loop-body-current-iteration-argument-declaration-id",ix={type:n.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:qg,entityType:n.ArgumentDeclaration},ax={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:ix},sx={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:kg,entityType:n.FunctionDeclaration},ox={id:qg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:ax,implements:Ya,required:!0,index:0,writesValues:[],parent:sx},lx={id:"iterate-over-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:jc,entityType:n.Loop},cx={id:kg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[ox],calls:[],implements:za,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:lx},dx={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:jc,entityType:n.Loop},ux={id:"iterate-over-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:tr.fixedArguments[0],defaultValue:null,readsValue:null,index:0,parent:dx},px={id:"iterate-over-list-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},yx={id:jc,type:n.Loop,version:1,declaration:tr,inputs:[ux],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:cx,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:px};var kc=(r=>(r.EQ="eq",r.NEQ="neq",r.GT="gt",r.GTE="gte",r.LT="lt",r.LTE="lte",r.LIKE="like",r.ILIKE="ilike",r))(kc||{}),Jg=(r=>(r.COUNT="count",r.SUM="sum",r.AVG="avg",r.MIN="min",r.MAX="max",r))(Jg||{});const hx={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:Jg.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:kc.NEQ,value:null}]},where:[{name:"employee_count",operation:kc.GT,value:1}]},fx={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},mx={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},Wg={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:n.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,required:!0,index:0,parent:mx},Tx={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},Ex={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:n.OutputMap,version:1,declaration:Wg,writesValues:[],index:0,parent:Tx},bx={id:"find-companies-with-multiple-employees-and-bank-account",type:n.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:[Wg],inputs:[],outputs:[Ex],query:hx,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:fx},Rx={type:n.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:_g},gx={type:n.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Hg={id:h4,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:Rx,parent:gx},vx={type:n.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Bg},Ix={type:n.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Yg={id:y4,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:vx,parent:Ix},Dx={type:n.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Cg},Px={type:n.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},zg={id:p4,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:Dx,parent:Px},Ax={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Sg},Ox={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Zg={id:u4,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:Ax,parent:Ox},Sx={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Ng},Cx={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Kg={id:d4,type:n.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:Sx,parent:Cx},Bx={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Lc},wx={id:_g,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Hg],parent:Bx},_x={type:n.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Lc},Nx={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:_x,defaultValue:null},Mx={type:n.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:wg},Vx={type:n.GenericReference,id:"manager-variable-parent-ref-id",entityType:n.Project,entityId:z},Xg={id:Lc,type:n.VariableDeclaration,version:1,name:"Manager",dataType:Nx,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Mx,writesValues:[],inputs:[],outputs:[wx],internalCalls:[],parent:Vx,x:0,y:0},Lx={type:n.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},$x={id:wg,type:n.OutputMap,version:1,declaration:Ct.properties[2],index:3,writesValues:[Xg],parent:Lx},Gx={type:n.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},Fx={id:Bg,type:n.OutputMap,version:1,declaration:Ct.properties[0],index:2,writesValues:[Yg],parent:Gx},Ux={type:n.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},xx={id:Cg,type:n.OutputMap,version:1,declaration:yt.properties[1],index:1,writesValues:[zg],parent:Ux},jx={type:n.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},kx={id:Sg,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Zg],parent:jx},qx={type:n.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},Jx={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:qx,defaultValue:null},Wx={type:n.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:n.Project,entityId:z},Hx={id:ni,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:Jx,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[kx,xx,Fx,$x],internalCalls:[],parent:Wx,x:0,y:0},Yx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:Mg},zx={type:n.PrimitiveValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:I.Date,version:1,valueAsType:null,value:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:Yx},Zx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:n.VariableInstance,entityId:Un},Kx={id:Mg,type:n.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:zx,index:5,readsValue:null,parent:Zx},Xx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:n.VariableDeclaration,entityId:hn},Qx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:n.VariableDeclaration,entityId:Un},e8={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:n.Project,entityId:z},t8={id:Un,type:n.VariableInstance,version:1,declaration:Xx,calledByError:[],calledByEntry:[],calledBySuccess:[Qx],successCalls:[Gc,xg],errorCalls:[],readsValue:null,writesValues:[Ug],inputs:[Kx],outputs:[],internalCalls:[],parent:e8,x:0,y:0},n8={type:n.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:n.Project,entityId:z},r8={id:hn,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Gc,t8],errorCalls:[],readsValue:null,writesValues:[$g],inputs:[Kg,Zg,zg,Yg,Hg],outputs:[],internalCalls:[],parent:n8,x:0,y:0},i8={type:n.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:n.VariableDeclaration,entityId:tc},a8={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:rc,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:i8,defaultValue:null},s8={type:n.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:n.Project,entityId:z},Qg={id:tc,type:n.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:a8,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:s8},o8={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableInstance,entityId:Og},l8={id:Ng,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Kg],parent:o8},c8={type:n.GenericReference,id:"global-user-instance-parent-ref-id",entityType:n.Project,entityId:z},d8={id:Og,type:n.VariableInstance,version:1,declaration:Qg,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[l8],internalCalls:[],parent:c8,x:0,y:0},u8={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:tc},p8={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:n.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},y8={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:u8,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:I.Boolean,version:1,value:null,type:n.PrimitiveValue,autogeneration:{type:qe.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:p8}},h8={type:n.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:n.Project,entityId:z},ev={id:"is-test-environment-variable-dcl-id",type:n.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:y8,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:h8},f8={type:n.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:n.Project,entityId:z},m8={id:"is-test-environment-variable-instance-id",type:n.VariableInstance,version:1,declaration:ev,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:f8,x:0,y:0},tv={type:n.Project,id:z,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:[r4],entities:[nc,rc,yt,lM,Ct,Ns,tb,nb,Zr,nN,vt,KN,GE,WO,eN],functions:[PG,Sb,vc,NG,xG,qb,Ic,lc,XU,ub,CF],events:[xM],variableDeclarations:[ev,Qg,Sc,Hx,Xg,r8],variableInstances:[m8,d8],conditions:[],operations:[Qr],functionCalls:[F0,H1],loops:[yx,Gc,xg,rx,R4],searches:[bx]};var T=(r=>(r.Error="error",r.Warning="warning",r))(T||{}),D=(r=>(r.InvalidObjectStructure="invalid-object-structure",r.NameNotUniqueInScope="name-not-unique-in-scope",r.EmptyName="empty-name",r.MissingCaller="missing-caller",r.PropertyOverwrite="property-overwrite",r.MethodOverwrite="method-overwrite",r.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",r.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",r.UnreachableEntity="unreachable-entity",r.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",r.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",r.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",r.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",r.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",r))(D||{}),h=(r=>(r.RootReference="root-reference",r.ReferencedEntityNotFound="referenced-entity-not-found",r.EntityIdNotUnique="entity-id-not-unique",r.BuiltInEntityGenerated="built-in-entity-generated",r.BuiltInEntityUpdated="built-in-entity-updated",r.BuiltInEntityDeleted="built-in-entity-deleted",r.UnknownEntityType="unknown-entity-type",r.MissingTypeProperty="missing-type-property",r.MissingIdProperty="missing-id-property",r.BuiltInEntityParent="built-in-entity-parent",r.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",r.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",r.RecommendedImplementOperationAction="recommended-implement-operation-action",r.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",r.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",r.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",r.RecommendedImplementConditionAction="recommended-implement-condition-action",r.InvalidReferenceObjectStructure="invalid-reference-object-structure",r.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",r.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",r.InvalidParentReference="invalid-parent-reference",r.InvalidImplementsReference="invalid-implements-reference",r.InvalidExtendsReference="invalid-extends-reference",r.InvalidGenerationActionPayload="invalid-generation-action-payload",r.InvalidReference="invalid-reference",r.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",r.InvalidUpdateEntityOperation="invalid-update-entity-operation",r.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",r.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",r.UnrecognizedProperty="unrecognized-property",r.SelfReference="self-reference",r.DuplicateReference="duplicate-reference",r.CallerWithIncompatibleScope="caller-with-incompatible-scope",r.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",r.InvalidInputMapDeclaration="invalid-input-map-declaration",r.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",r.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",r.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",r.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",r.OutputOverwrite="output-overwrite",r.InputOverwrite="input-overwrite",r.IncompatibleScope="incompatible-scope",r.InvalidParentUpdate="invalid-parent-update",r.NonInteractiveEntityReferenced="non-interactive-entity-referenced",r.InvalidParentRelationType="invalid-parent-relation-type",r))(h||{}),N=(r=>(r.ScopeWithoutLogic="scope-without-logic",r.ExtendingAbstractEntity="extending-abstract-entity",r.ImplementingNonAbstractEntity="implementing-non-abstract-entity",r.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",r.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",r.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",r.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",r.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",r.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",r.IncorrectEntityImplementation="incorrect-entity-implementation",r.IncorrectMethodImplementation="incorrect-method-implementation",r.IncorrectPropertyImplementation="incorrect-property-implementation",r.PropertyImplementsNonAbstact="property-implements-non-abstract",r.NonStaticPropertyImplementsStatic="non-static-property-implements-static",r.StaticPropertyImplementsNonStatic="static-property-implements-non-static",r.PropertyImplementsIncompatibleType="property-implements-incompatible-type",r.MissingPropertyImplementation="missing-property-implementation",r.MissingMethodImplementation="missing-method-implementation",r.NoProperties="no-properties",r.ReadingFromIncompatibleType="reading-from-incompatible-type",r.WritingToIncompatibleType="writing-to-incompatible-type",r.InvalidPropertiesCombination="invalid-properties-combination",r.DisconnectedCallableEntity="disconnected-callable-entity",r.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",r.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",r.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",r.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",r.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",r.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",r))(N||{});class E{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(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 D?new dr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class dr{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(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 dr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function T8(r){const e=new Set;return r.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Z(r){const e=r.entity.errors.find(i=>i.id===r.id);return e?{new:!1,error:e}:{new:!0,error:new dr(r)}}function E8(r,e){const t=new Map;return r.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function ae(r,e){const t=[];return e.forEach(i=>{const a=r.find(s=>s.id===i.id);a?t.push(a):t.push(i)}),t}const ua=d.union([d.string(),d.number(),d.boolean(),d.date()]),nv=d.enum([qe.CurrentDateAndTime,qe.Random,qe.Unique]),qs=d.object({type:nv,rangeStart:ua.nullable(),rangeEnd:ua.nullable()}),pa=qs.extend({type:d.literal(qe.Random),rangeStart:ua,rangeEnd:ua}),qc=qs.extend({type:d.literal(qe.Unique),rangeStart:d.null(),rangeEnd:d.null()}),rv=qs.extend({type:d.literal(qe.CurrentDateAndTime),rangeStart:d.null(),rangeEnd:d.null()}),Js=pa.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),iv=Js.extend({rangeStart:d.number(),rangeEnd:d.null()}),av=Js.extend({rangeStart:d.null(),rangeEnd:d.number()}),sv=Js.extend({rangeStart:d.number(),rangeEnd:d.number()}),Ws=pa.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),ov=Ws.extend({rangeStart:d.number(),rangeEnd:d.null()}),lv=Ws.extend({rangeStart:d.null(),rangeEnd:d.number()}),cv=Ws.extend({rangeStart:d.number(),rangeEnd:d.number()}),Hs=pa.extend({rangeStart:d.date().nullable(),rangeEnd:d.date().nullable()}),dv=Hs.extend({rangeStart:d.date(),rangeEnd:d.null()}),uv=Hs.extend({rangeStart:d.null(),rangeEnd:d.date()}),pv=Hs.extend({rangeStart:d.date(),rangeEnd:d.date()}),Jc=pa.extend({rangeStart:d.null(),rangeEnd:d.null()}),Wc=d.union([ov,lv,cv]),Hc=d.union([iv,av,sv]),Yc=d.union([dv,uv,pv,rv]),zc=d.union([Wc,Hc,Yc,qc,Jc]);function ya(){return d.union([d.object({type:d.literal(n.ValueDescriptor)}),d.record(d.string(),d.any())])}function yv(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ValueDescriptor)})}function Zc(){return d.object({id:d.string(),type:d.literal(n.ValueDescriptor),name:d.string(),required:d.boolean()})}function b8(){return Zc().merge(d.object({version:d.number(),index:d.number()}))}function R8(){return Zc().merge(d.object({}))}function g8(){return d.object({dataType:Tn(),parent:xn()})}function v8(){return b8().merge(g8())}function Ys(){return d.union([d.object({type:d.literal(n.PrimitiveEntity)}),d.record(d.string(),d.any())])}function zs(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.PrimitiveEntity)})}function Zs(){return d.object({id:d.string(),type:d.literal(n.PrimitiveEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function I8(){return Zs().merge(d.object({version:d.number()}))}function D8(){return Zs().merge(d.object({}))}function P8(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([Ys(),ri()]))})}function A8(){return I8().merge(P8())}function ur(){return d.union([d.object({type:d.literal(n.Property)}),d.record(d.string(),d.any())])}function hv(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Property)})}function Kc(){return d.object({id:d.string(),type:d.literal(n.Property),name:d.string(),description:d.string().nullable(),private:d.boolean(),static:d.boolean(),required:d.boolean(),abstract:d.boolean()})}function O8(){return Kc().merge(d.object({version:d.number(),index:d.number()}))}function S8(){return Kc().merge(d.object({}))}function C8(){return d.object({dataType:Tn(),implements:ur().nullable(),parent:d.union([fr(),zs(),Ks()])})}function B8(){return O8().merge(C8())}function w8(){return d.enum([L.CRON_JOB,L.EXECUTION,L.HTTP_ENDPOINT,L.PERSISTED_ENTITY,L.RELATIONAL_DATABASE])}function ri(){return d.union([d.object({type:d.literal(n.BuiltInBaseEntity)}),d.record(d.string(),d.any())])}function Ks(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.BuiltInBaseEntity)})}function Xc(){return d.object({id:d.string(),version:d.number(),type:d.literal(n.BuiltInBaseEntity),name:w8(),description:d.string().nullable(),abstract:d.boolean(),static:d.boolean()})}function _8(){return Xc()}function N8(){return Xc().merge(d.object({}))}function M8(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([ri(),Ys()]))})}function V8(){return _8().merge(M8())}function fv(){return d.enum([M.Dynamic,M.Fixed,M.None])}function tn(){return d.union([d.object({type:d.literal(n.ActionDescriptor)}),d.record(d.string(),d.any())])}function xn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ActionDescriptor)})}function Xs(){return d.object({id:d.string(),type:d.literal(n.ActionDescriptor),name:d.string(),description:d.string().nullable(),argumentsType:fv(),returnsType:fv()})}function L8(){return Xs().merge(d.object({version:d.number()}))}function $8(){return Xs().merge(d.object({}))}function G8(){return d.object({fixedArguments:d.array(ya()),fixedReturns:d.array(ya()),dynamicArgumentTypes:Tn().nullable(),dynamicReturnTypes:Tn().nullable(),parent:d.union([It(),fr(),Ks(),zs()]).nullable()})}function mv(){return L8().merge(G8())}function ii(){return d.union([d.object({type:d.literal(n.Loop)}),d.record(d.string(),d.any())])}function nn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Loop)})}function Tv(){return d.object({id:d.string(),type:d.literal(n.Loop)})}function F8(){return Tv().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function U8(){return Tv().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function x8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),declaration:tn(),inputs:d.array(Jt()),outputs:d.array(mt()),outputsDeclarations:d.array(ya()),successCalls:d.array(He()),errorCalls:d.array(He()),error:mt(),body:Bt(),parent:d.union([bn(),It()]),breakStatements:d.array(li()),continueStatements:d.array(ai())})}function j8(){return F8().merge(x8())}function ai(){return d.union([d.object({type:d.literal(n.ContinueStatement)}),d.record(d.string(),d.any())])}function si(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ContinueStatement)})}function Qc(){return d.object({id:d.string(),type:d.literal(n.ContinueStatement)})}function k8(){return Qc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function q8(){return Qc().merge(d.object({}))}function J8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:nn()})}function W8(){return k8().merge(J8())}function pr(){return d.union([d.object({type:d.literal(n.ReturnStatement)}),d.record(d.string(),d.any())])}function oi(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ReturnStatement)})}function ed(){return d.object({id:d.string(),type:d.literal(n.ReturnStatement)})}function H8(){return ed().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Y8(){return ed().merge(d.object({}))}function z8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:bn()})}function Z8(){return H8().merge(z8())}function fn(){return d.union([d.object({type:d.literal(n.ReturnDeclaration)}),d.record(d.string(),d.any())])}function Ev(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ReturnDeclaration)})}function td(){return d.object({id:d.string(),type:d.literal(n.ReturnDeclaration),name:d.string(),description:d.string().nullable(),isError:d.boolean()})}function K8(){return td().merge(d.object({version:d.number(),index:d.number()}))}function X8(){return td().merge(d.object({}))}function Q8(){return d.object({dataType:Tn().nullable(),readsValue:ba().nullable(),parent:d.union([oi(),xn(),mn(),si()])})}function e6(){return K8().merge(Q8())}function li(){return d.union([d.object({type:d.literal(n.BreakStatement)}),d.record(d.string(),d.any())])}function mn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.BreakStatement)})}function nd(){return d.object({id:d.string(),type:d.literal(n.BreakStatement)})}function t6(){return nd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function n6(){return nd().merge(d.object({}))}function r6(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:nn()})}function i6(){return t6().merge(r6())}function mt(){return d.union([d.object({type:d.literal(n.OutputMap)}),d.record(d.string(),d.any())])}function rd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.OutputMap)})}function id(){return d.object({id:d.string(),type:d.literal(n.OutputMap)})}function a6(){return id().merge(d.object({version:d.number(),index:d.number()}))}function s6(){return id().merge(d.object({}))}function o6(){return d.object({writesValues:d.array(En()),declaration:d.union([fn(),ur()]),parent:d.union([ye(),nn(),mn()])})}function l6(){return a6().merge(o6())}function ci(){return d.union([d.object({type:d.literal(n.FunctionCall)}),d.record(d.string(),d.any())])}function ha(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.FunctionCall)})}function ad(){return d.object({id:d.string(),type:d.literal(n.FunctionCall)})}function c6(){return ad().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function d6(){return ad().merge(d.object({}))}function u6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:Bt(),inputs:d.array(Jt()),outputs:d.array(mt()),error:d.optional(mt()),parent:d.union([bn(),It()])})}function p6(){return c6().merge(u6())}function y6(){return d.enum([Me.Equal,Me.NotEqual,Me.MoreThan,Me.MoreThanOrEqual,Me.LessThan,Me.LessThanOrEqual,Me.And,Me.Or,Mt.Empty,Mt.NotEmpty])}function fa(){return d.union([d.object({type:d.literal(n.Condition)}),d.record(d.string(),d.any())])}function Qs(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Condition)})}function sd(){return d.object({id:d.string(),type:d.literal(n.Condition)})}function h6(){return sd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function f6(){return sd().merge(d.object({}))}function m6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),leftValue:Jt(),rightValue:Jt().nullable(),operator:y6(),parent:d.union([bn(),It()])})}function T6(){return h6().merge(m6())}function ma(){return d.union([d.object({type:d.literal(n.Search)}),d.record(d.string(),d.any())])}function Ta(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Search)})}function od(){return d.object({id:d.string(),type:d.literal(n.Search),name:d.string(),query:d.any(),description:d.string().nullable()})}function E6(){return od().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function b6(){return od().merge(d.object({}))}function R6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),inputsDeclarations:d.array(hr()),inputs:d.array(Jt()),outputsDeclarations:d.array(ya()),outputs:d.array(mt()),parent:d.union([bn(),It()]),error:mt().nullable()})}function g6(){return E6().merge(R6())}function Ea(){return d.union([d.object({type:d.literal(n.InternalCall)}),d.record(d.string(),d.any())])}function ld(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InternalCall)})}function cd(){return d.object({id:d.string(),type:d.literal(n.InternalCall),index:d.number()})}function v6(){return cd().merge(d.object({version:d.number(),index:d.number()}))}function I6(){return cd().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function D6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:Bt(),inputs:d.array(Jt()),outputs:d.array(mt()),parent:jn(),error:d.optional(mt())})}function P6(){return v6().merge(D6())}function Jt(){return d.union([d.object({type:d.literal(n.InputMap)}),d.record(d.string(),d.any())])}function eo(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InputMap)})}function dd(){return d.object({id:d.string(),type:d.literal(n.InputMap),name:d.string().nullable().optional(),description:d.string().nullable().optional()})}function A6(){return dd().merge(d.object({version:d.number(),index:d.number()}))}function O6(){return dd().merge(d.object({}))}function S6(){return d.object({defaultValue:ud().nullable(),declaration:d.union([hr(),ur()]).nullable(),readsValue:ba().nullable(),parent:d.union([ye(),eo(),nn(),mn()])})}function C6(){return A6().merge(S6())}function di(){return d.union([d.object({type:d.literal(n.Operation)}),d.record(d.string(),d.any())])}function ui(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Operation)})}function to(){return d.object({id:d.string(),type:d.literal(n.Operation)})}function B6(){return to().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function w6(){return to().merge(d.object({}))}function _6(){return to().merge(d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:tn(),inputs:d.array(Jt()),outputs:d.array(mt()),error:d.array(mt()),parent:d.union([bn(),It()])}))}function N6(){return B6().merge(_6())}function no(){return d.union([d.string(),d.number(),d.boolean(),d.null(),d.date()])}function bv(){return d.record(d.string(),no())}function M6(){return d.array(d.union([no(),bv()]))}function Rv(){return d.union([no(),bv(),M6()])}function gv(){return d.union([no(),Rv()])}function vv(){return d.enum([I.String,I.Number,I.Boolean,I.Null,I.Date,I.JSON,I.Enum,I.File,I.UUID,I.EntityTemplate,I.ActionDescriptor])}function V6(){return d.union([fr(),ui(),Ra()])}function L6(){return d.object({id:d.string(),name:vv(),type:d.literal(n.PrimitiveValue),value:gv(),autogeneration:zc.nullable()})}function $6(){return L6().merge(d.object({}))}function Wt(){return d.object({id:d.string(),version:d.number(),name:vv(),type:d.literal(n.PrimitiveValue),value:gv(),valueAsType:V6().nullable(),autogeneration:zc.nullable(),parent:d.union([pd(),eo()])})}function G6(){return Wt().extend({name:d.literal(I.String),value:d.string(),autogeneration:Wc.nullable()})}function F6(){return Wt().extend({name:d.literal(I.Number),value:d.number(),autogeneration:Hc.nullable()})}function U6(){return Wt().extend({name:d.literal(I.Boolean),value:d.boolean(),autogeneration:Jc.nullable()})}function x6(){return Wt().extend({name:d.literal(I.Null),value:d.null(),autogeneration:d.null()})}function j6(){return Wt().extend({name:d.literal(I.Date),value:d.date(),autogeneration:Yc.nullable()})}function k6(){return Wt().extend({name:d.literal(I.JSON),value:Rv(),autogeneration:d.null()})}function q6(){return Wt().extend({name:d.literal(I.Enum),value:d.string(),autogeneration:d.null()})}function J6(){return Wt().extend({name:d.literal(I.File),value:d.string(),autogeneration:d.null()})}function W6(){return Wt().extend({name:d.literal(I.UUID),value:d.string(),autogeneration:qc.nullable()})}function H6(){return Wt().extend({name:d.literal(I.EntityTemplate),value:fr(),autogeneration:d.null()})}function Y6(){return Wt().extend({name:d.literal(I.ActionDescriptor),value:Ra(),autogeneration:d.null()})}function ud(){return d.union([G6(),F6(),U6(),x6(),j6(),k6(),q6(),J6(),W6(),H6(),Y6()])}function Tn(){return d.union([d.object({type:d.literal(n.DataType)}),d.record(d.string(),d.any())])}function pd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.DataType)})}function yd(){return d.object({id:d.string(),type:d.literal(n.DataType),isNullable:d.boolean(),isList:d.boolean(),constant:d.boolean(),asType:d.boolean(),options:d.array(d.string()).optional()})}function z6(){return yd().merge(d.object({version:d.number()}))}function Z6(){return yd().merge(d.object({}))}function K6(){return d.object({defaultValue:ud().nullable(),entity:d.union([pi(),ri(),Ys(),tn()]).nullable(),parent:d.union([hv(),Pv(),xn(),yv()])})}function X6(){return z6().merge(K6())}function hd(){return d.union([d.object({type:d.literal(n.VariableDeclaration)}),d.record(d.string(),d.any())])}function Q6(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.VariableDeclaration)})}function fd(){return d.object({id:d.string(),type:d.literal(n.VariableDeclaration),name:d.string(),description:d.string().nullable()})}function ej(){return fd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function tj(){return fd().merge(d.object({}))}function nj(){return d.object({dataType:Tn().nullable(),readsValue:ba().nullable(),writesValues:d.array(En()),inputs:d.array(Jt()),outputs:d.array(mt()),successCalls:d.array(He()),errorCalls:d.array(He()),internalCalls:d.array(Ea()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),parent:d.union([bn(),It()])})}function rj(){return ej().merge(nj())}function Iv(){return d.union([d.object({type:d.literal(n.VariableInstance)}),d.record(d.string(),d.any())])}function ij(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.VariableInstance)})}function md(){return d.object({id:d.string(),type:d.literal(n.VariableInstance)})}function aj(){return md().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function sj(){return md().merge(d.object({}))}function oj(){return d.object({declaration:hd(),dataType:Tn().nullable(),readsValue:ba().nullable(),writesValues:d.array(En()),inputs:d.array(Jt()),outputs:d.array(mt()),successCalls:d.array(He()),errorCalls:d.array(He()),internalCalls:d.array(Ea()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),parent:d.union([bn(),It()])})}function lj(){return aj().merge(oj())}function Td(){return d.union([d.object({type:d.literal(n.InstalledProject)}),d.record(d.string(),d.any())])}function ro(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InstalledProject)})}function cj(){return d.object({id:d.string(),type:d.literal(n.InstalledProject)})}function dj(){return d.object({version:d.number(),x:d.number(),y:d.number()})}function uj(){return d.object({})}function pj(){return d.object({implements:It(),description:d.string().nullable(),functions:d.array(Bt()),events:d.array(Ed()),parent:It()})}function yj(){return dj().merge(pj())}function Ed(){return d.union([d.object({type:d.literal(n.GlobalEvent)}),d.record(d.string(),d.any())])}function hj(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.GlobalEvent)})}function io(){return d.object({id:d.string(),type:d.literal(n.GlobalEvent),name:d.string(),collapsed:d.boolean()})}function fj(){return io().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function mj(){return io().merge(d.object({}))}function Tj(){return io().merge(d.object({returnStatements:d.array(pr()),implements:d.array(mv()),inputs:d.array(hr()),calls:d.array(He()),parent:d.union([It(),ro()])}))}function Ej(){return fj().merge(Tj())}function yr(){return d.union([hd(),Iv()])}function jn(){return d.union([Q6(),ij()])}function En(){return d.union([yr(),Jt(),fn()])}function Dv(){return d.union([jn(),eo(),Ev()])}function ba(){return d.union([yr(),hr(),mt(),di(),Ea(),ci()])}function bj(){return d.union([jn(),bd(),rd(),ui(),ld(),ha()])}function Rj(){return d.union([hr(),mt(),En()])}function Pv(){return d.union([bd(),rd(),Dv()])}function ao(){return Ed()}function so(){return hj()}function oo(){return d.union([di(),ci(),fa(),ma(),yr(),Ea(),ii()])}function ye(){return d.union([ui(),ha(),Qs(),Ta(),jn(),ld(),nn()])}function lo(){return d.union([di(),ci(),fa(),ma(),yr(),ii()])}function co(){return d.union([ui(),ha(),Qs(),Ta(),jn(),nn()])}function Av(){return d.union([oo(),pr(),li(),ai()])}function He(){return d.union([ye(),oi(),mn(),si()])}function Ov(){return d.union([lo(),pr(),li(),ai()])}function Sv(){return d.union([co(),oi(),mn(),si()])}function kn(){return d.union([Bt(),ao()])}function We(){return d.union([Ra(),so()])}function gj(){return d.union([oo(),kn()])}function vj(){return d.union([ye(),We()])}function Ij(){return d.union([lo(),kn()])}function Dj(){return d.union([co(),We()])}function Pj(){return d.union([Av(),kn()])}function Aj(){return d.union([He(),We()])}function Oj(){return d.union([Ov(),kn()])}function Sj(){return d.union([Sv(),We()])}function Cj(){return d.union([kn(),ii()])}function bn(){return d.union([We(),nn()])}function Bj(){return d.union([oo(),kn()])}function wj(){return d.union([ye(),We()])}function _j(){return d.union([lo(),kn()])}function Nj(){return d.union([co(),We()])}function Mj(){return d.union([pr(),li(),ai()])}function Vj(){return d.union([oi(),mn(),si()])}function Lj(){return d.union([ri(),Yj(),Td(),pi(),Bt(),ao(),yr(),Jt(),mt(),fa(),di(),ci(),fn(),hr(),Ys(),Tn(),ur(),tn(),pr(),ai(),li(),ii(),ma(),tn(),tn(),ya(),Ea()])}function $j(){return d.union([Ks(),It(),ro(),fr(),Ra(),so(),jn(),eo(),rd(),Qs(),ui(),ha(),Ev(),bd(),zs(),pd(),hv(),xn(),oi(),si(),mn(),nn(),Ta(),xn(),xn(),yv(),ld()])}function Gj(){return d.union([Td(),pi(),Bt(),ao(),yr(),fa(),di(),ci(),pr(),ai(),li(),ii(),ma()])}function Fj(){return d.union([ro(),fr(),Ra(),so(),jn(),Qs(),ui(),ha(),oi(),si(),mn(),nn(),Ta()])}function hr(){return d.union([d.object({type:d.literal(n.ArgumentDeclaration)}),d.record(d.string(),d.any())])}function bd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ArgumentDeclaration)})}function Rd(){return d.object({id:d.string(),type:d.literal(n.ArgumentDeclaration)})}function Uj(){return Rd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function xj(){return Rd().merge(d.object({}))}function jj(){return d.object({dataType:Tn().nullable(),writesValues:d.array(En()),parent:d.union([We(),xn(),xn(),Ta(),mn()])})}function kj(){return Uj().merge(jj())}function Bt(){return d.union([d.object({type:d.literal(n.FunctionDeclaration)}),d.record(d.string(),d.any())])}function Ra(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.FunctionDeclaration)})}function gd(){return d.object({id:d.string(),type:d.literal(n.FunctionDeclaration),name:d.string(),description:d.string().nullable()})}function qj(){return gd().merge(d.object({version:d.number(),x:d.number(),y:d.number(),index:d.number().nullable()}))}function Jj(){return gd()}function Wj(){return d.object({inputs:d.array(hr()),implements:tn().nullable(),returnStatements:d.array(pr()),parent:d.union([It(),ro(),fr(),nn(),Ks(),zs()])})}function Hj(){return qj().merge(Wj())}function Yj(){return d.union([d.object({type:d.literal(n.Project)}),d.record(d.string(),d.any())])}function It(){return d.object({entityType:d.literal(n.Project),entityId:d.string(),id:d.string(),type:d.literal(n.GenericReference)})}function vd(){return d.object({id:d.string(),type:d.literal(n.Project),name:d.string(),description:d.string().nullable()})}function zj(){return vd().merge(d.object({version:d.number()}))}function Zj(){return vd()}function Kj(){return d.object({entities:d.array(pi()),functions:d.array(Bt()),events:d.array(Ed()),projects:d.array(Td()),variableDeclarations:d.array(hd()),variableInstances:d.array(Iv()),conditions:d.array(fa()),operations:d.array(di()),functionCalls:d.array(ci()),loops:d.array(ii()),searches:d.array(ma())})}function Xj(){return zj().merge(Kj())}function pi(){return d.union([d.object({type:d.literal(n.CustomEntity)}),d.record(d.string(),d.any())])}function fr(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.CustomEntity)})}function Id(){return d.object({id:d.string(),type:d.literal(n.CustomEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function Qj(){return Id().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function e9(){return Id().merge(d.object({}))}function t9(){return d.union([It(),pd()])}function n9(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([pi(),ri()])),implements:d.array(d.union([pi(),ri()])),parent:t9()})}function r9(){return Qj().merge(n9())}function i9(r){const e=r9(),t=r.toJSON();e.safeParse(t).success;const a=r.implements.flatMap(f=>o9(r,f)),s=r.extends.flatMap(f=>l9(r,f)),o=d9(r),l=c9(r);r.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...l];return ae(r.errors,p)}function a9(r,e){const t=e.properties.filter(s=>s.abstract),i=[];let a=[...r.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):i.push(s)}),i}function s9(r,e){const t=e.abstractMethods,i=[];let a=[...r.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):i.push(s)}),i}function o9(r,e){const t=[];if(!e.abstract){const f=Z({id:r.id+"--"+N.ImplementingNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:N.ImplementingNonAbstractEntity,entity:r});return t.push(f.error),t}const i=e.properties.filter(f=>f.abstract),a=[];let s=[...r.properties];i.forEach(f=>{const m=s.find(b=>{var v;return((v=b.implements)==null?void 0:v.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=Z({id:r.id+"--"+N.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:T.Error,code:N.MissingPropertyImplementation,entity:r});t.push(m.error)});const o=[];let l=[...r.methods];e.abstractMethods.forEach(f=>{const m=l.find(b=>{var v;return((v=b.implements)==null?void 0:v.id)===f.id});m?l=l.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=Z({id:r.id+"--"+N.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:T.Error,code:N.MissingMethodImplementation,entity:r});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=Z({id:r.id+"--"+D.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.PropertyOverwrite,entity:r});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=l.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=Z({id:r.id+"--"+D.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.MethodOverwrite,entity:r});t.push(m.error)}),t}function l9(r,e){const t=[],i=[];if(e.abstract){const s=Z({id:r.id+"--"+N.ExtendingAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:N.ExtendingAbstractEntity,entity:r});return t.push(s.error),t}r.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&i.push(s)}),i.length&&i.forEach(s=>{const o=Z({id:r.id+"--"+D.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.PropertyOverwrite,entity:r});t.push(o.error)});const a=[];return r.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=Z({id:r.id+"--"+D.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.MethodOverwrite,entity:r});t.push(o.error)}),t}function c9(r){const e=[];if(!r.properties.length){const t=Z({id:r.id+"--"+N.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:N.NoProperties,entity:r});e.push(t.error)}return r.properties.forEach(t=>{t.validate()}),e}function d9(r){const e=[];if(r.abstract){if(r.methods.length){const t=Z({id:r.id+"--"+N.AbstractEntityWithNonAbstractMethods,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:N.AbstractEntityWithNonAbstractMethods,entity:r});e.push(t.error)}if(r.properties.some(t=>!t.abstract)){const t=Z({id:r.id+"--"+N.AbstractEntityWithNonAbstractProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:N.AbstractEntityWithNonAbstractProperties,entity:r});e.push(t.error),r.properties.forEach(i=>{if(!i.abstract){const a=Z({id:r.id+"--"+N.StaticEntityWithNonStaticProperties+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:N.StaticEntityWithNonStaticProperties,entity:r});e.push(a.error)}})}}else{if(r.abstractMethods.length){const t=Z({id:r.id+"--"+N.AbstractPropertyInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:N.AbstractPropertyInNonAbstractEntity,entity:r});e.push(t.error)}if(r.properties.some(t=>t.abstract)){const t=Z({id:r.id+"--"+N.AbstractMethodInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:N.AbstractMethodInNonAbstractEntity,entity:r});e.push(t.error),r.properties.forEach(i=>{if(i.abstract){const a=Z({id:r.id+"--"+N.AbstractMethodInNonAbstractEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:N.AbstractMethodInNonAbstractEntity,entity:r});e.push(a.error)}})}}if(r.static&&r.properties.some(t=>!t.static)){const t=Z({id:r.id+"--"+N.StaticEntityWithNonStaticProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:N.StaticEntityWithNonStaticProperties,entity:r});e.push(t.error),r.properties.forEach(i=>{if(!i.static){const a=Z({id:r.id+"--"+N.NonStaticPropertyInStaticEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:N.NonStaticPropertyInStaticEntity,entity:r});e.push(a.error)}})}return e}function u9(r){return r instanceof Error&&r.name==="ZodError"&&"issues"in r&&Array.isArray(r.issues)}var p9=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=y9(t)}toString(){return this.message}};function y9(r){if(r){const e=r.cause;if(u9(e))return e.issues}return[]}var h9="; ",Cv="Validation error",f9=": ",m9=", or ";function T9(r,e,t){return e!==null?r.length>0?[e,r].join(t):e:r.length>0?r:Cv}var E9=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function b9(r){return r.length===1?r[0].toString():r.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+R9(t)+'"]';if(!E9.test(t))return e+'["'+t+'"]';const i=e.length===0?"":".";return e+i+t},"")}function R9(r){return r.replace(/"/g,'\\"')}function g9(r){return r.length!==0}function uo(r){const{issue:e,issueSeparator:t,unionSeparator:i,includePath:a}=r;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>uo({issue:p,issueSeparator:t,unionSeparator:i,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(i);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>uo({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>uo({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(a&&g9(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 "${b9(e.path)}"`}return e.message}function v9(r,e={}){const{issueSeparator:t=h9,unionSeparator:i=m9,prefixSeparator:a=f9,prefix:s=Cv,includePath:o=!0}=e,l=uo({issue:r,issueSeparator:t,unionSeparator:i,includePath:o}),p=T9(l,s,a);return new p9(p,{cause:new gt([r])})}var Bv="1.13.7",wv=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},po=Array.prototype,Dd=Object.prototype,_v=typeof Symbol<"u"?Symbol.prototype:null,I9=po.push,ga=po.slice,va=Dd.toString,D9=Dd.hasOwnProperty,Nv=typeof ArrayBuffer<"u",P9=typeof DataView<"u",A9=Array.isArray,Mv=Object.keys,Vv=Object.create,Lv=Nv&&ArrayBuffer.isView,O9=isNaN,S9=isFinite,$v=!{toString:null}.propertyIsEnumerable("toString"),Gv=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C9=Math.pow(2,53)-1;function Dt(r,e){return e=e==null?r.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 r.call(this,i);case 1:return r.call(this,arguments[0],i);case 2:return r.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,r.apply(this,s)}}function qn(r){var e=typeof r;return e==="function"||e==="object"&&!!r}function B9(r){return r===null}function Fv(r){return r===void 0}function Uv(r){return r===!0||r===!1||va.call(r)==="[object Boolean]"}function w9(r){return!!(r&&r.nodeType===1)}function ot(r){var e="[object "+r+"]";return function(t){return va.call(t)===e}}const Pd=ot("String"),xv=ot("Number"),_9=ot("Date"),N9=ot("RegExp"),M9=ot("Error"),jv=ot("Symbol"),kv=ot("ArrayBuffer");var qv=ot("Function"),V9=wv.document&&wv.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof V9!="function"&&(qv=function(r){return typeof r=="function"||!1});const Tt=qv,Jv=ot("Object");var Wv=P9&&(!/\[native code\]/.test(String(DataView))||Jv(new DataView(new ArrayBuffer(8)))),Ad=typeof Map<"u"&&Jv(new Map),L9=ot("DataView");function $9(r){return r!=null&&Tt(r.getInt8)&&kv(r.buffer)}const yo=Wv?$9:L9,mr=A9||ot("Array");function Jn(r,e){return r!=null&&D9.call(r,e)}var Od=ot("Arguments");(function(){Od(arguments)||(Od=function(r){return Jn(r,"callee")})})();const Sd=Od;function G9(r){return!jv(r)&&S9(r)&&!isNaN(parseFloat(r))}function Hv(r){return xv(r)&&O9(r)}function Yv(r){return function(){return r}}function zv(r){return function(e){var t=r(e);return typeof t=="number"&&t>=0&&t<=C9}}function Zv(r){return function(e){return e==null?void 0:e[r]}}const ho=Zv("byteLength"),F9=zv(ho);var U9=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function x9(r){return Lv?Lv(r)&&!yo(r):F9(r)&&U9.test(va.call(r))}const Kv=Nv?x9:Yv(!1),Pt=Zv("length");function j9(r){for(var e={},t=r.length,i=0;i<t;++i)e[r[i]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,r.push(a)}}}function Xv(r,e){e=j9(e);var t=Gv.length,i=r.constructor,a=Tt(i)&&i.prototype||Dd,s="constructor";for(Jn(r,s)&&!e.contains(s)&&e.push(s);t--;)s=Gv[t],s in r&&r[s]!==a[s]&&!e.contains(s)&&e.push(s)}function Ze(r){if(!qn(r))return[];if(Mv)return Mv(r);var e=[];for(var t in r)Jn(r,t)&&e.push(t);return $v&&Xv(r,e),e}function Ia(r){if(r==null)return!0;var e=Pt(r);return typeof e=="number"&&(mr(r)||Pd(r)||Sd(r))?e===0:Pt(Ze(r))===0}function Qv(r,e){var t=Ze(e),i=t.length;if(r==null)return!i;for(var a=Object(r),s=0;s<i;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function se(r){if(r instanceof se)return r;if(!(this instanceof se))return new se(r);this._wrapped=r}se.VERSION=Bv,se.prototype.value=function(){return this._wrapped},se.prototype.valueOf=se.prototype.toJSON=se.prototype.value,se.prototype.toString=function(){return String(this._wrapped)};function eI(r){return new Uint8Array(r.buffer||r,r.byteOffset||0,ho(r))}var tI="[object DataView]";function Cd(r,e,t,i){if(r===e)return r!==0||1/r===1/e;if(r==null||e==null)return!1;if(r!==r)return e!==e;var a=typeof r;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:nI(r,e,t,i)}function nI(r,e,t,i){r instanceof se&&(r=r._wrapped),e instanceof se&&(e=e._wrapped);var a=va.call(r);if(a!==va.call(e))return!1;if(Wv&&a=="[object Object]"&&yo(r)){if(!yo(e))return!1;a=tI}switch(a){case"[object RegExp]":case"[object String]":return""+r==""+e;case"[object Number]":return+r!=+r?+e!=+e:+r==0?1/+r===1/e:+r==+e;case"[object Date]":case"[object Boolean]":return+r==+e;case"[object Symbol]":return _v.valueOf.call(r)===_v.valueOf.call(e);case"[object ArrayBuffer]":case tI:return nI(eI(r),eI(e),t,i)}var s=a==="[object Array]";if(!s&&Kv(r)){var o=ho(r);if(o!==ho(e))return!1;if(r.buffer===e.buffer&&r.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof r!="object"||typeof e!="object")return!1;var l=r.constructor,p=e.constructor;if(l!==p&&!(Tt(l)&&l instanceof l&&Tt(p)&&p instanceof p)&&"constructor"in r&&"constructor"in e)return!1}t=t||[],i=i||[];for(var y=t.length;y--;)if(t[y]===r)return i[y]===e;if(t.push(r),i.push(e),s){if(y=r.length,y!==e.length)return!1;for(;y--;)if(!Cd(r[y],e[y],t,i))return!1}else{var f=Ze(r),m;if(y=f.length,Ze(e).length!==y)return!1;for(;y--;)if(m=f[y],!(Jn(e,m)&&Cd(r[m],e[m],t,i)))return!1}return t.pop(),i.pop(),!0}function k9(r,e){return Cd(r,e)}function Da(r){if(!qn(r))return[];var e=[];for(var t in r)e.push(t);return $v&&Xv(r,e),e}function Bd(r){var e=Pt(r);return function(t){if(t==null)return!1;var i=Da(t);if(Pt(i))return!1;for(var a=0;a<e;a++)if(!Tt(t[r[a]]))return!1;return r!==aI||!Tt(t[wd])}}var wd="forEach",rI="has",_d=["clear","delete"],iI=["get",rI,"set"],q9=_d.concat(wd,iI),aI=_d.concat(iI),J9=["add"].concat(_d,wd,rI);const W9=Ad?Bd(q9):ot("Map"),H9=Ad?Bd(aI):ot("WeakMap"),Y9=Ad?Bd(J9):ot("Set"),z9=ot("WeakSet");function yi(r){for(var e=Ze(r),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=r[e[a]];return i}function Z9(r){for(var e=Ze(r),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=[e[a],r[e[a]]];return i}function sI(r){for(var e={},t=Ze(r),i=0,a=t.length;i<a;i++)e[r[t[i]]]=t[i];return e}function Nd(r){var e=[];for(var t in r)Tt(r[t])&&e.push(t);return e.sort()}function Md(r,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=r(s),l=o.length,p=0;p<l;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const oI=Md(Da),fo=Md(Ze),lI=Md(Da,!0);function K9(){return function(){}}function cI(r){if(!qn(r))return{};if(Vv)return Vv(r);var e=K9();e.prototype=r;var t=new e;return e.prototype=null,t}function X9(r,e){var t=cI(r);return e&&fo(t,e),t}function Q9(r){return qn(r)?mr(r)?r.slice():oI({},r):r}function e3(r,e){return e(r),r}function dI(r){return mr(r)?r:[r]}se.toPath=dI;function Pa(r){return se.toPath(r)}function Vd(r,e){for(var t=e.length,i=0;i<t;i++){if(r==null)return;r=r[e[i]]}return t?r:void 0}function uI(r,e,t){var i=Vd(r,Pa(e));return Fv(i)?t:i}function t3(r,e){e=Pa(e);for(var t=e.length,i=0;i<t;i++){var a=e[i];if(!Jn(r,a))return!1;r=r[a]}return!!t}function Ld(r){return r}function Aa(r){return r=fo({},r),function(e){return Qv(e,r)}}function $d(r){return r=Pa(r),function(e){return Vd(e,r)}}function Oa(r,e,t){if(e===void 0)return r;switch(t??3){case 1:return function(i){return r.call(e,i)};case 3:return function(i,a,s){return r.call(e,i,a,s)};case 4:return function(i,a,s,o){return r.call(e,i,a,s,o)}}return function(){return r.apply(e,arguments)}}function pI(r,e,t){return r==null?Ld:Tt(r)?Oa(r,e,t):qn(r)&&!mr(r)?Aa(r):$d(r)}function Gd(r,e){return pI(r,e,1/0)}se.iteratee=Gd;function At(r,e,t){return se.iteratee!==Gd?se.iteratee(r,e):pI(r,e,t)}function n3(r,e,t){e=At(e,t);for(var i=Ze(r),a=i.length,s={},o=0;o<a;o++){var l=i[o];s[l]=e(r[l],l,r)}return s}function yI(){}function r3(r){return r==null?yI:function(e){return uI(r,e)}}function i3(r,e,t){var i=Array(Math.max(0,r));e=Oa(e,t,1);for(var a=0;a<r;a++)i[a]=e(a);return i}function Fd(r,e){return e==null&&(e=r,r=0),r+Math.floor(Math.random()*(e-r+1))}const Sa=Date.now||function(){return new Date().getTime()};function hI(r){var e=function(s){return r[s]},t="(?:"+Ze(r).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 fI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},a3=hI(fI),s3=sI(fI),o3=hI(s3),l3=se.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Ud=/(.)^/,c3={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},d3=/\\|'|\r|\n|\u2028|\u2029/g;function u3(r){return"\\"+c3[r]}var p3=/^\s*(\w|\$)+\s*$/;function y3(r,e,t){!e&&t&&(e=t),e=lI({},e,se.templateSettings);var i=RegExp([(e.escape||Ud).source,(e.interpolate||Ud).source,(e.evaluate||Ud).source].join("|")+"|$","g"),a=0,s="__p+='";r.replace(i,function(y,f,m,b,v){return s+=r.slice(a,v).replace(d3,u3),a=v+y.length,f?s+=`'+
1
+ (function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var Uk=Object.defineProperty;var xk=(u,n,L)=>n in u?Uk(u,n,{enumerable:!0,configurable:!0,writable:!0,value:L}):u[n]=L;var c=(u,n,L)=>(xk(u,typeof n!="symbol"?n+"":n,L),L);var n=(r=>(r.CustomEntity="custom-entity",r.BuiltInBaseEntity="built-in-base-entity",r.Project="project",r.InstalledProject="installed-project",r.GlobalEvent="global-event",r.DataType="data-type",r.FunctionCall="function-call",r.FunctionDeclaration="function-declaration",r.ActionDescriptor="action-descriptor",r.ValueDescriptor="value-descriptor",r.ArgumentDeclaration="argument-declaration",r.InputMap="input-map",r.ReturnStatement="return-statement",r.BreakStatement="break-statement",r.ContinueStatement="continue-statement",r.ReturnDeclaration="return-declaration",r.OutputMap="output-map",r.PrimitiveEntity="primitive-entity",r.PrimitiveValue="primitive-value",r.Property="property",r.Operation="operation",r.Condition="condition",r.VariableDeclaration="variable-declaration",r.VariableInstance="variable-instance",r.Search="search",r.Loop="loop",r.InternalCall="internal-call",r.GenericReference="generic-reference",r))(n||{}),L=(r=>(r.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",r.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",r.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",r.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",r.EXECUTION="BUILT_IN_EXECUTION_ENTITY",r.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",r))(L||{}),qe=(r=>(r.CurrentDateAndTime="current-date-and-time",r.Unique="unique",r.Random="random",r))(qe||{}),St=(r=>(r.DeletePersistedEntity="base-delete-persisted-entity",r.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",r.AbortExecution="base-abort-execution",r))(St||{}),M=(r=>(r.Fixed="fixed",r.None="none",r.Dynamic="dynamic",r.Any="any",r.FixedThenDynamic="fixed-then-dynamic",r.FixedThenAny="fixed-then-any",r))(M||{}),B=(r=>(r.FixedArguments="fixed-arguments",r.FixedReturns="fixed-returns",r.ReturnedError="returned-error",r.OngoingProcessExecution="ongoing-process-execution",r))(B||{}),I=(r=>(r.EntityTemplate="entity-template",r.ActionDescriptor="action-descriptor",r.String="string",r.Number="number",r.Boolean="boolean",r.Null="null",r.Enum="enum",r.JSON="json",r.Date="date",r.UUID="uuid",r.File="file",r))(I||{}),ct=(r=>(r.Addition="addition",r.Substraction="substraction",r.Multiplication="multiplication",r.Division="division",r.Remainder="remainder",r.Exponentiation="exponentiation",r))(ct||{}),Ce=(r=>(r.Join="string-join",r.Split="stringSsplit",r.DeleteLast="string-delete-last",r.DeleteFirst="string-delete-first",r.DeleteIndex="string-delete-index",r.AddIndex="string-add-index",r.ReplaceFirst="string-replace-first",r.ReplaceLast="string-replace-last",r.ReplaceIndex="string-replace-index",r.ReplaceSingleMatch="string-replace-single-match",r.ReplaceAllMatches="string-replace-all-matches",r.GetIndex="string-get-index",r.GetFirst="string-get-first",r.GetLast="string-get-last",r.Append="string-append",r.Prepend="string-prepend",r))(Ce||{}),Y=(r=>(r.Join="list-join",r.Split="list-split",r.DeleteLast="list-delete-last",r.DeleteFirst="list-delete-first",r.DeleteIndex="list-delete-index",r.AddIndex="list-add-index",r.ReplaceFirst="list-replace-first",r.ReplaceLast="list-replace-last",r.ReplaceIndex="list-replace-index",r.ReplaceSingleMatch="list-replace-single-match",r.ReplaceAllMatches="list-replace-all-matches",r.GetIndex="list-get-index",r.GetFirst="list-get-first",r.GetLast="list-get-last",r.Append="list-append",r.Prepend="list-prepend",r))(Y||{}),we=(r=>(r.Parallel="parallel",r.Sequential="sequential",r.Wait="wait",r))(we||{}),Xe=(r=>(r.CreateNewInstance="create-new-instance",r.Validate="validate",r))(Xe||{}),Qe=(r=>(r.HttpRequest="base-http-request",r))(Qe||{}),Me=(r=>(r.Equal="equal",r.NotEqual="not-equal",r.And="and",r.Or="or",r.LessThan="less-than",r.MoreThan="more-than",r.LessThanOrEqual="less-than-or-equal",r.MoreThanOrEqual="more-than-or-equal",r))(Me||{}),Mt=(r=>(r.Empty="empty",r.NotEmpty="not-empty",r))(Mt||{}),q=(r=>(r.ManualFlow="manual-flow-loop",r.Counted="counted-loop",r.List="list-loop",r.ObjectKeys="object-keys-loop",r.ObjectValues="object-values-loop",r.String="string-loop",r))(q||{}),je=(r=>(r.OrDataTypeGroup="or-data-type-group",r.AndDataTypeGroup="and-data-type-group",r.DynamicArgumentTypes="dynamic-argument-types",r.DynamicReturnTypes="dynamic-return-types",r))(je||{}),on=(r=>(r.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",r))(on||{}),Cu=(r=>(r.Error="error",r.Task="task",r.Return="return",r))(Cu||{});const An=[n.VariableDeclaration,n.VariableInstance,n.InputMap,n.ReturnDeclaration],$e=[n.VariableDeclaration,n.VariableInstance,n.ArgumentDeclaration,n.OutputMap],Bu=[...An,...$e],ke=[n.VariableDeclaration,n.VariableInstance],Fr=[n.GlobalEvent],Ge=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.InternalCall,n.Loop],xo=[n.Operation,n.FunctionCall,n.Condition,n.Search,n.VariableDeclaration,n.VariableInstance,n.Loop],Ve=[n.FunctionDeclaration,...Fr],On=[...Ge,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],jo=[...xo,n.ReturnStatement,n.BreakStatement,n.ContinueStatement],ln=[...Ge,...Ve],wu=[...xo,...Ve],WD=[...On,...Ve],HD=[...jo,...Ve],dt=[...Ve,n.Loop],Le=[n.ReturnStatement,n.BreakStatement,n.ContinueStatement],YD=[n.CustomEntity,n.BuiltInBaseEntity,n.Project,n.InstalledProject,n.GlobalEvent,n.DataType,n.FunctionCall,n.FunctionDeclaration,n.ActionDescriptor,n.ValueDescriptor,n.ArgumentDeclaration,n.InputMap,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.ReturnDeclaration,n.OutputMap,n.PrimitiveEntity,n.PrimitiveValue,n.Property,n.Operation,n.Condition,n.VariableDeclaration,n.VariableInstance,n.Search,n.Loop,n.InternalCall],ko=[n.CustomEntity,n.GlobalEvent,n.FunctionDeclaration,n.FunctionCall,n.VariableDeclaration,n.VariableInstance,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.InstalledProject,n.Loop,n.Search],_u=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor],Ur=[n.BuiltInBaseEntity,n.PrimitiveEntity],zD=[n.CustomEntity,n.FunctionDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.Property,n.VariableDeclaration,n.GlobalEvent,n.Search,n.Project,n.InstalledProject,n.ActionDescriptor,n.ValueDescriptor,n.InputMap,n.OutputMap,n.FunctionCall,n.Operation,n.Condition,n.ReturnStatement,n.BreakStatement,n.ContinueStatement,n.VariableInstance,n.PrimitiveValue,n.InternalCall];var qo=(r=>(r.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",r))(qo||{});const G={[n.PrimitiveEntity]:{[I.String]:{id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",properties:{}},[I.Boolean]:{id:"f596545d-1565-4faa-9969-d95fa5edfea4",properties:{}},[I.Number]:{id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",properties:{}},[I.JSON]:{id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",properties:{}},[I.Enum]:{id:"9542b8b4-2642-4eee-9db9-def7963a17a0",properties:{options:{id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",dataType:{id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",defaultValue:{id:"enum-options-property-data-type-default-value-id"}}}}},[I.UUID]:{id:"4a6234aa-c0f6-4731-b4dd-750388029226",properties:{}},[I.Date]:{id:"dc58f38b-d574-4956-aac6-32ce9529b937",properties:{}}},[n.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[n.BuiltInBaseEntity]:{[L.KEY_VALUE_PARAM]:{id:L.KEY_VALUE_PARAM},[L.HTTP_ENDPOINT]:{id:L.HTTP_ENDPOINT,properties:{method:{id:"http-endpoint-built-in-method-property-id"},path:{id:"http-endpoint-built-in-path-property-id"},cors:{id:"http-endpoint-built-in-cors-property-id"}}},[L.PERSISTED_ENTITY]:{id:L.PERSISTED_ENTITY,properties:{database:{id:"persisted-built-in-base-entity-database-property-id"},identifier:{id:"persisted-built-in-base-entity-identifier-property-id"}}},[L.RELATIONAL_DATABASE]:{id:L.RELATIONAL_DATABASE,properties:{identifier:{id:"relational-database-built-in-base-entity-identifier-property-id"},username:{id:"relational-database-built-in-base-entity-username-property-id"},password:{id:"relational-database-built-in-base-entity-password-property-id"},minSize:{id:"relational-database-built-in-base-entity-min-size-property-id"},default:{id:"relational-database-built-in-base-entity-default-property-id"},autoscaling:{id:"relational-database-built-in-base-entity-autoscaling-property-id"}}},[L.CRON_JOB]:{id:L.CRON_JOB,properties:{expression:{id:"cron-job-built-in-base-entity-expression-property-id"}}}},[n.Operation]:{[Ce.Join]:{id:Ce.Join,inputs:{first:{id:"join-string-first-string-input-id"},second:{id:"join-string-second-string-input-id"}},outputs:{result:{id:"join-string-result-string-return-delaration-id"},error:{id:"join-string-error-return-delaration-id"}}},[Qe.HttpRequest]:{id:Qe.HttpRequest,inputs:{url:{id:"http-request-url-input-id"},query:{id:"http-request-query-input-id"},method:{id:"http-request-method-input-id"},headers:{id:"http-request-headers-input-id"},body:{id:"http-request-body-string-input-id"}},outputs:{code:{id:"http-response-code-return-delaration-id"},body:{id:"http-response-body-return-delaration-id"},headers:{id:"http-response-headers-return-delaration-id"},error:{id:"http-request-error-return-delaration-id"}}}},[n.Loop]:{[q.List]:{id:q.List,inputs:{list:{id:"iterate-over-list-loop-list-input-id"}},outputs:{results:{id:"iterate-over-list-loop-output-id"}},body:{id:"iterate-over-list-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-list-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-list-loop-current-value-input-id"}}}},[q.String]:{id:q.String,inputs:{string:{id:"iterate-over-string-loop-string-input-id"}},outputs:{results:{id:"iterate-over-string-loop-output-id"}},body:{id:"iterate-over-string-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-string-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-string-loop-current-value-input-id"}}}},[q.ObjectKeys]:{id:q.ObjectKeys,inputs:{object:{id:"iterate-over-object-keys-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-keys-loop-output-id"}},body:{id:"iterate-over-object-keys-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-keys-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-keys-loop-current-value-input-id"}}}},[q.ObjectValues]:{id:q.ObjectValues,inputs:{object:{id:"iterate-over-object-values-loop-object-input-id"}},outputs:{results:{id:"iterate-over-object-values-loop-output-id"}},body:{id:"iterate-over-object-values-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-object-values-loop-iteration-number-input-id"},currentValue:{id:"iterate-over-object-values-loop-current-value-input-id"}}}},[q.ManualFlow]:{id:q.ManualFlow,inputs:{},outputs:{results:{id:"manual-flow-loop-output-id"}},body:{id:"manual-flow-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-manual-flow-loop-iteration-number-input-id"}}}},[q.Counted]:{id:q.Counted,inputs:{number:{id:"iterate-over-counted-loop-number-input-id"}},outputs:{results:{id:"iterate-over-counted-loop-output-id"}},body:{id:"iterate-over-counted-loop-body-descriptor-id",inputs:{iterationNumber:{id:"iterate-over-counted-loop-iteration-number-input-id"}}}}},[n.Condition]:{[Me.MoreThanOrEqual]:{id:Me.MoreThanOrEqual,inputs:{leftHand:{id:"condition-more-than-or-equal-left-hand-input-id"},rightHand:{id:"condition-more-than-or-equal-right-hand-input-id"}}},[Mt.NotEmpty]:{id:Mt.NotEmpty,inputs:{leftHand:{id:"condition-not-empty-input-id"}}}},[n.GlobalEvent]:{[on.PROJECT_PUBLICATION_COMPLETED]:{id:on.PROJECT_PUBLICATION_COMPLETED}}},Yt=G["primitive-entity"],x={type:n.PrimitiveEntity,id:Yt.string.id,description:"A string of characters.",version:1,name:I.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Sn={type:n.PrimitiveEntity,id:Yt.boolean.id,description:"A 'true' or 'false' value.",version:1,name:I.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},te={type:n.PrimitiveEntity,id:Yt.number.id,description:"A number value.",version:1,name:I.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ye={type:n.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:I.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Nu={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:n.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:n.DataType},Mu={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:n.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:n.Property},Vu={like:!1,inferred:!1,id:Yt.enum.properties.options.dataType.id,version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:{id:Yt.enum.properties.options.dataType.defaultValue.id,type:n.PrimitiveValue,version:1,name:I.JSON,autogeneration:null,value:[],valueAsType:null,parent:Nu},parent:Mu},Lu={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:n.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:n.PrimitiveEntity},$u={hidden:!1,required:!0,id:Yt.enum.properties.options.id,name:"Options",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Vu,description:"Options for the enum. Each option is a text value.",parent:Lu},Cn={type:n.PrimitiveEntity,id:Yt.enum.id,description:"A set of text options to choose from.",version:1,name:I.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[$u],methods:[]},cn={type:n.PrimitiveEntity,id:Yt.date.id,description:"A date and time value.",version:1,name:I.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ga={type:n.PrimitiveEntity,id:Yt.uuid.id,description:"A unique identifier in the form of a 36-character string.",version:1,name:I.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[x],properties:[],methods:[]},Jo={type:n.PrimitiveEntity,id:Yt.json.id,description:"A complex data structure with any combination of properties with names and values.",version:1,name:I.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Gu=(r=>(r.FirstInputNumber="number-addition-first-number-argument-declaration",r.SecondInputNumber="number-addition-second-number-argument-declaration",r))(Gu||{}),Fu=(r=>(r.ResultNumber="number-addition-result-number-return-delaration",r.Error="number-addition-error-return-delaration",r))(Fu||{});const Uu={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:n.ValueDescriptor},xu={like:!1,inferred:!1,id:"number-addition-first-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Uu},ju={type:n.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:n.ValueDescriptor},ku={like:!1,inferred:!1,id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ju},qu={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:n.ValueDescriptor},Ju={like:!1,inferred:!1,id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qu},Wu={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:ct.Addition,entityType:n.ActionDescriptor},Wo={id:"number-addition-first-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:xu,required:!0,parentRelationType:B.FixedArguments,index:0,parent:Wu},Hu={type:n.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:ct.Addition,entityType:n.ActionDescriptor},Ho={id:"number-addition-second-number-argument-declaration",type:n.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:ku,required:!0,parentRelationType:B.FixedArguments,index:1,parent:Hu},Yu={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:ct.Addition,entityType:n.ActionDescriptor},Yo={parentRelationType:B.FixedReturns,id:"number-addition-result-number-return-delaration",type:n.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:Ju,required:!0,index:0,parent:Yu},zu={type:n.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:ct.Addition,entityType:n.ActionDescriptor},Zu={parentRelationType:B.FixedReturns,id:"number-addition-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:zu},Fa={id:ct.Addition,type:n.ActionDescriptor,description:"Add two numbers together",version:1,name:ct.Addition,fixedArguments:[Wo,Ho],error:Zu,fixedReturns:[Yo],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ku={[ct.Addition]:Fa};var Xu=(r=>(r.FirstInputString="join-string-first-string-argument-declaration",r.SecondInputString="join-string-second-string-argument-declaration",r))(Xu||{}),Qu=(r=>(r.ResultString="join-string-result-string-return-delaration",r.Error="join-string-error-return-delaration",r))(Qu||{});const ep={type:n.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:n.ValueDescriptor},tp={like:!1,inferred:!1,id:"join-string-first-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ep},np={type:n.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:n.ValueDescriptor},rp={like:!1,inferred:!1,id:"join-string-second-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:np},ip={type:n.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:n.ValueDescriptor},ap={like:!1,inferred:!1,id:"join-string-result-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ip},sp={type:n.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},Ua={id:"join-string-first-string-argument-declaration",type:n.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:tp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:sp},op={type:n.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},xa={id:"join-string-second-string-argument-declaration",type:n.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:rp,parentRelationType:B.FixedArguments,required:!0,index:1,parent:op},lp={type:n.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},vi={parentRelationType:B.FixedReturns,id:"join-string-result-string-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:ap,required:!0,index:0,parent:lp},cp={type:n.GenericReference,id:"join-string-operation-error-parent-ref",entityId:Ce.Join,entityType:n.ActionDescriptor},dp={parentRelationType:B.FixedReturns,id:"join-string-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:cp},Ii={id:Ce.Join,type:n.ActionDescriptor,version:1,name:Ce.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Ua,xa],fixedReturns:[vi],error:dp,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},up={[Ce.Join]:Ii};var pp=(r=>(r.FirstInputList="join-list-first-list-argument-declaration",r.SecondInputList="join-list-second-list-argument-declaration",r))(pp||{}),yp=(r=>(r.ResultList="join-list-result-list-return-delaration",r.Error="join-list-error-return-delaration",r))(yp||{});const hp={type:n.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:n.ValueDescriptor},fp={like:!1,inferred:!1,id:"join-list-first-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:hp},mp={type:n.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:n.ValueDescriptor},Tp={like:!1,inferred:!1,id:"join-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:mp},Ep={type:n.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:n.ValueDescriptor},bp={like:!1,inferred:!1,id:"join-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Ep},Rp={type:n.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},gp={id:"join-list-first-list-argument-declaration",type:n.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:fp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Rp},vp={type:n.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Ip={id:"join-list-second-list-argument-declaration",type:n.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:Tp,parentRelationType:B.FixedArguments,required:!0,index:1,parent:vp},Dp={type:n.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Pp={parentRelationType:B.FixedReturns,id:"join-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:bp,required:!0,index:0,parent:Dp},Ap={type:n.GenericReference,id:"join-list-operation-error-parent-ref",entityId:Y.Join,entityType:n.ActionDescriptor},Op={parentRelationType:B.FixedReturns,id:"join-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ap},zo={id:Y.Join,type:n.ActionDescriptor,version:1,name:Y.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[gp,Ip],error:Op,fixedReturns:[Pp],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Sp=(r=>(r.InputList="list-to-split-argument-declaration",r.SplitIndex="split-list-index-argument-declaration",r))(Sp||{}),Cp=(r=>(r.FirstOutputList="split-list-first-output-list-return-delaration",r.SecondOutputList="split-list-second-output-list-return-delaration",r.Error="split-list-error-return-delaration",r))(Cp||{});const Bp={type:n.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:n.ValueDescriptor},wp={like:!1,inferred:!1,id:"split-list-operation-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Bp},_p={type:n.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:n.ValueDescriptor},Np={like:!1,inferred:!1,id:"split-list-operation-split-index-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_p},Zo={type:n.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:n.ValueDescriptor},Mp={like:!1,inferred:!1,id:"split-list-operation-first-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zo},Vp={type:n.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Lp={id:"list-to-split-argument-declaration",type:n.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:wp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Vp},$p={type:n.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Gp={id:"split-list-index-argument-declaration",type:n.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:Np,parentRelationType:B.FixedArguments,required:!0,index:1,parent:$p},Fp={type:n.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Up={parentRelationType:B.FixedReturns,id:"split-list-first-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:Mp,required:!0,index:0,parent:Fp},xp={like:!1,inferred:!1,id:"split-list-operation-second-output-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zo},jp={type:n.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},kp={parentRelationType:B.FixedReturns,id:"split-list-second-output-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:xp,required:!0,index:0,parent:jp},qp={type:n.GenericReference,id:"split-list-operation-error-parent-ref",entityId:Y.Split,entityType:n.ActionDescriptor},Jp={parentRelationType:B.FixedReturns,id:"split-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:qp},Ko={id:Y.Split,type:n.ActionDescriptor,version:1,name:Y.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:[Lp,Gp],fixedReturns:[Up,kp],error:Jp,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Wp=(r=>(r.InputList="get-last-in-list-input-list-argument-declaration",r))(Wp||{}),Hp=(r=>(r.OutputElement="get-last-in-list-output-element-return-delaration",r.Error="get-last-in-list-error-return-delaration",r))(Hp||{});const Yp={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:n.ValueDescriptor},zp={like:!1,inferred:!1,id:"get-last-in-list-input-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Yp},Zp={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:n.ValueDescriptor},Kp={like:!1,inferred:!1,id:"get-last-in-list-output-element-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Zp},Xp={type:n.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},Qp={id:"get-last-in-list-input-list-argument-declaration",type:n.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:zp,parentRelationType:B.FixedArguments,required:!0,index:0,parent:Xp},ey={type:n.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},ty={parentRelationType:B.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:n.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:Kp,required:!0,index:0,parent:ey},ny={type:n.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:Y.GetLast,entityType:n.ActionDescriptor},ry={parentRelationType:B.FixedReturns,id:"get-last-in-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ny},Xo={id:Y.GetLast,type:n.ActionDescriptor,version:1,name:Y.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[Qp],fixedReturns:[ty],error:ry,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var iy=(r=>(r.List="append-to-list-lsit-argument-declaration",r.ElementToAppend="append-to-list-element-to-append-argument-declaration",r))(iy||{}),ay=(r=>(r.ResultList="append-to-list-result-list-return-delaration",r.Error="append-to-list-error-return-delaration",r))(ay||{});const sy={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:n.ValueDescriptor},oy={like:!1,inferred:!1,id:"append-to-list-lsit-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:sy},ly={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:n.ValueDescriptor},cy={like:!1,inferred:!1,id:"append-to-list-second-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ly},dy={type:n.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:n.ValueDescriptor},uy={like:!1,inferred:!1,id:"append-to-list-result-list-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:dy},py={type:n.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},Qo={id:"append-to-list-lsit-argument-declaration",type:n.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:oy,parentRelationType:B.FixedArguments,required:!0,index:0,parent:py},yy={type:n.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},el={id:"append-to-list-element-to-append-argument-declaration",type:n.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:cy,parentRelationType:B.FixedArguments,required:!0,index:1,parent:yy},hy={type:n.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},fy={parentRelationType:B.FixedReturns,id:"append-to-list-result-list-return-delaration",type:n.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:uy,required:!0,index:0,parent:hy},my={type:n.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:Y.Append,entityType:n.ActionDescriptor},Ty={parentRelationType:B.FixedReturns,id:"append-to-list-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:my},ja={id:Y.Append,type:n.ActionDescriptor,version:1,name:Y.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[Qo,el],error:Ty,fixedReturns:[fy],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ey={[Y.Join]:zo,[Y.Split]:Ko,[Y.GetLast]:Xo,[Y.Append]:ja};var by=(r=>(r.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",r))(by||{}),Ry=(r=>(r.ListOfExecutionResults="parallel-execution-result-return-delaration",r.Error="parallel-execution-error-return-delaration",r))(Ry||{});const gy={id:"parallel-execution-list-of-functions-blueprint-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},vy={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},Iy={like:!1,inferred:!1,id:"parallel-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:gy,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:vy},Dy={type:n.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:n.ValueDescriptor},Py={like:!1,inferred:!1,id:"b761acec-0755-4582-a68b-76267038bbe1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Dy},Ay={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:we.Parallel,entityType:n.ActionDescriptor},tl={id:"parallel-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Iy,required:!0,index:0,parent:Ay,parentRelationType:B.FixedArguments},Oy={type:n.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:we.Parallel,entityType:n.ActionDescriptor},nl={id:"parallel-execution-result-return-delaration",type:n.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:Py,required:!0,index:0,parent:Oy,parentRelationType:B.FixedReturns},Sy={type:n.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:we.Parallel,entityType:n.ActionDescriptor},Cy={id:"parallel-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Sy,parentRelationType:B.ReturnedError},xt={id:we.Parallel,type:n.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:we.Parallel,fixedArguments:[tl],fixedReturns:[nl],argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Cy,parent:null};var By=(r=>(r.MillisecondsNumber="wait-milliseconds-number-argument-declaration",r))(By||{}),wy=(r=>(r.Error="wait-operation-error-return-delaration",r))(wy||{});const _y={type:n.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:n.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},Ny={like:!1,inferred:!1,id:"wait-milliseconds-number-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_y},My={type:n.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:n.ActionDescriptor,entityId:we.Wait},Xn={id:"wait-milliseconds-number-argument-declaration",type:n.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:Ny,required:!0,index:0,parent:My,parentRelationType:B.FixedArguments},Vy={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:we.Wait,entityType:n.ActionDescriptor},Ly={id:"wait-operation-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Vy,parentRelationType:B.ReturnedError},ut={id:we.Wait,type:n.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:we.Wait,fixedArguments:[Xn],fixedReturns:[],error:Ly,argumentsType:M.Fixed,returnsType:M.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var $y=(r=>(r.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",r))($y||{}),Gy=(r=>(r.ListOfExecutionResults="sequential-execution-result-return-delaration",r.Error="sequential-execution-error-return-delaration",r))(Gy||{});const Fy={id:"sequential-execution-list-of-functions-blueprint-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},Uy={type:n.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:n.ValueDescriptor},xy={like:!1,inferred:!1,id:"sequential-execution-list-of-functions-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Fy,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Uy},jy={type:n.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:n.ValueDescriptor},ky={like:!1,inferred:!1,id:"sequential-execution-list-of-execution-results-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:jy},qy={type:n.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},rl={id:"sequential-execution-list-of-functions-argument-declaration",type:n.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:xy,required:!0,index:0,parent:qy,parentRelationType:B.FixedArguments},Jy={type:n.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},il={id:"sequential-execution-result-return-delaration",type:n.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:ky,required:!0,index:0,parent:Jy,parentRelationType:B.FixedReturns},Wy={type:n.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:we.Sequential,entityType:n.ActionDescriptor},Hy={id:"sequential-execution-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Wy,parentRelationType:B.ReturnedError},dn={id:we.Sequential,type:n.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:we.Sequential,fixedArguments:[rl],fixedReturns:[il],error:Hy,returnsType:M.Fixed,argumentsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Yy={[we.Parallel]:xt,[we.Wait]:ut,[we.Sequential]:dn};var zy=(r=>(r.EntityToInstanciate="entity-to-instanciate-argument-declaration",r.NewEntityData="new-entity-data-argument-declaration",r))(zy||{}),Zy=(r=>(r.Error="create-new-instance-error-return-delaration",r))(Zy||{});const Ky={type:n.GenericReference,id:"new-entity-data-argument-declaration-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},Xy={type:n.GenericReference,id:"new-entity-data-argument-data-type-parent-ref",entityId:"new-entity-data-argument-declaration",entityType:n.ValueDescriptor},Qy={like:!1,inferred:!1,id:"new-entity-data-argument-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Xy},eh={id:"new-entity-data-argument-declaration",type:n.ValueDescriptor,version:1,name:"Data for new entity",description:"The data to be used to create the new entity, with all the required properties",dataType:Qy,required:!0,parentRelationType:B.FixedArguments,index:1,parent:Ky},th={type:n.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},nh={like:!1,inferred:!1,id:"entity-to-instanciate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:th},rh={type:n.GenericReference,id:"create-new-instance-operation-ref",entityType:n.ActionDescriptor,entityId:Xe.CreateNewInstance},ih={id:"entity-to-instanciate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:nh,required:!0,parentRelationType:B.FixedArguments,index:0,parent:rh},ah={type:n.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},sh={parentRelationType:B.FixedReturns,id:"create-new-instance-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:ah,required:!0,index:0},oh={type:n.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Xe.CreateNewInstance,entityType:n.ActionDescriptor},lh={parentRelationType:B.FixedReturns,id:"create-new-instance-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:oh},Qn={id:Xe.CreateNewInstance,type:n.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:Xe.CreateNewInstance,fixedArguments:[ih,eh],fixedReturns:[sh],error:lh,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var ch=(r=>(r.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",r.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",r))(ch||{}),dh=(r=>(r.Error="validate-data-error-return-delaration",r.OutputEntity="validate-data-output-entity-declaration",r))(dh||{});const uh={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},ph={like:!1,inferred:!1,id:"validate-data-operation-data-to-validate-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uh},yh={type:n.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Xe.Validate},hh={id:"validate-data-operation-data-to-validate-argument-declaration",type:n.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:ph,required:!0,parentRelationType:B.FixedArguments,index:0,parent:yh},fh={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:n.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},mh={like:!1,inferred:!1,id:"validate-data-operation-entity-to-match-type-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fh},Th={type:n.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Xe.Validate},Eh={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:n.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:mh,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Th},bh={type:n.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Xe.Validate,entityType:n.ActionDescriptor},Rh={id:"validate-data-output-entity-declaration",type:n.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:bh,required:!0,index:0,parentRelationType:B.FixedReturns},gh={type:n.GenericReference,id:"wait-operation-error-parent-ref",entityId:Xe.Validate,entityType:n.ActionDescriptor},vh={id:"validate-data-error-return-delaration",type:n.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:gh,parentRelationType:B.ReturnedError},er={id:Xe.Validate,type:n.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Xe.Validate,fixedArguments:[Eh,hh],fixedReturns:[Rh],error:vh,argumentsType:M.Fixed,returnsType:M.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ih={[Xe.CreateNewInstance]:Qn,[Xe.Validate]:er},ze=G[n.Operation]["base-http-request"],Dh={type:n.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:n.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},Ph={id:"http-request-url-default-value-id",type:n.PrimitiveValue,version:1,value:"https://some-url.com",name:I.String,valueAsType:null,parent:Dh,autogeneration:null},Ah={type:n.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:ze.inputs.url.id,entityType:n.ValueDescriptor},Oh={like:!1,inferred:!1,id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:Ph,constant:!1,parent:Ah},Sh={type:n.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:ze.inputs.query.id,entityType:n.ValueDescriptor},Ch={like:!1,inferred:!1,id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Sh},Bh={type:n.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:n.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},wh={id:"http-request-method-default-value-id",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,valueAsType:null,parent:Bh,autogeneration:null},_h={type:n.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:ze.inputs.method.id,entityType:n.ValueDescriptor},Nh={like:!1,inferred:!1,id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:wh,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:_h},Mh={type:n.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:ze.inputs.headers.id,entityType:n.ValueDescriptor},Vh={like:!1,inferred:!1,id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Mh},Lh={type:n.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:ze.inputs.body.id,entityType:n.ValueDescriptor},$h={like:!1,inferred:!1,id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Lh},Gh={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:ze.outputs.code.id},Fh={like:!1,inferred:!1,id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Gh},Uh={type:n.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:n.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},xh={type:n.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:n.ValueDescriptor,entityId:ze.outputs.headers.id},jh={like:!1,inferred:!1,id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:I.JSON,parent:Uh,valueAsType:null,autogeneration:null},constant:!1,parent:xh},kh={type:n.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:n.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},qh={type:n.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:n.ValueDescriptor,entityId:ze.outputs.body.id},Jh={like:!1,inferred:!1,id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:n.PrimitiveValue,version:1,value:{},name:I.JSON,parent:kh,valueAsType:null,autogeneration:null},constant:!1,parent:qh},Wh={type:n.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},ka={id:ze.inputs.method.id,type:n.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:Nh,required:!1,index:0,parentRelationType:B.FixedArguments,parent:Wh},Hh={type:n.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},qa={id:ze.inputs.url.id,type:n.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:Oh,required:!1,index:1,parentRelationType:B.FixedArguments,parent:Hh},Yh={type:n.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},al={id:ze.inputs.query.id,type:n.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:Ch,required:!1,index:2,parentRelationType:B.FixedArguments,parent:Yh},zh={type:n.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Ja={id:ze.inputs.headers.id,type:n.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:Vh,required:!1,index:3,parent:zh,parentRelationType:B.FixedArguments},Zh={type:n.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Wa={id:ze.inputs.body.id,type:n.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:$h,required:!1,index:4,parentRelationType:B.FixedArguments,parent:Zh},Kh={type:n.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},sl={id:ze.outputs.code.id,type:n.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:Fh,required:!0,index:0,parentRelationType:B.FixedReturns,parent:Kh},Xh={type:n.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Ha={parentRelationType:B.FixedReturns,id:ze.outputs.headers.id,type:n.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:jh,required:!0,index:1,parent:Xh},Qh={type:n.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},Di={parentRelationType:B.FixedReturns,id:ze.outputs.body.id,type:n.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:Jh,required:!0,index:2,parent:Qh},ef={type:n.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:n.ActionDescriptor,entityId:Qe.HttpRequest},tf={type:n.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:n.ValueDescriptor,entityId:ze.outputs.error.id},nf={like:!1,inferred:!1,id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:tf},ol={parentRelationType:B.ReturnedError,id:ze.outputs.error.id,type:n.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:nf,required:!0,index:0,parent:ef},Pi={type:n.ActionDescriptor,id:Qe.HttpRequest,name:Qe.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:[ka,qa,al,Ja,Wa],fixedReturns:[sl,Ha,Di],argumentsType:M.Fixed,returnsType:M.Fixed,error:ol,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},rf={[Qe.HttpRequest]:Pi},ZD={...up,...Ku,...Ey,...Yy,...Ih,...rf},ll={id:q.ManualFlow,type:n.ActionDescriptor,version:1,name:q.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:[],argumentsType:M.None,returnsType:M.Any,error:null,parent:null},cl=G[n.Loop]["manual-flow-loop"],af={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"manual-flow-loop-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},sf={like:!1,inferred:!1,id:"manual-flow-loop-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:af},of={id:"manual-flow-loop-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:cl.body.id,entityType:n.ActionDescriptor},dl={id:cl.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the manual flow loop. Keeps track of the number of iterations that have been executed.",dataType:sf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:of},ul={id:cl.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the manual flow loop.",fixedArguments:[dl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},KD=G[n.Loop]["list-loop"],lf={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:n.ValueDescriptor},cf={like:!1,inferred:!1,id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:lf},df={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.List,entityType:n.ActionDescriptor},uf={id:KD.inputs.list.id,type:n.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:cf,index:0,parent:df,parentRelationType:B.FixedArguments},tr={id:q.List,type:n.ActionDescriptor,version:1,name:q.List,description:"Iterates over a list of entities",fixedArguments:[uf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ai=G[n.Loop]["list-loop"],pf={id:"iterate-over-list-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},yf={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:pf},hf={id:"iterate-over-list-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Ai.body.id,entityType:n.ActionDescriptor},Ya={id:Ai.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the list that is being iterated over. This value is passed to the child actions.",dataType:yf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:hf},ff={id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-list-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},mf={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:ff},Tf={id:"iterate-over-list-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Ai.body.id,entityType:n.ActionDescriptor},Ef={id:Ai.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the list loop. Keeps track of the number of iterations that have been executed.",dataType:mf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Tf},za={id:Ai.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the list loop.",fixedArguments:[Ef,Ya],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},XD=G[n.Loop]["string-loop"],bf={id:"iterate-over-string-loop-string-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-string-argument-declaration-id",entityType:n.ValueDescriptor},Rf={like:!1,inferred:!1,id:"iterate-over-string-loop-string-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:bf},gf={id:"iterate-over-string-loop-string-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.String,entityType:n.ActionDescriptor},vf={id:XD.inputs.string.id,type:n.ValueDescriptor,version:1,name:"Texts",description:"The text to iterate over the characters of",required:!0,dataType:Rf,index:0,parent:gf,parentRelationType:B.FixedArguments},Za={id:q.String,type:n.ActionDescriptor,version:1,name:q.String,description:"Iterates over a string of entities",fixedArguments:[vf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Oi=G[n.Loop]["string-loop"],If={id:"iterate-over-string-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Df={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:If},Pf={id:"iterate-over-string-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Oi.body.id,entityType:n.ActionDescriptor},pl={id:Oi.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the string that is being iterated over. This value is passed to the child actions.",dataType:Df,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Pf},Af={id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-string-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},Of={like:!1,inferred:!1,id:"iterate-over-string-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Af},Sf={id:"iterate-over-string-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Oi.body.id,entityType:n.ActionDescriptor},yl={id:Oi.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",dataType:Of,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Sf},hl={id:Oi.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",fixedArguments:[yl,pl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},QD=G[n.Loop]["object-keys-loop"],Cf={id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-object-argument-declaration-id",entityType:n.ValueDescriptor},Bf={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-object-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:null,parent:Cf},wf={id:"iterate-over-object-keys-loop-object-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.ObjectKeys,entityType:n.ActionDescriptor},_f={id:QD.inputs.object.id,type:n.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,dataType:Bf,index:0,parent:wf,parentRelationType:B.FixedArguments},Si={id:q.ObjectKeys,type:n.ActionDescriptor,version:1,name:q.ObjectKeys,description:"Iterates over a object of entities",fixedArguments:[_f],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Ci=G[n.Loop]["object-keys-loop"],Nf={id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Mf={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:Nf},Vf={id:"iterate-over-object-keys-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:Ci.body.id,entityType:n.ActionDescriptor},fl={id:Ci.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-keys that is being iterated over. This value is passed to the child actions.",dataType:Mf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Vf},Lf={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},$f={like:!1,inferred:!1,id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Lf},Gf={id:"iterate-over-object-keys-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Ci.body.id,entityType:n.ActionDescriptor},Ff={id:Ci.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-keys loop. Keeps track of the number of iterations that have been executed.",dataType:$f,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Gf},Uf={id:Ci.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-keys loop.",fixedArguments:[Ff,fl],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},eP=G[n.Loop]["object-values-loop"],xf={id:"iterate-over-object-values-loop-object-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-object-argument-declaration-id",entityType:n.ValueDescriptor},jf={like:!1,inferred:!1,id:"iterate-over-object-values-loop-object-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:null,parent:xf},kf={id:"iterate-over-object-values-loop-object-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.ObjectValues,entityType:n.ActionDescriptor},qf={id:eP.inputs.object.id,type:n.ValueDescriptor,version:1,name:"Object",description:"The object to iterate over",required:!0,dataType:jf,index:0,parent:kf,parentRelationType:B.FixedArguments},Bi={id:q.ObjectValues,type:n.ActionDescriptor,version:1,name:q.ObjectValues,description:"Iterates over a object of entities",fixedArguments:[qf],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},wi=G[n.Loop]["object-values-loop"],Jf={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-body-current-value-declaration-id",entityType:n.ValueDescriptor},Wf={id:"iterate-over-object-values-loop-body-current-value-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:null,isNullable:!1,constant:!1,entity:null,asType:null,like:!1,inferred:!1,defaultValue:null,parent:Jf},Hf={id:"iterate-over-object-values-loop-body-current-value-declaration-parent-ref-id",type:n.GenericReference,entityId:wi.body.id,entityType:n.ActionDescriptor},ml={id:wi.body.inputs.currentValue.id,type:n.ValueDescriptor,version:1,name:"Current value",description:"The current value in the object-values that is being iterated over. This value is passed to the child actions.",dataType:Wf,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Hf},Yf={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-object-values-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},zf={like:!1,inferred:!1,id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:Yf},Zf={id:"iterate-over-object-values-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:wi.body.id,entityType:n.ActionDescriptor},Kf={id:wi.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the object-values loop. Keeps track of the number of iterations that have been executed.",dataType:zf,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Zf},Xf={id:wi.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the object-values loop.",fixedArguments:[Kf,ml],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},tP=G[n.Loop]["counted-loop"],Qf={id:"iterate-over-counted-loop-string-argument-declaration-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-string-argument-declaration-data-type-id",entityType:n.DataType},em={id:"iterate-over-counted-loop-string-argument-declaration-data-type-default-value-id",type:n.PrimitiveValue,name:I.Number,version:1,value:5,valueAsType:null,autogeneration:null,parent:Qf},tm={id:"iterate-over-counted-loop-string-argument-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-string-argument-declaration-id",entityType:n.ValueDescriptor},nm={like:!1,inferred:!1,id:"iterate-over-counted-loop-string-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:em,parent:tm},rm={id:"iterate-over-counted-loop-string-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:q.Counted,entityType:n.ActionDescriptor},im={id:tP.inputs.number.id,type:n.ValueDescriptor,version:1,name:"Number of iterations",description:"The number of iterations to perform",required:!0,dataType:nm,index:0,parent:rm,parentRelationType:B.FixedArguments},Ka={id:q.Counted,type:n.ActionDescriptor,version:1,name:q.Counted,description:"Iterates a given number of times",fixedArguments:[im],fixedReturns:[],error:null,argumentsType:M.Fixed,returnsType:M.Any,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Tl=G[n.Loop]["counted-loop"],am={id:"iterate-over-counted-loop-body-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:"iterate-over-counted-loop-body-current-iteration-number-declaration-id",entityType:n.ValueDescriptor},sm={like:!1,inferred:!1,id:"iterate-over-counted-loop-body-current-iteration-number-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,isNullable:!1,constant:!1,entity:te,asType:!1,defaultValue:null,parent:am},om={id:"iterate-over-counted-loop-body-current-iteration-number-declaration-parent-ref-id",type:n.GenericReference,entityId:Tl.body.id,entityType:n.ActionDescriptor},El={id:Tl.body.inputs.iterationNumber.id,type:n.ValueDescriptor,version:1,name:"Current iteration number",description:"The number of the current iteration of the string loop. Keeps track of the number of iterations that have been executed.",dataType:sm,required:!0,index:0,parentRelationType:B.FixedArguments,parent:om},bl={id:Tl.body.id,type:n.ActionDescriptor,version:1,name:"Iteration logic trigger",description:"Describes the body of the string loop.",fixedArguments:[El],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[],argumentsType:M.FixedThenAny,returnsType:M.Any,error:null,parent:null},Xa=G[n.BuiltInBaseEntity][L.KEY_VALUE_PARAM],nP={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:n.DataType},lm={id:"key-value-param-built-in-base-entity-name-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:n.Property},rP={like:!1,inferred:!1,id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:lm},cm={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:n.GenericReference,entityId:Xa.id,entityType:n.BuiltInBaseEntity},dm={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:rP,description:"The name of the path parameter",parent:cm},iP={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:n.DataType},um={id:"key-value-param-built-in-base-entity-value-property-ref",type:n.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:n.Property},aP={like:!1,inferred:!1,id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:null,parent:um},pm={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:n.GenericReference,entityId:Xa.id,entityType:n.BuiltInBaseEntity},ym={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:aP,description:"The value of the path parameter",parent:pm},Qa={id:Xa.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Xa.id,type:n.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[dm,ym],abstractMethods:[],methods:[],extends:[]},_i=G[n.BuiltInBaseEntity][L.HTTP_ENDPOINT].properties,hm={id:"endpointBuiltInCorsPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},fm={id:"endpointBuiltInCorsPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:_i.cors.id},mm={like:!1,inferred:!1,id:"endpointBuiltInCorsPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:["*"],parent:hm,autogeneration:null,valueAsType:null},parent:fm},Tm={id:"endpointBuiltInBaseEntityRef",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Em={hidden:!0,required:!0,id:_i.cors.id,name:"Allowed origins",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:mm,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:Tm},bm={id:"endpointBuiltInPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Rm={id:"endpointBuiltInPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:_i.path.id},gm={like:!1,inferred:!1,id:"endpointBuiltInPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.String,value:"/",parent:bm,autogeneration:null,valueAsType:null},parent:Rm},vm={id:"endpointBuiltInBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Rl={hidden:!1,required:!0,id:_i.path.id,name:"Path",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:gm,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:vm},Im={id:"endpointBuiltInMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},Dm={id:"endpointBuiltInMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"endpointBuiltInMethodProperty"},Pm={like:!1,inferred:!1,id:"endpointBuiltInMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Cn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,parent:Im,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Dm},Am={id:"endpointBuiltInBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},gl={hidden:!1,required:!0,id:_i.method.id,name:"Method",version:1,type:n.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Pm,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Am},Om={id:"endpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestHeadersVariableDataType"},Sm={id:"endpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},Cm={like:!1,inferred:!1,id:"endpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:Om,autogeneration:null,valueAsType:null},parent:Sm},Bm={id:"endpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},wm={like:!1,inferred:!1,id:"endpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:Bm},_m={id:"endpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Nm={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Mm={like:!1,inferred:!1,id:"endpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:Qa,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:[],parent:_m,autogeneration:null,valueAsType:null},parent:Nm},Vm={id:"endpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointPathParamsVariableDataType"},Lm={id:"endpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},$m={like:!1,inferred:!1,id:"endpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Qa,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:[],parent:Vm,autogeneration:null,valueAsType:null},parent:Lm},Gm={id:"endpointReachedTriggerActionDescriptorRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},vl={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ValueDescriptor,name:"Request headers",dataType:Cm,required:!0,index:0,parentRelationType:B.FixedArguments,parent:Gm},Fm={id:"endpointReachedTriggerActionDescriptorRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Il={id:"endpointPathParamsArgumentDeclaration",type:n.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:$m,required:!0,index:1,parentRelationType:B.FixedArguments,parent:Fm},Um={id:"endpointReachedTriggerActionDescriptorRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Dl={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:n.ValueDescriptor,name:"Request query params",dataType:Mm,required:!0,index:2,parentRelationType:B.FixedArguments,parent:Um},xm={id:"endpointReachedTriggerActionDescriptorRefFour",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Pl={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ValueDescriptor,name:"Request body",dataType:wm,index:3,required:!0,parentRelationType:B.FixedArguments,parent:xm},jm={id:"endpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},km={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jm},qm={id:"endpointReturnStatementRef",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Al={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:n.ValueDescriptor,name:"Response code",dataType:km,required:!0,index:0,parentRelationType:B.FixedReturns,parent:qm},Jm={id:"endpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"endpointResponseHeadersDataType"},Wm={id:"endpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},Hm={like:!1,inferred:!1,id:"endpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:Jm,autogeneration:null,valueAsType:null},parent:Wm},Ym={id:"endpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Ol={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ValueDescriptor,name:"Response headers",dataType:Hm,required:!1,index:1,parentRelationType:B.FixedReturns,parent:Ym},zm={id:"endpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},Zm={like:!1,inferred:!1,id:"endpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:zm},Km={id:"endpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ActionDescriptor,entityId:"endpointReturnStatement"},Sl={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ValueDescriptor,name:"Response body",dataType:Zm,required:!1,index:2,parentRelationType:B.FixedReturns,parent:Km},Xm={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Cl={id:"endpointReachedTriggerActionDescriptor",type:n.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:M.Fixed,dynamicArgumentTypes:null,fixedArguments:[vl,Il,Dl,Pl],returnsType:M.Fixed,fixedReturns:[Al,Ol,Sl],error:null,dynamicReturnTypes:null,parent:Xm},es={id:L.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:L.HTTP_ENDPOINT,type:n.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Em,Rl,gl],abstractMethods:[Cl],extends:[],methods:[]},Vt=G[n.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,Qm={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},eT={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:Vt.properties.identifier.id,entityType:n.Property},sP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:null,parent:Qm,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:eT},xr={id:"relational-database-built-in-base-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},ts={hidden:!1,required:!0,id:Vt.properties.identifier.id,name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:sP,description:"The name of the main database inside of the server instance where the data will be stored.",parent:xr},oP={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:n.DataType},tT={id:"relational-database-built-in-base-entity-username-property-ref-id",type:n.GenericReference,entityId:Vt.properties.username.id,entityType:n.Property},lP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:n.DataType},autogeneration:null,valueAsType:null},parent:tT},ns={hidden:!1,required:!0,id:Vt.properties.username.id,name:"Username",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:lP,description:"The username that will be used to connect to the database.",parent:xr},cP={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:n.DataType},nT={id:"relational-database-built-in-base-entity-password-property-ref-id",type:n.GenericReference,entityId:Vt.properties.password.id,entityType:n.Property},dP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:nT},rs={hidden:!1,required:!0,id:Vt.properties.password.id,name:"Password",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:dP,description:"The password that will be used to connect to the database.",parent:xr},rT={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:n.DataType},iT={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:n.GenericReference,entityId:Vt.properties.minSize.id,entityType:n.Property},uP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:rT,autogeneration:null,valueAsType:null},parent:iT},is={hidden:!0,required:!0,id:Vt.properties.minSize.id,name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:uP,description:"The minimum size of the database in GB.",parent:xr},aT={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:n.DataType},sT={id:"relational-database-built-in-base-entity-default-property-ref-id",type:n.GenericReference,entityId:Vt.properties.default.id,entityType:n.Property},pP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Sn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!1,parent:aT,autogeneration:null,valueAsType:null},parent:sT},Bl={hidden:!0,required:!0,id:Vt.properties.default.id,name:"Default",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:pP,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:xr},oT={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:n.GenericReference,entityId:Vt.properties.autoscaling.id,entityType:n.Property},lT={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:n.GenericReference,entityId:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",entityType:n.DataType},yP={like:!1,inferred:!1,id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Sn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!1,parent:lT,autogeneration:null,valueAsType:null},parent:oT},cT={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},wl={hidden:!0,required:!0,id:Vt.properties.autoscaling.id,name:"Auto-scaling",version:1,type:n.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:yP,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:cT},Bn={id:L.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:L.RELATIONAL_DATABASE,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[ts,ns,rs,is,Bl,wl],abstractMethods:[],methods:[],extends:[]},dT={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:St.DeletePersistedEntity},_l={type:n.FunctionDeclaration,id:St.DeletePersistedEntity,name:St.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:dT,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},uT={type:n.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:n.BuiltInBaseEntity,id:St.SoftDeletePersistedEntity},pT={type:n.FunctionDeclaration,id:St.SoftDeletePersistedEntity,name:St.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:uT,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},yT=G[n.BuiltInBaseEntity][L.PERSISTED_ENTITY].properties,hP={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:n.DataType},hT={id:"persisted-built-in-base-entity-database-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:n.Property},fP={like:!1,inferred:!1,id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Bn,asType:!1,defaultValue:null,parent:hT},fT={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},Ni={hidden:!0,required:!0,id:yT.database.id,name:"Database",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:fP,description:"The database that the entity belongs to.",parent:fT},mT={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:n.DataType},TT={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:n.Property},mP={like:!1,inferred:!1,id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Ga,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.UUID,value:null,parent:mT,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:TT},ET={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},bT={hidden:!1,required:!0,id:yT.identifier.id,name:"Identifier",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:mP,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:ET},TP={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:n.DataType},RT={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:n.Property},gT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:cn,asType:!1,defaultValue:null,parent:RT},vT={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},IT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:gT,description:"The date and time when the entity was deleted.",parent:vT},EP={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:n.DataType},DT={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:n.Property},PT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:cn,asType:!1,defaultValue:null,parent:DT},AT={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},OT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:n.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:PT,description:"The date and time when the entity was created.",parent:AT},bP={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:n.DataType},ST={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:n.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:n.Property},CT={like:!1,inferred:!1,id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:cn,asType:!1,defaultValue:null,parent:ST},BT={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},wT={hidden:!1,required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:n.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:CT,description:"The date and time when the entity was last updated.",parent:BT},Fe={id:L.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:L.PERSISTED_ENTITY,type:n.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[Ni,bT,IT,OT,wT],methods:[_l,pT],extends:[]},_T={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},Nl={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:n.ActionDescriptor,argumentsType:M.None,returnsType:M.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:_T},NT=G[n.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,RP={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:n.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:n.DataType},MT={id:"cron-job-built-in-base-entity-expression-property-ref",type:n.GenericReference,entityId:NT.properties.expression.id,entityType:n.Property},gP={like:!1,inferred:!1,id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:MT},VT={id:"cron-job-built-in-base-entity-ref",type:n.GenericReference,entityId:L.CRON_JOB,entityType:n.BuiltInBaseEntity},LT={hidden:!1,required:!0,id:NT.properties.expression.id,name:"Cron expression",version:1,type:n.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:gP,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:VT},Ml={id:L.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:L.CRON_JOB,type:n.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[LT],methods:[],abstractMethods:[Nl],extends:[]},$T={type:n.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:n.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Vl={id:"execution-built-in-entity-abort-method-id",type:n.FunctionDeclaration,version:1,name:St.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:$T},Ll={id:L.EXECUTION,type:n.BuiltInBaseEntity,version:1,name:L.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:[Vl],abstractMethods:[]},vP=G[n.Condition]["not-empty"],GT={type:n.GenericReference,id:"not-empty-condition-ref",entityType:n.ActionDescriptor,entityId:Mt.NotEmpty},FT={id:vP.inputs.leftHand.id,type:n.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:0,parent:GT},nr={type:n.ActionDescriptor,id:Mt.NotEmpty,version:1,name:Mt.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[FT],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:M.Fixed,returnsType:M.None,error:null},UT={[Mt.NotEmpty]:nr},xT=G[n.Condition]["more-than-or-equal"],jT={type:n.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Me.MoreThanOrEqual},kT={id:xT.inputs.leftHand.id,type:n.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:0,parent:jT},qT={type:n.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:n.ActionDescriptor,entityId:Me.MoreThanOrEqual},JT={id:xT.inputs.rightHand.id,type:n.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:B.FixedArguments,index:1,parent:qT},jr={type:n.ActionDescriptor,id:Me.MoreThanOrEqual,version:1,name:Me.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[kT,JT],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:M.Fixed,returnsType:M.None,error:null},WT={[Me.MoreThanOrEqual]:jr},IP={...UT,...WT},as={type:n.ActionDescriptor,id:on.PROJECT_PUBLICATION_COMPLETED,version:1,name:on.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:M.None,returnsType:M.None,error:null},DP={[on.PROJECT_PUBLICATION_COMPLETED]:as},$l=G[n.ValueDescriptor][qo.ActionOngoingProcessOutputValue],HT={type:n.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:n.ValueDescriptor,entityId:$l.id},YT={like:!1,inferred:!1,id:$l.dataType.id,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ll,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:HT},Gl={id:$l.id,type:n.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:YT,required:!0,index:0,parent:null,parentRelationType:B.OngoingProcessExecution};var ee;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.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},r.find=(a,s)=>{for(const o of a)if(s(o))return o},r.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)}r.joinValues=i,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(ee||(ee={}));var Fl;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Fl||(Fl={}));const $=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wn=r=>{switch(typeof r){case"undefined":return $.undefined;case"string":return $.string;case"number":return isNaN(r)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":return Array.isArray(r)?$.array:r===null?$.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?$.promise:typeof Map<"u"&&r instanceof Map?$.map:typeof Set<"u"&&r instanceof Set?$.set:typeof Date<"u"&&r instanceof Date?$.date:$.object;default:return $.unknown}},C=ee.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"]),PP=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class gt 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 l=i,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(l[y]=l[y]||{_errors:[]},l[y]._errors.push(t(o))):l[y]=l[y]||{_errors:[]},l=l[y],p++}}};return a(this),i}static assert(e){if(!(e instanceof gt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.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()}}gt.create=r=>new gt(r);const kr=(r,e)=>{let t;switch(r.code){case C.invalid_type:r.received===$.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,ee.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${ee.joinValues(r.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ee.joinValues(r.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${ee.joinValues(r.options)}, received '${r.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:ee.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case C.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case C.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,ee.assertNever(r)}return{message:t}};let zT=kr;function AP(r){zT=r}function ss(){return zT}const os=r=>{const{data:e,path:t,errorMaps:i,issueData:a}=r,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=i.filter(y=>!!y).slice().reverse();for(const y of p)l=y(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},OP=[];function V(r,e){const t=ss(),i=os({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===kr?void 0:kr].filter(a=>!!a)});r.common.issues.push(i)}class nt{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 W;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 nt.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 W;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 W=Object.freeze({status:"aborted"}),qr=r=>({status:"dirty",value:r}),pt=r=>({status:"valid",value:r}),Ul=r=>r.status==="aborted",xl=r=>r.status==="dirty",Mi=r=>r.status==="valid",Vi=r=>typeof Promise<"u"&&r instanceof Promise;function ls(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function ZT(r,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"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(r,t):a?a.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;var U;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(U||(U={}));var Li,$i;class zt{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 KT=(r,e)=>{if(Mi(e))return{success:!0,data:e.value};if(!r.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 gt(r.common.issues);return this._error=t,this._error}}};function K(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:a}=r;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,l)=>{var p,y;const{message:f}=r;return o.code==="invalid_enum_value"?{message:f??l.defaultError}:typeof l.data>"u"?{message:(p=f??i)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:l.defaultError}},description:a}}class X{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 wn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nt,ctx:{common:e.parent.common,data:e.data,parsedType:wn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vi(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:wn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return KT(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:wn(e)},a=this._parse({data:e,path:i.path,parent:i}),s=await(Vi(a)?a:Promise.resolve(a));return KT(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),l=()=>s.addIssue({code:C.custom,...i(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!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 qt({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Kt.create(this,this._def)}nullable(){return Vn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Yr.create(this,this._def)}or(e){return xi.create([this,e],this._def)}and(e){return ji.create(this,e,this._def)}transform(e){return new qt({...K(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Hi({...K(this._def),innerType:this,defaultValue:t,typeName:J.ZodDefault})}brand(){return new ql({typeName:J.ZodBranded,type:this,...K(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Yi({...K(this._def),innerType:this,catchValue:t,typeName:J.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return zi.create(this,e)}readonly(){return Zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SP=/^c[^\s-]{8,}$/i,CP=/^[0-9a-z]+$/,BP=/^[0-9A-HJKMNP-TV-Z]{26}$/,wP=/^[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,_P=/^[a-z0-9_-]{21}$/i,NP=/^[-+]?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)?)??$/,MP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jl;const LP=/^(?:(?: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])$/,$P=/^(([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})))$/,GP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XT="((\\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])))",FP=new RegExp(`^${XT}$`);function QT(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function UP(r){return new RegExp(`^${QT(r)}$`)}function eE(r){let e=`${XT}T${QT(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xP(r,e){return!!((e==="v4"||!e)&&LP.test(r)||(e==="v6"||!e)&&$P.test(r))}class jt extends X{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_type,expected:$.string,received:s.parsedType}),W}const i=new nt;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:C.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),V(a,{code:C.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,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?V(a,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&V(a,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")MP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"email",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")jl||(jl=new RegExp(VP,"u")),jl.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"emoji",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")wP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"uuid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")_P.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"nanoid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")SP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")CP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid2",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")BP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ulid",code:C.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),V(a,{validation:"url",code:C.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),V(a,{validation:"regex",code:C.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),V(a,{code:C.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),V(a,{code:C.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?eE(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?FP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?UP(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:C.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?NP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"duration",code:C.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?xP(e.data,s.version)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ip",code:C.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?GP.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"base64",code:C.invalid_string,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(a=>e.test(a),{validation:t,code:C.invalid_string,...U.errToObj(i)})}_addCheck(e){return new jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.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,...U.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,...U.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...U.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jt({...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}}jt.create=r=>{var e;return new jt({checks:[],typeName:J.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...K(r)})};function jP(r,e){const t=(r.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=t>i?t:i,s=parseInt(r.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class _n extends X{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 V(s,{code:C.invalid_type,expected:$.number,received:s.parsedType}),W}let i;const a=new nt;for(const s of this._def.checks)s.kind==="int"?ee.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),V(i,{code:C.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),V(i,{code:C.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),V(i,{code:C.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?jP(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),V(i,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),V(i,{code:C.not_finite,message:s.message}),a.dirty()):ee.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,i,a){return new _n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:U.toString(a)}]})}_addCheck(e){return new _n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.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"&&ee.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)}}_n.create=r=>new _n({checks:[],typeName:J.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...K(r)});class Nn extends X{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 V(s,{code:C.invalid_type,expected:$.bigint,received:s.parsedType}),W}let i;const a=new nt;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),V(i,{code:C.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),V(i,{code:C.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),V(i,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):ee.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,i,a){return new Nn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:U.toString(a)}]})}_addCheck(e){return new Nn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.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}}Nn.create=r=>{var e;return new Nn({checks:[],typeName:J.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...K(r)})};class Gi extends X{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==$.boolean){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.boolean,received:i.parsedType}),W}return pt(e.data)}}Gi.create=r=>new Gi({typeName:J.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...K(r)});class rr extends X{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_type,expected:$.date,received:s.parsedType}),W}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return V(s,{code:C.invalid_date}),W}const i=new nt;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:C.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),V(a,{code:C.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):ee.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.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}}rr.create=r=>new rr({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:J.ZodDate,...K(r)});class cs extends X{_parse(e){if(this._getType(e)!==$.symbol){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.symbol,received:i.parsedType}),W}return pt(e.data)}}cs.create=r=>new cs({typeName:J.ZodSymbol,...K(r)});class Fi extends X{_parse(e){if(this._getType(e)!==$.undefined){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.undefined,received:i.parsedType}),W}return pt(e.data)}}Fi.create=r=>new Fi({typeName:J.ZodUndefined,...K(r)});class Ui extends X{_parse(e){if(this._getType(e)!==$.null){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.null,received:i.parsedType}),W}return pt(e.data)}}Ui.create=r=>new Ui({typeName:J.ZodNull,...K(r)});class Jr extends X{constructor(){super(...arguments),this._any=!0}_parse(e){return pt(e.data)}}Jr.create=r=>new Jr({typeName:J.ZodAny,...K(r)});class ir extends X{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pt(e.data)}}ir.create=r=>new ir({typeName:J.ZodUnknown,...K(r)});class un extends X{_parse(e){const t=this._getOrReturnCtx(e);return V(t,{code:C.invalid_type,expected:$.never,received:t.parsedType}),W}}un.create=r=>new un({typeName:J.ZodNever,...K(r)});class ds extends X{_parse(e){if(this._getType(e)!==$.undefined){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.void,received:i.parsedType}),W}return pt(e.data)}}ds.create=r=>new ds({typeName:J.ZodVoid,...K(r)});class kt extends X{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==$.array)return V(t,{code:C.invalid_type,expected:$.array,received:t.parsedType}),W;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(V(t,{code:o?C.too_big:C.too_small,minimum:l?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&&(V(t,{code:C.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&&(V(t,{code:C.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,l)=>a.type._parseAsync(new zt(t,o,t.path,l)))).then(o=>nt.mergeArray(i,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new zt(t,o,t.path,l)));return nt.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new kt({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new kt({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new kt({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}kt.create=(r,e)=>new kt({type:r,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...K(e)});function Wr(r){if(r instanceof xe){const e={};for(const t in r.shape){const i=r.shape[t];e[t]=Kt.create(Wr(i))}return new xe({...r._def,shape:()=>e})}else return r instanceof kt?new kt({...r._def,type:Wr(r.element)}):r instanceof Kt?Kt.create(Wr(r.unwrap())):r instanceof Vn?Vn.create(Wr(r.unwrap())):r instanceof Zt?Zt.create(r.items.map(e=>Wr(e))):r}class xe extends X{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=ee.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==$.object){const y=this._getOrReturnCtx(e);return V(y,{code:C.invalid_type,expected:$.object,received:y.parsedType}),W}const{status:i,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof un&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||l.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new zt(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof un){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of l)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")l.length>0&&(V(a,{code:C.unrecognized_keys,keys:l}),i.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of l){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new zt(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>nt.mergeObjectSync(i,y)):nt.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var a,s,o,l;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:(l=U.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new xe({...this._def,unknownKeys:"strip"})}passthrough(){return new xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xe({...this._def,catchall:e})}pick(e){const t={};return ee.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new xe({...this._def,shape:()=>t})}omit(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new xe({...this._def,shape:()=>t})}deepPartial(){return Wr(this)}partial(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];e&&!e[i]?t[i]=a:t[i]=a.optional()}),new xe({...this._def,shape:()=>t})}required(e){const t={};return ee.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Kt;)s=s._def.innerType;t[i]=s}}),new xe({...this._def,shape:()=>t})}keyof(){return tE(ee.objectKeys(this.shape))}}xe.create=(r,e)=>new xe({shape:()=>r,unknownKeys:"strip",catchall:un.create(),typeName:J.ZodObject,...K(e)}),xe.strictCreate=(r,e)=>new xe({shape:()=>r,unknownKeys:"strict",catchall:un.create(),typeName:J.ZodObject,...K(e)}),xe.lazycreate=(r,e)=>new xe({shape:r,unknownKeys:"strip",catchall:un.create(),typeName:J.ZodObject,...K(e)});class xi extends X{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new gt(l.ctx.common.issues));return V(t,{code:C.invalid_union,unionErrors:o}),W}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 y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new gt(p));return V(t,{code:C.invalid_union,unionErrors:l}),W}}get options(){return this._def.options}}xi.create=(r,e)=>new xi({options:r,typeName:J.ZodUnion,...K(e)});const pn=r=>r instanceof qi?pn(r.schema):r instanceof qt?pn(r.innerType()):r instanceof Ji?[r.value]:r instanceof Mn?r.options:r instanceof Wi?ee.objectValues(r.enum):r instanceof Hi?pn(r._def.innerType):r instanceof Fi?[void 0]:r instanceof Ui?[null]:r instanceof Kt?[void 0,...pn(r.unwrap())]:r instanceof Vn?[null,...pn(r.unwrap())]:r instanceof ql||r instanceof Zi?pn(r.unwrap()):r instanceof Yi?pn(r._def.innerType):[];class us extends X{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.object)return V(t,{code:C.invalid_type,expected:$.object,received:t.parsedType}),W;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}):(V(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}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=pn(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 l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new us({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...K(i)})}}function kl(r,e){const t=wn(r),i=wn(e);if(r===e)return{valid:!0,data:r};if(t===$.object&&i===$.object){const a=ee.objectKeys(e),s=ee.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o={...r,...e};for(const l of s){const p=kl(r[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===$.array&&i===$.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const o=r[s],l=e[s],p=kl(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===$.date&&i===$.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ji extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),a=(s,o)=>{if(Ul(s)||Ul(o))return W;const l=kl(s.value,o.value);return l.valid?((xl(s)||xl(o))&&t.dirty(),{status:t.value,value:l.data}):(V(i,{code:C.invalid_intersection_types}),W)};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}))}}ji.create=(r,e,t)=>new ji({left:r,right:e,typeName:J.ZodIntersection,...K(t)});class Zt extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==$.array)return V(i,{code:C.invalid_type,expected:$.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return V(i,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(V(i,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new zt(i,o,i.path,l)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>nt.mergeArray(t,o)):nt.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Zt({...this._def,rest:e})}}Zt.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:r,typeName:J.ZodTuple,rest:null,...K(e)})};class ki extends X{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 V(i,{code:C.invalid_type,expected:$.object,received:i.parsedType}),W;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in i.data)a.push({key:s._parse(new zt(i,l,i.path,l)),value:o._parse(new zt(i,i.data[l],i.path,l)),alwaysSet:l in i.data});return i.common.async?nt.mergeObjectAsync(t,a):nt.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof X?new ki({keyType:e,valueType:t,typeName:J.ZodRecord,...K(i)}):new ki({keyType:jt.create(),valueType:e,typeName:J.ZodRecord,...K(t)})}}class ps extends X{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 V(i,{code:C.invalid_type,expected:$.map,received:i.parsedType}),W;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([l,p],y)=>({key:a._parse(new zt(i,l,i.path,[y,"key"])),value:s._parse(new zt(i,p,i.path,[y,"value"]))}));if(i.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return W;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return W;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}}}}ps.create=(r,e,t)=>new ps({valueType:e,keyType:r,typeName:J.ZodMap,...K(t)});class ar extends X{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==$.set)return V(i,{code:C.invalid_type,expected:$.set,received:i.parsedType}),W;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(V(i,{code:C.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&&(V(i,{code:C.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 y=new Set;for(const f of p){if(f.status==="aborted")return W;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const l=[...i.data.values()].map((p,y)=>s._parse(new zt(i,p,i.path,y)));return i.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new ar({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new ar({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ar.create=(r,e)=>new ar({valueType:r,minSize:null,maxSize:null,typeName:J.ZodSet,...K(e)});class Hr extends X{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.function)return V(t,{code:C.invalid_type,expected:$.function,received:t.parsedType}),W;function i(l,p){return os({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ss(),kr].filter(y=>!!y),issueData:{code:C.invalid_arguments,argumentsError:p}})}function a(l,p){return os({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ss(),kr].filter(y=>!!y),issueData:{code:C.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Yr){const l=this;return pt(async function(...p){const y=new gt([]),f=await l._def.args.parseAsync(p,s).catch(v=>{throw y.addIssue(i(p,v)),y}),m=await Reflect.apply(o,this,f);return await l._def.returns._def.type.parseAsync(m,s).catch(v=>{throw y.addIssue(a(m,v)),y})})}else{const l=this;return pt(function(...p){const y=l._def.args.safeParse(p,s);if(!y.success)throw new gt([i(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=l._def.returns.safeParse(f,s);if(!m.success)throw new gt([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Hr({...this._def,args:Zt.create(e).rest(ir.create())})}returns(e){return new Hr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Hr({args:e||Zt.create([]).rest(ir.create()),returns:t||ir.create(),typeName:J.ZodFunction,...K(i)})}}class qi extends X{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})}}qi.create=(r,e)=>new qi({getter:r,typeName:J.ZodLazy,...K(e)});class Ji extends X{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ji.create=(r,e)=>new Ji({value:r,typeName:J.ZodLiteral,...K(e)});function tE(r,e){return new Mn({values:r,typeName:J.ZodEnum,...K(e)})}class Mn extends X{constructor(){super(...arguments),Li.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{expected:ee.joinValues(i),received:t.parsedType,code:C.invalid_type}),W}if(ls(this,Li,"f")||ZT(this,Li,new Set(this._def.values),"f"),!ls(this,Li,"f").has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return V(t,{received:t.data,code:C.invalid_enum_value,options:i}),W}return pt(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 Mn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Mn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Li=new WeakMap,Mn.create=tE;class Wi extends X{constructor(){super(...arguments),$i.set(this,void 0)}_parse(e){const t=ee.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==$.string&&i.parsedType!==$.number){const a=ee.objectValues(t);return V(i,{expected:ee.joinValues(a),received:i.parsedType,code:C.invalid_type}),W}if(ls(this,$i,"f")||ZT(this,$i,new Set(ee.getValidEnumValues(this._def.values)),"f"),!ls(this,$i,"f").has(e.data)){const a=ee.objectValues(t);return V(i,{received:i.data,code:C.invalid_enum_value,options:a}),W}return pt(e.data)}get enum(){return this._def.values}}$i=new WeakMap,Wi.create=(r,e)=>new Wi({values:r,typeName:J.ZodNativeEnum,...K(e)});class Yr extends X{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$.promise&&t.common.async===!1)return V(t,{code:C.invalid_type,expected:$.promise,received:t.parsedType}),W;const i=t.parsedType===$.promise?t.data:Promise.resolve(t.data);return pt(i.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Yr.create=(r,e)=>new Yr({type:r,typeName:J.ZodPromise,...K(e)});class qt extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.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=>{V(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 l=>{if(t.value==="aborted")return W;const p=await this._def.schema._parseAsync({data:l,path:i.path,parent:i});return p.status==="aborted"?W:p.status==="dirty"||t.value==="dirty"?qr(p.value):p});{if(t.value==="aborted")return W;const l=this._def.schema._parseSync({data:o,path:i.path,parent:i});return l.status==="aborted"?W:l.status==="dirty"||t.value==="dirty"?qr(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,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 l};if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?W:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>l.status==="aborted"?W:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.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(!Mi(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Mi(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);ee.assertNever(a)}}qt.create=(r,e,t)=>new qt({schema:r,typeName:J.ZodEffects,effect:e,...K(t)}),qt.createWithPreprocess=(r,e,t)=>new qt({schema:e,effect:{type:"preprocess",transform:r},typeName:J.ZodEffects,...K(t)});class Kt extends X{_parse(e){return this._getType(e)===$.undefined?pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kt.create=(r,e)=>new Kt({innerType:r,typeName:J.ZodOptional,...K(e)});class Vn extends X{_parse(e){return this._getType(e)===$.null?pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vn.create=(r,e)=>new Vn({innerType:r,typeName:J.ZodNullable,...K(e)});class Hi extends X{_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}}Hi.create=(r,e)=>new Hi({innerType:r,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...K(e)});class Yi extends X{_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 Vi(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Yi.create=(r,e)=>new Yi({innerType:r,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...K(e)});class ys extends X{_parse(e){if(this._getType(e)!==$.nan){const i=this._getOrReturnCtx(e);return V(i,{code:C.invalid_type,expected:$.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}}ys.create=r=>new ys({typeName:J.ZodNaN,...K(r)});const kP=Symbol("zod_brand");class ql extends X{_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 zi extends X{_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"?W:s.status==="dirty"?(t.dirty(),qr(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"?W: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 zi({in:e,out:t,typeName:J.ZodPipeline})}}class Zi extends X{_parse(e){const t=this._def.innerType._parse(e),i=a=>(Mi(a)&&(a.value=Object.freeze(a.value)),a);return Vi(t)?t.then(a=>i(a)):i(t)}unwrap(){return this._def.innerType}}Zi.create=(r,e)=>new Zi({innerType:r,typeName:J.ZodReadonly,...K(e)});function nE(r,e={},t){return r?Jr.create().superRefine((i,a)=>{var s,o;if(!r(i)){const l=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...y,fatal:p})}}):Jr.create()}const qP={object:xe.lazycreate};var J;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(J||(J={}));const JP=(r,e={message:`Input not instance of ${r.name}`})=>nE(t=>t instanceof r,e),hs=jt.create,Jl=_n.create,WP=ys.create,HP=Nn.create,Wl=Gi.create,rE=rr.create,YP=cs.create,zP=Fi.create,iE=Ui.create,ZP=Jr.create,fs=ir.create,KP=un.create,XP=ds.create,QP=kt.create,aE=xe.create,eA=xe.strictCreate,tA=xi.create,nA=us.create,rA=ji.create,iA=Zt.create,sE=ki.create,aA=ps.create,sA=ar.create,oA=Hr.create,lA=qi.create,cA=Ji.create,oE=Mn.create,dA=Wi.create,uA=Yr.create,lE=qt.create,pA=Kt.create,yA=Vn.create,hA=qt.createWithPreprocess,fA=zi.create;var d=Object.freeze({__proto__:null,defaultErrorMap:kr,setErrorMap:AP,getErrorMap:ss,makeIssue:os,EMPTY_PATH:OP,addIssueToContext:V,ParseStatus:nt,INVALID:W,DIRTY:qr,OK:pt,isAborted:Ul,isDirty:xl,isValid:Mi,isAsync:Vi,get util(){return ee},get objectUtil(){return Fl},ZodParsedType:$,getParsedType:wn,ZodType:X,datetimeRegex:eE,ZodString:jt,ZodNumber:_n,ZodBigInt:Nn,ZodBoolean:Gi,ZodDate:rr,ZodSymbol:cs,ZodUndefined:Fi,ZodNull:Ui,ZodAny:Jr,ZodUnknown:ir,ZodNever:un,ZodVoid:ds,ZodArray:kt,ZodObject:xe,ZodUnion:xi,ZodDiscriminatedUnion:us,ZodIntersection:ji,ZodTuple:Zt,ZodRecord:ki,ZodMap:ps,ZodSet:ar,ZodFunction:Hr,ZodLazy:qi,ZodLiteral:Ji,ZodEnum:Mn,ZodNativeEnum:Wi,ZodPromise:Yr,ZodEffects:qt,ZodTransformer:qt,ZodOptional:Kt,ZodNullable:Vn,ZodDefault:Hi,ZodCatch:Yi,ZodNaN:ys,BRAND:kP,ZodBranded:ql,ZodPipeline:zi,ZodReadonly:Zi,custom:nE,Schema:X,ZodSchema:X,late:qP,get ZodFirstPartyTypeKind(){return J},coerce:{string:r=>jt.create({...r,coerce:!0}),number:r=>_n.create({...r,coerce:!0}),boolean:r=>Gi.create({...r,coerce:!0}),bigint:r=>Nn.create({...r,coerce:!0}),date:r=>rr.create({...r,coerce:!0})},any:ZP,array:QP,bigint:HP,boolean:Wl,date:rE,discriminatedUnion:nA,effect:lE,enum:oE,function:oA,instanceof:JP,intersection:rA,lazy:lA,literal:cA,map:aA,nan:WP,nativeEnum:dA,never:KP,null:iE,nullable:yA,number:Jl,object:aE,oboolean:()=>Wl().optional(),onumber:()=>Jl().optional(),optional:pA,ostring:()=>hs().optional(),pipeline:fA,preprocess:hA,promise:uA,record:sE,set:sA,strictObject:eA,string:hs,symbol:YP,transformer:lE,tuple:iA,undefined:zP,union:tA,unknown:fs,void:XP,NEVER:W,ZodIssueCode:C,quotelessJson:PP,ZodError:gt});function cE(r){var a,s,o;if(!(r!=null&&r.dataType))return fs();const e=r.dataType.isNullable||!1,t=r.dataType.isList||!1;let i=fs();if(((a=r.dataType.entity)==null?void 0:a.type)===n.PrimitiveEntity)switch(r.dataType.entity.name){case I.String:i=hs();break;case I.JSON:i=sE(fs());break;case I.Number:i=Jl();break;case I.Boolean:i=Wl();break;case I.Date:i=rE();break;case I.Enum:{const l=r.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${r.name} has no options`);i=oE(l);break}case I.Null:i=iE();break;case I.UUID:i=hs().uuid();break}else if(((s=r.dataType.entity)==null?void 0:s.type)===n.CustomEntity)i=dE(r.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=r.dataType.entity)==null?void 0:o.type}`);return e&&(i=i.nullable()),t&&(i=i.array()),i}function dE(r){const e=aE({});for(const t of r.properties){const i=cE(t);e.shape[t.name]=i}return e}function uE(r){const e=r.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function pE(r){const e=r.rangeEnd;return new Date(Math.random()*e.getTime())}function yE(r){const e=r.rangeStart,t=r.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function hE(r){return r.rangeStart&&r.rangeEnd?yE(r):r.rangeStart?uE(r):r.rangeEnd?pE(r):new Date}function mA(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fE={},ms={},Ts={};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.default=EA;let Es;const TA=new Uint8Array(16);function EA(){if(!Es&&(Es=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Es))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Es(TA)}var Ln={},sr={},bs={};Object.defineProperty(bs,"__esModule",{value:!0}),bs.default=void 0;var bA=/^(?:[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;bs.default=bA,Object.defineProperty(sr,"__esModule",{value:!0}),sr.default=void 0;var RA=gA(bs);function gA(r){return r&&r.__esModule?r:{default:r}}function vA(r){return typeof r=="string"&&RA.default.test(r)}var IA=vA;sr.default=IA,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.default=void 0,Ln.unsafeStringify=mE;var DA=PA(sr);function PA(r){return r&&r.__esModule?r:{default:r}}const et=[];for(let r=0;r<256;++r)et.push((r+256).toString(16).slice(1));function mE(r,e=0){return et[r[e+0]]+et[r[e+1]]+et[r[e+2]]+et[r[e+3]]+"-"+et[r[e+4]]+et[r[e+5]]+"-"+et[r[e+6]]+et[r[e+7]]+"-"+et[r[e+8]]+et[r[e+9]]+"-"+et[r[e+10]]+et[r[e+11]]+et[r[e+12]]+et[r[e+13]]+et[r[e+14]]+et[r[e+15]]}function AA(r,e=0){const t=mE(r,e);if(!(0,DA.default)(t))throw TypeError("Stringified UUID is invalid");return t}var OA=AA;Ln.default=OA,Object.defineProperty(ms,"__esModule",{value:!0}),ms.default=void 0;var SA=BA(Ts),CA=Ln;function BA(r){return r&&r.__esModule?r:{default:r}}let TE,Hl,Yl=0,zl=0;function wA(r,e,t){let i=e&&t||0;const a=e||new Array(16);r=r||{};let s=r.node||TE,o=r.clockseq!==void 0?r.clockseq:Hl;if(s==null||o==null){const b=r.random||(r.rng||SA.default)();s==null&&(s=TE=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=Hl=(b[6]<<8|b[7])&16383)}let l=r.msecs!==void 0?r.msecs:Date.now(),p=r.nsecs!==void 0?r.nsecs:zl+1;const y=l-Yl+(p-zl)/1e4;if(y<0&&r.clockseq===void 0&&(o=o+1&16383),(y<0||l>Yl)&&r.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yl=l,zl=p,Hl=o,l+=122192928e5;const f=((l&268435455)*1e4+p)%4294967296;a[i++]=f>>>24&255,a[i++]=f>>>16&255,a[i++]=f>>>8&255,a[i++]=f&255;const m=l/4294967296*1e4&268435455;a[i++]=m>>>8&255,a[i++]=m&255,a[i++]=m>>>24&15|16,a[i++]=m>>>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,CA.unsafeStringify)(a)}var _A=wA;ms.default=_A;var Rs={},$n={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var NA=MA(sr);function MA(r){return r&&r.__esModule?r:{default:r}}function VA(r){if(!(0,NA.default)(r))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(r.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 LA=VA;Ki.default=LA,Object.defineProperty($n,"__esModule",{value:!0}),$n.URL=$n.DNS=void 0,$n.default=xA;var $A=Ln,GA=FA(Ki);function FA(r){return r&&r.__esModule?r:{default:r}}function UA(r){r=unescape(encodeURIComponent(r));const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}const EE="6ba7b810-9dad-11d1-80b4-00c04fd430c8";$n.DNS=EE;const bE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";$n.URL=bE;function xA(r,e,t){function i(a,s,o,l){var p;if(typeof a=="string"&&(a=UA(a)),typeof s=="string"&&(s=(0,GA.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 y=new Uint8Array(16+a.length);if(y.set(s),y.set(a,s.length),y=t(y),y[6]=y[6]&15|e,y[8]=y[8]&63|128,o){l=l||0;for(let f=0;f<16;++f)o[l+f]=y[f];return o}return(0,$A.unsafeStringify)(y)}try{i.name=r}catch{}return i.DNS=EE,i.URL=bE,i}var gs={};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=void 0;function jA(r){if(typeof r=="string"){const e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(let t=0;t<e.length;++t)r[t]=e.charCodeAt(t)}return kA(qA(JA(r),r.length*8))}function kA(r){const e=[],t=r.length*32,i="0123456789abcdef";for(let a=0;a<t;a+=8){const s=r[a>>5]>>>a%32&255,o=parseInt(i.charAt(s>>>4&15)+i.charAt(s&15),16);e.push(o)}return e}function RE(r){return(r+64>>>9<<4)+14+1}function qA(r,e){r[e>>5]|=128<<e%32,r[RE(e)-1]=e;let t=1732584193,i=-271733879,a=-1732584194,s=271733878;for(let o=0;o<r.length;o+=16){const l=t,p=i,y=a,f=s;t=rt(t,i,a,s,r[o],7,-680876936),s=rt(s,t,i,a,r[o+1],12,-389564586),a=rt(a,s,t,i,r[o+2],17,606105819),i=rt(i,a,s,t,r[o+3],22,-1044525330),t=rt(t,i,a,s,r[o+4],7,-176418897),s=rt(s,t,i,a,r[o+5],12,1200080426),a=rt(a,s,t,i,r[o+6],17,-1473231341),i=rt(i,a,s,t,r[o+7],22,-45705983),t=rt(t,i,a,s,r[o+8],7,1770035416),s=rt(s,t,i,a,r[o+9],12,-1958414417),a=rt(a,s,t,i,r[o+10],17,-42063),i=rt(i,a,s,t,r[o+11],22,-1990404162),t=rt(t,i,a,s,r[o+12],7,1804603682),s=rt(s,t,i,a,r[o+13],12,-40341101),a=rt(a,s,t,i,r[o+14],17,-1502002290),i=rt(i,a,s,t,r[o+15],22,1236535329),t=it(t,i,a,s,r[o+1],5,-165796510),s=it(s,t,i,a,r[o+6],9,-1069501632),a=it(a,s,t,i,r[o+11],14,643717713),i=it(i,a,s,t,r[o],20,-373897302),t=it(t,i,a,s,r[o+5],5,-701558691),s=it(s,t,i,a,r[o+10],9,38016083),a=it(a,s,t,i,r[o+15],14,-660478335),i=it(i,a,s,t,r[o+4],20,-405537848),t=it(t,i,a,s,r[o+9],5,568446438),s=it(s,t,i,a,r[o+14],9,-1019803690),a=it(a,s,t,i,r[o+3],14,-187363961),i=it(i,a,s,t,r[o+8],20,1163531501),t=it(t,i,a,s,r[o+13],5,-1444681467),s=it(s,t,i,a,r[o+2],9,-51403784),a=it(a,s,t,i,r[o+7],14,1735328473),i=it(i,a,s,t,r[o+12],20,-1926607734),t=at(t,i,a,s,r[o+5],4,-378558),s=at(s,t,i,a,r[o+8],11,-2022574463),a=at(a,s,t,i,r[o+11],16,1839030562),i=at(i,a,s,t,r[o+14],23,-35309556),t=at(t,i,a,s,r[o+1],4,-1530992060),s=at(s,t,i,a,r[o+4],11,1272893353),a=at(a,s,t,i,r[o+7],16,-155497632),i=at(i,a,s,t,r[o+10],23,-1094730640),t=at(t,i,a,s,r[o+13],4,681279174),s=at(s,t,i,a,r[o],11,-358537222),a=at(a,s,t,i,r[o+3],16,-722521979),i=at(i,a,s,t,r[o+6],23,76029189),t=at(t,i,a,s,r[o+9],4,-640364487),s=at(s,t,i,a,r[o+12],11,-421815835),a=at(a,s,t,i,r[o+15],16,530742520),i=at(i,a,s,t,r[o+2],23,-995338651),t=st(t,i,a,s,r[o],6,-198630844),s=st(s,t,i,a,r[o+7],10,1126891415),a=st(a,s,t,i,r[o+14],15,-1416354905),i=st(i,a,s,t,r[o+5],21,-57434055),t=st(t,i,a,s,r[o+12],6,1700485571),s=st(s,t,i,a,r[o+3],10,-1894986606),a=st(a,s,t,i,r[o+10],15,-1051523),i=st(i,a,s,t,r[o+1],21,-2054922799),t=st(t,i,a,s,r[o+8],6,1873313359),s=st(s,t,i,a,r[o+15],10,-30611744),a=st(a,s,t,i,r[o+6],15,-1560198380),i=st(i,a,s,t,r[o+13],21,1309151649),t=st(t,i,a,s,r[o+4],6,-145523070),s=st(s,t,i,a,r[o+11],10,-1120210379),a=st(a,s,t,i,r[o+2],15,718787259),i=st(i,a,s,t,r[o+9],21,-343485551),t=Gn(t,l),i=Gn(i,p),a=Gn(a,y),s=Gn(s,f)}return[t,i,a,s]}function JA(r){if(r.length===0)return[];const e=r.length*8,t=new Uint32Array(RE(e));for(let i=0;i<e;i+=8)t[i>>5]|=(r[i/8]&255)<<i%32;return t}function Gn(r,e){const t=(r&65535)+(e&65535);return(r>>16)+(e>>16)+(t>>16)<<16|t&65535}function WA(r,e){return r<<e|r>>>32-e}function vs(r,e,t,i,a,s){return Gn(WA(Gn(Gn(e,r),Gn(i,s)),a),t)}function rt(r,e,t,i,a,s,o){return vs(e&t|~e&i,r,e,a,s,o)}function it(r,e,t,i,a,s,o){return vs(e&i|t&~i,r,e,a,s,o)}function at(r,e,t,i,a,s,o){return vs(e^t^i,r,e,a,s,o)}function st(r,e,t,i,a,s,o){return vs(t^(e|~i),r,e,a,s,o)}var HA=jA;gs.default=HA,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.default=void 0;var YA=gE($n),zA=gE(gs);function gE(r){return r&&r.__esModule?r:{default:r}}var ZA=(0,YA.default)("v3",48,zA.default);Rs.default=ZA;var Is={},Ds={};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=void 0;var KA={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Ds.default=KA,Object.defineProperty(Is,"__esModule",{value:!0}),Is.default=void 0;var vE=IE(Ds),XA=IE(Ts),QA=Ln;function IE(r){return r&&r.__esModule?r:{default:r}}function eO(r,e,t){if(vE.default.randomUUID&&!e&&!r)return vE.default.randomUUID();r=r||{};const i=r.random||(r.rng||XA.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,QA.unsafeStringify)(i)}var tO=eO;Is.default=tO;var Ps={},As={};Object.defineProperty(As,"__esModule",{value:!0}),As.default=void 0;function nO(r,e,t,i){switch(r){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 Zl(r,e){return r<<e|r>>>32-e}function rO(r){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){const o=unescape(encodeURIComponent(r));r=[];for(let l=0;l<o.length;++l)r.push(o.charCodeAt(l))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);const i=r.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=r[o*64+p*4]<<24|r[o*64+p*4+1]<<16|r[o*64+p*4+2]<<8|r[o*64+p*4+3];s[o]=l}s[a-1][14]=(r.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(r.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let v=0;v<16;++v)l[v]=s[o][v];for(let v=16;v<80;++v)l[v]=Zl(l[v-3]^l[v-8]^l[v-14]^l[v-16],1);let p=t[0],y=t[1],f=t[2],m=t[3],b=t[4];for(let v=0;v<80;++v){const P=Math.floor(v/20),O=Zl(p,5)+nO(P,y,f,m)+b+e[P]+l[v]>>>0;b=m,m=f,f=Zl(y,30)>>>0,y=p,p=O}t[0]=t[0]+p>>>0,t[1]=t[1]+y>>>0,t[2]=t[2]+f>>>0,t[3]=t[3]+m>>>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 iO=rO;As.default=iO,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=void 0;var aO=DE($n),sO=DE(As);function DE(r){return r&&r.__esModule?r:{default:r}}var oO=(0,aO.default)("v5",80,sO.default);Ps.default=oO;var Os={};Object.defineProperty(Os,"__esModule",{value:!0}),Os.default=void 0;var lO="00000000-0000-0000-0000-000000000000";Os.default=lO;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.default=void 0;var cO=dO(sr);function dO(r){return r&&r.__esModule?r:{default:r}}function uO(r){if(!(0,cO.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var pO=uO;Ss.default=pO,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return o.default}});var e=f(ms),t=f(Rs),i=f(Is),a=f(Ps),s=f(Os),o=f(Ss),l=f(sr),p=f(Ln),y=f(Ki);function f(m){return m&&m.__esModule?m:{default:m}}}(fE);function Kl(r,e){if(!r||!e||!r.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=r,this.dstAlphabet=e}Kl.prototype.convert=function(r){var e,t,i,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=r.length,p=typeof r=="string"?"":[];if(!this.isValid(r))throw new Error('Number "'+r+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return r;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(r[e]);do{for(t=0,i=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[i++]=parseInt(t/o,10),t=t%o):i>0&&(a[i++]=0);l=i,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(i!==0);return p},Kl.prototype.isValid=function(r){for(var e=0;e<r.length;++e)if(this.srcAlphabet.indexOf(r[e])===-1)return!1;return!0};var yO=Kl,hO=yO;function Xi(r,e){var t=new hO(r,e);return function(i){return t.convert(i)}}Xi.BIN="01",Xi.OCT="01234567",Xi.DEC="0123456789",Xi.HEX="0123456789abcdef";var fO=Xi;const{v4:Xl,validate:mO}=fE,Cs=fO,Ql={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},TO={consistentLength:!0};let ec;const PE=(r,e,t)=>{const i=e(r.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?i:i.padStart(t.shortIdLength,t.paddingChar)},AE=(r,e)=>{const i=e(r).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("-")},EO=r=>Math.ceil(Math.log(2**128)/Math.log(r));var bO=(()=>{const r=(e,t)=>{const i=e||Ql.flickrBase58,a={...TO,...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=EO(i.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:i[0]},l=Cs(Cs.HEX,i),p=Cs(i,Cs.HEX),y=()=>PE(Xl(),l,o),m={alphabet:i,fromUUID:b=>PE(b,l,o),maxLength:s,generate:y,new:y,toUUID:b=>AE(b,p),uuid:Xl,validate:(b,v=!1)=>{if(!b||typeof b!="string")return!1;const P=a.consistentLength?b.length===s:b.length<=s,O=b.split("").every(A=>i.includes(A));return v===!1?P&&O:P&&O&&mO(AE(b,p))}};return Object.freeze(m),m};return r.constants=Ql,r.uuid=Xl,r.generate=()=>(ec||(ec=r(Ql.flickrBase58).generate),ec()),r})();const Bs=mA(bO);function OE(){return Bs().uuid()}function SE(r){return r.rangeStart+Math.random()}function CE(r){const e=r.rangeEnd;return Math.random()*e}function BE(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random()*(t-e)+e}function wE(r){return r.rangeStart&&r.rangeEnd?BE(r):r.rangeStart?SE(r):r.rangeEnd?CE(r):Math.random()}function _E(r){const e=r.rangeStart;return Math.random().toString(36).substring(e)}function NE(r){const e=r.rangeEnd;return Math.random().toString(36).substring(0,e)}function ME(r){const e=r.rangeStart,t=r.rangeEnd;return Math.random().toString(36).substring(e,t)}function VE(r){return r.rangeStart&&r.rangeEnd?ME(r):r.rangeStart?_E(r):r.rangeEnd?NE(r):Math.random().toString(36)}function LE(r){return Math.random()>=.5}function RO(r){if(!r||!r.autogeneration)return null;switch(r.autogeneration.type){case qe.CurrentDateAndTime:if(r.name===I.Date)return new Date;case qe.Random:{if(r.name===I.Date)return hE(r.autogeneration);if(r.name===I.Number)return wE(r.autogeneration);if(r.name===I.String)return VE(r.autogeneration);if(r.name===I.Boolean)return LE(r.autogeneration)}case qe.Unique:if(r.name===I.UUID)return OE();default:throw new Error(`Generating a ${r.autogeneration.type} value for a ${r.name} is not supported`)}}const z="e7eb5382-3d99-44fd-972a-b8b1e819f6be",tc="global-user-variable-id",$E="last-executed-timestamp-variable-id",gO={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},vO={id:"alternative-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:n.Property},IO={like:!1,inferred:!1,id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:null,parent:gO,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:vO},ws={id:"alternative-relational-database-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},DO={hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:ts,static:!0,index:0,dataType:IO,description:"The name of the main database inside of the server instance where the data will be stored.",parent:ws};n.GenericReference,n.DataType;const PO={id:"alternative-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:n.Property},AO={like:!1,inferred:!1,id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:PO},OO={hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:ns,static:!0,index:1,dataType:AO,description:"The username that will be used to connect to the database.",parent:ws};n.GenericReference,n.DataType;const SO={id:"alternative-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:n.Property},CO={like:!1,inferred:!1,id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:SO},BO={hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:rs,static:!0,index:2,dataType:CO,description:"The password that will be used to connect to the database.",parent:ws},wO={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},_O={id:"alternative-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:n.Property},NO={like:!1,inferred:!1,id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:wO,autogeneration:null,valueAsType:null},parent:_O},MO={hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:is,static:!0,index:3,dataType:NO,description:"The minimum size of the database in GB.",parent:ws},VO={id:"alternative-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},GE={id:"alternative-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[DO,OO,BO,MO],methods:[],abstractMethods:[],extends:[],implements:[Bn],x:0,y:0,parent:VO},LO={id:"animal-prototype-database-property-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-id",entityType:n.Property},$O={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:n.DataType},GO={like:!1,inferred:!1,id:"animal-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:GE,autogeneration:null,parent:$O},parent:LO},FO={id:"animal-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},UO={hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:GO,description:"The database that the entity belongs to.",parent:FO},xO={type:n.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:n.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},jO={like:!1,inferred:!1,id:"c1930577-9e79-48a6-8905-be24611015c1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xO},kO={type:n.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},qO={hidden:!1,required:!0,type:n.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:jO,abstract:!1,parent:kO},JO={type:n.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:n.Project,entityId:z},WO={type:n.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:[UO,qO],methods:[],extends:[],implements:[Fe],x:0,y:0,parent:JO},HO={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:n.DataType},YO={id:"default-relational-database-entity-identifier-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:n.Property},zO={like:!1,inferred:!1,id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"main",parent:HO,autogeneration:{type:qe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:YO},zr={id:"default-relational-database-entity-ref-id",type:n.GenericReference,entityId:L.PERSISTED_ENTITY,entityType:n.BuiltInBaseEntity},ZO={hidden:!1,required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:n.Property,private:!1,abstract:!1,implements:ts,static:!0,index:0,dataType:zO,description:"The name of the main database inside of the server instance where the data will be stored.",parent:zr};n.GenericReference,n.DataType;const KO={id:"default-relational-database-entity-username-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:n.Property},XO={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-username-property-data-type-id",entityType:n.DataType},QO={like:!1,inferred:!1,id:"default-relational-database-entity-username-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"root",parent:XO,autogeneration:null,valueAsType:null},parent:KO},eS={hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:n.Property,private:!1,abstract:!1,implements:ns,static:!0,index:1,dataType:QO,description:"The username that will be used to connect to the database.",parent:zr};n.GenericReference,n.DataType;const tS={id:"default-relational-database-entity-password-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:n.Property},nS={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-password-property-data-type-id",entityType:n.DataType},rS={like:!1,inferred:!1,id:"default-relational-database-entity-password-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"password",parent:nS,autogeneration:null,valueAsType:null},parent:tS},iS={hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:n.Property,private:!1,abstract:!1,implements:rs,static:!0,index:2,dataType:rS,description:"The password that will be used to connect to the database.",parent:zr},aS={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:n.DataType},sS={id:"default-relational-database-entity-min-size-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:n.Property},oS={like:!1,inferred:!1,id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:6,parent:aS,autogeneration:null,valueAsType:null},parent:sS},lS={hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:n.Property,private:!1,abstract:!1,implements:is,static:!0,index:3,dataType:oS,description:"The minimum size of the database in GB.",parent:zr},cS={id:"default-relational-database-entity-default-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-default-property-data-type-id",entityType:n.DataType},dS={id:"default-relational-database-entity-default-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:n.Property},uS={like:!1,inferred:!1,id:"default-relational-database-entity-default-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!0,parent:cS,autogeneration:null,valueAsType:null},parent:dS},pS={hidden:!0,required:!0,id:"default-relational-database-entity-default-property-id",name:"Default",version:1,type:n.Property,private:!1,abstract:!1,implements:Bl,static:!0,index:4,dataType:uS,description:"Whether this database is automatically picked by other entities as the default database.",parent:zr},yS={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-data-type-id",entityType:n.DataType},hS={id:"default-relational-database-entity-autoscaling-property-ref-id",type:n.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:n.Property},fS={like:!1,inferred:!1,id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:te,asType:!1,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.Boolean,value:!0,parent:yS,autogeneration:null,valueAsType:null},parent:hS},mS={hidden:!1,required:!0,id:"default-relational-database-entity-autoscaling-property-id",name:"Auto-scaling",version:1,type:n.Property,private:!1,abstract:!1,implements:wl,static:!0,index:5,dataType:fS,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:zr},TS={id:"default-relational-database-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},nc={id:"default-relational-database-entity-id",type:n.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[pS,mS,ZO,eS,iS,lS],methods:[],abstractMethods:[],extends:[],implements:[Bn],x:0,y:0,parent:TS},ES={id:"user-prototype-database-property-data-type-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:n.DataType},bS={id:"user-prototype-database-property-ref-id",type:n.GenericReference,entityId:"user-prototype-database-property-id",entityType:n.Property},RS={like:!1,inferred:!1,id:"user-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:nc,autogeneration:null,parent:ES},parent:bS},gS={id:"user-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},vS={hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:RS,description:"The database that the entity belongs to.",parent:gS},IS={type:n.GenericReference,id:"user-prototype-parent-ref-id",entityType:n.Project,entityId:z},rc={type:n.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Fe],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[vS],methods:[],x:0,y:0,parent:IS},DS={type:n.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:n.Property,entityId:"person-date-of-birth-property-id"},PS={like:!1,inferred:!1,id:"person-date-of-birth-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:cn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:DS},AS={type:n.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},OS={hidden:!1,required:!0,type:n.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:PS,abstract:!1,parent:AS},SS={type:n.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:n.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},CS={like:!1,inferred:!1,id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:SS},BS={type:n.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:n.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},wS={hidden:!1,required:!0,type:n.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:CS,abstract:!1,parent:BS},_S={type:n.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:n.Project,entityId:z},yt={type:n.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:[wS,OS],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[rc],x:0,y:0,parent:_S},NS={type:n.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},MS={type:n.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:n.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},VS={type:n.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},LS={type:n.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:n.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},$S={like:!1,inferred:!1,id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LS},ic={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:n.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:$S,implements:null,readsValue:VS,required:!0,index:0,parent:MS},GS={type:n.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},FS={type:n.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:n.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},FE={type:n.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[ic],calledByError:[],calledByEntry:[GS],calledBySuccess:[],throws:null,x:0,y:0,parent:FS},US={type:n.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:n.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},xS={like:!1,inferred:!1,id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:US},UE={id:"500dee3a-3435-4453-9699-0d053f646523",type:n.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:xS,implements:null,required:!0,writesValues:[ic],index:0,parent:NS},jS={type:n.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},xE={type:n.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[UE],calls:[FE],returnStatements:[FE],index:0,collapsed:!1,private:!1,x:0,y:0,parent:jS},kS={type:n.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:n.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},qS={like:!1,inferred:!1,id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kS},JS={type:n.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:n.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},WS={type:n.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},HS={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:n.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:qS,readsValue:JS,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:WS},YS={type:n.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},zS={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:n.OutputMap,version:1,declaration:ic,writesValues:[HS],index:0,parent:YS},ZS={type:n.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},KS={type:n.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},XS={type:n.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},QS={like:!1,inferred:!1,id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XS},eC={type:n.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},tC={type:n.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},nC={type:n.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:n.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},rC={type:n.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:n.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},jE={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:n.InputMap,version:1,declaration:UE,name:null,description:null,readsValue:rC,defaultValue:null,index:0,parent:nC},iC={type:n.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:QS,readsValue:eC,writesValues:[jE],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:tC},aC={type:n.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:xE,inputs:[jE],outputs:[zS],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[ZS],calledBySuccess:[],parent:KS,error:null,x:0,y:0},sC={type:n.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:n.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},oC={like:!1,inferred:!1,id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sC},lC={type:n.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:n.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},cC={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:n.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:oC,implements:null,required:!0,index:0,writesValues:[iC],parent:lC},dC={type:n.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},uC={type:n.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[cC],collapsed:!0,returnStatements:[],calls:[aC],private:!1,index:0,implements:null,x:0,y:0,parent:dC},pC={type:n.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:n.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},yC={like:!1,inferred:!1,id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:pC},hC={type:n.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},fC={hidden:!1,required:!0,type:n.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:yC,abstract:!1,parent:hC},mC={type:n.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:n.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},TC={like:!1,inferred:!1,id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:mC},EC={type:n.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:n.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},bC={hidden:!1,required:!0,type:n.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:TC,implements:null,static:!1,private:!0,abstract:!1,parent:EC},RC={type:n.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:n.Project,entityId:z},Zr={type:n.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[fC,bC],methods:[xE,uC],extends:[],implements:[Fe],x:0,y:0,parent:RC},Qi="bitcoin-api-response-id",kE="time-property-id",qE="disclamer-property-id",JE="chart-name-property-id",WE="bpi-property-id",_s="bpi-entity-id",HE="usd-property-id",YE="gbp-property-id",zE="eur-property-id",Kr="currency-entity-id",ZE="currency-code-property-id",KE="currency-symbol-property-id",XE="currency-rate-property-id",QE="currency-description-property-id",eb="currency-rate-number-property-id",gC={type:n.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:n.Property,entityId:ZE},vC={like:!1,inferred:!1,id:"code-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:gC},IC={type:n.GenericReference,id:"code-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},DC={hidden:!1,required:!0,type:n.Property,id:ZE,version:1,name:"code",description:null,dataType:vC,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:IC},PC={type:n.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:n.Property,entityId:KE},AC={like:!1,inferred:!1,id:"symbol-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["&#36;","&pound;","&euro;"],constant:!1,parent:PC},OC={type:n.GenericReference,id:"symbol-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},SC={hidden:!1,required:!0,type:n.Property,id:KE,version:1,name:"symbol",description:null,index:0,dataType:AC,implements:null,static:!1,private:!1,abstract:!1,parent:OC},CC={type:n.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:n.Property,entityId:XE},BC={like:!1,inferred:!1,id:"rate-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:CC},wC={type:n.GenericReference,id:"rate-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},_C={hidden:!1,required:!0,type:n.Property,id:XE,version:1,name:"rate",description:null,index:0,dataType:BC,implements:null,static:!1,private:!1,abstract:!1,parent:wC},NC={type:n.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:n.Property,entityId:QE},MC={like:!1,inferred:!1,id:"description-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:NC},VC={type:n.GenericReference,id:"description-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},LC={hidden:!1,required:!0,type:n.Property,id:QE,version:1,name:"description",description:null,dataType:MC,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:VC},$C={type:n.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:n.Property,entityId:eb},GC={like:!1,inferred:!1,id:"rate-number-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:$C},FC={type:n.GenericReference,id:"rate-number-property-parent-ref-id",entityType:n.CustomEntity,entityId:Kr},UC={hidden:!1,required:!0,type:n.Property,id:eb,version:1,name:"rate_float",description:null,dataType:GC,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:FC},xC={type:n.GenericReference,id:"currency-prototype-parent-ref-id",entityType:n.Project,entityId:z},Ns={type:n.CustomEntity,id:Kr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[DC,SC,_C,LC,UC],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:xC},jC={type:n.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:n.Property,entityId:HE},kC={like:!1,inferred:!1,id:"usd-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jC},qC={type:n.GenericReference,id:"usd-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},JC={hidden:!1,required:!0,id:HE,type:n.Property,version:1,name:"USD",description:null,index:0,dataType:kC,implements:null,static:!1,private:!1,abstract:!1,parent:qC},WC={type:n.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:n.Property,entityId:YE},HC={like:!1,inferred:!1,id:"gbp-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WC},YC={type:n.GenericReference,id:"gbp-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},zC={hidden:!1,required:!0,id:YE,type:n.Property,version:1,name:"GBP",description:null,index:0,dataType:HC,implements:null,static:!1,private:!1,abstract:!1,parent:YC},ZC={type:n.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:n.Property,entityId:zE},KC={like:!1,inferred:!1,id:"eur-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ns,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ZC},XC={type:n.GenericReference,id:"eur-property-parent-ref-id",entityType:n.CustomEntity,entityId:_s},QC={hidden:!1,required:!0,id:zE,type:n.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:KC,private:!1,abstract:!1,parent:XC},eB={type:n.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:n.Project,entityId:z},tb={type:n.CustomEntity,id:_s,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[JC,zC,QC],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:eB},tB={type:n.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:n.Property,entityId:kE},nB={like:!1,inferred:!1,id:"time-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Jo,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:tB},rB={type:n.GenericReference,id:"time-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},iB={hidden:!1,required:!0,type:n.Property,id:kE,version:1,name:"time",description:null,index:0,dataType:nB,implements:null,static:!1,private:!1,abstract:!1,parent:rB},aB={type:n.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:n.Property,entityId:qE},sB={like:!1,inferred:!1,id:"disclamer-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aB},oB={type:n.GenericReference,id:"disclamer-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},lB={hidden:!1,required:!0,type:n.Property,id:qE,version:1,name:"disclamer",description:null,index:0,dataType:sB,implements:null,static:!1,private:!1,abstract:!1,parent:oB},cB={type:n.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:n.Property,entityId:JE},dB={like:!1,inferred:!1,id:"chart-name-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cB},uB={type:n.GenericReference,id:"chart-name-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},pB={hidden:!1,required:!0,type:n.Property,id:JE,version:1,name:"chartName",description:null,index:0,dataType:dB,implements:null,static:!1,private:!1,abstract:!1,parent:uB},yB={type:n.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:n.Property,entityId:WE},hB={like:!1,inferred:!1,id:"bpi-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:tb,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yB},fB={type:n.GenericReference,id:"bpi-property-parent-ref-id",entityType:n.CustomEntity,entityId:Qi},mB={hidden:!1,required:!0,type:n.Property,id:WE,version:1,name:"bpi",description:null,implements:null,index:0,dataType:hB,static:!1,private:!1,abstract:!1,parent:fB},TB={type:n.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:n.Project,entityId:z},nb={type:n.CustomEntity,id:Qi,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[iB,lB,pB,mB],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:TB},EB={type:n.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},bB={like:!1,inferred:!1,id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:EB},RB={type:n.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:n.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},gB={type:n.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:n.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},vB={like:!1,inferred:!1,id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gB},IB={type:n.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:n.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},rb={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",implements:null,dataType:vB,readsValue:IB,required:!0,index:0,parent:RB},DB={type:n.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},PB={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:n.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,implements:null,dataType:bB,writesValues:[rb],required:!0,index:0,parent:DB},AB={type:n.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},OB={type:n.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},SB={type:n.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},ib={type:n.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[rb],calledByError:[],calledByEntry:[OB],calledBySuccess:[],throws:null,x:0,y:0,parent:SB},CB={type:n.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:[PB],calls:[ib],index:0,collapsed:!1,implements:null,returnStatements:[ib],private:!1,x:0,y:0,parent:AB},BB={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},wB={type:n.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},_B={type:n.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:n.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},NB={type:n.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},MB={type:n.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:n.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},VB={like:!1,inferred:!1,id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MB},ac={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:n.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:VB,implements:null,readsValue:NB,required:!0,index:0,parent:_B},LB={type:n.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},sc={type:n.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[ac],calledByError:[],calledByEntry:[],calledBySuccess:[BB,LB],throws:null,x:0,y:0,parent:wB},$B={type:n.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},GB={type:n.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},ab={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:al,name:null,description:null,readsValue:GB,defaultValue:null,parent:$B,index:2},FB={type:n.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:n.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},UB={like:!1,inferred:!1,id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FB},xB={type:n.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},jB={type:n.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:n.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},kB={type:n.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:n.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},sb={type:n.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:UB,readsValue:jB,writesValues:[ac],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[kB],successCalls:[sc],errorCalls:[],internalCalls:[],x:0,y:0,parent:xB},qB={type:n.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:n.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},JB={type:n.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},WB={type:n.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:qa,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:I.String,valueAsType:null,parent:qB,autogeneration:null},index:1,parent:JB},HB={type:n.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},YB={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:n.OutputMap,version:1,declaration:Di,index:2,writesValues:[sb],parent:HB},zB={type:n.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},ZB={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:n.InputMap,version:1,declaration:ka,name:null,description:null,readsValue:null,index:0,defaultValue:null,parent:zB},KB={type:n.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},XB={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:n.InputMap,version:1,name:null,description:null,declaration:Ja,index:3,readsValue:null,defaultValue:null,parent:KB},QB={type:n.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},ew={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:n.InputMap,version:1,declaration:Wa,name:null,description:null,readsValue:null,index:4,defaultValue:null,parent:QB},tw={type:n.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},nw={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:n.OutputMap,version:1,declaration:Ha,index:1,writesValues:[],parent:tw},rw={type:n.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},iw={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:n.OutputMap,version:1,declaration:Di,index:0,writesValues:[],parent:rw},aw={type:n.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},sw={type:n.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},ow={type:n.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},lw={type:n.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:n.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},cw={type:n.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:n.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},dw={like:!1,inferred:!1,id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ye,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cw},uw={type:n.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:n.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},ob={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:n.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:dw,implements:null,required:!0,readsValue:null,index:0,parent:uw},pw={type:n.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lw],throws:ob,x:0,y:0,parent:ow},yw={type:n.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:n.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},hw={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:n.OutputMap,declaration:ol,version:1,writesValues:[ob],index:0,parent:yw},fw={type:n.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Pi,inputs:[ZB,WB,ab,XB,ew],outputs:[iw,nw,YB],process:null,calledByError:[],calledByEntry:[aw],calledBySuccess:[],successCalls:[sc,sb],errorCalls:[pw],error:hw,x:0,y:0,parent:sw},mw={type:n.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:n.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},Tw={type:n.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Ew={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:n.InputMap,version:1,declaration:Ua,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"?name=",name:I.String,parent:mw,valueAsType:null,autogeneration:null},index:0,parent:Tw},bw={type:n.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},Rw={type:n.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},gw={type:n.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:n.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},vw={like:!1,inferred:!1,id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:gw},Iw={type:n.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:n.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},Dw={type:n.GenericReference,id:"assembled-query-string-called-by-ref",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},lb={type:n.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:vw,readsValue:Iw,writesValues:[ab],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[Dw],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:Rw},Pw={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:n.OutputMap,version:1,writesValues:[lb],declaration:vi,index:0,parent:bw},Aw={type:n.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Ow={type:n.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},Sw={type:n.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:n.ArgumentDeclaration},Cw={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},cb={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:n.InputMap,declaration:xa,name:null,description:null,readsValue:Sw,defaultValue:null,index:1,parent:Cw},Bw={type:n.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:Ii,version:1,inputs:[Ew,cb],outputs:[Pw],process:null,calledByError:[],calledByEntry:[Aw],calledBySuccess:[],successCalls:[lb],errorCalls:[],error:null,x:0,y:0,parent:Ow},ww={type:n.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:n.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},_w={like:!1,inferred:!1,id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ww},Nw={type:n.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:n.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},db={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:n.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:_w,implements:null,required:!1,writesValues:[cb],index:0,parent:Nw},Mw={type:n.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:n.Project,entityId:z},ub={type:n.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:[db],calls:[Bw,fw],returnStatements:[sc],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:Mw},Vw={type:n.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},Lw={type:n.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},$w={type:n.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},Gw={type:n.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},pb={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:n.InputMap,declaration:db,name:null,description:null,readsValue:$w,defaultValue:null,index:0,parent:Gw},Fw={type:n.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},Uw={type:n.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:n.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},xw={like:!1,inferred:!1,id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Sn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Uw},jw={type:n.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:n.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},kw={type:n.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},qw={type:n.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:n.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},yb={type:n.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:xw,readsValue:jw,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[qw],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:kw},Jw={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.OutputMap,version:1,declaration:ac,writesValues:[yb],index:0,parent:Fw},Ww={type:n.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:ub,inputs:[pb],outputs:[Jw],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[Vw],successCalls:[yb],errorCalls:[],error:null,x:0,y:0,parent:Lw},Hw={type:n.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Yw={type:n.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},zw={type:n.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},Zw={type:n.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:n.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},hb={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:n.InputMap,declaration:nr.fixedArguments[0],name:null,description:null,readsValue:zw,defaultValue:null,index:0,parent:Zw},Kw={type:n.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:nr,inputs:[hb],calledByError:[],calledByEntry:[Hw],calledBySuccess:[],successCalls:[Ww],errorCalls:[],x:0,y:0,parent:Yw},Xw={type:n.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},Qw={type:n.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:n.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},e_={like:!1,inferred:!1,id:"d64152ea-831f-4426-9506-a39bfa170513",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Qw},t_={type:n.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},n_={type:n.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},r_={type:n.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},fb={type:n.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:e_,readsValue:n_,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[r_],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:t_},i_={type:n.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:n.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},a_={like:!1,inferred:!1,id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:i_},s_={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:n.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:a_,implements:null,required:!0,index:1,writesValues:[fb],parent:Xw},o_={type:n.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},l_={type:n.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:n.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},c_={type:n.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:n.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},d_={like:!1,inferred:!1,id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:c_},u_={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:n.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:d_,implements:null,required:!0,index:0,writesValues:[hb,pb],parent:l_},p_={type:n.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:[u_,s_],calls:[Kw,fb],index:1,private:!1,implements:null,x:0,y:0,parent:o_},y_={type:n.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},h_={type:n.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-manager-property-id"},f_={like:!1,inferred:!1,id:"employee-manager-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:y_,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:h_},m_={type:n.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},T_={hidden:!1,required:!0,type:n.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:f_,abstract:!1,parent:m_},E_={type:n.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:n.Property,entityId:"employee-start-date-property-id"},b_={like:!1,inferred:!1,id:"employee-start-date-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:cn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:E_},R_={type:n.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},g_={hidden:!1,required:!0,type:n.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:b_,abstract:!1,parent:R_},v_={type:n.GenericReference,id:"employee-department-property-ref-id",entityType:n.Property,entityId:"employee-department-property-id"},I_={like:!1,inferred:!1,id:"employee-department-property-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Cn,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:v_},D_={type:n.GenericReference,id:"employee-department-property-parent-ref-id",entityType:n.CustomEntity,entityId:"employee-entity-id"},P_={hidden:!1,required:!0,type:n.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:I_,abstract:!1,parent:D_},A_={type:n.GenericReference,id:"employee-prototype-parent-ref-id",entityType:n.Project,entityId:z},Ct={type:n.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[P_,g_,T_],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[yt],x:0,y:0,parent:A_},O_={type:n.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:n.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},S_={like:!1,inferred:!1,id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:O_},C_={type:n.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},B_={hidden:!1,required:!0,type:n.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:S_,abstract:!1,parent:C_},w_={type:n.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:n.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},__={like:!1,inferred:!1,id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Zr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:w_},N_={type:n.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},oc={hidden:!1,required:!0,type:n.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:__,abstract:!1,parent:N_},M_={type:n.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:n.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},V_={like:!1,inferred:!1,id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:yt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:M_},L_={type:n.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},$_={hidden:!1,required:!0,type:n.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:V_,private:!0,abstract:!1,parent:L_},G_={type:n.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:n.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},F_={like:!1,inferred:!1,id:"ad44250b-40c2-48f7-a480-381fa938f562",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:G_},U_={type:n.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:n.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},x_={hidden:!1,required:!0,type:n.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:F_,implements:null,private:!0,static:!1,abstract:!1,parent:U_},j_={type:n.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:n.Project,entityId:z},vt={type:n.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[B_,oc,$_,x_],static:!1,abstract:!1,abstractMethods:[],methods:[CB,p_],extends:[],implements:[Fe],x:0,y:0,parent:j_},k_={type:n.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:n.Project,entityId:z},lc={type:n.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:k_};n.GenericReference,n.DataType;const q_={id:"cron-job-entity-expression-property-ref-id",type:n.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:n.Property},J_={like:!1,inferred:!1,id:"cron-job-entity-expression-property-data-type-id",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:null,parent:q_},W_={id:"cron-job-entity-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},H_={hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:n.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:J_,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:W_},Y_={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:n.GenericReference,entityId:"show-popup-func-decl-id",entityType:n.FunctionDeclaration},z_={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:n.FunctionDeclaration},Z_={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:n.FunctionCall,declaration:lc,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[Y_],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:z_},K_={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:n.GenericReference,entityId:"cron-job-entity-id",entityType:n.CustomEntity},X_={id:"cron-job-entity-trigger-func-decl-id",version:1,type:n.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Nl,calls:[Z_],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:K_},Q_={id:"cron-job-entity-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},eN={id:"cron-job-entity-id",version:1,type:n.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[H_],static:!0,abstract:!1,abstractMethods:[],extends:[Ml],implements:[],methods:[X_],x:0,y:0,parent:Q_},tN={type:n.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:n.Project,entityId:z},nN={type:n.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:[es],x:0,y:0,parent:tN},mb="f558fbf8-67de-4545-9804-6ae621e0b2d4",rN={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},iN={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},aN={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:x,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:rN,autogeneration:null,valueAsType:null},parent:iN},sN={id:"getCompanyByIdEndpointReachedEntityEventRef",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},oN={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},lN={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},cN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:oN,autogeneration:null,valueAsType:null},parent:lN},dN={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:cN,implements:vl,required:!0,index:0,parent:sN},uN={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},pN={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:n.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:aN,implements:Il,required:!0,index:1,parent:uN},yN={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},hN={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},fN={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},mN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:x,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:hN,autogeneration:null,valueAsType:null},parent:fN},TN={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:n.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:mN,implements:Dl,required:!0,index:2,parent:yN},EN={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},bN={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},RN={like:!1,inferred:!1,id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:bN},gN={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:n.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:RN,implements:Pl,index:3,required:!0,parent:EN},vN={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},IN={like:!1,inferred:!1,id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vN},DN={id:"getCompanyByIdEndpointReturnStatementRef",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},PN={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:n.ReturnDeclaration,name:"Response code",dataType:IN,implements:Al,readsValue:null,required:!0,index:0,parent:DN},AN={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},ON={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},SN={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ye,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.JSON,value:{},parent:AN,autogeneration:null,valueAsType:null},parent:ON},CN={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},BN={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:n.ReturnDeclaration,name:"Response headers",dataType:SN,implements:Ol,readsValue:null,required:!0,index:1,parent:CN},wN={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:n.GenericReference,entityType:n.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},_N={like:!1,inferred:!1,id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ye,defaultValue:null,parent:wN},NN={id:"getCompanyByIdEndpointReturnStatementRefThree",type:n.GenericReference,entityType:n.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},MN={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:n.ReturnDeclaration,name:"Response body",implements:Sl,dataType:_N,readsValue:null,required:!0,index:2,parent:NN},VN={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:n.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:n.FunctionDeclaration},LN={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},$N={id:"getCompanyByIdEndpointReturnStatement",type:n.ReturnStatement,version:1,outputs:[PN,BN,MN],calledByError:[],calledByEntry:[VN],calledBySuccess:[],throws:null,x:0,y:0,parent:LN},GN={id:"endpointBuiltInBaseEntityRefFour",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:mb},FN={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:n.FunctionDeclaration,inputs:[dN,pN,TN,gN],returnStatements:[$N],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:Cl,index:0,private:!1,x:0,y:0,parent:GN},UN={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},xN={id:"getCompanyByIdEndpointPathPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointPathProperty"},jN={like:!1,inferred:!1,id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:x,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,name:I.String,value:"/company/{id}",parent:UN,valueAsType:null,autogeneration:null},parent:xN},kN={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},qN={hidden:!1,required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:Rl,dataType:jN,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:kN},JN={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:n.GenericReference,entityType:n.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},WN={id:"getCompanyByIdEndpointMethodPropertyRef",type:n.GenericReference,entityType:n.Property,entityId:"getCompanyByIdEndpointMethodProperty"},HN={like:!1,inferred:!1,id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Cn,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:n.PrimitiveValue,version:1,value:"GET",name:I.Enum,parent:JN,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:WN},YN={id:"getCompanyByIdEndpointBaseEntityRefThree",type:n.GenericReference,entityType:n.BuiltInBaseEntity,entityId:L.HTTP_ENDPOINT},zN={hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:n.Property,private:!1,abstract:!1,static:!0,implements:gl,index:0,dataType:HN,description:null,parent:YN},ZN={type:n.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:n.Project,entityId:z},KN={type:n.CustomEntity,id:mb,version:1,name:"Get given company data by id",description:null,properties:[qN,zN],methods:[FN],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[es],x:0,y:0,parent:ZN},XN={id:"product-prototype-database-property-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-id",entityType:n.Property},QN={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:n.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:n.DataType},eM={like:!1,inferred:!1,id:"product-prototype-database-property-data-type-id",version:1,type:n.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:n.PrimitiveValue,version:1,value:null,name:I.EntityTemplate,valueAsType:nc,autogeneration:null,parent:QN},parent:XN},tM={id:"product-prototype-database-property-parent-ref-id",type:n.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:n.CustomEntity},nM={hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:n.Property,private:!1,abstract:!1,implements:Ni,static:!0,index:0,dataType:eM,description:"The database that the entity belongs to.",parent:tM},rM={type:n.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:n.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},iM={like:!1,inferred:!1,id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:rM},aM={type:n.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:n.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},sM={hidden:!1,required:!0,type:n.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:iM,abstract:!1,parent:aM},oM={type:n.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:n.Project,entityId:z},lM={type:n.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Fe],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[nM,sM],methods:[],x:0,y:0,parent:oM},ea="project-loaded-event-id",Xt="get-bitcoin-price-http-call-operation-id",Tb="get-bitcoin-price-http-call-response-body-id",Ms="validate-bitcoin-price-response-operation-ids",cM={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Tb},dM={type:n.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:n.Operation,entityId:Ms},Eb={id:"validate-bitcoin-data-to-validate-input-map-id",type:n.InputMap,version:1,declaration:er.fixedArguments[1],name:null,description:null,readsValue:cM,defaultValue:null,index:0,parent:dM},uM={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},pM={type:n.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:n.Operation,entityId:Ms},yM={id:"validate-bitcoin-type-to-match-input-map-id",type:n.InputMap,version:1,declaration:er.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:n.PrimitiveValue,version:1,name:I.EntityTemplate,valueAsType:nb,value:null,parent:uM,autogeneration:null},index:0,parent:pM},hM={type:n.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:n.Operation,entityId:Ms},fM={id:"validate-bitcoin-validated-entity-output-map-id",type:n.OutputMap,version:1,declaration:er.fixedReturns[0],writesValues:[],index:0,parent:hM},mM={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:n.GlobalEvent,entityId:ea},TM={type:n.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:n.Operation,entityId:Xt},EM={type:n.Operation,id:Ms,version:1,declaration:er,inputs:[yM,Eb],outputs:[fM],process:null,successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[TM],parent:mM},bM={type:n.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:n.FunctionCall,entityId:Xt},RM={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:n.InputMap,declaration:ka,name:null,description:null,readsValue:null,defaultValue:null,index:0,parent:bM},gM={type:n.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:n.FunctionCall,entityId:Xt},vM={type:n.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:n.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},IM={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:n.InputMap,declaration:qa,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:n.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:I.String,parent:vM,valueAsType:null,autogeneration:null},index:1,parent:gM},DM={type:n.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:n.FunctionCall,entityId:Xt},PM={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:n.InputMap,declaration:Ja,name:null,description:null,readsValue:null,defaultValue:null,index:2,parent:DM},AM={type:n.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:n.FunctionCall,entityId:Xt},OM={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:n.InputMap,declaration:Wa,name:null,description:null,readsValue:null,defaultValue:null,index:3,parent:AM},SM={type:n.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:n.FunctionCall,entityId:Xt},CM={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:n.OutputMap,declaration:Ha,writesValues:[],index:1,parent:SM},BM={type:n.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:n.FunctionCall,entityId:Xt},wM={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:n.OutputMap,declaration:sl,writesValues:[],index:0,parent:BM},_M={type:n.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:n.FunctionCall,entityId:Xt},NM={id:Tb,type:n.OutputMap,version:1,declaration:Di,writesValues:[Eb],index:2,parent:_M},MM={type:n.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:n.FunctionDeclaration,entityId:Xt},VM={type:n.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:n.GlobalEvent,entityId:ea},LM={type:n.Operation,id:Xt,version:1,declaration:Pi,inputs:[RM,IM,PM,OM],outputs:[wM,CM,NM],process:null,parent:VM,calledByError:[],calledByEntry:[MM],calledBySuccess:[],successCalls:[EM],errorCalls:[],error:null,x:0,y:0},$M={type:n.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:n.GlobalEvent,entityId:ea},GM={type:n.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:n.GlobalEvent,entityId:ea},FM={process:null,type:n.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:lc,inputs:[],outputs:[],calledByError:[],calledByEntry:[$M],calledBySuccess:[],parent:GM,successCalls:[],errorCalls:[],error:null,x:0,y:0},UM={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:n.GenericReference,entityType:n.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},xM={type:n.GlobalEvent,id:ea,version:1,name:on.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:as,parent:UM,inputs:[],calls:[FM,LM],x:0,y:0},Lt="abort-execution-func-declaration-id",ta="abort-execution-func-exec-var-declaration-id",Vs="abort-execution-func-small-wait-op-id",cc="abort-execution-func-long-wait-op-id",bb="abort-execution-func-long-wait-process-output-id",Rb="abort-execution-func-exec-var-instance-write-id",gb="abort-execution-func-long-wait-return-stmt-id",vb="abort-execution-func-small-wait-return-stmt-id",jM="abort-execution-func-exec-var-instance-abort-call-id",dc="abort-execution-func-exec-var-instance-abort-internal-call-id",Ib="abort-execution-func-exec-second-wait-op-id",kM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},qM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},JM={like:!1,inferred:!1,id:"short-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:qM},constant:!1,parent:kM},WM={type:n.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:vb},HM={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",dataType:JM,implements:null,readsValue:null,required:!0,index:0,parent:WM},YM={type:n.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Vs},zM={type:n.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},Db={type:n.ReturnStatement,id:vb,version:1,outputs:[HM],calledByError:[],calledByEntry:[],calledBySuccess:[YM],throws:null,x:0,y:0,parent:zM},ZM={type:n.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"second-wait-argument-map-id"},KM={type:n.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:Ib},XM={id:"second-wait-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:I.Number,parent:ZM},index:0,parent:KM},QM={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},e0={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.InternalCall,entityId:dc},t0={id:Ib,type:n.Operation,version:1,declaration:ut,inputs:[XM],outputs:[],process:null,successCalls:[Db],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[e0],error:null,parent:QM},n0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:n.VariableInstance,entityId:Rb},r0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:n.Operation,entityId:Vs},i0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},a0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ta},s0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:n.InternalCall,entityId:dc},o0={id:jM,type:n.VariableInstance,version:1,declaration:a0,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[s0],parent:i0},Pb={id:dc,type:n.InternalCall,version:1,inputs:[],outputs:[],declaration:Vl,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[n0,r0],successCalls:[t0],errorCalls:[],error:null,index:0,parent:o0},l0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},c0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:ta},d0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:Lt},u0={type:n.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ta},p0={type:n.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:n.OutputMap,entityId:bb},uc={id:Rb,type:n.VariableInstance,version:1,declaration:u0,inputs:[],outputs:[],calledByError:[],calledByEntry:[d0],calledBySuccess:[c0],successCalls:[Pb],errorCalls:[],x:0,y:0,readsValue:p0,writesValues:[],internalCalls:[],parent:l0},y0={type:n.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:ta};n.GenericReference,n.DataType;const h0={like:!1,inferred:!1,id:"abort-exec-func-var-decl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Ll,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:y0,defaultValue:null},f0={type:n.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},m0={type:n.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},T0={id:ta,type:n.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:h0,inputs:[],outputs:[],calledByError:[],calledByEntry:[m0],calledBySuccess:[],successCalls:[uc],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:f0},E0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},b0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:n.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},R0={like:!1,inferred:!1,id:"long-wait-return-statement-returned-hello-string-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:b0},constant:!1,parent:E0},g0={type:n.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:n.ReturnStatement,entityId:gb},v0={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:n.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",implements:null,dataType:R0,readsValue:null,required:!0,index:0,parent:g0},I0={type:n.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:cc},D0={type:n.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},Ab={type:n.ReturnStatement,id:gb,version:1,outputs:[v0],calledByError:[],calledByEntry:[],calledBySuccess:[I0],throws:null,x:0,y:0,parent:D0},P0={type:n.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"long-argument-map-id"},Ob={type:n.GenericReference,id:"long-argument-map-parent-ref-id",entityType:n.Operation,entityId:cc},A0={id:"long-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:n.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:I.Number,parent:P0},index:0,parent:Ob},O0={type:n.GenericReference,id:"long-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},S0={type:n.GenericReference,id:"long-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},C0={id:bb,type:n.OutputMap,version:1,declaration:Gl,writesValues:[uc],index:0,parent:Ob},B0={id:cc,type:n.Operation,version:1,declaration:ut,inputs:[A0],outputs:[],process:C0,successCalls:[Ab],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[S0],calledBySuccess:[],error:null,parent:O0},w0={type:n.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"small-wait-argument-map-id"},_0={type:n.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:n.Operation,entityId:Vs},N0={id:"small-wait-argument-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:n.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:I.Number,parent:w0},index:0,parent:_0},M0={type:n.GenericReference,id:"small-wait-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Lt},V0={type:n.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:Lt},L0={id:Vs,type:n.Operation,version:1,declaration:ut,inputs:[N0],outputs:[],process:null,successCalls:[Pb],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[V0],calledBySuccess:[],error:null,parent:M0},$0={type:n.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:n.Project,entityId:z},Sb={id:"abort-execution-func-decl-id",type:n.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[Ab,Db],calls:[L0,T0,uc,B0],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:$0},G0={type:n.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:n.Project,entityId:z},F0={id:"call-execution-abort-func-id",type:n.FunctionCall,version:1,declaration:Sb,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:G0},pc="manual-hello-world-loop-func-decl-id",Cb="manual-hello-world-loop-func-return-statement-id",Qt="manual-hello-world-loop-id",na="manual-hello-world-loop-body-id",yc="manual-hello-world-loop-break-statement-id",ra="manual-hello-world-loop-current-iteration-number-output-map-id",hc="manual-hello-world-loop-previous-iterations-results-output-map-id",fc="assembled-hello-world-text-output-id",Bb="assembled-hello-world-list-output-id",ia="iteration-number-is-equal-or-greater-than-10-condition-id",Ls="join-hello-world-and-number-operation-id",$s="append-string-to-list-operation-id",wb="hello-world-loop-output-map-id",U0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:n.ReturnStatement,entityId:Cb},x0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:n.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},j0={like:!1,inferred:!1,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:x0},k0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:n.OutputMap,entityId:wb},_b={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:n.ReturnDeclaration,name:"Results",description:null,dataType:j0,implements:null,readsValue:k0,required:!0,index:0,parent:U0},q0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:n.Loop,entityId:Qt},J0={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:n.FunctionDeclaration,entityId:pc},Nb={type:n.ReturnStatement,id:Cb,version:1,outputs:[_b],calledByError:[],calledByEntry:[],calledBySuccess:[q0],parent:J0,throws:null,x:0,y:0},W0={type:n.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:n.BreakStatement,entityId:yc},H0={type:n.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:fc},Mb={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,dataType:null,readsValue:H0,implements:null,required:!0,index:0,parent:W0},Y0={type:n.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:ra},z0={type:n.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:n.BreakStatement,entityId:yc},Vb={isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration counter",description:null,implements:null,dataType:null,readsValue:Y0,required:!0,index:1,parent:z0},Z0={type:n.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:n.Condition,entityId:ia},K0={type:n.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:n.Loop,entityId:Qt},Lb={type:n.BreakStatement,id:yc,version:1,outputs:[Mb,Vb],calledByError:[],calledByEntry:[],calledBySuccess:[Z0],parent:K0,throws:null,x:0,y:0},X0={type:n.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:n.ContinueStatement,entityId:"hello-world-loop-continue-statement"},Q0={type:n.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:n.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},e1={like:!1,inferred:!1,id:"hello-world-loop-continue-statement-output-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Q0},t1={type:n.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:n.OutputMap,entityId:fc},$b={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:n.ReturnDeclaration,name:"Iteration result",description:null,implements:null,dataType:e1,readsValue:t1,required:!0,index:0,parent:X0},n1={type:n.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:n.Condition,entityId:ia},r1={type:n.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:n.Loop,entityId:Qt},Gb={type:n.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[$b],calledBySuccess:[],calledByError:[n1],calledByEntry:[],parent:r1,throws:null,x:0,y:0};n.GenericReference,n.InputMap;const i1={type:n.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:n.Operation,entityId:$s},a1={type:n.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:n.OutputMap,entityId:hc},Fb={id:"append-string-to-list-base-string-map-id",type:n.InputMap,version:1,declaration:Qo,name:null,description:null,readsValue:a1,defaultValue:null,index:0,parent:i1},s1={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:$s},o1={id:Bb,type:n.OutputMap,version:1,writesValues:[Mb],declaration:vi,index:0,parent:s1},l1={type:n.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:n.Condition,entityId:ia},c1={type:n.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Bb},d1={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:$s},Ub={id:"latest-string-to-add-input-map-id",version:1,type:n.InputMap,declaration:el,name:null,description:null,readsValue:c1,defaultValue:null,index:1,parent:d1},u1={type:n.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Qt},p1={type:n.Operation,id:$s,declaration:ja,version:1,inputs:[Fb,Ub],outputs:[o1],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[l1],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:u1},y1={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:na},h1={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:n.Loop,entityId:Qt},f1={type:n.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:ra},xb={type:n.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:n.Condition,entityId:ia},m1={id:"current-iteration-number-to-check-map-id",version:1,type:n.InputMap,declaration:jr.fixedArguments[0],name:null,description:null,readsValue:f1,index:1,defaultValue:null,parent:xb},T1={type:n.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:"max-num-iterations-value-map-id"},E1={id:"max-num-iterations-value-map-id",version:1,type:n.InputMap,declaration:jr.fixedArguments[1],name:null,description:null,readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:n.PrimitiveValue,version:1,name:I.Number,value:10,autogeneration:null,valueAsType:null,parent:T1},parent:xb},b1={type:n.Condition,id:ia,version:1,declaration:jr,inputs:[E1,m1],calledByError:[],calledByEntry:[y1],calledBySuccess:[],successCalls:[Lb,p1],errorCalls:[Gb],x:0,y:0,parent:h1},R1={type:n.GenericReference,id:"base-string-map-ref-id",entityType:n.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},g1={type:n.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:n.Operation,entityId:Ls},v1={id:"join-hello-world-and-number-base-string-map-id",type:n.InputMap,version:1,declaration:Ua,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:n.PrimitiveValue,version:1,value:"Hello world ",name:I.String,parent:R1,valueAsType:null,autogeneration:null},index:0,parent:g1},I1={type:n.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:n.Operation,entityId:Ls},D1={id:fc,type:n.OutputMap,version:1,writesValues:[Ub,$b],declaration:vi,index:0,parent:I1},P1={type:n.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:na},A1={type:n.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:ra},O1={type:n.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:n.Operation,entityId:Ls},jb={id:"current-iteration-number-input-map-id",version:1,type:n.InputMap,declaration:xa,name:null,description:null,readsValue:A1,defaultValue:null,index:1,parent:O1},S1={type:n.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Qt},C1={type:n.Operation,id:Ls,declaration:Ii,version:1,inputs:[v1,jb],outputs:[D1],process:null,calledByError:[],calledByEntry:[P1],calledBySuccess:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:S1},B1={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:hc,entityType:n.ArgumentDeclaration},w1={like:!1,inferred:!1,id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:B1},_1={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:n.GenericReference,entityId:na,entityType:n.FunctionDeclaration},N1={id:hc,type:n.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:w1,implements:null,writesValues:[Fb],index:1,parent:_1},M1={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:n.GenericReference,entityId:na,entityType:n.FunctionDeclaration},V1={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:n.GenericReference,entityId:ra,entityType:n.ArgumentDeclaration};n.DataType;const L1={id:ra,type:n.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,implements:dl,dataType:null,writesValues:[jb,Vb],index:0,parent:M1},$1={id:"manual-flow-loop-body-parent-ref-id",type:n.GenericReference,entityId:Qt,entityType:n.Loop},G1={id:na,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[L1,N1],calls:[b1,C1],implements:ul,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:$1},F1={type:n.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:n.Loop,entityId:Qt},kb={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:n.ValueDescriptor,name:"Iteration result",description:null,dataType:null,required:!0,index:0,parent:F1},U1={type:n.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:n.Loop,entityId:Qt},x1={type:n.OutputMap,id:wb,version:1,declaration:kb,writesValues:[_b],index:0,parent:U1},j1={id:"manual-hello-world-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},k1={id:"manual-hello-world-loop-called-by-ref-id",type:n.GenericReference,entityId:pc,entityType:n.FunctionDeclaration},q1={id:Qt,type:n.Loop,version:1,declaration:ll,inputs:[],outputsDeclarations:[kb],outputs:[x1],body:G1,successCalls:[Nb],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[k1],calledBySuccess:[],breakStatements:[Lb],continueStatements:[Gb],x:0,y:0,parent:j1},J1={type:n.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},qb={type:n.FunctionDeclaration,id:pc,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[q1],returnStatements:[Nb],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:J1},W1={type:n.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:n.Project,entityId:z},H1={id:"call-hello-world-loop-id",type:n.FunctionCall,version:1,declaration:qb,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:W1},yn="company-dto-function-declaration-id",mc="company-dto-func-declaration-argument-dcl-id",en="company-dto-function-company-variable-id",Fn="company-dto-function-company-dto-variable-id",Xr="iterate-over-employee-list-loop-id",Jb="iterate-over-employee-list-loop-employee-dto-output-map-id",Tc="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",aa="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",Wb="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",Y1="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",Hb="iterate-over-employee-list-continue-statement-id",Gs="iterate-over-employee-list-loop-body-id",Yb="company-dto-func-declaration-return-statement-id",zb="company-dto-func-declaration-return-decl-id",Zb="company-dto-func-declaration-company-variable-id-output-map-id",Kb="company-dto-func-declaration-company-variable-employess-output-map-id",Xb="company-dto-func-declaration-company-variable-name-output-map-id",z1="company-dto-func-declaration-company-dto-variable-input-map-id",Z1="company-dto-func-declaration-company-dto-variable-employess-input-map-id",K1="company-dto-func-declaration-company-dto-variable-name-input-map-id",Fs="company-dto-func-declaration-owner-variable-id",X1="company-dto-func-declaration-company-dto-variable-owner-input-map-id",Qb="company-dto-func-declaration-company-variable-owner-output-map-id",eR="company-dto-func-declaration-owner-variable-id-output-map-id",Us="company-dto-func-declaration-bank-account-variable-id",Q1="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",tR="company-dto-func-declaration-company-variable-bank-account-output-map-id",nR="company-dto-func-declaration-bank-account-variable-id-output-map-id",eV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:zb},tV={like:!1,inferred:!1,id:"company-dto-func-returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eV},nV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:Yb},rV={type:n.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:Fn},rR={isError:!1,id:zb,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",implements:null,dataType:tV,readsValue:rV,required:!0,index:0,parent:nV},iV={type:n.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Fn},aV={type:n.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},Ec={type:n.ReturnStatement,id:Yb,version:1,outputs:[rR],calledByError:[],calledByEntry:[],calledBySuccess:[iV],throws:null,x:0,y:0,parent:aV},sV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:eR},oV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},iR={id:X1,type:n.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,index:5,readsValue:sV,parent:oV},lV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:nR},cV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},aR={id:Q1,type:n.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,index:4,readsValue:lV,parent:cV},dV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Xb},uV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},sR={id:K1,type:n.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,index:3,readsValue:dV,parent:uV},pV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Jb},yV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},oR={id:Z1,type:n.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,index:2,readsValue:pV,parent:yV},hV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Zb},fV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fn},lR={id:z1,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,index:1,readsValue:hV,parent:fV},mV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},TV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:n.VariableDeclaration,entityId:Us},EV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:n.VariableDeclaration,entityId:Fs},bV={type:n.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:n.VariableDeclaration,entityId:Xr},bc={id:Fn,type:n.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[TV,EV,bV],successCalls:[Ec],errorCalls:[],readsValue:null,writesValues:[rR],inputs:[lR,sR,aR,iR,oR],outputs:[],internalCalls:[],parent:mV,x:0,y:0},or="employee-dto-func-declaration-id",Rc="employee-dto-func-declaration-argument-dcl-id",cR="employee-dto-func-declaration-return-statement-id",dR="employee-dto-func-declaration-return-decl-id",lr="employee-dto-func-declaration-employee-variable-id",cr="employee-dto-func-declaration-employee-dto-variable-id",xs="employee-dto-func-declaration-manager-variable-id",uR="employee-dto-func-declaration-employee-variable-id-output-map-id",pR="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",yR="employee-dto-func-declaration-employee-variable-department-output-map-id",hR="employee-dto-func-declaration-employee-variable-manager-output-map-id",fR="employee-dto-func-declaration-manager-variable-id-output-map-id",RV="employee-dto-func-declaration-employee-dto-variable-input-map-id",gV="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",vV="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",IV="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",DV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:dR},PV={like:!1,inferred:!1,id:"employee-dto-func-returned-employee-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DV},AV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:cR},OV={type:n.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:cr},mR={isError:!1,id:dR,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:PV,implements:null,readsValue:OV,required:!0,index:0,parent:AV},SV={type:n.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:n.Operation,entityId:cr},CV={type:n.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},gc={type:n.ReturnStatement,id:cR,version:1,outputs:[mR],calledByError:[],calledByEntry:[],calledBySuccess:[SV],throws:null,x:0,y:0,parent:CV},BV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:fR},wV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},TR={id:IV,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:BV,parent:wV},_V={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:yR},NV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},ER={id:vV,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:_V,parent:NV},MV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:pR},VV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},bR={id:gV,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:MV,parent:VV},LV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:uR},$V={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:cr},RR={id:RV,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:LV,parent:$V},GV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},FV={type:n.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:xs},UV={id:cr,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[FV],successCalls:[gc],errorCalls:[],readsValue:null,writesValues:[mR],inputs:[RR,bR,ER,TR],outputs:[],internalCalls:[],parent:GV,x:0,y:0},xV={type:n.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:xs},jV={id:fR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[TR],parent:xV},kV={type:n.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:xs},qV={like:!1,inferred:!1,id:"employee-dto-func-manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:kV,defaultValue:null},JV={type:n.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:hR},WV={type:n.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or};n.GenericReference,n.VariableDeclaration;const gR={id:xs,type:n.VariableDeclaration,version:1,name:"Manager",dataType:qV,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[UV],errorCalls:[],readsValue:JV,writesValues:[],inputs:[],outputs:[jV],internalCalls:[],parent:WV,x:0,y:0},HV={type:n.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},YV={id:hR,type:n.OutputMap,version:1,declaration:Ct.properties[2],index:3,writesValues:[gR],parent:HV},zV={type:n.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},ZV={id:yR,type:n.OutputMap,version:1,declaration:Ct.properties[0],index:2,writesValues:[ER],parent:zV},KV={type:n.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},XV={id:pR,type:n.OutputMap,version:1,declaration:yt.properties[1],index:1,writesValues:[bR],parent:KV},QV={type:n.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},eL={id:uR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[RR],parent:QV},tL={type:n.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:lr},nL={like:!1,inferred:!1,id:"employee-dto-func-employee-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:tL,defaultValue:null},rL={type:n.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:or},iL={type:n.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:Rc},aL={type:n.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:or},vR={id:lr,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:nL,description:"A variable holding a company employee",calledByError:[],calledByEntry:[aL],calledBySuccess:[],successCalls:[gR],errorCalls:[],readsValue:iL,writesValues:[],inputs:[],outputs:[eL,XV,ZV,YV],internalCalls:[],parent:rL,x:0,y:0},sL={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Rc,entityType:n.ArgumentDeclaration},oL={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Ct,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,parent:sL,defaultValue:null},lL={type:n.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:or,entityType:n.FunctionDeclaration},cL={type:n.ArgumentDeclaration,id:Rc,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,implements:null,dataType:oL,index:0,writesValues:[vR],parent:lL},dL={type:n.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},vc={type:n.FunctionDeclaration,id:or,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[cL],calls:[vR],implements:null,returnStatements:[gc],collapsed:!1,private:!1,x:0,y:0,parent:dL},uL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:Wb,entityType:n.ReturnDeclaration},pL={like:!1,inferred:!1,id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ct,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:uL},yL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:n.GenericReference,entityId:aa,entityType:n.OutputMap},hL={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:n.GenericReference,entityId:Hb,entityType:n.ContinueStatement},IR={isError:!1,id:Wb,type:n.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:yL,dataType:pL,implements:null,required:!0,index:0,parent:hL},fL={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},mL={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},DR={id:Hb,type:n.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[fL],outputs:[IR],throws:null,x:0,y:0,parent:mL},TL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},EL={id:Y1,type:n.OutputMap,version:1,declaration:gc.outputs[0],writesValues:[IR],index:0,parent:TL},bL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Tc,entityType:n.ArgumentDeclaration},RL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:n.GenericReference,entityId:aa,entityType:n.FunctionCall},PR={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:vc.inputs[0],readsValue:bL,index:0,defaultValue:null,parent:RL},gL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},vL={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},IL={id:aa,type:n.FunctionCall,version:1,declaration:vc,inputs:[PR],process:null,outputs:[EL],calledByError:[],calledByEntry:[gL],calledBySuccess:[],successCalls:[DR],errorCalls:[],error:null,x:0,y:0,parent:vL},DL={type:n.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Tc,entityType:n.ArgumentDeclaration},PL={like:!1,inferred:!1,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ct,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:DL},AL={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Gs,entityType:n.FunctionDeclaration},OL={id:Tc,type:n.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:PL,required:!0,implements:Ya,index:0,writesValues:[PR],parent:AL},SL={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},CL={id:Gs,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[OL],calls:[IL],implements:za,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:SL},BL={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},wL={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Kb,entityType:n.OutputMap},AR={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:tr.fixedArguments[0],defaultValue:null,readsValue:wL,index:0,parent:BL},_L={id:"iterate-over-employee-list-loop-parent-ref-id",type:n.GenericReference,entityId:yn,entityType:n.FunctionDeclaration},NL={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:n.GenericReference,entityId:Xr,entityType:n.Loop},ML={id:Jb,type:n.OutputMap,version:1,declaration:tr.fixedReturns[0],writesValues:[oR],index:0,parent:NL},VL={type:n.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:n.VariableDeclaration,entityId:en},LL={id:Xr,type:n.Loop,version:1,declaration:tr,inputs:[AR],successCalls:[bc],errorCalls:[],outputsDeclarations:[],outputs:[ML],body:CL,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[VL],breakStatements:[],continueStatements:[DR],error:null,x:0,y:0,parent:_L},$L={type:n.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Us},GL={id:nR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[aR],parent:$L},FL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Us},UL={like:!1,inferred:!1,id:"company-dto-func-bank-account-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:FL,defaultValue:null},xL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:tR},jL={type:n.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn};n.GenericReference,n.VariableDeclaration;const OR={id:Us,type:n.VariableDeclaration,version:1,name:"Bank account",dataType:UL,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[bc],errorCalls:[],readsValue:xL,writesValues:[],inputs:[],outputs:[GL],internalCalls:[],parent:jL,x:0,y:0},kL={type:n.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fs},qL={id:eR,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[iR],parent:kL},JL={type:n.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Fs},WL={like:!1,inferred:!1,id:"company-dto-func-owner-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:JL,defaultValue:null},HL={type:n.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:Qb},YL={type:n.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn};n.GenericReference,n.VariableDeclaration;const SR={id:Fs,type:n.VariableDeclaration,version:1,name:"Owner",dataType:WL,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[bc],errorCalls:[],readsValue:HL,writesValues:[],inputs:[],outputs:[qL],internalCalls:[],parent:YL,x:0,y:0},zL={type:n.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},ZL={id:Qb,type:n.OutputMap,version:1,declaration:vt.properties[2],index:4,writesValues:[SR],parent:zL},KL={type:n.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},XL={id:tR,type:n.OutputMap,version:1,declaration:vt.properties[2],index:3,writesValues:[OR],parent:KL},QL={type:n.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},e$={id:Xb,type:n.OutputMap,version:1,declaration:vt.properties[0],index:2,writesValues:[sR],parent:QL},t$={type:n.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},n$={id:Kb,type:n.OutputMap,version:1,declaration:vt.properties[3],index:1,writesValues:[AR],parent:t$},r$={type:n.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},i$={id:Zb,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[lR],parent:r$},a$={type:n.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:en},s$={like:!1,inferred:!1,id:"company-dto-func-company-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:a$,defaultValue:null},o$={type:n.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:yn},l$={type:n.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:mc},c$={type:n.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:n.FunctionDeclaration,entityId:yn},CR={id:en,type:n.VariableDeclaration,version:1,name:"Company",dataType:s$,description:"A variable holding a company",calledByError:[],calledByEntry:[c$],calledBySuccess:[],successCalls:[OR,SR,LL],errorCalls:[],readsValue:l$,writesValues:[],inputs:[],outputs:[i$,n$,e$,XL,ZL],internalCalls:[],parent:o$,x:0,y:0},d$={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:mc,entityType:n.ArgumentDeclaration},u$={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,parent:d$,defaultValue:null},p$={type:n.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:yn,entityType:n.FunctionDeclaration},y$={type:n.ArgumentDeclaration,id:mc,version:1,name:"Company",description:"The company to create a DTO for",required:!0,implements:null,dataType:u$,index:0,writesValues:[CR],parent:p$},h$={type:n.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:n.Project,entityId:z},Ic={type:n.FunctionDeclaration,id:yn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[y$],calls:[CR],implements:null,index:null,returnStatements:[Ec],collapsed:!1,private:!1,x:0,y:0,parent:h$},sa="exec-in-parallel-operation-call-id",oa="exec-sequentially-operation-call-id",ht="concurrency-and-wait-function-declaration-id",BR="concurrency-and-wait-return-statement-id",wR="concurrency-and-wait-return-declaration-id",Dc="exec-in-parallel-argument-map-id",_R="exec-sequentially-argument-map-id",Pc="wait-for-2-seconds-operation-id",NR="wait-for-2-seconds-argument-map-id",Ac="map-company-dto-function-call-id",MR="map-company-dto-function-call-company-dto-output-map-id",la="company-dto-variable-one-id",Oc="company-dto-variable-one-instance-id",f$="company-dto-variable-two-id",m$={type:n.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:wR},T$={like:!1,inferred:!1,id:"returned-company-dto-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:m$},E$={type:n.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:n.ReturnStatement,entityId:BR},b$={type:n.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:la},VR={isError:!1,id:wR,type:n.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:T$,implements:null,readsValue:b$,required:!0,index:0,parent:E$},R$={type:n.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:n.Operation,entityId:Pc},g$={type:n.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},LR={type:n.ReturnStatement,id:BR,version:1,outputs:[VR],calledByError:[],calledByEntry:[],calledBySuccess:[R$],throws:null,x:0,y:0,parent:g$},v$={type:n.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:n.VariableInstance,entityId:Oc},I$={type:n.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:n.VariableInstance,entityId:Oc},D$={type:n.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},$R={id:f$,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[v$],internalCalls:[],writesValues:[VR],readsValue:I$,x:0,y:0,parent:D$},P$={type:n.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:n.VariableDeclaration,entityId:la},A$={type:n.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:la},O$={type:n.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},S$={type:n.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:la},GR={id:Oc,type:n.VariableInstance,version:1,declaration:S$,inputs:[],outputs:[],successCalls:[$R],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[P$],internalCalls:[],writesValues:[$R],readsValue:A$,x:0,y:0,parent:O$},C$={type:n.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:n.FunctionCall,entityId:Ac},B$={type:n.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:n.OutputMap,entityId:MR},w$={type:n.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},FR={id:la,type:n.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[GR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[C$],internalCalls:[],writesValues:[GR],readsValue:B$,x:0,y:0,parent:w$},UR={type:n.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:n.FunctionCall,entityId:Ac},_$={id:"map-company-dto-function-call-company-input-map-id",type:n.InputMap,version:1,declaration:Ic.inputs[0],name:null,description:null,defaultValue:null,index:0,readsValue:null,parent:UR},N$={id:MR,type:n.OutputMap,version:1,declaration:Ec.outputs[0],writesValues:[FR],index:0,parent:UR},M$={id:"map-company-dto-function-call-called-by-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ht},V$={id:"map-company-dto-function-call-parent-ref-id",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:ht},L$={id:Ac,type:n.FunctionCall,version:1,declaration:Ic,successCalls:[FR],process:null,errorCalls:[],inputs:[_$],outputs:[N$],calledByError:[],calledByEntry:[M$],calledBySuccess:[],parent:V$,x:0,y:0,error:null},$$={type:n.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:$E},G$={type:n.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:n.DataType,entityId:"last-timestamp-variable-datatype-id"},F$={like:!1,inferred:!1,id:"last-timestamp-variable-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:cn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:$$,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,name:I.Date,value:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:G$,valueAsType:null}},U$={type:n.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:n.Project,entityId:z},Sc={id:$E,type:n.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:F$,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:U$},x$={type:n.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:NR},j$={type:n.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:n.Operation,entityId:Pc},k$={id:NR,type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:n.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:I.Number,parent:x$},index:0,parent:j$},q$={type:n.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},J$={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:n.FunctionDeclaration,entityId:oa},W$={type:n.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:n.FunctionDeclaration,entityId:sa},xR={id:Pc,type:n.Operation,version:1,declaration:xt,inputs:[k$],outputs:[],process:null,successCalls:[LR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[J$,W$],calledBySuccess:[],error:null,parent:q$},H$={type:n.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:n.InputMap,entityId:"wait-for-random-amount-input-map-id"},Y$={type:n.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:n.Operation,entityId:"wait-for-random-amount-id"},z$={id:"wait-for-random-amount-input-map-id",type:n.InputMap,version:1,declaration:Xn,name:null,description:null,readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:n.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:qe.Random,rangeStart:1e3,rangeEnd:4e3},name:I.Number,parent:H$},index:0,parent:Y$},Z$={type:n.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:n.Project,entityId:z},Qr={id:"wait-for-random-amount-id",type:n.Operation,version:1,declaration:xt,inputs:[z$],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:Z$},jR="list-of-functions-variable-id",K$={type:n.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:jR},X$={id:"list-of-functions-variable-action-descriptor-id",type:n.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:M.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:M.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},Q$={type:n.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:n.DataType,entityId:"list-of-functions-variable-data-type-id"},eG={like:!1,inferred:!1,id:"list-of-functions-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:X$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:n.PrimitiveValue,version:1,name:I.ActionDescriptor,value:null,valueAsType:[Qr,Qr,Qr,Qr,Qr],autogeneration:null,parent:Q$},constant:!1,parent:K$},tG={type:n.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht};n.GenericReference,n.InputMap;const nG={type:n.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:n.InputMap,entityId:_R},rG={type:n.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:n.InputMap,entityId:Dc},kR={id:jR,type:n.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:eG,parent:tG,readsValue:null,writesValues:[nG,rG],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},iG={type:n.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:n.Operation,entityId:sa},aG={type:n.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},sG={type:n.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-in-parallel-return-map-id"},oG={type:n.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:n.Operation,entityId:sa},qR={id:"exec-in-parallel-result-variable-id",type:n.VariableInstance,version:1,declaration:Sc,readsValue:sG,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[oG],successCalls:[],errorCalls:[],internalCalls:[],parent:aG,x:0,y:0},lG={id:"exec-in-parallel-return-map-id",type:n.OutputMap,version:1,declaration:nl,writesValues:[qR],index:0,parent:iG},cG={type:n.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:n.Operation,entityId:sa},dG={id:Dc,type:n.InputMap,version:1,declaration:tl,name:null,description:null,readsValue:kR,defaultValue:null,index:0,parent:cG},uG={type:n.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},pG={type:n.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ht},yG={process:null,id:sa,type:n.Operation,version:1,declaration:xt,inputs:[dG],outputs:[lG],successCalls:[xR,qR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[pG],calledBySuccess:[],error:null,parent:uG},hG={type:n.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:n.Operation,entityId:oa},fG={type:n.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},mG={type:n.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:"exec-sequentially-return-map-id"},TG={type:n.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:n.Operation,entityId:oa},JR={id:"exec-sequentially-result-variable-id",type:n.VariableInstance,version:1,declaration:Sc,readsValue:mG,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[TG],successCalls:[],errorCalls:[],internalCalls:[],parent:fG,x:0,y:0},EG={id:"exec-sequentially-return-map-id",type:n.OutputMap,version:1,declaration:il,writesValues:[JR],index:0,parent:hG},bG={type:n.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:n.Operation,entityId:oa},RG={id:_R,type:n.InputMap,version:1,declaration:rl,name:null,description:null,readsValue:kR,defaultValue:null,index:0,parent:bG},gG={type:n.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ht},vG={type:n.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ht},IG={id:oa,type:n.Operation,version:1,declaration:dn,inputs:[RG],process:null,outputs:[EG],successCalls:[xR,JR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[vG],calledBySuccess:[],error:null,parent:gG},DG={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:z},PG={type:n.FunctionDeclaration,id:ht,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:[IG,yG,L$],returnStatements:[LR],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:DG},AG={type:n.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:n.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},OG={like:!1,inferred:!1,id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:AG},SG={type:n.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:n.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},CG={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:n.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",implements:null,dataType:OG,readsValue:null,required:!0,index:0,parent:SG},BG={type:n.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},wG={type:n.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:n.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},WR={type:n.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[CG],calledByError:[],calledByEntry:[wG],calledBySuccess:[],throws:null,x:0,y:0,parent:BG},_G={type:n.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:n.Project,entityId:z},NG={type:n.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[WR],index:null,implements:null,returnStatements:[WR],collapsed:!1,private:!1,x:0,y:0,parent:_G},Cc="get-current-date-and-time-func-decl-id",HR="get-current-date-and-time-return-statement-id",YR="get-current-date-and-time-return-declaration-id",zR="get-current-date-and-time-return-declaration-data-type-id",MG={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:n.DataType,entityId:zR},VG={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:n.ReturnDeclaration,entityId:YR},LG={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:zR,version:1,entity:cn,asType:!1,isList:!1,isNullable:!1,like:!1,inferred:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:n.PrimitiveValue,version:1,value:null,name:I.Date,valueAsType:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:MG},constant:!1,parent:VG},$G={type:n.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:n.ReturnStatement,entityId:HR};n.ReturnDeclaration;const GG={type:n.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:Cc},FG={type:n.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:n.FunctionDeclaration,entityId:Cc};n.ReturnStatement;const UG={type:n.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:n.Project,entityId:z},xG={type:n.FunctionDeclaration,id:Cc,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:UG},ZR="do-math-return-statement-id",KR="do-math-return-declaration-id",jG={type:n.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:n.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},kG={like:!1,inferred:!1,id:"do-math-func-var-to-return-one-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:jG},qG={type:n.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},JG={type:n.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:n.ReturnDeclaration,entityId:KR},WG={type:n.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:kG,readsValue:null,writesValues:[JG],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:qG},HG={type:n.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:n.ReturnStatement,entityId:ZR},YG={type:n.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:n.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},zG={like:!1,inferred:!1,id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YG},ZG={isError:!1,id:KR,version:1,type:n.ReturnDeclaration,name:"Result",description:null,implements:null,dataType:zG,readsValue:WG,required:!0,index:0,parent:HG},KG={type:n.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},XG={type:n.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},XR={type:n.ReturnStatement,id:ZR,version:1,outputs:[ZG],calledByError:[],calledByEntry:[],calledBySuccess:[KG],parent:XG,throws:null,x:0,y:0},QG={type:n.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:n.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},eF={like:!1,inferred:!1,id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:QG},tF={type:n.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},nF={type:n.GenericReference,id:"do-math-func-return-one-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},rF={type:n.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},QR={type:n.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:eF,description:null,readsValue:rF,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[nF],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:tF},iF={type:n.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},aF={type:n.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:n.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},sF={type:n.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:n.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},oF={like:!1,inferred:!1,id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sF},lF={type:n.GenericReference,id:"do-math-func-return-two-called-by",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},eg={type:n.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lF],successCalls:[],errorCalls:[],dataType:oF,readsValue:aF,writesValues:[],internalCalls:[],parent:iF,x:0,y:0},tg={type:n.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},cF={type:n.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},dF={type:n.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},uF={type:n.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:n.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},ng={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:n.InputMap,declaration:Wo,name:null,description:null,readsValue:uF,defaultValue:null,index:0,parent:dF},pF={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:n.OutputMap,version:1,declaration:Yo,writesValues:[QR,eg],index:0,parent:cF},yF={type:n.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:n.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},hF={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:n.GenericReference,entityType:n.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},rg={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:n.InputMap,declaration:Ho,name:null,description:null,readsValue:hF,defaultValue:null,index:1,parent:yF},fF={type:n.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Fa,version:1,inputs:[ng,rg],outputs:[pF],calledByError:[],calledByEntry:[tg],calledBySuccess:[],process:null,successCalls:[XR,QR,eg],errorCalls:[],parent:tg,error:null,x:0,y:0},mF={type:n.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:n.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},TF={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:n.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:n.ArgumentDeclaration},ig={like:!1,inferred:!1,id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:n.PrimitiveValue,version:1,value:1,name:I.Number,parent:mF,valueAsType:null,autogeneration:null},constant:!1,parent:TF},EF={type:n.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:n.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},bF={type:n.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},RF={type:n.GenericReference,id:"do-math-func-var-called-by-ref",entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},ag={type:n.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:ig,inputs:[],outputs:[],calledByError:[],calledByEntry:[RF],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:EF,writesValues:[rg],internalCalls:[],x:0,y:0,parent:bF},gF={entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:n.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},vF={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:n.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:ig,implements:null,writesValues:[ag],required:!0,index:1,parent:gF},IF={type:n.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:n.Project,entityId:z},DF={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},PF={type:n.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:n.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},AF={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:n.ArgumentDeclaration},OF={like:!1,inferred:!1,id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:n.PrimitiveValue,version:1,value:5,name:I.Number,parent:PF,valueAsType:null,autogeneration:null},constant:!1,parent:AF},SF={id:"d8895765-f705-457e-85fa-25d130926769",type:n.ArgumentDeclaration,version:1,name:"N",dataType:OF,description:"The number to add",implements:null,writesValues:[ng],required:!0,index:0,parent:DF},CF={type:n.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[SF,vF],calls:[fF,ag],implements:null,index:null,collapsed:!1,returnStatements:[XR],private:!1,x:0,y:0,parent:IF},ft="replace-bank-account-in-company-func-declaration-id",Bc="company-entity-to-modify-arg-declaration-id",wc="account-number-to-create-arg-decl-id",ei="company-main-variable-id",ti="search-person-by-id-id",sg="new-bank-account-owner-arg-decl-id",og="search-person-by-id-output-declaration-id",_c="search-person-by-id-output-entity-map-id",ca="person-not-empty-condition-id",js="create-new-bank-account-instance-operation-id",lg="create-new-bank-account-instance-operation-output-entity-map-id",cg="company-bank-account-output-map-id",Nc="old-bank-account-var-declaration-id",dg="old-bank-account-var-instance-id",ug="company-variable-instance-id",Mc="delete-bank-account-internal-call-id",da="new-bank-account-data-variable-declaration-id",BF={type:n.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},wF={type:n.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:n.InternalCall,entityId:Mc},_F={type:n.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:n.VariableDeclaration,entityId:ei},NF={type:n.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:n.VariableInstance,entityId:ug},MF={type:n.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:lg},pg={type:n.InputMap,id:"bank-account-input-map-id",version:1,readsValue:MF,declaration:oc,name:null,description:null,index:0,defaultValue:null,parent:NF},VF={type:n.VariableInstance,id:ug,version:1,declaration:_F,inputs:[pg],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[wF],successCalls:[],errorCalls:[],internalCalls:[],parent:BF,readsValue:null,writesValues:[],x:0,y:0},LF={type:n.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},$F={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:Zr,asType:!1,isList:!1,isNullable:!1,constant:!1,like:!1,inferred:!1,defaultValue:null,parent:LF},GF={type:n.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:cg},FF={type:n.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},UF={type:n.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:n.VariableDeclaration,entityId:ei},xF={type:n.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:n.Operation,entityId:js};n.GenericReference,n.VariableInstance;const jF={type:n.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:n.VariableDeclaration,entityId:Nc},kF={type:n.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:n.VariableDeclaration,entityId:Nc},qF={type:n.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:n.FunctionDeclaration,entityId:ft},JF={type:n.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:n.InternalCall,entityId:Mc},WF={type:n.VariableInstance,id:dg,version:1,declaration:kF,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[JF],errorCalls:[],parent:qF,readsValue:null,writesValues:[],x:0,y:0},yg={process:null,type:n.InternalCall,id:Mc,version:1,declaration:_l,index:0,successCalls:[VF],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[xF,jF],parent:WF},hg={type:n.VariableDeclaration,id:Nc,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:$F,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[UF],successCalls:[yg],internalCalls:[],errorCalls:[],parent:FF,readsValue:GF,writesValues:[],x:0,y:0},HF={type:n.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},YF={type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:vt,asType:!1,isList:!1,isNullable:!1,like:!1,inferred:!1,constant:!1,defaultValue:null,parent:HF},zF={type:n.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:n.ArgumentDeclaration,entityId:Bc},ZF={type:n.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},KF={type:n.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ft},XF={type:n.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ei},QF={id:cg,version:1,type:n.OutputMap,declaration:oc,index:0,parent:XF,writesValues:[hg]},fg={type:n.VariableDeclaration,id:ei,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:YF,inputs:[],outputs:[QF],calledByError:[],calledByEntry:[KF],calledBySuccess:[],successCalls:[hg],errorCalls:[],parent:ZF,internalCalls:[],readsValue:zF,writesValues:[],x:0,y:0},eU={type:n.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:da},tU={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.OutputMap,entityId:_c},mg={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:n.InputMap,declaration:null,name:"Account owner",description:null,readsValue:tU,index:1,defaultValue:null,parent:eU},nU={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:n.GenericReference,entityType:n.ArgumentDeclaration,entityId:wc},rU={type:n.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:da},Tg={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:n.InputMap,declaration:null,name:"Account number",description:null,readsValue:nU,defaultValue:null,index:0,parent:rU},Eg={type:n.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:n.Operation,entityId:js},iU={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:n.InputMap,declaration:Qn.fixedArguments[0],name:null,description:null,index:0,readsValue:null,defaultValue:{type:n.PrimitiveValue,name:I.EntityTemplate,value:null,valueAsType:Zr,autogeneration:null},parent:Eg},aU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-entity-data-input-map-reads-value-ref-id",entityType:n.VariableDeclaration,entityId:da},bg={id:"create-new-bank-account-instance-operation-entity-data-input-map-id",version:1,type:n.InputMap,declaration:Qn.fixedArguments[1],name:null,description:null,index:1,readsValue:aU,defaultValue:null,parent:Eg},sU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:n.Operation,entityId:js},oU={id:lg,version:1,type:n.OutputMap,declaration:Qn.fixedReturns[0],index:0,writesValues:[pg],parent:sU},lU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.Condition,entityId:ca},cU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.VariableDeclaration,entityId:da},dU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},Rg={process:null,id:js,type:n.Operation,version:1,declaration:Qn,inputs:[iU,bg],error:null,outputs:[oU],successCalls:[yg],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[cU,lU],parent:dU,x:0,y:0},uU={type:n.GenericReference,id:"new-bank-account-data-variable-declaration-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},pU={type:n.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:n.Condition,entityId:ca},yU={id:da,type:n.VariableDeclaration,version:1,inputs:[Tg,mg],dataType:null,name:"New bank Account's data",description:null,readsValue:null,outputs:[],writesValues:[bg],successCalls:[Rg],errorCalls:[],internalCalls:[],calledByError:[],calledBySuccess:[pU],calledByEntry:[],x:0,y:0,parent:uU},hU={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:n.DataType},fU={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:n.ReturnDeclaration};n.DataType,n.PrimitiveValue,I.String;const mU={id:"person-not-found-thrown-error-parent-ref-id",type:n.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:n.ReturnStatement},TU={isError:!0,id:"person-not-found-thrown-error-id",type:n.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:mU,implements:null,required:!0,index:0,readsValue:null},EU={id:"person-not-found-error-return-statement-called-by-ref-id",type:n.GenericReference,entityId:ca,entityType:n.Condition},bU={id:"person-not-found-error-return-statement-parent-ref-id",type:n.GenericReference,entityId:ft,entityType:n.FunctionDeclaration},RU={id:"person-not-found-error-return-statement-id",type:n.ReturnStatement,version:1,throws:TU,outputs:[],calledBySuccess:[],calledByError:[EU],calledByEntry:[],x:0,y:0,parent:bU},gU={type:n.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:n.Search,entityId:ti},vU={type:n.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},IU={type:n.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:n.OutputMap,entityId:_c},DU={type:n.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:n.Condition,entityId:ca},gg={id:"person-entity-to-check-map-id",version:1,type:n.InputMap,declaration:nr.fixedArguments[0],name:null,description:null,readsValue:IU,index:0,defaultValue:null,parent:DU},PU={type:n.Condition,id:ca,version:1,declaration:nr,inputs:[gg],calledByError:[],calledByEntry:[],calledBySuccess:[gU],successCalls:[yU,Rg],errorCalls:[RU],x:0,y:0,parent:vU},AU={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:n.ValueDescriptor,entityId:og},OU={like:!1,inferred:!1,id:"search-person-by-id-output-entity-declaration-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:yt,defaultValue:null,parent:AU},SU={type:n.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:n.Search,entityId:ti},vg={id:og,type:n.ValueDescriptor,version:1,dataType:OU,name:"Found person",description:"The person entity that was found",parent:SU,required:!0,index:0},CU={type:n.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:n.Search,entityId:ti},BU={type:n.OutputMap,id:_c,version:1,declaration:vg,parent:CU,writesValues:[gg,mg],index:0},wU={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:n.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:n.ArgumentDeclaration};n.DataType;const _U={type:n.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:n.Search,entityId:ti},Ig={id:"search-person-by-id-input-declaration-id",type:n.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",implements:null,index:0,required:!0,parent:_U,writesValues:[]},NU={type:n.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:n.Search,entityId:ti},MU={id:"search-person-by-id-input-map-reads-value-ref-id",type:n.GenericReference,entityId:sg,entityType:n.ArgumentDeclaration},Dg={type:n.InputMap,id:"search-person-by-id-input-map",version:1,declaration:Ig,name:null,description:null,readsValue:MU,defaultValue:null,parent:NU,index:0},VU={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},LU={type:n.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:n.FunctionDeclaration,entityId:ft},$U={type:n.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:n.FunctionDeclaration,entityId:ft},GU={type:n.Search,id:ti,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:VU,inputsDeclarations:[Ig],inputs:[Dg],outputsDeclarations:[vg],outputs:[BU],calledByError:[],calledByEntry:[$U],calledBySuccess:[],error:null,successCalls:[PU],errorCalls:[],parent:LU,x:0,y:0};n.GenericReference,n.DataType;const FU={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:wc,entityType:n.ArgumentDeclaration},UU={like:!1,inferred:!1,id:"account-number-to-create-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:x,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:FU},xU={entityType:n.FunctionDeclaration,entityId:ft,type:n.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},jU={id:wc,type:n.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:UU,implements:null,writesValues:[Tg],required:!0,index:1,parent:xU};n.GenericReference,n.DataType;const kU={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:n.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:n.ArgumentDeclaration},qU={like:!1,inferred:!1,id:"new-bank-account-owner-arg-decl-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ga,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:kU},JU={entityType:n.FunctionDeclaration,entityId:ft,type:n.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},WU={id:sg,type:n.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:qU,implements:null,writesValues:[Dg],required:!1,index:1,parent:JU},HU={type:n.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:n.Project,entityId:z},YU={type:n.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:n.FunctionDeclaration,entityId:ft};n.GenericReference,n.DataType;const zU={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:n.GenericReference,entityId:Bc,entityType:n.ArgumentDeclaration},ZU={like:!1,inferred:!1,id:"company-entity-to-modify-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:te,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:zU},KU={id:Bc,type:n.ArgumentDeclaration,version:1,name:"Company",dataType:ZU,implements:null,description:"The company to replace the bank account for",writesValues:[fg],required:!0,index:0,parent:YU},XU={type:n.FunctionDeclaration,id:ft,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:[KU,jU,WU],index:null,implements:null,calls:[GU,fg],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:HU},QU={type:n.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},e4={type:n.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:QU,x:0,y:0},t4={type:n.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:n.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},n4={type:n.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:n.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},r4={type:n.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[e4],events:[],implements:n4,parent:t4,x:0,y:0},Vc="global-counted-test-loop-id",Pg="global-counted-test-loop-body-id",Ag="global-counted-test-loop-body-current-iteration-argument-declaration-id",i4={type:n.GenericReference,id:"global-counted-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Ag,entityType:n.ArgumentDeclaration},a4={like:!1,inferred:!1,id:"global-counted-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:i4},s4={id:"global-counted-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Pg,entityType:n.FunctionDeclaration},o4={id:Ag,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:a4,implements:El,required:!0,index:0,writesValues:[],parent:s4},l4={id:"global-counted-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:Vc,entityType:n.Loop},c4={id:Pg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[o4],calls:[],implements:bl,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:l4},ni="random-company-employee-test-variable-id",Lc="manager-global-variable-id",Og="global-user-instance-id",hn="employee-mapped-dto-variable-id",Un="employee-mapped-dto-variable-instance-id",Sg="random-employee-id-output-map-id",Cg="random-employee-birth-date-output-map-id",Bg="random-employee-department-output-map-id",wg="random-employee-manager-output-map-id",_g="manager-global-id-output-map-id",Ng="global-user-instance-id-output-map-id",d4="employee-mapped-dto-requester-id-input-map-id",Mg="employee-mapped-dto-now-timestamp-input-map-id",u4="employee-mapped-dto-id-input-map-id",p4="employee-mapped-dto-birth-date-input-map-id",y4="employee-mapped-dto-department-input-map-id",h4="employee-mapped-dto-manager-input-map-id",f4={id:"global-counted-test-loop-iteration-number-input-map-parent-ref-id",type:n.GenericReference,entityId:Vc,entityType:n.Loop};n.GenericReference,n.VariableDeclaration;const m4={id:"global-counted-test-loop-iteration-number-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Ka.fixedArguments[0],defaultValue:null,readsValue:null,index:0,parent:f4},T4={id:"global-counted-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},E4={id:"global-counted-test-loop-called-by-success-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},b4={id:Vc,type:n.Loop,version:1,declaration:Ka,inputs:[m4],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:c4,calledByError:[],calledByEntry:[],calledBySuccess:[E4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:T4},$c="global-object-keys-test-loop-id",Vg="global-object-keys-test-loop-body-id",Lg="global-object-keys-test-loop-body-current-iteration-argument-declaration-id",R4={type:n.GenericReference,id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Lg,entityType:n.ArgumentDeclaration},g4={like:!1,inferred:!1,id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:R4},v4={id:"global-object-keys-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Vg,entityType:n.FunctionDeclaration},I4={id:Lg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:g4,implements:fl,required:!0,index:0,writesValues:[],parent:v4},D4={id:"global-object-keys-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:$c,entityType:n.Loop},P4={id:Vg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[I4],calls:[],implements:Si,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:D4},A4={id:"global-object-keys-test-loop-iteration-object-input-map-parent-ref-id",type:n.GenericReference,entityId:$c,entityType:n.Loop},O4={id:"global-object-keys-test-loop-iteration-object-input-map-reads-value-ref-id",type:n.GenericReference,entityId:hn,entityType:n.VariableDeclaration},$g={id:"global-object-keys-test-loop-iteration-object-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Si.fixedArguments[0],defaultValue:null,readsValue:O4,index:0,parent:A4},S4={id:"global-object-keys-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},C4={id:"global-object-keys-test-loop-called-by-success-ref-two-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},B4={id:"global-object-keys-test-loop-called-by-success-ref-one-id",type:n.GenericReference,entityId:hn,entityType:n.VariableDeclaration},Gc={id:$c,type:n.Loop,version:1,declaration:Si,inputs:[$g],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:P4,calledByError:[],calledByEntry:[],calledBySuccess:[B4,C4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:S4},Fc="global-object-values-test-loop-id",Gg="global-object-values-test-loop-body-id",Fg="global-object-values-test-loop-body-current-iteration-argument-declaration-id",w4={type:n.GenericReference,id:"global-object-values-test-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:Fg,entityType:n.ArgumentDeclaration},_4={like:!1,inferred:!1,id:"global-object-values-test-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:w4},N4={id:"global-object-values-test-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:Gg,entityType:n.FunctionDeclaration},M4={id:Fg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:_4,implements:ml,required:!0,index:0,writesValues:[],parent:N4},V4={id:"global-object-values-test-loop-body-parent-ref-id",type:n.GenericReference,entityId:Fc,entityType:n.Loop},L4={id:Gg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[M4],calls:[],implements:Bi,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:V4},$4={id:"global-object-values-test-loop-iteration-object-input-map-parent-ref-id",type:n.GenericReference,entityId:Fc,entityType:n.Loop},G4={id:"global-object-values-test-loop-iteration-object-input-map-reads-value-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},Ug={id:"global-object-values-test-loop-iteration-object-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:Bi.fixedArguments[0],defaultValue:null,readsValue:G4,index:0,parent:$4},F4={id:"global-object-values-test-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},U4={id:"global-object-values-test-loop-called-by-success-ref-id",type:n.GenericReference,entityId:Un,entityType:n.VariableDeclaration},xg={id:Fc,type:n.Loop,version:1,declaration:Bi,inputs:[Ug],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:L4,calledByError:[],calledByEntry:[],calledBySuccess:[U4],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:F4},Uc="global-test-iterate-over-string-loop-id",xc="global-test-iterate-over-string-loop-body-id",ks="global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-id",jg="global-test-iterate-over-string-loop-iteration-list-input-map-id",x4={type:n.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:ks,entityType:n.ArgumentDeclaration},j4={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:x4},k4={id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:xc,entityType:n.FunctionDeclaration},q4={id:ks,type:n.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",dataType:j4,implements:pl,required:!0,index:1,writesValues:[],parent:k4},J4={type:n.GenericReference,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:ks,entityType:n.ArgumentDeclaration},W4={like:!1,inferred:!1,id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:J4},H4={id:"global-test-iterate-over-string-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:xc,entityType:n.FunctionDeclaration},Y4={id:ks,type:n.ArgumentDeclaration,version:1,name:"Current character",description:"The current character value being processed.",dataType:W4,implements:yl,required:!0,index:0,writesValues:[],parent:H4},z4={id:"global-test-iterate-over-string-loop-body-parent-ref-id",type:n.GenericReference,entityId:Uc,entityType:n.Loop},Z4={id:xc,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[Y4,q4],calls:[],implements:hl,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:z4},K4={id:"global-test-iterate-over-string-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:Uc,entityType:n.Loop},X4={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-parent-ref-id",type:n.GenericReference,entityId:jg,entityType:n.InputMap},Q4={id:"global-test-iterate-over-string-loop-iteration-list-input-map-default-value-id",type:n.PrimitiveValue,name:I.String,version:1,value:"Hello",valueAsType:null,autogeneration:{type:qe.Random,rangeStart:4,rangeEnd:5},parent:X4},ex={id:jg,type:n.InputMap,version:1,name:null,description:null,declaration:Za.fixedArguments[0],defaultValue:Q4,readsValue:null,index:0,parent:K4},tx={id:"global-test-iterate-over-string-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},nx={id:Uc,type:n.Loop,version:1,declaration:Za,inputs:[ex],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:Z4,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:tx},jc="iterate-over-list-loop-id",kg="iterate-over-list-loop-body-id",qg="iterate-over-list-loop-body-current-iteration-argument-declaration-id",rx={type:n.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:qg,entityType:n.ArgumentDeclaration},ix={like:!1,inferred:!1,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:rx},ax={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:n.GenericReference,entityId:kg,entityType:n.FunctionDeclaration},sx={id:qg,type:n.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:ix,implements:Ya,required:!0,index:0,writesValues:[],parent:ax},ox={id:"iterate-over-list-loop-body-parent-ref-id",type:n.GenericReference,entityId:jc,entityType:n.Loop},lx={id:kg,type:n.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each iteration of the loop.",inputs:[sx],calls:[],implements:za,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:ox},cx={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:n.GenericReference,entityId:jc,entityType:n.Loop},dx={id:"iterate-over-list-loop-iteration-list-input-map-id",type:n.InputMap,version:1,name:null,description:null,declaration:tr.fixedArguments[0],defaultValue:null,readsValue:null,index:0,parent:cx},ux={id:"iterate-over-list-loop-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},px={id:jc,type:n.Loop,version:1,declaration:tr,inputs:[dx],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:lx,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:ux};var kc=(r=>(r.EQ="eq",r.NEQ="neq",r.GT="gt",r.GTE="gte",r.LT="lt",r.LTE="lte",r.LIKE="like",r.ILIKE="ilike",r))(kc||{}),Jg=(r=>(r.COUNT="count",r.SUM="sum",r.AVG="avg",r.MIN="min",r.MAX="max",r))(Jg||{});const yx={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:Jg.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:kc.NEQ,value:null}]},where:[{name:"employee_count",operation:kc.GT,value:1}]},hx={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:n.GenericReference,entityId:z,entityType:n.Project},fx={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},Wg={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:n.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,required:!0,index:0,parent:fx},mx={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:n.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:n.Search},Tx={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:n.OutputMap,version:1,declaration:Wg,writesValues:[],index:0,parent:mx},Ex={id:"find-companies-with-multiple-employees-and-bank-account",type:n.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:[Wg],inputs:[],outputs:[Tx],query:yx,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:hx},bx={type:n.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:_g},Rx={type:n.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Hg={id:h4,type:n.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,index:4,readsValue:bx,parent:Rx},gx={type:n.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Bg},vx={type:n.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Yg={id:y4,type:n.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,index:3,readsValue:gx,parent:vx},Ix={type:n.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Cg},Dx={type:n.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},zg={id:p4,type:n.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,index:2,readsValue:Ix,parent:Dx},Px={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Sg},Ax={type:n.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Zg={id:u4,type:n.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,index:1,readsValue:Px,parent:Ax},Ox={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:n.OutputMap,entityId:Ng},Sx={type:n.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:hn},Kg={id:d4,type:n.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,index:0,readsValue:Ox,parent:Sx},Cx={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:Lc},Bx={id:_g,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Hg],parent:Cx},wx={type:n.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:Lc},_x={like:!1,inferred:!1,id:"manager-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:wx,defaultValue:null},Nx={type:n.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:n.OutputMap,entityId:wg},Mx={type:n.GenericReference,id:"manager-variable-parent-ref-id",entityType:n.Project,entityId:z},Xg={id:Lc,type:n.VariableDeclaration,version:1,name:"Manager",dataType:_x,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:Nx,writesValues:[],inputs:[],outputs:[Bx],internalCalls:[],parent:Mx,x:0,y:0},Vx={type:n.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},Lx={id:wg,type:n.OutputMap,version:1,declaration:Ct.properties[2],index:3,writesValues:[Xg],parent:Vx},$x={type:n.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},Gx={id:Bg,type:n.OutputMap,version:1,declaration:Ct.properties[0],index:2,writesValues:[Yg],parent:$x},Fx={type:n.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},Ux={id:Cg,type:n.OutputMap,version:1,declaration:yt.properties[1],index:1,writesValues:[zg],parent:Fx},xx={type:n.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},jx={id:Sg,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Zg],parent:xx},kx={type:n.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:n.VariableDeclaration,entityId:ni},qx={like:!1,inferred:!1,id:"random-company-employee-test-variable-data-type-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ct,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:kx,defaultValue:null},Jx={type:n.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:n.Project,entityId:z},Wx={id:ni,type:n.VariableDeclaration,version:1,name:"Company employee",dataType:qx,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[jx,Ux,Gx,Lx],internalCalls:[],parent:Jx,x:0,y:0},Hx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:n.InputMap,entityId:Mg},Yx={type:n.PrimitiveValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:I.Date,version:1,valueAsType:null,value:null,autogeneration:{type:qe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:Hx},zx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:n.VariableInstance,entityId:Un},Zx={id:Mg,type:n.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:Yx,index:5,readsValue:null,parent:zx},Kx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:n.VariableDeclaration,entityId:hn},Xx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:n.VariableDeclaration,entityId:Un},Qx={type:n.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:n.Project,entityId:z},e8={id:Un,type:n.VariableInstance,version:1,declaration:Kx,calledByError:[],calledByEntry:[],calledBySuccess:[Xx],successCalls:[Gc,xg],errorCalls:[],readsValue:null,writesValues:[Ug],inputs:[Zx],outputs:[],internalCalls:[],parent:Qx,x:0,y:0},t8={type:n.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:n.Project,entityId:z},n8={id:hn,type:n.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Gc,e8],errorCalls:[],readsValue:null,writesValues:[$g],inputs:[Kg,Zg,zg,Yg,Hg],outputs:[],internalCalls:[],parent:t8,x:0,y:0},r8={type:n.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:n.VariableDeclaration,entityId:tc},i8={like:!1,inferred:!1,id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:rc,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:r8,defaultValue:null},a8={type:n.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:n.Project,entityId:z},Qg={id:tc,type:n.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:i8,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:a8},s8={type:n.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:n.VariableInstance,entityId:Og},o8={id:Ng,type:n.OutputMap,version:1,declaration:Fe.properties[1],index:0,writesValues:[Kg],parent:s8},l8={type:n.GenericReference,id:"global-user-instance-parent-ref-id",entityType:n.Project,entityId:z},c8={id:Og,type:n.VariableInstance,version:1,declaration:Qg,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[o8],internalCalls:[],parent:l8,x:0,y:0},d8={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:n.VariableDeclaration,entityId:tc},u8={type:n.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:n.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},p8={like:!1,inferred:!1,id:"is-test-environment-variable-dcl-datatype-id",type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Sn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:d8,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:I.Boolean,version:1,value:null,type:n.PrimitiveValue,autogeneration:{type:qe.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:u8}},y8={type:n.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:n.Project,entityId:z},ev={id:"is-test-environment-variable-dcl-id",type:n.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:p8,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:y8},h8={type:n.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:n.Project,entityId:z},f8={id:"is-test-environment-variable-instance-id",type:n.VariableInstance,version:1,declaration:ev,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:h8,x:0,y:0},tv={type:n.Project,id:z,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:[r4],entities:[nc,rc,yt,lM,Ct,Ns,tb,nb,Zr,nN,vt,KN,GE,WO,eN],functions:[PG,Sb,vc,NG,xG,qb,Ic,lc,XU,ub,CF],events:[xM],variableDeclarations:[ev,Qg,Sc,Wx,Xg,n8],variableInstances:[f8,c8],conditions:[],operations:[Qr],functionCalls:[F0,H1],loops:[px,Gc,xg,nx,b4],searches:[Ex]};var T=(r=>(r.Error="error",r.Warning="warning",r))(T||{}),D=(r=>(r.InvalidObjectStructure="invalid-object-structure",r.NameNotUniqueInScope="name-not-unique-in-scope",r.EmptyName="empty-name",r.MissingCaller="missing-caller",r.PropertyOverwrite="property-overwrite",r.MethodOverwrite="method-overwrite",r.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",r.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",r.UnreachableEntity="unreachable-entity",r.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",r.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",r.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",r.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",r.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",r))(D||{}),h=(r=>(r.RootReference="root-reference",r.ReferencedEntityNotFound="referenced-entity-not-found",r.EntityIdNotUnique="entity-id-not-unique",r.BuiltInEntityGenerated="built-in-entity-generated",r.BuiltInEntityUpdated="built-in-entity-updated",r.BuiltInEntityDeleted="built-in-entity-deleted",r.UnknownEntityType="unknown-entity-type",r.MissingTypeProperty="missing-type-property",r.MissingIdProperty="missing-id-property",r.BuiltInEntityParent="built-in-entity-parent",r.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",r.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",r.RecommendedImplementOperationAction="recommended-implement-operation-action",r.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",r.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",r.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",r.RecommendedImplementConditionAction="recommended-implement-condition-action",r.InvalidReferenceObjectStructure="invalid-reference-object-structure",r.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",r.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",r.InvalidParentReference="invalid-parent-reference",r.InvalidImplementsReference="invalid-implements-reference",r.InvalidExtendsReference="invalid-extends-reference",r.InvalidGenerationActionPayload="invalid-generation-action-payload",r.InvalidReference="invalid-reference",r.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",r.InvalidUpdateEntityOperation="invalid-update-entity-operation",r.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",r.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",r.UnrecognizedProperty="unrecognized-property",r.SelfReference="self-reference",r.DuplicateReference="duplicate-reference",r.CallerWithIncompatibleScope="caller-with-incompatible-scope",r.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",r.InvalidInputMapDeclaration="invalid-input-map-declaration",r.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",r.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",r.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",r.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",r.OutputOverwrite="output-overwrite",r.InputOverwrite="input-overwrite",r.IncompatibleScope="incompatible-scope",r.InvalidParentUpdate="invalid-parent-update",r.NonInteractiveEntityReferenced="non-interactive-entity-referenced",r.InvalidParentRelationType="invalid-parent-relation-type",r))(h||{}),N=(r=>(r.ScopeWithoutLogic="scope-without-logic",r.ExtendingAbstractEntity="extending-abstract-entity",r.ImplementingNonAbstractEntity="implementing-non-abstract-entity",r.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",r.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",r.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",r.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",r.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",r.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",r.IncorrectEntityImplementation="incorrect-entity-implementation",r.IncorrectMethodImplementation="incorrect-method-implementation",r.IncorrectPropertyImplementation="incorrect-property-implementation",r.PropertyImplementsNonAbstact="property-implements-non-abstract",r.NonStaticPropertyImplementsStatic="non-static-property-implements-static",r.StaticPropertyImplementsNonStatic="static-property-implements-non-static",r.PropertyImplementsIncompatibleType="property-implements-incompatible-type",r.MissingPropertyImplementation="missing-property-implementation",r.MissingMethodImplementation="missing-method-implementation",r.NoProperties="no-properties",r.ReadingFromIncompatibleType="reading-from-incompatible-type",r.WritingToIncompatibleType="writing-to-incompatible-type",r.InvalidPropertiesCombination="invalid-properties-combination",r.DisconnectedCallableEntity="disconnected-callable-entity",r.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",r.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",r.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",r.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",r.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",r.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",r))(N||{});class E{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(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 D?new dr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class dr{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(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 dr({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function m8(r){const e=new Set;return r.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Z(r){const e=r.entity.errors.find(i=>i.id===r.id);return e?{new:!1,error:e}:{new:!0,error:new dr(r)}}function T8(r,e){const t=new Map;return r.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function ae(r,e){const t=[];return e.forEach(i=>{const a=r.find(s=>s.id===i.id);a?t.push(a):t.push(i)}),t}const ua=d.union([d.string(),d.number(),d.boolean(),d.date()]),nv=d.enum([qe.CurrentDateAndTime,qe.Random,qe.Unique]),qs=d.object({type:nv,rangeStart:ua.nullable(),rangeEnd:ua.nullable()}),pa=qs.extend({type:d.literal(qe.Random),rangeStart:ua,rangeEnd:ua}),qc=qs.extend({type:d.literal(qe.Unique),rangeStart:d.null(),rangeEnd:d.null()}),rv=qs.extend({type:d.literal(qe.CurrentDateAndTime),rangeStart:d.null(),rangeEnd:d.null()}),Js=pa.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),iv=Js.extend({rangeStart:d.number(),rangeEnd:d.null()}),av=Js.extend({rangeStart:d.null(),rangeEnd:d.number()}),sv=Js.extend({rangeStart:d.number(),rangeEnd:d.number()}),Ws=pa.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),ov=Ws.extend({rangeStart:d.number(),rangeEnd:d.null()}),lv=Ws.extend({rangeStart:d.null(),rangeEnd:d.number()}),cv=Ws.extend({rangeStart:d.number(),rangeEnd:d.number()}),Hs=pa.extend({rangeStart:d.date().nullable(),rangeEnd:d.date().nullable()}),dv=Hs.extend({rangeStart:d.date(),rangeEnd:d.null()}),uv=Hs.extend({rangeStart:d.null(),rangeEnd:d.date()}),pv=Hs.extend({rangeStart:d.date(),rangeEnd:d.date()}),Jc=pa.extend({rangeStart:d.null(),rangeEnd:d.null()}),Wc=d.union([ov,lv,cv]),Hc=d.union([iv,av,sv]),Yc=d.union([dv,uv,pv,rv]),zc=d.union([Wc,Hc,Yc,qc,Jc]);function ya(){return d.union([d.object({type:d.literal(n.ValueDescriptor)}),d.record(d.string(),d.any())])}function yv(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ValueDescriptor)})}function Zc(){return d.object({id:d.string(),type:d.literal(n.ValueDescriptor),name:d.string(),required:d.boolean()})}function E8(){return Zc().merge(d.object({version:d.number(),index:d.number()}))}function b8(){return Zc().merge(d.object({}))}function R8(){return d.object({dataType:Tn(),parent:xn()})}function g8(){return E8().merge(R8())}function Ys(){return d.union([d.object({type:d.literal(n.PrimitiveEntity)}),d.record(d.string(),d.any())])}function zs(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.PrimitiveEntity)})}function Zs(){return d.object({id:d.string(),type:d.literal(n.PrimitiveEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function v8(){return Zs().merge(d.object({version:d.number()}))}function I8(){return Zs().merge(d.object({}))}function D8(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([Ys(),ri()]))})}function P8(){return v8().merge(D8())}function ur(){return d.union([d.object({type:d.literal(n.Property)}),d.record(d.string(),d.any())])}function hv(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Property)})}function Kc(){return d.object({id:d.string(),type:d.literal(n.Property),name:d.string(),description:d.string().nullable(),private:d.boolean(),static:d.boolean(),required:d.boolean(),abstract:d.boolean()})}function A8(){return Kc().merge(d.object({version:d.number(),index:d.number()}))}function O8(){return Kc().merge(d.object({}))}function S8(){return d.object({dataType:Tn(),implements:ur().nullable(),parent:d.union([fr(),zs(),Ks()])})}function C8(){return A8().merge(S8())}function B8(){return d.enum([L.CRON_JOB,L.EXECUTION,L.HTTP_ENDPOINT,L.PERSISTED_ENTITY,L.RELATIONAL_DATABASE])}function ri(){return d.union([d.object({type:d.literal(n.BuiltInBaseEntity)}),d.record(d.string(),d.any())])}function Ks(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.BuiltInBaseEntity)})}function Xc(){return d.object({id:d.string(),version:d.number(),type:d.literal(n.BuiltInBaseEntity),name:B8(),description:d.string().nullable(),abstract:d.boolean(),static:d.boolean()})}function w8(){return Xc()}function _8(){return Xc().merge(d.object({}))}function N8(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([ri(),Ys()]))})}function M8(){return w8().merge(N8())}function fv(){return d.enum([M.Dynamic,M.Fixed,M.None])}function tn(){return d.union([d.object({type:d.literal(n.ActionDescriptor)}),d.record(d.string(),d.any())])}function xn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ActionDescriptor)})}function Xs(){return d.object({id:d.string(),type:d.literal(n.ActionDescriptor),name:d.string(),description:d.string().nullable(),argumentsType:fv(),returnsType:fv()})}function V8(){return Xs().merge(d.object({version:d.number()}))}function L8(){return Xs().merge(d.object({}))}function $8(){return d.object({fixedArguments:d.array(ya()),fixedReturns:d.array(ya()),dynamicArgumentTypes:Tn().nullable(),dynamicReturnTypes:Tn().nullable(),parent:d.union([It(),fr(),Ks(),zs()]).nullable()})}function mv(){return V8().merge($8())}function ii(){return d.union([d.object({type:d.literal(n.Loop)}),d.record(d.string(),d.any())])}function nn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Loop)})}function Tv(){return d.object({id:d.string(),type:d.literal(n.Loop)})}function G8(){return Tv().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function F8(){return Tv().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function U8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),declaration:tn(),inputs:d.array(Jt()),outputs:d.array(mt()),outputsDeclarations:d.array(ya()),successCalls:d.array(He()),errorCalls:d.array(He()),error:mt(),body:Bt(),parent:d.union([bn(),It()]),breakStatements:d.array(li()),continueStatements:d.array(ai())})}function x8(){return G8().merge(U8())}function ai(){return d.union([d.object({type:d.literal(n.ContinueStatement)}),d.record(d.string(),d.any())])}function si(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ContinueStatement)})}function Qc(){return d.object({id:d.string(),type:d.literal(n.ContinueStatement)})}function j8(){return Qc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function k8(){return Qc().merge(d.object({}))}function q8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:nn()})}function J8(){return j8().merge(q8())}function pr(){return d.union([d.object({type:d.literal(n.ReturnStatement)}),d.record(d.string(),d.any())])}function oi(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ReturnStatement)})}function ed(){return d.object({id:d.string(),type:d.literal(n.ReturnStatement)})}function W8(){return ed().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function H8(){return ed().merge(d.object({}))}function Y8(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:bn()})}function z8(){return W8().merge(Y8())}function fn(){return d.union([d.object({type:d.literal(n.ReturnDeclaration)}),d.record(d.string(),d.any())])}function Ev(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ReturnDeclaration)})}function td(){return d.object({id:d.string(),type:d.literal(n.ReturnDeclaration),name:d.string(),description:d.string().nullable(),isError:d.boolean()})}function Z8(){return td().merge(d.object({version:d.number(),index:d.number()}))}function K8(){return td().merge(d.object({}))}function X8(){return d.object({dataType:Tn().nullable(),readsValue:ba().nullable(),parent:d.union([oi(),xn(),mn(),si()])})}function Q8(){return Z8().merge(X8())}function li(){return d.union([d.object({type:d.literal(n.BreakStatement)}),d.record(d.string(),d.any())])}function mn(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.BreakStatement)})}function nd(){return d.object({id:d.string(),type:d.literal(n.BreakStatement)})}function e6(){return nd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function t6(){return nd().merge(d.object({}))}function n6(){return d.object({calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),outputs:d.array(fn()),throws:d.optional(fn()),parent:nn()})}function r6(){return e6().merge(n6())}function mt(){return d.union([d.object({type:d.literal(n.OutputMap)}),d.record(d.string(),d.any())])}function rd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.OutputMap)})}function id(){return d.object({id:d.string(),type:d.literal(n.OutputMap)})}function i6(){return id().merge(d.object({version:d.number(),index:d.number()}))}function a6(){return id().merge(d.object({}))}function s6(){return d.object({writesValues:d.array(En()),declaration:d.union([fn(),ur()]),parent:d.union([ye(),nn(),mn()])})}function o6(){return i6().merge(s6())}function ci(){return d.union([d.object({type:d.literal(n.FunctionCall)}),d.record(d.string(),d.any())])}function ha(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.FunctionCall)})}function ad(){return d.object({id:d.string(),type:d.literal(n.FunctionCall)})}function l6(){return ad().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function c6(){return ad().merge(d.object({}))}function d6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:Bt(),inputs:d.array(Jt()),outputs:d.array(mt()),error:d.optional(mt()),parent:d.union([bn(),It()])})}function u6(){return l6().merge(d6())}function p6(){return d.enum([Me.Equal,Me.NotEqual,Me.MoreThan,Me.MoreThanOrEqual,Me.LessThan,Me.LessThanOrEqual,Me.And,Me.Or,Mt.Empty,Mt.NotEmpty])}function fa(){return d.union([d.object({type:d.literal(n.Condition)}),d.record(d.string(),d.any())])}function Qs(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Condition)})}function sd(){return d.object({id:d.string(),type:d.literal(n.Condition)})}function y6(){return sd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function h6(){return sd().merge(d.object({}))}function f6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),leftValue:Jt(),rightValue:Jt().nullable(),operator:p6(),parent:d.union([bn(),It()])})}function m6(){return y6().merge(f6())}function ma(){return d.union([d.object({type:d.literal(n.Search)}),d.record(d.string(),d.any())])}function Ta(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Search)})}function od(){return d.object({id:d.string(),type:d.literal(n.Search),name:d.string(),query:d.any(),description:d.string().nullable()})}function T6(){return od().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function E6(){return od().merge(d.object({}))}function b6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),inputsDeclarations:d.array(hr()),inputs:d.array(Jt()),outputsDeclarations:d.array(ya()),outputs:d.array(mt()),parent:d.union([bn(),It()]),error:mt().nullable()})}function R6(){return T6().merge(b6())}function Ea(){return d.union([d.object({type:d.literal(n.InternalCall)}),d.record(d.string(),d.any())])}function ld(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InternalCall)})}function cd(){return d.object({id:d.string(),type:d.literal(n.InternalCall),index:d.number()})}function g6(){return cd().merge(d.object({version:d.number(),index:d.number()}))}function v6(){return cd().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function I6(){return d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:Bt(),inputs:d.array(Jt()),outputs:d.array(mt()),parent:jn(),error:d.optional(mt())})}function D6(){return g6().merge(I6())}function Jt(){return d.union([d.object({type:d.literal(n.InputMap)}),d.record(d.string(),d.any())])}function eo(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InputMap)})}function dd(){return d.object({id:d.string(),type:d.literal(n.InputMap),name:d.string().nullable().optional(),description:d.string().nullable().optional()})}function P6(){return dd().merge(d.object({version:d.number(),index:d.number()}))}function A6(){return dd().merge(d.object({}))}function O6(){return d.object({defaultValue:ud().nullable(),declaration:d.union([hr(),ur()]).nullable(),readsValue:ba().nullable(),parent:d.union([ye(),eo(),nn(),mn()])})}function S6(){return P6().merge(O6())}function di(){return d.union([d.object({type:d.literal(n.Operation)}),d.record(d.string(),d.any())])}function ui(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.Operation)})}function to(){return d.object({id:d.string(),type:d.literal(n.Operation)})}function C6(){return to().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function B6(){return to().merge(d.object({}))}function w6(){return to().merge(d.object({successCalls:d.array(He()),errorCalls:d.array(He()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),writesValues:d.array(En()),declaration:tn(),inputs:d.array(Jt()),outputs:d.array(mt()),error:d.array(mt()),parent:d.union([bn(),It()])}))}function _6(){return C6().merge(w6())}function no(){return d.union([d.string(),d.number(),d.boolean(),d.null(),d.date()])}function bv(){return d.record(d.string(),no())}function N6(){return d.array(d.union([no(),bv()]))}function Rv(){return d.union([no(),bv(),N6()])}function gv(){return d.union([no(),Rv()])}function vv(){return d.enum([I.String,I.Number,I.Boolean,I.Null,I.Date,I.JSON,I.Enum,I.File,I.UUID,I.EntityTemplate,I.ActionDescriptor])}function M6(){return d.union([fr(),ui(),Ra()])}function V6(){return d.object({id:d.string(),name:vv(),type:d.literal(n.PrimitiveValue),value:gv(),autogeneration:zc.nullable()})}function L6(){return V6().merge(d.object({}))}function Wt(){return d.object({id:d.string(),version:d.number(),name:vv(),type:d.literal(n.PrimitiveValue),value:gv(),valueAsType:M6().nullable(),autogeneration:zc.nullable(),parent:d.union([pd(),eo()])})}function $6(){return Wt().extend({name:d.literal(I.String),value:d.string(),autogeneration:Wc.nullable()})}function G6(){return Wt().extend({name:d.literal(I.Number),value:d.number(),autogeneration:Hc.nullable()})}function F6(){return Wt().extend({name:d.literal(I.Boolean),value:d.boolean(),autogeneration:Jc.nullable()})}function U6(){return Wt().extend({name:d.literal(I.Null),value:d.null(),autogeneration:d.null()})}function x6(){return Wt().extend({name:d.literal(I.Date),value:d.date(),autogeneration:Yc.nullable()})}function j6(){return Wt().extend({name:d.literal(I.JSON),value:Rv(),autogeneration:d.null()})}function k6(){return Wt().extend({name:d.literal(I.Enum),value:d.string(),autogeneration:d.null()})}function q6(){return Wt().extend({name:d.literal(I.File),value:d.string(),autogeneration:d.null()})}function J6(){return Wt().extend({name:d.literal(I.UUID),value:d.string(),autogeneration:qc.nullable()})}function W6(){return Wt().extend({name:d.literal(I.EntityTemplate),value:fr(),autogeneration:d.null()})}function H6(){return Wt().extend({name:d.literal(I.ActionDescriptor),value:Ra(),autogeneration:d.null()})}function ud(){return d.union([$6(),G6(),F6(),U6(),x6(),j6(),k6(),q6(),J6(),W6(),H6()])}function Tn(){return d.union([d.object({type:d.literal(n.DataType)}),d.record(d.string(),d.any())])}function pd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.DataType)})}function yd(){return d.object({id:d.string(),type:d.literal(n.DataType),isNullable:d.boolean(),isList:d.boolean(),constant:d.boolean(),asType:d.boolean(),options:d.array(d.string()).optional()})}function Y6(){return yd().merge(d.object({version:d.number()}))}function z6(){return yd().merge(d.object({}))}function Z6(){return d.object({defaultValue:ud().nullable(),entity:d.union([pi(),ri(),Ys(),tn()]).nullable(),parent:d.union([hv(),Pv(),xn(),yv()])})}function K6(){return Y6().merge(Z6())}function hd(){return d.union([d.object({type:d.literal(n.VariableDeclaration)}),d.record(d.string(),d.any())])}function X6(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.VariableDeclaration)})}function fd(){return d.object({id:d.string(),type:d.literal(n.VariableDeclaration),name:d.string(),description:d.string().nullable()})}function Q6(){return fd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function ej(){return fd().merge(d.object({}))}function tj(){return d.object({dataType:Tn().nullable(),readsValue:ba().nullable(),writesValues:d.array(En()),inputs:d.array(Jt()),outputs:d.array(mt()),successCalls:d.array(He()),errorCalls:d.array(He()),internalCalls:d.array(Ea()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),parent:d.union([bn(),It()])})}function nj(){return Q6().merge(tj())}function Iv(){return d.union([d.object({type:d.literal(n.VariableInstance)}),d.record(d.string(),d.any())])}function rj(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.VariableInstance)})}function md(){return d.object({id:d.string(),type:d.literal(n.VariableInstance)})}function ij(){return md().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function aj(){return md().merge(d.object({}))}function sj(){return d.object({declaration:hd(),dataType:Tn().nullable(),readsValue:ba().nullable(),writesValues:d.array(En()),inputs:d.array(Jt()),outputs:d.array(mt()),successCalls:d.array(He()),errorCalls:d.array(He()),internalCalls:d.array(Ea()),calledBySuccess:d.array(ye()),calledByError:d.array(ye()),calledByEntry:d.array(We()),parent:d.union([bn(),It()])})}function oj(){return ij().merge(sj())}function Td(){return d.union([d.object({type:d.literal(n.InstalledProject)}),d.record(d.string(),d.any())])}function ro(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.InstalledProject)})}function lj(){return d.object({id:d.string(),type:d.literal(n.InstalledProject)})}function cj(){return d.object({version:d.number(),x:d.number(),y:d.number()})}function dj(){return d.object({})}function uj(){return d.object({implements:It(),description:d.string().nullable(),functions:d.array(Bt()),events:d.array(Ed()),parent:It()})}function pj(){return cj().merge(uj())}function Ed(){return d.union([d.object({type:d.literal(n.GlobalEvent)}),d.record(d.string(),d.any())])}function yj(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.GlobalEvent)})}function io(){return d.object({id:d.string(),type:d.literal(n.GlobalEvent),name:d.string(),collapsed:d.boolean()})}function hj(){return io().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function fj(){return io().merge(d.object({}))}function mj(){return io().merge(d.object({returnStatements:d.array(pr()),implements:d.array(mv()),inputs:d.array(hr()),calls:d.array(He()),parent:d.union([It(),ro()])}))}function Tj(){return hj().merge(mj())}function yr(){return d.union([hd(),Iv()])}function jn(){return d.union([X6(),rj()])}function En(){return d.union([yr(),Jt(),fn()])}function Dv(){return d.union([jn(),eo(),Ev()])}function ba(){return d.union([yr(),hr(),mt(),di(),Ea(),ci()])}function Ej(){return d.union([jn(),bd(),rd(),ui(),ld(),ha()])}function bj(){return d.union([hr(),mt(),En()])}function Pv(){return d.union([bd(),rd(),Dv()])}function ao(){return Ed()}function so(){return yj()}function oo(){return d.union([di(),ci(),fa(),ma(),yr(),Ea(),ii()])}function ye(){return d.union([ui(),ha(),Qs(),Ta(),jn(),ld(),nn()])}function lo(){return d.union([di(),ci(),fa(),ma(),yr(),ii()])}function co(){return d.union([ui(),ha(),Qs(),Ta(),jn(),nn()])}function Av(){return d.union([oo(),pr(),li(),ai()])}function He(){return d.union([ye(),oi(),mn(),si()])}function Ov(){return d.union([lo(),pr(),li(),ai()])}function Sv(){return d.union([co(),oi(),mn(),si()])}function kn(){return d.union([Bt(),ao()])}function We(){return d.union([Ra(),so()])}function Rj(){return d.union([oo(),kn()])}function gj(){return d.union([ye(),We()])}function vj(){return d.union([lo(),kn()])}function Ij(){return d.union([co(),We()])}function Dj(){return d.union([Av(),kn()])}function Pj(){return d.union([He(),We()])}function Aj(){return d.union([Ov(),kn()])}function Oj(){return d.union([Sv(),We()])}function Sj(){return d.union([kn(),ii()])}function bn(){return d.union([We(),nn()])}function Cj(){return d.union([oo(),kn()])}function Bj(){return d.union([ye(),We()])}function wj(){return d.union([lo(),kn()])}function _j(){return d.union([co(),We()])}function Nj(){return d.union([pr(),li(),ai()])}function Mj(){return d.union([oi(),mn(),si()])}function Vj(){return d.union([ri(),Hj(),Td(),pi(),Bt(),ao(),yr(),Jt(),mt(),fa(),di(),ci(),fn(),hr(),Ys(),Tn(),ur(),tn(),pr(),ai(),li(),ii(),ma(),tn(),tn(),ya(),Ea()])}function Lj(){return d.union([Ks(),It(),ro(),fr(),Ra(),so(),jn(),eo(),rd(),Qs(),ui(),ha(),Ev(),bd(),zs(),pd(),hv(),xn(),oi(),si(),mn(),nn(),Ta(),xn(),xn(),yv(),ld()])}function $j(){return d.union([Td(),pi(),Bt(),ao(),yr(),fa(),di(),ci(),pr(),ai(),li(),ii(),ma()])}function Gj(){return d.union([ro(),fr(),Ra(),so(),jn(),Qs(),ui(),ha(),oi(),si(),mn(),nn(),Ta()])}function hr(){return d.union([d.object({type:d.literal(n.ArgumentDeclaration)}),d.record(d.string(),d.any())])}function bd(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.ArgumentDeclaration)})}function Rd(){return d.object({id:d.string(),type:d.literal(n.ArgumentDeclaration)})}function Fj(){return Rd().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Uj(){return Rd().merge(d.object({}))}function xj(){return d.object({dataType:Tn().nullable(),writesValues:d.array(En()),parent:d.union([We(),xn(),xn(),Ta(),mn()])})}function jj(){return Fj().merge(xj())}function Bt(){return d.union([d.object({type:d.literal(n.FunctionDeclaration)}),d.record(d.string(),d.any())])}function Ra(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.FunctionDeclaration)})}function gd(){return d.object({id:d.string(),type:d.literal(n.FunctionDeclaration),name:d.string(),description:d.string().nullable()})}function kj(){return gd().merge(d.object({version:d.number(),x:d.number(),y:d.number(),index:d.number().nullable()}))}function qj(){return gd()}function Jj(){return d.object({inputs:d.array(hr()),implements:tn().nullable(),returnStatements:d.array(pr()),parent:d.union([It(),ro(),fr(),nn(),Ks(),zs()])})}function Wj(){return kj().merge(Jj())}function Hj(){return d.union([d.object({type:d.literal(n.Project)}),d.record(d.string(),d.any())])}function It(){return d.object({entityType:d.literal(n.Project),entityId:d.string(),id:d.string(),type:d.literal(n.GenericReference)})}function vd(){return d.object({id:d.string(),type:d.literal(n.Project),name:d.string(),description:d.string().nullable()})}function Yj(){return vd().merge(d.object({version:d.number()}))}function zj(){return vd()}function Zj(){return d.object({entities:d.array(pi()),functions:d.array(Bt()),events:d.array(Ed()),projects:d.array(Td()),variableDeclarations:d.array(hd()),variableInstances:d.array(Iv()),conditions:d.array(fa()),operations:d.array(di()),functionCalls:d.array(ci()),loops:d.array(ii()),searches:d.array(ma())})}function Kj(){return Yj().merge(Zj())}function pi(){return d.union([d.object({type:d.literal(n.CustomEntity)}),d.record(d.string(),d.any())])}function fr(){return d.object({id:d.string(),type:d.literal(n.GenericReference),entityId:d.string(),entityType:d.literal(n.CustomEntity)})}function Id(){return d.object({id:d.string(),type:d.literal(n.CustomEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function Xj(){return Id().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Qj(){return Id().merge(d.object({}))}function e9(){return d.union([It(),pd()])}function t9(){return d.object({properties:d.array(ur()),methods:d.array(Bt()),abstractMethods:d.array(tn()),extends:d.array(d.union([pi(),ri()])),implements:d.array(d.union([pi(),ri()])),parent:e9()})}function n9(){return Xj().merge(t9())}function r9(r){const e=n9(),t=r.toJSON();e.safeParse(t).success;const a=r.implements.flatMap(f=>s9(r,f)),s=r.extends.flatMap(f=>o9(r,f)),o=c9(r),l=l9(r);r.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...l];return ae(r.errors,p)}function i9(r,e){const t=e.properties.filter(s=>s.abstract),i=[];let a=[...r.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):i.push(s)}),i}function a9(r,e){const t=e.abstractMethods,i=[];let a=[...r.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):i.push(s)}),i}function s9(r,e){const t=[];if(!e.abstract){const f=Z({id:r.id+"--"+N.ImplementingNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:N.ImplementingNonAbstractEntity,entity:r});return t.push(f.error),t}const i=e.properties.filter(f=>f.abstract),a=[];let s=[...r.properties];i.forEach(f=>{const m=s.find(b=>{var v;return((v=b.implements)==null?void 0:v.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=Z({id:r.id+"--"+N.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:T.Error,code:N.MissingPropertyImplementation,entity:r});t.push(m.error)});const o=[];let l=[...r.methods];e.abstractMethods.forEach(f=>{const m=l.find(b=>{var v;return((v=b.implements)==null?void 0:v.id)===f.id});m?l=l.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=Z({id:r.id+"--"+N.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${r.name}" with id "${r.id}" implements it`,issue:null,severity:T.Error,code:N.MissingMethodImplementation,entity:r});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=Z({id:r.id+"--"+D.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.PropertyOverwrite,entity:r});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=l.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=Z({id:r.id+"--"+D.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.MethodOverwrite,entity:r});t.push(m.error)}),t}function o9(r,e){const t=[],i=[];if(e.abstract){const s=Z({id:r.id+"--"+N.ExtendingAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:N.ExtendingAbstractEntity,entity:r});return t.push(s.error),t}r.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&i.push(s)}),i.length&&i.forEach(s=>{const o=Z({id:r.id+"--"+D.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.PropertyOverwrite,entity:r});t.push(o.error)});const a=[];return r.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=Z({id:r.id+"--"+D.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${r.name}" with id "${r.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:D.MethodOverwrite,entity:r});t.push(o.error)}),t}function l9(r){const e=[];if(!r.properties.length){const t=Z({id:r.id+"--"+N.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:N.NoProperties,entity:r});e.push(t.error)}return r.properties.forEach(t=>{t.validate()}),e}function c9(r){const e=[];if(r.abstract){if(r.methods.length){const t=Z({id:r.id+"--"+N.AbstractEntityWithNonAbstractMethods,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:N.AbstractEntityWithNonAbstractMethods,entity:r});e.push(t.error)}if(r.properties.some(t=>!t.abstract)){const t=Z({id:r.id+"--"+N.AbstractEntityWithNonAbstractProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:N.AbstractEntityWithNonAbstractProperties,entity:r});e.push(t.error),r.properties.forEach(i=>{if(!i.abstract){const a=Z({id:r.id+"--"+N.StaticEntityWithNonStaticProperties+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:N.StaticEntityWithNonStaticProperties,entity:r});e.push(a.error)}})}}else{if(r.abstractMethods.length){const t=Z({id:r.id+"--"+N.AbstractPropertyInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:N.AbstractPropertyInNonAbstractEntity,entity:r});e.push(t.error)}if(r.properties.some(t=>t.abstract)){const t=Z({id:r.id+"--"+N.AbstractMethodInNonAbstractEntity,message:`Entity "${r.name}" with id "${r.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:N.AbstractMethodInNonAbstractEntity,entity:r});e.push(t.error),r.properties.forEach(i=>{if(i.abstract){const a=Z({id:r.id+"--"+N.AbstractMethodInNonAbstractEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:N.AbstractMethodInNonAbstractEntity,entity:r});e.push(a.error)}})}}if(r.static&&r.properties.some(t=>!t.static)){const t=Z({id:r.id+"--"+N.StaticEntityWithNonStaticProperties,message:`Entity "${r.name}" with id "${r.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:N.StaticEntityWithNonStaticProperties,entity:r});e.push(t.error),r.properties.forEach(i=>{if(!i.static){const a=Z({id:r.id+"--"+N.NonStaticPropertyInStaticEntity+"--"+i.id,message:`Property "${i.name}" with id "${i.id}" of entity "${r.name}" with id "${r.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:N.NonStaticPropertyInStaticEntity,entity:r});e.push(a.error)}})}return e}function d9(r){return r instanceof Error&&r.name==="ZodError"&&"issues"in r&&Array.isArray(r.issues)}var u9=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=p9(t)}toString(){return this.message}};function p9(r){if(r){const e=r.cause;if(d9(e))return e.issues}return[]}var y9="; ",Cv="Validation error",h9=": ",f9=", or ";function m9(r,e,t){return e!==null?r.length>0?[e,r].join(t):e:r.length>0?r:Cv}var T9=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function E9(r){return r.length===1?r[0].toString():r.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+b9(t)+'"]';if(!T9.test(t))return e+'["'+t+'"]';const i=e.length===0?"":".";return e+i+t},"")}function b9(r){return r.replace(/"/g,'\\"')}function R9(r){return r.length!==0}function uo(r){const{issue:e,issueSeparator:t,unionSeparator:i,includePath:a}=r;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>uo({issue:p,issueSeparator:t,unionSeparator:i,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(i);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>uo({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>uo({issue:s,issueSeparator:t,unionSeparator:i,includePath:a}))].join(t);if(a&&R9(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 "${E9(e.path)}"`}return e.message}function g9(r,e={}){const{issueSeparator:t=y9,unionSeparator:i=f9,prefixSeparator:a=h9,prefix:s=Cv,includePath:o=!0}=e,l=uo({issue:r,issueSeparator:t,unionSeparator:i,includePath:o}),p=m9(l,s,a);return new u9(p,{cause:new gt([r])})}var Bv="1.13.7",wv=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},po=Array.prototype,Dd=Object.prototype,_v=typeof Symbol<"u"?Symbol.prototype:null,v9=po.push,ga=po.slice,va=Dd.toString,I9=Dd.hasOwnProperty,Nv=typeof ArrayBuffer<"u",D9=typeof DataView<"u",P9=Array.isArray,Mv=Object.keys,Vv=Object.create,Lv=Nv&&ArrayBuffer.isView,A9=isNaN,O9=isFinite,$v=!{toString:null}.propertyIsEnumerable("toString"),Gv=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S9=Math.pow(2,53)-1;function Dt(r,e){return e=e==null?r.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 r.call(this,i);case 1:return r.call(this,arguments[0],i);case 2:return r.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,r.apply(this,s)}}function qn(r){var e=typeof r;return e==="function"||e==="object"&&!!r}function C9(r){return r===null}function Fv(r){return r===void 0}function Uv(r){return r===!0||r===!1||va.call(r)==="[object Boolean]"}function B9(r){return!!(r&&r.nodeType===1)}function ot(r){var e="[object "+r+"]";return function(t){return va.call(t)===e}}const Pd=ot("String"),xv=ot("Number"),w9=ot("Date"),_9=ot("RegExp"),N9=ot("Error"),jv=ot("Symbol"),kv=ot("ArrayBuffer");var qv=ot("Function"),M9=wv.document&&wv.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof M9!="function"&&(qv=function(r){return typeof r=="function"||!1});const Tt=qv,Jv=ot("Object");var Wv=D9&&(!/\[native code\]/.test(String(DataView))||Jv(new DataView(new ArrayBuffer(8)))),Ad=typeof Map<"u"&&Jv(new Map),V9=ot("DataView");function L9(r){return r!=null&&Tt(r.getInt8)&&kv(r.buffer)}const yo=Wv?L9:V9,mr=P9||ot("Array");function Jn(r,e){return r!=null&&I9.call(r,e)}var Od=ot("Arguments");(function(){Od(arguments)||(Od=function(r){return Jn(r,"callee")})})();const Sd=Od;function $9(r){return!jv(r)&&O9(r)&&!isNaN(parseFloat(r))}function Hv(r){return xv(r)&&A9(r)}function Yv(r){return function(){return r}}function zv(r){return function(e){var t=r(e);return typeof t=="number"&&t>=0&&t<=S9}}function Zv(r){return function(e){return e==null?void 0:e[r]}}const ho=Zv("byteLength"),G9=zv(ho);var F9=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function U9(r){return Lv?Lv(r)&&!yo(r):G9(r)&&F9.test(va.call(r))}const Kv=Nv?U9:Yv(!1),Pt=Zv("length");function x9(r){for(var e={},t=r.length,i=0;i<t;++i)e[r[i]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,r.push(a)}}}function Xv(r,e){e=x9(e);var t=Gv.length,i=r.constructor,a=Tt(i)&&i.prototype||Dd,s="constructor";for(Jn(r,s)&&!e.contains(s)&&e.push(s);t--;)s=Gv[t],s in r&&r[s]!==a[s]&&!e.contains(s)&&e.push(s)}function Ze(r){if(!qn(r))return[];if(Mv)return Mv(r);var e=[];for(var t in r)Jn(r,t)&&e.push(t);return $v&&Xv(r,e),e}function Ia(r){if(r==null)return!0;var e=Pt(r);return typeof e=="number"&&(mr(r)||Pd(r)||Sd(r))?e===0:Pt(Ze(r))===0}function Qv(r,e){var t=Ze(e),i=t.length;if(r==null)return!i;for(var a=Object(r),s=0;s<i;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function se(r){if(r instanceof se)return r;if(!(this instanceof se))return new se(r);this._wrapped=r}se.VERSION=Bv,se.prototype.value=function(){return this._wrapped},se.prototype.valueOf=se.prototype.toJSON=se.prototype.value,se.prototype.toString=function(){return String(this._wrapped)};function eI(r){return new Uint8Array(r.buffer||r,r.byteOffset||0,ho(r))}var tI="[object DataView]";function Cd(r,e,t,i){if(r===e)return r!==0||1/r===1/e;if(r==null||e==null)return!1;if(r!==r)return e!==e;var a=typeof r;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:nI(r,e,t,i)}function nI(r,e,t,i){r instanceof se&&(r=r._wrapped),e instanceof se&&(e=e._wrapped);var a=va.call(r);if(a!==va.call(e))return!1;if(Wv&&a=="[object Object]"&&yo(r)){if(!yo(e))return!1;a=tI}switch(a){case"[object RegExp]":case"[object String]":return""+r==""+e;case"[object Number]":return+r!=+r?+e!=+e:+r==0?1/+r===1/e:+r==+e;case"[object Date]":case"[object Boolean]":return+r==+e;case"[object Symbol]":return _v.valueOf.call(r)===_v.valueOf.call(e);case"[object ArrayBuffer]":case tI:return nI(eI(r),eI(e),t,i)}var s=a==="[object Array]";if(!s&&Kv(r)){var o=ho(r);if(o!==ho(e))return!1;if(r.buffer===e.buffer&&r.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof r!="object"||typeof e!="object")return!1;var l=r.constructor,p=e.constructor;if(l!==p&&!(Tt(l)&&l instanceof l&&Tt(p)&&p instanceof p)&&"constructor"in r&&"constructor"in e)return!1}t=t||[],i=i||[];for(var y=t.length;y--;)if(t[y]===r)return i[y]===e;if(t.push(r),i.push(e),s){if(y=r.length,y!==e.length)return!1;for(;y--;)if(!Cd(r[y],e[y],t,i))return!1}else{var f=Ze(r),m;if(y=f.length,Ze(e).length!==y)return!1;for(;y--;)if(m=f[y],!(Jn(e,m)&&Cd(r[m],e[m],t,i)))return!1}return t.pop(),i.pop(),!0}function j9(r,e){return Cd(r,e)}function Da(r){if(!qn(r))return[];var e=[];for(var t in r)e.push(t);return $v&&Xv(r,e),e}function Bd(r){var e=Pt(r);return function(t){if(t==null)return!1;var i=Da(t);if(Pt(i))return!1;for(var a=0;a<e;a++)if(!Tt(t[r[a]]))return!1;return r!==aI||!Tt(t[wd])}}var wd="forEach",rI="has",_d=["clear","delete"],iI=["get",rI,"set"],k9=_d.concat(wd,iI),aI=_d.concat(iI),q9=["add"].concat(_d,wd,rI);const J9=Ad?Bd(k9):ot("Map"),W9=Ad?Bd(aI):ot("WeakMap"),H9=Ad?Bd(q9):ot("Set"),Y9=ot("WeakSet");function yi(r){for(var e=Ze(r),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=r[e[a]];return i}function z9(r){for(var e=Ze(r),t=e.length,i=Array(t),a=0;a<t;a++)i[a]=[e[a],r[e[a]]];return i}function sI(r){for(var e={},t=Ze(r),i=0,a=t.length;i<a;i++)e[r[t[i]]]=t[i];return e}function Nd(r){var e=[];for(var t in r)Tt(r[t])&&e.push(t);return e.sort()}function Md(r,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=r(s),l=o.length,p=0;p<l;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const oI=Md(Da),fo=Md(Ze),lI=Md(Da,!0);function Z9(){return function(){}}function cI(r){if(!qn(r))return{};if(Vv)return Vv(r);var e=Z9();e.prototype=r;var t=new e;return e.prototype=null,t}function K9(r,e){var t=cI(r);return e&&fo(t,e),t}function X9(r){return qn(r)?mr(r)?r.slice():oI({},r):r}function Q9(r,e){return e(r),r}function dI(r){return mr(r)?r:[r]}se.toPath=dI;function Pa(r){return se.toPath(r)}function Vd(r,e){for(var t=e.length,i=0;i<t;i++){if(r==null)return;r=r[e[i]]}return t?r:void 0}function uI(r,e,t){var i=Vd(r,Pa(e));return Fv(i)?t:i}function e3(r,e){e=Pa(e);for(var t=e.length,i=0;i<t;i++){var a=e[i];if(!Jn(r,a))return!1;r=r[a]}return!!t}function Ld(r){return r}function Aa(r){return r=fo({},r),function(e){return Qv(e,r)}}function $d(r){return r=Pa(r),function(e){return Vd(e,r)}}function Oa(r,e,t){if(e===void 0)return r;switch(t??3){case 1:return function(i){return r.call(e,i)};case 3:return function(i,a,s){return r.call(e,i,a,s)};case 4:return function(i,a,s,o){return r.call(e,i,a,s,o)}}return function(){return r.apply(e,arguments)}}function pI(r,e,t){return r==null?Ld:Tt(r)?Oa(r,e,t):qn(r)&&!mr(r)?Aa(r):$d(r)}function Gd(r,e){return pI(r,e,1/0)}se.iteratee=Gd;function At(r,e,t){return se.iteratee!==Gd?se.iteratee(r,e):pI(r,e,t)}function t3(r,e,t){e=At(e,t);for(var i=Ze(r),a=i.length,s={},o=0;o<a;o++){var l=i[o];s[l]=e(r[l],l,r)}return s}function yI(){}function n3(r){return r==null?yI:function(e){return uI(r,e)}}function r3(r,e,t){var i=Array(Math.max(0,r));e=Oa(e,t,1);for(var a=0;a<r;a++)i[a]=e(a);return i}function Fd(r,e){return e==null&&(e=r,r=0),r+Math.floor(Math.random()*(e-r+1))}const Sa=Date.now||function(){return new Date().getTime()};function hI(r){var e=function(s){return r[s]},t="(?:"+Ze(r).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 fI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i3=hI(fI),a3=sI(fI),s3=hI(a3),o3=se.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Ud=/(.)^/,l3={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},c3=/\\|'|\r|\n|\u2028|\u2029/g;function d3(r){return"\\"+l3[r]}var u3=/^\s*(\w|\$)+\s*$/;function p3(r,e,t){!e&&t&&(e=t),e=lI({},e,se.templateSettings);var i=RegExp([(e.escape||Ud).source,(e.interpolate||Ud).source,(e.evaluate||Ud).source].join("|")+"|$","g"),a=0,s="__p+='";r.replace(i,function(y,f,m,b,v){return s+=r.slice(a,v).replace(c3,d3),a=v+y.length,f?s+=`'+
2
2
  ((__t=(`+f+`))==null?'':_.escape(__t))+
3
3
  '`:m?s+=`'+
4
4
  ((__t=(`+m+`))==null?'':__t)+
5
5
  '`:b&&(s+=`';
6
6
  `+b+`
7
7
  __p+='`),y}),s+=`';
8
- `;var o=e.variable;if(o){if(!p3.test(o))throw new Error("variable is not a bare identifier: "+o)}else s=`with(obj||{}){
8
+ `;var o=e.variable;if(o){if(!u3.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
12
  `;var l;try{l=new Function(o,"_",s)}catch(y){throw y.source=s,y}var p=function(y){return l.call(this,y,se)};return p.source="function("+o+`){
13
- `+s+"}",p}function h3(r,e,t){e=Pa(e);var i=e.length;if(!i)return Tt(t)?t.call(r):t;for(var a=0;a<i;a++){var s=r==null?void 0:r[e[a]];s===void 0&&(s=t,a=i),r=Tt(s)?s.call(r):s}return r}var f3=0;function m3(r){var e=++f3+"";return r?r+e:e}function T3(r){var e=se(r);return e._chain=!0,e}function mI(r,e,t,i,a){if(!(i instanceof e))return r.apply(t,a);var s=cI(r.prototype),o=r.apply(s,a);return qn(o)?o:s}var hi=Dt(function(r,e){var t=hi.placeholder,i=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return mI(r,i,this,this,o)};return i});hi.placeholder=se;const TI=Dt(function(r,e,t){if(!Tt(r))throw new TypeError("Bind must be called on a function");var i=Dt(function(a){return mI(r,i,e,this,t.concat(a))});return i}),wt=zv(Pt);function Tr(r,e,t,i){if(i=i||[],!e&&e!==0)e=1/0;else if(e<=0)return i.concat(r);for(var a=i.length,s=0,o=Pt(r);s<o;s++){var l=r[s];if(wt(l)&&(mr(l)||Sd(l)))if(e>1)Tr(l,e-1,t,i),a=i.length;else for(var p=0,y=l.length;p<y;)i[a++]=l[p++];else t||(i[a++]=l)}return i}const E3=Dt(function(r,e){e=Tr(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];r[i]=TI(r[i],r)}return r});function b3(r,e){var t=function(i){var a=t.cache,s=""+(e?e.apply(this,arguments):i);return Jn(a,s)||(a[s]=r.apply(this,arguments)),a[s]};return t.cache={},t}const EI=Dt(function(r,e,t){return setTimeout(function(){return r.apply(null,t)},e)}),R3=hi(EI,se,1);function g3(r,e,t){var i,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:Sa(),i=null,o=r.apply(a,s),i||(a=s=null)},y=function(){var f=Sa();!l&&t.leading===!1&&(l=f);var m=e-(f-l);return a=this,s=arguments,m<=0||m>e?(i&&(clearTimeout(i),i=null),l=f,o=r.apply(a,s),i||(a=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(i),l=0,i=a=s=null},y}function v3(r,e,t){var i,a,s,o,l,p=function(){var f=Sa()-a;e>f?i=setTimeout(p,e-f):(i=null,t||(o=r.apply(l,s)),i||(s=l=null))},y=Dt(function(f){return l=this,s=f,a=Sa(),i||(i=setTimeout(p,e),t&&(o=r.apply(l,s))),o});return y.cancel=function(){clearTimeout(i),i=s=l=null},y}function I3(r,e){return hi(e,r)}function xd(r){return function(){return!r.apply(this,arguments)}}function D3(){var r=arguments,e=r.length-1;return function(){for(var t=e,i=r[e].apply(this,arguments);t--;)i=r[t].call(this,i);return i}}function P3(r,e){return function(){if(--r<1)return e.apply(this,arguments)}}function bI(r,e){var t;return function(){return--r>0&&(t=e.apply(this,arguments)),r<=1&&(e=null),t}}const A3=hi(bI,2);function RI(r,e,t){e=At(e,t);for(var i=Ze(r),a,s=0,o=i.length;s<o;s++)if(a=i[s],e(r[a],a,r))return a}function gI(r){return function(e,t,i){t=At(t,i);for(var a=Pt(e),s=r>0?0:a-1;s>=0&&s<a;s+=r)if(t(e[s],s,e))return s;return-1}}const jd=gI(1),vI=gI(-1);function II(r,e,t,i){t=At(t,i,1);for(var a=t(e),s=0,o=Pt(r);s<o;){var l=Math.floor((s+o)/2);t(r[l])<a?s=l+1:o=l}return s}function DI(r,e,t){return function(i,a,s){var o=0,l=Pt(i);if(typeof s=="number")r>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(i,a),i[s]===a?s:-1;if(a!==a)return s=e(ga.call(i,o,l),Hv),s>=0?s+o:-1;for(s=r>0?o:l-1;s>=0&&s<l;s+=r)if(i[s]===a)return s;return-1}}const PI=DI(1,jd,II),O3=DI(-1,vI);function kd(r,e,t){var i=wt(r)?jd:RI,a=i(r,e,t);if(a!==void 0&&a!==-1)return r[a]}function S3(r,e){return kd(r,Aa(e))}function Rn(r,e,t){e=Oa(e,t);var i,a;if(wt(r))for(i=0,a=r.length;i<a;i++)e(r[i],i,r);else{var s=Ze(r);for(i=0,a=s.length;i<a;i++)e(r[s[i]],s[i],r)}return r}function Er(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=Array(a),o=0;o<a;o++){var l=i?i[o]:o;s[o]=e(r[l],l,r)}return s}function AI(r){var e=function(t,i,a,s){var o=!wt(t)&&Ze(t),l=(o||t).length,p=r>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=r);p>=0&&p<l;p+=r){var y=o?o[p]:p;a=i(a,t[y],y,t)}return a};return function(t,i,a,s){var o=arguments.length>=3;return e(t,Oa(i,s,4),a,o)}}const qd=AI(1),OI=AI(-1);function fi(r,e,t){var i=[];return e=At(e,t),Rn(r,function(a,s,o){e(a,s,o)&&i.push(a)}),i}function C3(r,e,t){return fi(r,xd(At(e)),t)}function SI(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=0;s<a;s++){var o=i?i[s]:s;if(!e(r[o],o,r))return!1}return!0}function CI(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=0;s<a;s++){var o=i?i[s]:s;if(e(r[o],o,r))return!0}return!1}function gn(r,e,t,i){return wt(r)||(r=yi(r)),(typeof t!="number"||i)&&(t=0),PI(r,e,t)>=0}const B3=Dt(function(r,e,t){var i,a;return Tt(e)?a=e:(e=Pa(e),i=e.slice(0,-1),e=e[e.length-1]),Er(r,function(s){var o=a;if(!o){if(i&&i.length&&(s=Vd(s,i)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function Jd(r,e){return Er(r,$d(e))}function w3(r,e){return fi(r,Aa(e))}function BI(r,e,t){var i=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=wt(r)?r:yi(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s>i&&(i=s)}else e=At(e,t),Rn(r,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&i===-1/0)&&(i=y,a=o)});return i}function _3(r,e,t){var i=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=wt(r)?r:yi(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s<i&&(i=s)}else e=At(e,t),Rn(r,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&i===1/0)&&(i=y,a=o)});return i}var N3=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function wI(r){return r?mr(r)?ga.call(r):Pd(r)?r.match(N3):wt(r)?Er(r,Ld):yi(r):[]}function _I(r,e,t){if(e==null||t)return wt(r)||(r=yi(r)),r[Fd(r.length-1)];var i=wI(r),a=Pt(i);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=Fd(o,s),p=i[o];i[o]=i[l],i[l]=p}return i.slice(0,e)}function M3(r){return _I(r,1/0)}function V3(r,e,t){var i=0;return e=At(e,t),Jd(Er(r,function(a,s,o){return{value:a,index:i++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function mo(r,e){return function(t,i,a){var s=e?[[],[]]:{};return i=At(i,a),Rn(t,function(o,l){var p=i(o,l,t);r(s,o,p)}),s}}const L3=mo(function(r,e,t){Jn(r,t)?r[t].push(e):r[t]=[e]}),$3=mo(function(r,e,t){r[t]=e}),G3=mo(function(r,e,t){Jn(r,t)?r[t]++:r[t]=1}),F3=mo(function(r,e,t){r[t?0:1].push(e)},!0);function U3(r){return r==null?0:wt(r)?r.length:Ze(r).length}function x3(r,e,t){return e in t}const NI=Dt(function(r,e){var t={},i=e[0];if(r==null)return t;Tt(i)?(e.length>1&&(i=Oa(i,e[1])),e=Da(r)):(i=x3,e=Tr(e,!1,!1),r=Object(r));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=r[o];i(l,o,r)&&(t[o]=l)}return t}),j3=Dt(function(r,e){var t=e[0],i;return Tt(t)?(t=xd(t),e.length>1&&(i=e[1])):(e=Er(Tr(e,!1,!1),String),t=function(a,s){return!gn(e,s)}),NI(r,t,i)});function MI(r,e,t){return ga.call(r,0,Math.max(0,r.length-(e==null||t?1:e)))}function Wd(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[0]:MI(r,r.length-e)}function To(r,e,t){return ga.call(r,e==null||t?1:e)}function k3(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[r.length-1]:To(r,Math.max(0,r.length-e))}function q3(r){return fi(r,Boolean)}function J3(r,e){return Tr(r,e,!1)}const VI=Dt(function(r,e){return e=Tr(e,!0,!0),fi(r,function(t){return!gn(e,t)})}),W3=Dt(function(r,e){return VI(r,e)});function Hd(r,e,t,i){Uv(e)||(i=t,t=e,e=!1),t!=null&&(t=At(t,i));for(var a=[],s=[],o=0,l=Pt(r);o<l;o++){var p=r[o],y=t?t(p,o,r):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?gn(s,y)||(s.push(y),a.push(p)):gn(a,p)||a.push(p)}return a}const H3=Dt(function(r){return Hd(Tr(r,!0,!0))});function Y3(r){for(var e=[],t=arguments.length,i=0,a=Pt(r);i<a;i++){var s=r[i];if(!gn(e,s)){var o;for(o=1;o<t&&gn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Yd(r){for(var e=r&&BI(r,Pt).length||0,t=Array(e),i=0;i<e;i++)t[i]=Jd(r,i);return t}const z3=Dt(Yd);function Z3(r,e){for(var t={},i=0,a=Pt(r);i<a;i++)e?t[r[i]]=e[i]:t[r[i][0]]=r[i][1];return t}function K3(r,e,t){e==null&&(e=r||0,r=0),t||(t=e<r?-1:1);for(var i=Math.max(Math.ceil((e-r)/t),0),a=Array(i),s=0;s<i;s++,r+=t)a[s]=r;return a}function X3(r,e){if(e==null||e<1)return[];for(var t=[],i=0,a=r.length;i<a;)t.push(ga.call(r,i,i+=e));return t}function zd(r,e){return r._chain?se(e).chain():e}function LI(r){return Rn(Nd(r),function(e){var t=se[e]=r[e];se.prototype[e]=function(){var i=[this._wrapped];return I9.apply(i,arguments),zd(this,t.apply(se,i))}}),se}Rn(["pop","push","reverse","shift","sort","splice","unshift"],function(r){var e=po[r];se.prototype[r]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(r==="shift"||r==="splice")&&t.length===0&&delete t[0]),zd(this,t)}}),Rn(["concat","join","slice"],function(r){var e=po[r];se.prototype[r]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),zd(this,t)}});var $I=LI(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Bv,after:P3,all:SI,allKeys:Da,any:CI,assign:fo,before:bI,bind:TI,bindAll:E3,chain:T3,chunk:X3,clone:Q9,collect:Er,compact:q3,compose:D3,constant:Yv,contains:gn,countBy:G3,create:X9,debounce:v3,default:se,defaults:lI,defer:R3,delay:EI,detect:kd,difference:VI,drop:To,each:Rn,escape:a3,every:SI,extend:oI,extendOwn:fo,filter:fi,find:kd,findIndex:jd,findKey:RI,findLastIndex:vI,findWhere:S3,first:Wd,flatten:J3,foldl:qd,foldr:OI,forEach:Rn,functions:Nd,get:uI,groupBy:L3,has:t3,head:Wd,identity:Ld,include:gn,includes:gn,indexBy:$3,indexOf:PI,initial:MI,inject:qd,intersection:Y3,invert:sI,invoke:B3,isArguments:Sd,isArray:mr,isArrayBuffer:kv,isBoolean:Uv,isDataView:yo,isDate:_9,isElement:w9,isEmpty:Ia,isEqual:k9,isError:M9,isFinite:G9,isFunction:Tt,isMap:W9,isMatch:Qv,isNaN:Hv,isNull:B9,isNumber:xv,isObject:qn,isRegExp:N9,isSet:Y9,isString:Pd,isSymbol:jv,isTypedArray:Kv,isUndefined:Fv,isWeakMap:H9,isWeakSet:z9,iteratee:Gd,keys:Ze,last:k3,lastIndexOf:O3,map:Er,mapObject:n3,matcher:Aa,matches:Aa,max:BI,memoize:b3,methods:Nd,min:_3,mixin:LI,negate:xd,noop:yI,now:Sa,object:Z3,omit:j3,once:A3,pairs:Z9,partial:hi,partition:F3,pick:NI,pluck:Jd,property:$d,propertyOf:r3,random:Fd,range:K3,reduce:qd,reduceRight:OI,reject:C3,rest:To,restArguments:Dt,result:h3,sample:_I,select:fi,shuffle:M3,size:U3,some:CI,sortBy:V3,sortedIndex:II,tail:To,take:Wd,tap:e3,template:y3,templateSettings:l3,throttle:g3,times:i3,toArray:wI,toPath:dI,transpose:Yd,unescape:o3,union:H3,uniq:Hd,unique:Hd,uniqueId:m3,unzip:Yd,values:yi,where:w3,without:W3,wrap:I3,zip:z3},Symbol.toStringTag,{value:"Module"})));$I._=$I;function Eo(r){return r.charAt(0).toUpperCase()+r.slice(1)}function GI(r){return r.charAt(0).toLowerCase()+r.slice(1)}function FI(r,e){if(r.type!==n.Property||e.type!==n.Property)throw new Error(`Expected property entities for comparison. But got ${r.type} and ${e.type}.`);return r===e||r.id===e.id?!0:r.name!==e.name||r.static!==e.static||r.abstract!==e.abstract?!1:Ht(r.dataType,e.dataType).compatible}function UI(r,e){if(r.type!==n.CustomEntity||e.type!==n.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${r.type} and ${e.type}.`);if(r===e||r.id===e.id)return!0;if(r.properties.length!==e.properties.length)return!1;let t=[...e.properties];const i=[];for(let a=0;a<r.properties.length;a++){const s=r.properties[a];t.find(l=>{const p=FI(s,l);return p&&(t=t.filter(y=>y.id!==l.id)),p})||i.push(s)}return!(i.length>0)}var $t=(r=>(r.BothUnconstrained="both-unconstrained",r.AConstraintBUnconstrained="a-constraint-b-unconstrained",r.BConstraintAUnconstrained="b-constraint-a-unconstrained",r.Same="same",r.AIsListBIsNot="a-is-list-b-is-not",r.BIsListAIsNot="b-is-list-a-is-not",r.AIsNullableBIsNot="a-is-nullable-b-is-not",r.BIsNullableAIsNot="b-is-nullable-a-is-not",r.AIsTemplateBIsNot="a-is-template-b-is-not",r.BIsTemplateAIsNot="b-is-template-a-is-not",r.BothUntyped="both-untyped",r.AIsUntypedBIsNot="a-is-untyped-b-is-not",r.BIsUntypedAIsNot="b-is-untyped-a-is-not",r.TypeEntityMismatch="type-entity-mismatch",r.SameCustomEntities="same-custom-entities",r.CompatibleCustomEntities="compatible-custom-entities",r.IncompatibleCustomEntities="incompatible-custom-entities",r.SamePrimitiveEntities="same-primitive-entities",r.IncompatiblePrimitiveEntities="incompatible-primitive-entities",r.SameBuiltInBaseEntities="same-built-in-base-entities",r.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",r.CheckUnknown="check-unknown",r))($t||{});function Ht(r,e){var t,i,a,s,o,l,p,y,f,m,b;if(r&&r.type!==n.DataType||e&&e.type!==n.DataType)throw new Error(`Expected data-type entities for comparison. But got ${r==null?void 0:r.type} and ${e==null?void 0:e.type}.`);if(r===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(r===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(r===e)return{compatible:!0,type:"same"};if(r.id===e.id)return{compatible:!0,type:"same"};if(r.isList!==e.isList)return{compatible:!1,type:r.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(r.isNullable!==e.isNullable)return{compatible:!1,type:r.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(r.asType!==e.asType)return{compatible:!1,type:r.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!r.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(r.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!r.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=r.entity)==null?void 0:t.type)!==((i=e.entity)==null?void 0:i.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=r.entity)==null?void 0:a.type)===n.CustomEntity){if(((s=r.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const v=UI(r.entity,e.entity);return{compatible:v,type:v?"compatible-custom-entities":"incompatible-custom-entities"}}return((l=r.entity)==null?void 0:l.type)===n.PrimitiveEntity?((p=r.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=r.entity)==null?void 0:f.type)===n.BuiltInBaseEntity?((m=r.entity)==null?void 0:m.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 Q3(r){const e=r.project.builtInBaseEntities.find(a=>a.id===L.EXECUTION),t={id:r.id+"--infered-data-type",version:1,type:n.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},i=R(t,r.project);return i.inferred=!0,i.sync(t),i.setParent(r),i.entity=e,i}function xI(r){return r.dataType?r.dataType:null}function jI(r){var e;return(e=r.declaration)!=null&&e.dataType?r.declaration.dataType:r.readsValue?rn(r.readsValue):null}function Zd(r){return r.dataType&&!r.dataType.inferred&&r.dataType.isResolved()?r.dataType:r.readsValue?rn(r.readsValue):null}function kI(r){return rn(r.declaration)}function qI(r){return r.dataType&&!r.dataType.inferred?r.dataType:(r.dataType&&r.dataType.inferred,r.inferDataTypeAndSyncInstancesInputsAndOutputs(),r.dataType)}function JI(r){var e;return((e=r.declaration)==null?void 0:e.dataType)||null}function rn(r){switch(r.type){case n.VariableDeclaration:return qI(r);case n.ArgumentDeclaration:return xI(r);case n.ReturnDeclaration:return Zd(r);case n.VariableInstance:return kI(r);case n.InputMap:return jI(r);case n.OutputMap:return JI(r);default:throw new Error(`Cannot infer data type from entity of type ${r.type}.`)}}function bo(r){switch(r.type){case n.ArgumentDeclaration:return r.getDataType();case n.InputMap:return r.getDataType();case n.VariableDeclaration:return r.getDataType();case n.VariableInstance:return r.getDataType();case n.OutputMap:return r.getDataType();case n.ReturnDeclaration:return r.getDataType();case n.Property:return r.getDataType();case n.ValueDescriptor:return r.getDataType();default:return null}}function w(r){if(r){let e=null;return typeof r=="string"?e=r:r.entityId?e=r.entityId:r.type!==n.GenericReference&&(e=r.id),e}return null}function br(r){return r.declaration||r}function e5(r){return r.type===n.VariableDeclaration?r.parent===r.project?"global-declaration":"local-declaration":r.declaration.parent===r.project?"global-instance":"local-instance"}function Kd(r,e){const t=[];if(r.type===n.Project)t.push(...r.variableDeclarations);else{const a=bt(Be(r)).filter(s=>s.type===n.VariableDeclaration);t.push(...a),r.parent&&(dt.includes(r.parent.type)||r.parent.type===n.Project)&&t.push(...Kd(r.parent))}return t}function t5(r){return r.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function n5(r){return r.split(/\s+/).map(i=>i[0].toUpperCase()+i.slice(1).toLowerCase()).join("")}function WI(r){var e;return(e=r.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 Ro(r){return WI(r).toLowerCase()}function Rr(r,e=!0){if(!(r!=null&&r.dataType))return"Any data type";if(!r.dataType.entity)return r.dataType.isList?"List of an unknown data type":"Unknown data type";if(r.dataType.entity.type===n.PrimitiveEntity){let t=r.dataType.entity.name;switch(r.dataType.entity.name){case I.String:t="Text";break;case I.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=r.dataType.entity.name;break}return r.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return r.dataType.isList?`List of ${r.dataType.entity.name} entities`:`${r.dataType.entity.name.slice(0,1).toUpperCase()+r.dataType.entity.name.slice(1)} entity`}function HI(r){return Rr(r.declaration)}function r5(r){return r.type===n.VariableInstance?HI(r):Rr(r)}function YI(r){if(!r)return"Any data type";if(!r.entity)return"Inherited";if(r.entity.type===n.PrimitiveEntity){const e=r.entity.name===I.String?"Text":r.entity.name;return r.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(r.entity.type===n.CustomEntity){const e=Qd(r.entity);return r.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(r.entity.type===n.BuiltInBaseEntity){const e=Xd(r.entity);return r.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return r.isList?`List of ${r.entity.name} entities`:`${r.entity.name.slice(0,1).toUpperCase()+r.entity.name.slice(1)} entity`}function zI(r){if(!r.dataType)return"Any data type";if(!r.dataType.entity)return"Inherited";if(r.dataType.entity.type===n.PrimitiveEntity){const e=r.dataType.entity.name===I.String?"Text":r.dataType.entity.name;return r.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(r.dataType.entity.type===n.CustomEntity){const e=Qd(r.dataType.entity);return r.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(r.dataType.entity.type===n.BuiltInBaseEntity){const e=Xd(r.dataType.entity);return r.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return r.dataType.isList?`List of ${r.dataType.entity.name} entities`:`${r.dataType.entity.name.slice(0,1).toUpperCase()+r.dataType.entity.name.slice(1)} entity`}function ZI(r){switch(r.type){case n.Property:return zI(r);case n.VariableDeclaration:return Rr(r);case n.ArgumentDeclaration:return Rr(r,!1);case n.InputMap:{const e=r.declaration;return e?ZI(e):"Unknown data type"}case n.ReturnDeclaration:return Rr(r,!1);case n.OutputMap:{const e=r.declaration;return Rr(e,!1)}}return"Unknown data type"}function go(r){switch(r.declaration.id){case Me.Equal:return"is equal to";case Me.NotEqual:return"is not equal to";case Me.MoreThan:return"is greater than";case Me.MoreThanOrEqual:return"is greater than or equal to";case Me.LessThan:return"is less than";case Me.LessThanOrEqual:return"is less than or equal to";case Me.And:return"and";case Me.Or:return"or";case Mt.Empty:return"is empty";case Mt.NotEmpty:return"is not empty"}}function KI(r){return r.includes(L.HTTP_ENDPOINT)?"HTTP endpoint":r.includes(L.PERSISTED_ENTITY)?"Persisted entity":r.includes(L.CRON_JOB)?"Scheduled execution":r.includes(L.RELATIONAL_DATABASE)?"Relational database":"Entity"}function Xd(r){switch(r.name){case L.HTTP_ENDPOINT:return"HTTP endpoint";case L.PERSISTED_ENTITY:return"Persisted entity";case L.CRON_JOB:return"Scheduled execution";case L.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function Qd(r){const e=MD(r);if(!e){const t=_D(r);return t.includes(L.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(L.PERSISTED_ENTITY)?"Persisted entity":t.includes(L.CRON_JOB)?"Scheduled execution":t.includes(L.RELATIONAL_DATABASE)?"Relational database":S(r,r.project)+" entity"}return S(e,r.project)+" entity"}function XI(r){let e="Find ";return r.outputsDeclarations.forEach((t,i)=>{const a=bo(t),s=GI(a&&a.entity?S(a.entity,r.project):"unstructured data");i===0?e+=`${s} `:i===r.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function QI(r){switch(r.name){case I.String:return"Text";case I.Number:return"Number";case I.Boolean:return"Boolean";case I.JSON:return"Data structure";case I.UUID:return"Unique identifier";case I.Date:return"Date";case I.EntityTemplate:return"Entity as template";case I.Enum:return"Enumeration";case I.File:return"File";case I.Null:return"Empty";case I.ActionDescriptor:return"Action descriptor";default:return r.name}}function eD(r){switch(r.id){case q.List:return"Loop over list items";case q.ManualFlow:return"Manual flow control loop";case q.ObjectKeys:return"Loop over object keys";case q.ObjectValues:return"Loop over object values";case q.Counted:return"Loop given number of times";case q.String:return"Loop over text characters";case ct.Addition:return"Sum numbers";case ct.Substraction:return"Subtract numbers";case ct.Multiplication:return"Multiply numbers";case ct.Division:return"Divide numbers";case ct.Remainder:return"Get remainder of numbers";case ct.Exponentiation:return"Get exponent of numbers";case Ce.AddIndex:return"Add at index position";case Ce.DeleteFirst:return"Delete first character";case Ce.DeleteLast:return"Delete last character";case Ce.DeleteIndex:return"Delete at index position";case Ce.Join:return"Join texts";case Ce.ReplaceAllMatches:return"Replace all matches";case Ce.ReplaceFirst:return"Replace first match";case Ce.ReplaceLast:return"Replace last match";case Ce.Split:return"Split text";case Ce.ReplaceIndex:return"Replace at index position";case Ce.ReplaceSingleMatch:return"Replace single match";case Ce.GetFirst:return"Get first character";case Ce.GetLast:return"Get last character";case Ce.GetIndex:return"Get at index position";case Ce.Append:return"Add at the end";case Ce.Prepend:return"Add at the start";case we.Wait:return"Wait";case we.Parallel:return"Run in parallel";case we.Sequential:return"Run in sequence";case Qe.HttpRequest:return"HTTP request";case Xe.CreateNewInstance:return"Create new copy of entity";case Y.AddIndex:return"Add item at index position";case Y.DeleteFirst:return"Delete first item";case Y.DeleteLast:return"Delete last item";case Y.DeleteIndex:return"Delete item at index position";case Y.Join:return"Join lists";case Y.ReplaceAllMatches:return"Replace all matches";case Y.ReplaceFirst:return"Replace first match";case Y.ReplaceLast:return"Replace last match";case Y.Split:return"Split list";case Y.ReplaceIndex:return"Replace at index position";case Y.ReplaceSingleMatch:return"Replace single match";case Y.GetFirst:return"Get first item";case Y.GetLast:return"Get last item";case Y.GetIndex:return"Get item at index position";case Y.Append:return"Add item at the end";case Y.Prepend:return"Add item at the start";case on.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(r.name.slice(0,1).toUpperCase()+r.name.slice(1)).replaceAll("-"," ")}}function S(r,e){var t;if(n.FunctionDeclaration===r.type){const i=r.name;if(Object.values(St).includes(i))switch(i){case St.AbortExecution:return"Abort execution";case St.DeletePersistedEntity:return"Delete persisted entity";case St.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Eo(r.type).replaceAll("-"," ")}return i}if(n.BuiltInBaseEntity===r.type)return KI([r.name]);if(_u.includes(r.type)&&r.type!==n.ActionDescriptor)return r.name;switch(r.type){case n.Search:return XI(r);case n.Operation:case n.InternalCall:case n.Loop:const i=Nt(r.declaration,e);return S(i,e);case n.ActionDescriptor:return eD(r);case n.BreakStatement:const a=Nt(r.parent,e);return`Stop loop ${S(a,e)}`;case n.ContinueStatement:const s=Nt(r.parent,e);return`Execute next iteration of ${S(s,e)}`;case n.FunctionCall:return Nt(r.declaration,e).name;case n.Condition:{const l=r;if((t=r.inputs)!=null&&t.length){const p=S(l.inputs[0],l.project);if(l.inputs[1]){const y=l.inputs[1].declaration.name;return`If ${p} ${go(l)} ${y}`}return`If ${p} ${go(l)}`}else return`If ${go(l)}`}case n.ReturnStatement:{const l=Nt(r.parent,e);return`Output of ${S(l,e)}`}case n.InputMap:if(r.declaration){const l=Nt(r.declaration,e);return S(l,e)||""}else return r.name||"";case n.VariableInstance:{const l=Nt(r.declaration,e);return S(l,e)||""}case n.OutputMap:if(r.declaration){const l=Nt(r.declaration,e);return(l==null?void 0:l.name)||""}else return"";case n.PrimitiveEntity:case n.PrimitiveValue:return QI(r);default:return Eo(r.type).replaceAll("-"," ")}}function vo(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=e.entities.filter(a=>a.name===r.name);return i.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in the project. Entity with id "${i[0].id}" has the same name.
13
+ `+s+"}",p}function y3(r,e,t){e=Pa(e);var i=e.length;if(!i)return Tt(t)?t.call(r):t;for(var a=0;a<i;a++){var s=r==null?void 0:r[e[a]];s===void 0&&(s=t,a=i),r=Tt(s)?s.call(r):s}return r}var h3=0;function f3(r){var e=++h3+"";return r?r+e:e}function m3(r){var e=se(r);return e._chain=!0,e}function mI(r,e,t,i,a){if(!(i instanceof e))return r.apply(t,a);var s=cI(r.prototype),o=r.apply(s,a);return qn(o)?o:s}var hi=Dt(function(r,e){var t=hi.placeholder,i=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return mI(r,i,this,this,o)};return i});hi.placeholder=se;const TI=Dt(function(r,e,t){if(!Tt(r))throw new TypeError("Bind must be called on a function");var i=Dt(function(a){return mI(r,i,e,this,t.concat(a))});return i}),wt=zv(Pt);function Tr(r,e,t,i){if(i=i||[],!e&&e!==0)e=1/0;else if(e<=0)return i.concat(r);for(var a=i.length,s=0,o=Pt(r);s<o;s++){var l=r[s];if(wt(l)&&(mr(l)||Sd(l)))if(e>1)Tr(l,e-1,t,i),a=i.length;else for(var p=0,y=l.length;p<y;)i[a++]=l[p++];else t||(i[a++]=l)}return i}const T3=Dt(function(r,e){e=Tr(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];r[i]=TI(r[i],r)}return r});function E3(r,e){var t=function(i){var a=t.cache,s=""+(e?e.apply(this,arguments):i);return Jn(a,s)||(a[s]=r.apply(this,arguments)),a[s]};return t.cache={},t}const EI=Dt(function(r,e,t){return setTimeout(function(){return r.apply(null,t)},e)}),b3=hi(EI,se,1);function R3(r,e,t){var i,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:Sa(),i=null,o=r.apply(a,s),i||(a=s=null)},y=function(){var f=Sa();!l&&t.leading===!1&&(l=f);var m=e-(f-l);return a=this,s=arguments,m<=0||m>e?(i&&(clearTimeout(i),i=null),l=f,o=r.apply(a,s),i||(a=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(i),l=0,i=a=s=null},y}function g3(r,e,t){var i,a,s,o,l,p=function(){var f=Sa()-a;e>f?i=setTimeout(p,e-f):(i=null,t||(o=r.apply(l,s)),i||(s=l=null))},y=Dt(function(f){return l=this,s=f,a=Sa(),i||(i=setTimeout(p,e),t&&(o=r.apply(l,s))),o});return y.cancel=function(){clearTimeout(i),i=s=l=null},y}function v3(r,e){return hi(e,r)}function xd(r){return function(){return!r.apply(this,arguments)}}function I3(){var r=arguments,e=r.length-1;return function(){for(var t=e,i=r[e].apply(this,arguments);t--;)i=r[t].call(this,i);return i}}function D3(r,e){return function(){if(--r<1)return e.apply(this,arguments)}}function bI(r,e){var t;return function(){return--r>0&&(t=e.apply(this,arguments)),r<=1&&(e=null),t}}const P3=hi(bI,2);function RI(r,e,t){e=At(e,t);for(var i=Ze(r),a,s=0,o=i.length;s<o;s++)if(a=i[s],e(r[a],a,r))return a}function gI(r){return function(e,t,i){t=At(t,i);for(var a=Pt(e),s=r>0?0:a-1;s>=0&&s<a;s+=r)if(t(e[s],s,e))return s;return-1}}const jd=gI(1),vI=gI(-1);function II(r,e,t,i){t=At(t,i,1);for(var a=t(e),s=0,o=Pt(r);s<o;){var l=Math.floor((s+o)/2);t(r[l])<a?s=l+1:o=l}return s}function DI(r,e,t){return function(i,a,s){var o=0,l=Pt(i);if(typeof s=="number")r>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(i,a),i[s]===a?s:-1;if(a!==a)return s=e(ga.call(i,o,l),Hv),s>=0?s+o:-1;for(s=r>0?o:l-1;s>=0&&s<l;s+=r)if(i[s]===a)return s;return-1}}const PI=DI(1,jd,II),A3=DI(-1,vI);function kd(r,e,t){var i=wt(r)?jd:RI,a=i(r,e,t);if(a!==void 0&&a!==-1)return r[a]}function O3(r,e){return kd(r,Aa(e))}function Rn(r,e,t){e=Oa(e,t);var i,a;if(wt(r))for(i=0,a=r.length;i<a;i++)e(r[i],i,r);else{var s=Ze(r);for(i=0,a=s.length;i<a;i++)e(r[s[i]],s[i],r)}return r}function Er(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=Array(a),o=0;o<a;o++){var l=i?i[o]:o;s[o]=e(r[l],l,r)}return s}function AI(r){var e=function(t,i,a,s){var o=!wt(t)&&Ze(t),l=(o||t).length,p=r>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=r);p>=0&&p<l;p+=r){var y=o?o[p]:p;a=i(a,t[y],y,t)}return a};return function(t,i,a,s){var o=arguments.length>=3;return e(t,Oa(i,s,4),a,o)}}const qd=AI(1),OI=AI(-1);function fi(r,e,t){var i=[];return e=At(e,t),Rn(r,function(a,s,o){e(a,s,o)&&i.push(a)}),i}function S3(r,e,t){return fi(r,xd(At(e)),t)}function SI(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=0;s<a;s++){var o=i?i[s]:s;if(!e(r[o],o,r))return!1}return!0}function CI(r,e,t){e=At(e,t);for(var i=!wt(r)&&Ze(r),a=(i||r).length,s=0;s<a;s++){var o=i?i[s]:s;if(e(r[o],o,r))return!0}return!1}function gn(r,e,t,i){return wt(r)||(r=yi(r)),(typeof t!="number"||i)&&(t=0),PI(r,e,t)>=0}const C3=Dt(function(r,e,t){var i,a;return Tt(e)?a=e:(e=Pa(e),i=e.slice(0,-1),e=e[e.length-1]),Er(r,function(s){var o=a;if(!o){if(i&&i.length&&(s=Vd(s,i)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function Jd(r,e){return Er(r,$d(e))}function B3(r,e){return fi(r,Aa(e))}function BI(r,e,t){var i=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=wt(r)?r:yi(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s>i&&(i=s)}else e=At(e,t),Rn(r,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&i===-1/0)&&(i=y,a=o)});return i}function w3(r,e,t){var i=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof r[0]!="object"&&r!=null){r=wt(r)?r:yi(r);for(var l=0,p=r.length;l<p;l++)s=r[l],s!=null&&s<i&&(i=s)}else e=At(e,t),Rn(r,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&i===1/0)&&(i=y,a=o)});return i}var _3=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function wI(r){return r?mr(r)?ga.call(r):Pd(r)?r.match(_3):wt(r)?Er(r,Ld):yi(r):[]}function _I(r,e,t){if(e==null||t)return wt(r)||(r=yi(r)),r[Fd(r.length-1)];var i=wI(r),a=Pt(i);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=Fd(o,s),p=i[o];i[o]=i[l],i[l]=p}return i.slice(0,e)}function N3(r){return _I(r,1/0)}function M3(r,e,t){var i=0;return e=At(e,t),Jd(Er(r,function(a,s,o){return{value:a,index:i++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function mo(r,e){return function(t,i,a){var s=e?[[],[]]:{};return i=At(i,a),Rn(t,function(o,l){var p=i(o,l,t);r(s,o,p)}),s}}const V3=mo(function(r,e,t){Jn(r,t)?r[t].push(e):r[t]=[e]}),L3=mo(function(r,e,t){r[t]=e}),$3=mo(function(r,e,t){Jn(r,t)?r[t]++:r[t]=1}),G3=mo(function(r,e,t){r[t?0:1].push(e)},!0);function F3(r){return r==null?0:wt(r)?r.length:Ze(r).length}function U3(r,e,t){return e in t}const NI=Dt(function(r,e){var t={},i=e[0];if(r==null)return t;Tt(i)?(e.length>1&&(i=Oa(i,e[1])),e=Da(r)):(i=U3,e=Tr(e,!1,!1),r=Object(r));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=r[o];i(l,o,r)&&(t[o]=l)}return t}),x3=Dt(function(r,e){var t=e[0],i;return Tt(t)?(t=xd(t),e.length>1&&(i=e[1])):(e=Er(Tr(e,!1,!1),String),t=function(a,s){return!gn(e,s)}),NI(r,t,i)});function MI(r,e,t){return ga.call(r,0,Math.max(0,r.length-(e==null||t?1:e)))}function Wd(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[0]:MI(r,r.length-e)}function To(r,e,t){return ga.call(r,e==null||t?1:e)}function j3(r,e,t){return r==null||r.length<1?e==null||t?void 0:[]:e==null||t?r[r.length-1]:To(r,Math.max(0,r.length-e))}function k3(r){return fi(r,Boolean)}function q3(r,e){return Tr(r,e,!1)}const VI=Dt(function(r,e){return e=Tr(e,!0,!0),fi(r,function(t){return!gn(e,t)})}),J3=Dt(function(r,e){return VI(r,e)});function Hd(r,e,t,i){Uv(e)||(i=t,t=e,e=!1),t!=null&&(t=At(t,i));for(var a=[],s=[],o=0,l=Pt(r);o<l;o++){var p=r[o],y=t?t(p,o,r):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?gn(s,y)||(s.push(y),a.push(p)):gn(a,p)||a.push(p)}return a}const W3=Dt(function(r){return Hd(Tr(r,!0,!0))});function H3(r){for(var e=[],t=arguments.length,i=0,a=Pt(r);i<a;i++){var s=r[i];if(!gn(e,s)){var o;for(o=1;o<t&&gn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function Yd(r){for(var e=r&&BI(r,Pt).length||0,t=Array(e),i=0;i<e;i++)t[i]=Jd(r,i);return t}const Y3=Dt(Yd);function z3(r,e){for(var t={},i=0,a=Pt(r);i<a;i++)e?t[r[i]]=e[i]:t[r[i][0]]=r[i][1];return t}function Z3(r,e,t){e==null&&(e=r||0,r=0),t||(t=e<r?-1:1);for(var i=Math.max(Math.ceil((e-r)/t),0),a=Array(i),s=0;s<i;s++,r+=t)a[s]=r;return a}function K3(r,e){if(e==null||e<1)return[];for(var t=[],i=0,a=r.length;i<a;)t.push(ga.call(r,i,i+=e));return t}function zd(r,e){return r._chain?se(e).chain():e}function LI(r){return Rn(Nd(r),function(e){var t=se[e]=r[e];se.prototype[e]=function(){var i=[this._wrapped];return v9.apply(i,arguments),zd(this,t.apply(se,i))}}),se}Rn(["pop","push","reverse","shift","sort","splice","unshift"],function(r){var e=po[r];se.prototype[r]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(r==="shift"||r==="splice")&&t.length===0&&delete t[0]),zd(this,t)}}),Rn(["concat","join","slice"],function(r){var e=po[r];se.prototype[r]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),zd(this,t)}});var $I=LI(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Bv,after:D3,all:SI,allKeys:Da,any:CI,assign:fo,before:bI,bind:TI,bindAll:T3,chain:m3,chunk:K3,clone:X9,collect:Er,compact:k3,compose:I3,constant:Yv,contains:gn,countBy:$3,create:K9,debounce:g3,default:se,defaults:lI,defer:b3,delay:EI,detect:kd,difference:VI,drop:To,each:Rn,escape:i3,every:SI,extend:oI,extendOwn:fo,filter:fi,find:kd,findIndex:jd,findKey:RI,findLastIndex:vI,findWhere:O3,first:Wd,flatten:q3,foldl:qd,foldr:OI,forEach:Rn,functions:Nd,get:uI,groupBy:V3,has:e3,head:Wd,identity:Ld,include:gn,includes:gn,indexBy:L3,indexOf:PI,initial:MI,inject:qd,intersection:H3,invert:sI,invoke:C3,isArguments:Sd,isArray:mr,isArrayBuffer:kv,isBoolean:Uv,isDataView:yo,isDate:w9,isElement:B9,isEmpty:Ia,isEqual:j9,isError:N9,isFinite:$9,isFunction:Tt,isMap:J9,isMatch:Qv,isNaN:Hv,isNull:C9,isNumber:xv,isObject:qn,isRegExp:_9,isSet:H9,isString:Pd,isSymbol:jv,isTypedArray:Kv,isUndefined:Fv,isWeakMap:W9,isWeakSet:Y9,iteratee:Gd,keys:Ze,last:j3,lastIndexOf:A3,map:Er,mapObject:t3,matcher:Aa,matches:Aa,max:BI,memoize:E3,methods:Nd,min:w3,mixin:LI,negate:xd,noop:yI,now:Sa,object:z3,omit:x3,once:P3,pairs:z9,partial:hi,partition:G3,pick:NI,pluck:Jd,property:$d,propertyOf:n3,random:Fd,range:Z3,reduce:qd,reduceRight:OI,reject:S3,rest:To,restArguments:Dt,result:y3,sample:_I,select:fi,shuffle:N3,size:F3,some:CI,sortBy:M3,sortedIndex:II,tail:To,take:Wd,tap:Q9,template:p3,templateSettings:o3,throttle:R3,times:r3,toArray:wI,toPath:dI,transpose:Yd,unescape:s3,union:W3,uniq:Hd,unique:Hd,uniqueId:f3,unzip:Yd,values:yi,where:B3,without:J3,wrap:v3,zip:Y3},Symbol.toStringTag,{value:"Module"})));$I._=$I;function Eo(r){return r.charAt(0).toUpperCase()+r.slice(1)}function GI(r){return r.charAt(0).toLowerCase()+r.slice(1)}function FI(r,e){if(r.type!==n.Property||e.type!==n.Property)throw new Error(`Expected property entities for comparison. But got ${r.type} and ${e.type}.`);return r===e||r.id===e.id?!0:r.name!==e.name||r.static!==e.static||r.abstract!==e.abstract?!1:Ht(r.dataType,e.dataType).compatible}function UI(r,e){if(r.type!==n.CustomEntity||e.type!==n.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${r.type} and ${e.type}.`);if(r===e||r.id===e.id)return!0;if(r.properties.length!==e.properties.length)return!1;let t=[...e.properties];const i=[];for(let a=0;a<r.properties.length;a++){const s=r.properties[a];t.find(l=>{const p=FI(s,l);return p&&(t=t.filter(y=>y.id!==l.id)),p})||i.push(s)}return!(i.length>0)}var $t=(r=>(r.BothUnconstrained="both-unconstrained",r.AConstraintBUnconstrained="a-constraint-b-unconstrained",r.BConstraintAUnconstrained="b-constraint-a-unconstrained",r.Same="same",r.AIsListBIsNot="a-is-list-b-is-not",r.BIsListAIsNot="b-is-list-a-is-not",r.AIsNullableBIsNot="a-is-nullable-b-is-not",r.BIsNullableAIsNot="b-is-nullable-a-is-not",r.AIsTemplateBIsNot="a-is-template-b-is-not",r.BIsTemplateAIsNot="b-is-template-a-is-not",r.BothUntyped="both-untyped",r.AIsUntypedBIsNot="a-is-untyped-b-is-not",r.BIsUntypedAIsNot="b-is-untyped-a-is-not",r.TypeEntityMismatch="type-entity-mismatch",r.SameCustomEntities="same-custom-entities",r.CompatibleCustomEntities="compatible-custom-entities",r.IncompatibleCustomEntities="incompatible-custom-entities",r.SamePrimitiveEntities="same-primitive-entities",r.IncompatiblePrimitiveEntities="incompatible-primitive-entities",r.SameBuiltInBaseEntities="same-built-in-base-entities",r.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",r.CheckUnknown="check-unknown",r))($t||{});function Ht(r,e){var t,i,a,s,o,l,p,y,f,m,b;if(r&&r.type!==n.DataType||e&&e.type!==n.DataType)throw new Error(`Expected data-type entities for comparison. But got ${r==null?void 0:r.type} and ${e==null?void 0:e.type}.`);if(r===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(r===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(r===e)return{compatible:!0,type:"same"};if(r.id===e.id)return{compatible:!0,type:"same"};if(r.isList!==e.isList)return{compatible:!1,type:r.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(r.isNullable!==e.isNullable)return{compatible:!1,type:r.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(r.asType!==e.asType)return{compatible:!1,type:r.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!r.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(r.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!r.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=r.entity)==null?void 0:t.type)!==((i=e.entity)==null?void 0:i.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=r.entity)==null?void 0:a.type)===n.CustomEntity){if(((s=r.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const v=UI(r.entity,e.entity);return{compatible:v,type:v?"compatible-custom-entities":"incompatible-custom-entities"}}return((l=r.entity)==null?void 0:l.type)===n.PrimitiveEntity?((p=r.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=r.entity)==null?void 0:f.type)===n.BuiltInBaseEntity?((m=r.entity)==null?void 0:m.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 X3(r){const e=r.project.builtInBaseEntities.find(a=>a.id===L.EXECUTION),t={id:r.id+"--infered-data-type",version:1,type:n.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},i=R(t,r.project);return i.inferred=!0,i.sync(t),i.setParent(r),i.entity=e,i}function xI(r){return r.dataType?r.dataType:null}function jI(r){var e;return(e=r.declaration)!=null&&e.dataType?r.declaration.dataType:r.readsValue?rn(r.readsValue):null}function Zd(r){return r.dataType&&!r.dataType.inferred&&r.dataType.isResolved()?r.dataType:r.readsValue?rn(r.readsValue):null}function kI(r){return rn(r.declaration)}function qI(r){return r.dataType&&!r.dataType.inferred?r.dataType:(r.dataType&&r.dataType.inferred,r.inferDataTypeAndSyncInstancesInputsAndOutputs(),r.dataType)}function JI(r){var e;return((e=r.declaration)==null?void 0:e.dataType)||null}function rn(r){switch(r.type){case n.VariableDeclaration:return qI(r);case n.ArgumentDeclaration:return xI(r);case n.ReturnDeclaration:return Zd(r);case n.VariableInstance:return kI(r);case n.InputMap:return jI(r);case n.OutputMap:return JI(r);default:throw new Error(`Cannot infer data type from entity of type ${r.type}.`)}}function bo(r){switch(r.type){case n.ArgumentDeclaration:return r.getDataType();case n.InputMap:return r.getDataType();case n.VariableDeclaration:return r.getDataType();case n.VariableInstance:return r.getDataType();case n.OutputMap:return r.getDataType();case n.ReturnDeclaration:return r.getDataType();case n.Property:return r.getDataType();case n.ValueDescriptor:return r.getDataType();default:return null}}function w(r){if(r){let e=null;return typeof r=="string"?e=r:r.entityId?e=r.entityId:r.type!==n.GenericReference&&(e=r.id),e}return null}function br(r){return r.declaration||r}function Q3(r){return r.type===n.VariableDeclaration?r.parent===r.project?"global-declaration":"local-declaration":r.declaration.parent===r.project?"global-instance":"local-instance"}function Kd(r,e){const t=[];if(r.type===n.Project)t.push(...r.variableDeclarations);else{const a=bt(Be(r)).filter(s=>s.type===n.VariableDeclaration);t.push(...a),r.parent&&(dt.includes(r.parent.type)||r.parent.type===n.Project)&&t.push(...Kd(r.parent))}return t}function e5(r){return r.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function t5(r){return r.split(/\s+/).map(i=>i[0].toUpperCase()+i.slice(1).toLowerCase()).join("")}function WI(r){var e;return(e=r.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 Ro(r){return WI(r).toLowerCase()}function Rr(r,e=!0){if(!(r!=null&&r.dataType))return"Any data type";if(!r.dataType.entity)return r.dataType.isList?"List of an unknown data type":"Unknown data type";if(r.dataType.entity.type===n.PrimitiveEntity){let t=r.dataType.entity.name;switch(r.dataType.entity.name){case I.String:t="Text";break;case I.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=r.dataType.entity.name;break}return r.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return r.dataType.isList?`List of ${r.dataType.entity.name} entities`:`${r.dataType.entity.name.slice(0,1).toUpperCase()+r.dataType.entity.name.slice(1)} entity`}function HI(r){return Rr(r.declaration)}function n5(r){return r.type===n.VariableInstance?HI(r):Rr(r)}function YI(r){if(!r)return"Any data type";if(!r.entity)return"Inherited";if(r.entity.type===n.PrimitiveEntity){const e=r.entity.name===I.String?"Text":r.entity.name;return r.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(r.entity.type===n.CustomEntity){const e=Qd(r.entity);return r.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(r.entity.type===n.BuiltInBaseEntity){const e=Xd(r.entity);return r.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return r.isList?`List of ${r.entity.name} entities`:`${r.entity.name.slice(0,1).toUpperCase()+r.entity.name.slice(1)} entity`}function zI(r){if(!r.dataType)return"Any data type";if(!r.dataType.entity)return"Inherited";if(r.dataType.entity.type===n.PrimitiveEntity){const e=r.dataType.entity.name===I.String?"Text":r.dataType.entity.name;return r.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(r.dataType.entity.type===n.CustomEntity){const e=Qd(r.dataType.entity);return r.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(r.dataType.entity.type===n.BuiltInBaseEntity){const e=Xd(r.dataType.entity);return r.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return r.dataType.isList?`List of ${r.dataType.entity.name} entities`:`${r.dataType.entity.name.slice(0,1).toUpperCase()+r.dataType.entity.name.slice(1)} entity`}function ZI(r){switch(r.type){case n.Property:return zI(r);case n.VariableDeclaration:return Rr(r);case n.ArgumentDeclaration:return Rr(r,!1);case n.InputMap:{const e=r.declaration;return e?ZI(e):"Unknown data type"}case n.ReturnDeclaration:return Rr(r,!1);case n.OutputMap:{const e=r.declaration;return Rr(e,!1)}}return"Unknown data type"}function go(r){switch(r.declaration.id){case Me.Equal:return"is equal to";case Me.NotEqual:return"is not equal to";case Me.MoreThan:return"is greater than";case Me.MoreThanOrEqual:return"is greater than or equal to";case Me.LessThan:return"is less than";case Me.LessThanOrEqual:return"is less than or equal to";case Me.And:return"and";case Me.Or:return"or";case Mt.Empty:return"is empty";case Mt.NotEmpty:return"is not empty"}}function KI(r){return r.includes(L.HTTP_ENDPOINT)?"HTTP endpoint":r.includes(L.PERSISTED_ENTITY)?"Persisted entity":r.includes(L.CRON_JOB)?"Scheduled execution":r.includes(L.RELATIONAL_DATABASE)?"Relational database":"Entity"}function Xd(r){switch(r.name){case L.HTTP_ENDPOINT:return"HTTP endpoint";case L.PERSISTED_ENTITY:return"Persisted entity";case L.CRON_JOB:return"Scheduled execution";case L.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function Qd(r){const e=MD(r);if(!e){const t=_D(r);return t.includes(L.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(L.PERSISTED_ENTITY)?"Persisted entity":t.includes(L.CRON_JOB)?"Scheduled execution":t.includes(L.RELATIONAL_DATABASE)?"Relational database":S(r,r.project)+" entity"}return S(e,r.project)+" entity"}function XI(r){let e="Find ";return r.outputsDeclarations.forEach((t,i)=>{const a=bo(t),s=GI(a&&a.entity?S(a.entity,r.project):"unstructured data");i===0?e+=`${s} `:i===r.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function QI(r){switch(r.name){case I.String:return"Text";case I.Number:return"Number";case I.Boolean:return"Boolean";case I.JSON:return"Data structure";case I.UUID:return"Unique identifier";case I.Date:return"Date";case I.EntityTemplate:return"Entity as template";case I.Enum:return"Enumeration";case I.File:return"File";case I.Null:return"Empty";case I.ActionDescriptor:return"Action descriptor";default:return r.name}}function eD(r){switch(r.id){case q.List:return"Loop over list items";case q.ManualFlow:return"Manual flow control loop";case q.ObjectKeys:return"Loop over object keys";case q.ObjectValues:return"Loop over object values";case q.Counted:return"Loop given number of times";case q.String:return"Loop over text characters";case ct.Addition:return"Sum numbers";case ct.Substraction:return"Subtract numbers";case ct.Multiplication:return"Multiply numbers";case ct.Division:return"Divide numbers";case ct.Remainder:return"Get remainder of numbers";case ct.Exponentiation:return"Get exponent of numbers";case Ce.AddIndex:return"Add at index position";case Ce.DeleteFirst:return"Delete first character";case Ce.DeleteLast:return"Delete last character";case Ce.DeleteIndex:return"Delete at index position";case Ce.Join:return"Join texts";case Ce.ReplaceAllMatches:return"Replace all matches";case Ce.ReplaceFirst:return"Replace first match";case Ce.ReplaceLast:return"Replace last match";case Ce.Split:return"Split text";case Ce.ReplaceIndex:return"Replace at index position";case Ce.ReplaceSingleMatch:return"Replace single match";case Ce.GetFirst:return"Get first character";case Ce.GetLast:return"Get last character";case Ce.GetIndex:return"Get at index position";case Ce.Append:return"Add at the end";case Ce.Prepend:return"Add at the start";case we.Wait:return"Wait";case we.Parallel:return"Run in parallel";case we.Sequential:return"Run in sequence";case Qe.HttpRequest:return"HTTP request";case Xe.CreateNewInstance:return"Create new copy of entity";case Y.AddIndex:return"Add item at index position";case Y.DeleteFirst:return"Delete first item";case Y.DeleteLast:return"Delete last item";case Y.DeleteIndex:return"Delete item at index position";case Y.Join:return"Join lists";case Y.ReplaceAllMatches:return"Replace all matches";case Y.ReplaceFirst:return"Replace first match";case Y.ReplaceLast:return"Replace last match";case Y.Split:return"Split list";case Y.ReplaceIndex:return"Replace at index position";case Y.ReplaceSingleMatch:return"Replace single match";case Y.GetFirst:return"Get first item";case Y.GetLast:return"Get last item";case Y.GetIndex:return"Get item at index position";case Y.Append:return"Add item at the end";case Y.Prepend:return"Add item at the start";case on.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(r.name.slice(0,1).toUpperCase()+r.name.slice(1)).replaceAll("-"," ")}}function S(r,e){var t;if(n.FunctionDeclaration===r.type){const i=r.name;if(Object.values(St).includes(i))switch(i){case St.AbortExecution:return"Abort execution";case St.DeletePersistedEntity:return"Delete persisted entity";case St.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Eo(r.type).replaceAll("-"," ")}return i}if(n.BuiltInBaseEntity===r.type)return KI([r.name]);if(_u.includes(r.type)&&r.type!==n.ActionDescriptor)return r.name;switch(r.type){case n.Search:return XI(r);case n.Operation:case n.InternalCall:case n.Loop:const i=Nt(r.declaration,e);return S(i,e);case n.ActionDescriptor:return eD(r);case n.BreakStatement:const a=Nt(r.parent,e);return`Stop loop ${S(a,e)}`;case n.ContinueStatement:const s=Nt(r.parent,e);return`Execute next iteration of ${S(s,e)}`;case n.FunctionCall:return Nt(r.declaration,e).name;case n.Condition:{const l=r;if((t=r.inputs)!=null&&t.length){const p=S(l.inputs[0],l.project);if(l.inputs[1]){const y=l.inputs[1].declaration.name;return`If ${p} ${go(l)} ${y}`}return`If ${p} ${go(l)}`}else return`If ${go(l)}`}case n.ReturnStatement:{const l=Nt(r.parent,e);return`Output of ${S(l,e)}`}case n.InputMap:if(r.declaration){const l=Nt(r.declaration,e);return S(l,e)||""}else return r.name||"";case n.VariableInstance:{const l=Nt(r.declaration,e);return S(l,e)||""}case n.OutputMap:if(r.declaration){const l=Nt(r.declaration,e);return(l==null?void 0:l.name)||""}else return"";case n.PrimitiveEntity:case n.PrimitiveValue:return QI(r);default:return Eo(r.type).replaceAll("-"," ")}}function vo(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=e.entities.filter(a=>a.name===r.name);return i.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in the project. Entity with id "${i[0].id}" has the same name.
14
14
  Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null})),t}function eu(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=r.parent?w(r.parent):null;let a=e;i&&(a=e.get(i));const s=[];a.type===n.CustomEntity?s.push(...a.methods.map(l=>l)):a.type===n.Project?s.push(...a.functions.map(l=>l)):a.type===n.Loop?a.body&&s.push(a.body):a.type===n.InstalledProject&&s.push(...a.functions.map(l=>l));const o=s.filter(l=>l.name===r.name);return o.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in ${a.type===n.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
15
15
  Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null})),t}function tu(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=r.parent&&Nt(r.parent,e)||e;if(!i)t.push(new E({id:`${r.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const s=Kd(i).filter(o=>o.name===r.name);s.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
16
16
  Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null}))}return t}function nu(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=w(r.parent);if(!i)t.push(new E({id:`${r.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${r.id}" and type "${r.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${r.id}--parent-reference--${h.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:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(l=>l.name===r.name);o.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
17
17
  Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null}))}}return t}function ru(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=w(r.parent);if(!i)t.push(new E({id:`${r.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${r.id}" and type "${r.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${r.id}--parent-reference--${h.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:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Ru(a).filter(l=>l.name===r.name);o.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
18
18
  Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null}))}}return t}function iu(r,e){const t=[];r.name||t.push(new E({id:`${r.id}--${D.EmptyName}`,message:`Entity with id "${r.id}" and type "${r.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:D.EmptyName,issue:null}));const i=w(r.parent);if(!i)t.push(new E({id:`${r.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${r.id}" and type "${r.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(i);if(!a)t.push(new E({id:`${r.id}--parent-reference--${h.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:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=gu(a).filter(l=>l.name===r.name);o.length&&t.push(new E({id:`${r.id}--${D.NameNotUniqueInScope}`,message:`Entity with id "${r.id}" and type "${r.type}" has a name "${r.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:T.Error,code:D.NameNotUniqueInScope,issue:null}))}}return t}function i5(r,e){switch(r.type){case n.CustomEntity:return vo(r,e);case n.FunctionDeclaration:return eu(r,e);case n.VariableDeclaration:return tu(r,e);case n.Property:return nu(r,e);case n.ArgumentDeclaration:return ru(r,e);case n.ReturnDeclaration:return iu(r,e);default:return[]}}function tt(r,e,t){const a=`${Ro(r)}-${e}-id`;return t.instances[a]?_.UUID.uuid():a}function au(r,e){let t="",i=null;if(r.parent){const s=e.get(r.parent);s&&(i=s)}let a="";return i&&(a=`${Ro(S(i,e))}-`),t=`${a}${Ro(S(r,e))}-id`,e.instances[t]?_.UUID.uuid():t}function a5(r){var o;const e=B8(),t=r.toJSON();e.safeParse(t).success;const a=s5(r);(o=r.dataType)==null||o.validate();const s=[...a];if(r.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}return s}function s5(r){const e=[];if(!r.implements)return e;const t=r.implements;if(!t.abstract){const a=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});e.push(a.error)}if(r.static&&!t.static){const a=Z({id:`${r.id}--${N.NonStaticPropertyImplementsStatic}`,message:`Static property "${S(r,r.project)}" with id "${r.id}" implements a non-static property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.NonStaticPropertyImplementsStatic,entity:r});e.push(a.error)}if(!r.static&&t.static){const a=Z({id:`${r.id}--${N.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${S(r,r.project)}" with id "${r.id}" implements a static property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.StaticPropertyImplementsNonStatic,entity:r});e.push(a.error)}if(!Ht(r.dataType,t.dataType)){const a=Z({id:`${r.id}--${N.PropertyImplementsIncompatibleType}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a property "${S(t,r.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:T.Error,code:N.PropertyImplementsIncompatibleType,entity:r});e.push(a.error)}return ae(r.errors,e)}function o5(r,e){const t=[];if(r.parent){const a=e.get(r.parent);if(!a)t.push(new E({id:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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=Kn(a);if(s){const o=a!==s?`The entity of type '${r.type}' with id '${r.id}' have 'parent' with id '${r.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${S(s,a.project)}) higher up in the tree.`:`The entity of type '${r.type}' with id '${r.id}' have 'parent' with id '${r.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${r.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:o,issue:null}))}else if(![n.CustomEntity].includes(a.type))t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const l=Zn(a).filter(p=>!p.interactive);if(l.length){let p=l.length>1?`The entity of type '${r.type}' with id '${r.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(l.map(y=>S(y,y.project)),'", "','" and "')}").`:`The entity of type '${r.type}' with id '${r.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(l[0],l[0].project)}").`;p+=`
20
- ${Yn}`,t.push(new E({id:`${r.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:p,issue:null}))}else if(r.implements){const p=e.get(r.implements);if(r.id===r.implements)return t.push(new E({id:`${r.id}--${r.implements}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.implements}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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 y=a.properties.find(f=>{var m;return((m=f.implements)==null?void 0:m.id)===r.implements});y?t.push(new E({id:`${r.id}--${D.PropertyOverwrite}`,code:D.PropertyOverwrite,severity:T.Error,message:`The property with id "${r.id}" is trying to implement the property with id "${r.implements}", but the parent entity already has a property with id '${y.id}' that implements the same base property.`,issue:null})):[n.Property].includes(p.type)?p.abstract||t.push(new E({id:`${r.id}--${r.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${r.id}--${r.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Je(r,{},e);return t.push(...i.errors),t}const he=class he{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"private");c(this,"abstract");c(this,"index");c(this,"static");c(this,"required");c(this,"type",n.Property);c(this,"hidden",!1);c(this,"dataType",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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,this.hidden=e.hidden||!1}static fromGenerationTarget(e,t){const i=w(e.parent),a=t.get(i);let s=null;if(e.implements){const p=w(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,hidden:!1,description:e.description,implements:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=o5(i,t),o=nu(i,t);return a.push(...s,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
19
+ Please provide a unique 'name' string.`,severity:T.Error,code:D.NameNotUniqueInScope,issue:null}))}}return t}function r5(r,e){switch(r.type){case n.CustomEntity:return vo(r,e);case n.FunctionDeclaration:return eu(r,e);case n.VariableDeclaration:return tu(r,e);case n.Property:return nu(r,e);case n.ArgumentDeclaration:return ru(r,e);case n.ReturnDeclaration:return iu(r,e);default:return[]}}function tt(r,e,t){const a=`${Ro(r)}-${e}-id`;return t.instances[a]?_.UUID.uuid():a}function au(r,e){let t="",i=null;if(r.parent){const s=e.get(r.parent);s&&(i=s)}let a="";return i&&(a=`${Ro(S(i,e))}-`),t=`${a}${Ro(S(r,e))}-id`,e.instances[t]?_.UUID.uuid():t}function i5(r){var o;const e=C8(),t=r.toJSON();e.safeParse(t).success;const a=a5(r);(o=r.dataType)==null||o.validate();const s=[...a];if(r.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}return s}function a5(r){const e=[];if(!r.implements)return e;const t=r.implements;if(!t.abstract){const a=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});e.push(a.error)}if(r.static&&!t.static){const a=Z({id:`${r.id}--${N.NonStaticPropertyImplementsStatic}`,message:`Static property "${S(r,r.project)}" with id "${r.id}" implements a non-static property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.NonStaticPropertyImplementsStatic,entity:r});e.push(a.error)}if(!r.static&&t.static){const a=Z({id:`${r.id}--${N.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${S(r,r.project)}" with id "${r.id}" implements a static property "${S(t,r.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:N.StaticPropertyImplementsNonStatic,entity:r});e.push(a.error)}if(!Ht(r.dataType,t.dataType)){const a=Z({id:`${r.id}--${N.PropertyImplementsIncompatibleType}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a property "${S(t,r.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:T.Error,code:N.PropertyImplementsIncompatibleType,entity:r});e.push(a.error)}return ae(r.errors,e)}function s5(r,e){const t=[];if(r.parent){const a=e.get(r.parent);if(!a)t.push(new E({id:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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=Kn(a);if(s){const o=a!==s?`The entity of type '${r.type}' with id '${r.id}' have 'parent' with id '${r.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${S(s,a.project)}) higher up in the tree.`:`The entity of type '${r.type}' with id '${r.id}' have 'parent' with id '${r.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${r.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:o,issue:null}))}else if(![n.CustomEntity].includes(a.type))t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const l=Zn(a).filter(p=>!p.interactive);if(l.length){let p=l.length>1?`The entity of type '${r.type}' with id '${r.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(l.map(y=>S(y,y.project)),'", "','" and "')}").`:`The entity of type '${r.type}' with id '${r.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(l[0],l[0].project)}").`;p+=`
20
+ ${Yn}`,t.push(new E({id:`${r.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:p,issue:null}))}else if(r.implements){const p=e.get(r.implements);if(r.id===r.implements)return t.push(new E({id:`${r.id}--${r.implements}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.implements}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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 y=a.properties.find(f=>{var m;return((m=f.implements)==null?void 0:m.id)===r.implements});y?t.push(new E({id:`${r.id}--${D.PropertyOverwrite}`,code:D.PropertyOverwrite,severity:T.Error,message:`The property with id "${r.id}" is trying to implement the property with id "${r.implements}", but the parent entity already has a property with id '${y.id}' that implements the same base property.`,issue:null})):[n.Property].includes(p.type)?p.abstract||t.push(new E({id:`${r.id}--${r.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${r.id}--${r.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const i=Je(r,{},e);return t.push(...i.errors),t}const he=class he{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"private");c(this,"abstract");c(this,"index");c(this,"static");c(this,"required");c(this,"type",n.Property);c(this,"hidden",!1);c(this,"dataType",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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,this.hidden=e.hidden||!1}static fromGenerationTarget(e,t){const i=w(e.parent),a=t.get(i);let s=null;if(e.implements){const p=w(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,hidden:!1,description:e.description,implements:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=s5(i,t),o=nu(i,t);return a.push(...s,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
21
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}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
22
- ${Ao}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.parent.addProperty(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.required=e.required||this.required,this.hidden=e.hidden||this.hidden,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===n.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:g(i),removed:g(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===n.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,hidden:this.hidden,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:n.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,hidden:this.hidden,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=a5(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 f;const a=t||tt(S(this,this.project),n.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l={hidden:!1,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=Ut(l,this.project);i&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",i))||null;return y&&p.setDataType(y),p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};c(he,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),c(he,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),c(he,"MUTABLE_META_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,"index"]),c(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),c(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),c(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(he,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),c(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let gr=he;function l5(r){const e=Hj(),t=r.toJSON();e.safeParse(t).success;const a=c5(r),s=d5(r),o=Ot(r);r.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const l=[...a,...s];if(r.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});l.push(p.error)}return ae(r.errors,l)}function c5(r){const e=[];if(!r.calls.length){const t=Z({id:`${r.id}--${N.ScopeWithoutLogic}`,message:`Action "${S(r,r.project)}" with id "${r.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:T.Error,code:N.ScopeWithoutLogic,entity:r});e.push(t.error)}return ae(r.errors,e)}function d5(r){const e=[];return r.implements,ae(r.errors,e)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"private");c(this,"index",null);c(this,"type",n.FunctionDeclaration);c(this,"implements",null);c(this,"inputs",[]);c(this,"returnStatements",[]);c(this,"calls",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(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 l=w(e.parent);i=t.get(l)}let a=null;if(e.implements){const l=w(e.implements);a=t.get(l)}const s={id:e.id,version:1,name:e.name,type:n.FunctionDeclaration,index:i.type===n.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 f;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Project,n.InstalledProject,n.CustomEntity,n.Loop],optional:!0},implements:{list:!1,types:[n.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=eu(i,t),l=i.parent?t.get(i.parent):null;if(l&&l.type===n.CustomEntity){const m=l,v=Zn(m).filter(P=>!P.interactive);if(v.length){let P=v.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(v.map(O=>S(O,O.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(v[0],v[0].project)}").`;P+=`
22
+ ${Ao}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.parent.addProperty(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.required=e.required||this.required,this.hidden=e.hidden||this.hidden,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===n.CustomEntity&&(this.parent.removeProperty(this),i.push(this.parent)),{affected:g(i),removed:g(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===n.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,hidden:this.hidden,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:n.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,hidden:this.hidden,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=i5(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 f;const a=t||tt(S(this,this.project),n.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l={hidden:!1,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=Ut(l,this.project);i&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",i))||null;return y&&p.setDataType(y),p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};c(he,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),c(he,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),c(he,"MUTABLE_META_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,"index"]),c(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),c(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),c(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(he,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),c(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let gr=he;function o5(r){const e=Wj(),t=r.toJSON();e.safeParse(t).success;const a=l5(r),s=c5(r),o=Ot(r);r.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const l=[...a,...s];if(r.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});l.push(p.error)}return ae(r.errors,l)}function l5(r){const e=[];if(!r.calls.length){const t=Z({id:`${r.id}--${N.ScopeWithoutLogic}`,message:`Action "${S(r,r.project)}" with id "${r.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:T.Error,code:N.ScopeWithoutLogic,entity:r});e.push(t.error)}return ae(r.errors,e)}function c5(r){const e=[];return r.implements,ae(r.errors,e)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"private");c(this,"index",null);c(this,"type",n.FunctionDeclaration);c(this,"implements",null);c(this,"inputs",[]);c(this,"returnStatements",[]);c(this,"calls",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(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 l=w(e.parent);i=t.get(l)}let a=null;if(e.implements){const l=w(e.implements);a=t.get(l)}const s={id:e.id,version:1,name:e.name,type:n.FunctionDeclaration,index:i.type===n.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 f;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Project,n.InstalledProject,n.CustomEntity,n.Loop],optional:!0},implements:{list:!1,types:[n.ActionDescriptor],optional:!0}},t);i=s.modifiedData;const o=eu(i,t),l=i.parent?t.get(i.parent):null;if(l&&l.type===n.CustomEntity){const m=l,v=Zn(m).filter(P=>!P.interactive);if(v.length){let P=v.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(v.map(O=>S(O,O.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(v[0],v[0].project)}").`;P+=`
23
23
  ${Yn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:P,issue:null}))}else{const P=m.methods.find(k=>{var j;return((j=k.implements)==null?void 0:j.id)===i.implements});P&&a.push(new E({id:`${i.id}--${D.MethodOverwrite}`,code:D.MethodOverwrite,severity:T.Error,message:`The '${n.FunctionDeclaration}' with id "${i.id}" is trying to implement the '${n.ActionDescriptor}' with id "${i.implements}", but the parent custom-entity already has a ${n.FunctionDeclaration} with id '${P.id}' that implements the same base method.
24
24
  A ${n.FunctionDeclaration} that has a parent of type '${n.CustomEntity}' is considered a method of that entity, and cannot implement the same '${n.ActionDescriptor}' more than once.
25
25
  ${n.ActionDescriptor} entities inside a ${n.CustomEntity} are considered abstract methods that can be implemented by ${n.FunctionDeclaration} entities inside the same parent.
@@ -29,38 +29,38 @@ If you want to implement a new method, you can create a new 'function-declaratio
29
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 ${n.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(l&&l.type===n.Loop){const m=l.body;m&&((f=m.implements)==null?void 0:f.id)===i.implements&&a.push(new E({id:`${i.id}--${D.MethodOverwrite}`,code:D.MethodOverwrite,severity:T.Error,message:`The '${n.FunctionDeclaration}' with id "${i.id}" is being added as the 'body' of the ${n.Loop} with id "${l.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),y=p?Kn(p):null;return y&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${S(y,t)}" with id '${y.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,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===n.Project?t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
30
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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
31
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.
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(){const e=[this],t=[],i=[];return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===n.CustomEntity?(this.parent.addMethod(this),e.push(this.parent)):this.parent.type===n.Loop&&(this.parent.setBody(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self: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}setImplements(e){return this.implements=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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==n.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:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),Ot(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),{affected:g(i),removed:g(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)}),Ot(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:g(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Ot(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=Ot(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:n.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===n.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=l5(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Ot(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0,a=!1){var m;const s=this.toJSON(),o=t||tt(S(this,this.project),n.FunctionDeclaration,this.project);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const y=Ut(s,this.project);e?y.setParent(e):y.setParent(this.parent),i&&y.subscribe(),y.initChildren();const f=(m=this.inputs)==null?void 0:m.map((b,v)=>b.clone(this,p+"-argument-declaration-"+v+"-id",i));return y.inputs=f,y}getVariableInstances(){return ie(this).filter(i=>i.type===n.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:n.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}createInternalCall(e,t={}){const i={id:t.id||_.UUID.uuid(),version:t.version||1,type:n.InternalCall,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.toShallowJSON(),index:e.internalCalls.length},a=R(i,this.project);return a.setParent(e),a.initChildren(),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}};c(fe,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),c(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),c(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),c(fe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(fe,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUATABLE_UPSTREAM_PROPERTIES]),c(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(fe,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),c(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUATABLE_DOWNSTREAM_PROPERTIES]),c(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let vr=fe;function u5(r){const e=X6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.entity&&r.andChildrenGroup||r.entity&&r.orChildrenGroup||r.andChildrenGroup&&r.orChildrenGroup){const s=Z({id:r.id+"--"+N.InvalidPropertiesCombination,message:`Data type with id "${r.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:T.Error,code:N.InvalidPropertiesCombination,entity:r});a.push(s.error)}return ae(r.errors,a)}function p5(r,e){const t=[],i=[n.CustomEntity,n.ActionDescriptor,n.Property,n.ArgumentDeclaration,n.ReturnDeclaration,n.VariableDeclaration,n.ValueDescriptor,n.DataType],a=`'${F(i,"', '","' or '")}'`;if(r.parent)if(r.id===r.parent)t.push(new E({id:`${r.id}--${r.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.parent);s?i.includes(s.type)||t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.entity){if(r.id===r.entity)return t.push(new E({id:`${r.id}--${r.entity}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.entity);s?[n.CustomEntity,n.PrimitiveEntity,n.ActionDescriptor,n.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${r.id}--${r.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.entity}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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 me=class me{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"isNullable");c(this,"isList",null);c(this,"constant");c(this,"asType",null);c(this,"type",n.DataType);c(this,"options");c(this,"parentRelationType");c(this,"like");c(this,"defaultValue",null);c(this,"entity",null);c(this,"andChildrenGroup");c(this,"orChildrenGroup");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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,this.like=e.like||!1}static fromGenerationTarget(e,t){const i=w(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,like:e.like||!1,inferred:!1,defaultValue:null,entity:s,asType:e.asType,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=p5(i,t);if(a.push(...s,..._e(i)),i.entity){const y=t.get(i.entity);if(y.type===n.CustomEntity){const m=Zn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${F(m.map(v=>v.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.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}.
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(){const e=[this],t=[],i=[];return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===n.CustomEntity?(this.parent.addMethod(this),e.push(this.parent)):this.parent.type===n.Loop&&(this.parent.setBody(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self: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}setImplements(e){return this.implements=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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==n.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:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),Ot(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),{affected:g(i),removed:g(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)}),Ot(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:g(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Ot(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=Ot(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:n.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===n.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=o5(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Ot(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,i=!0,a=!1){var m;const s=this.toJSON(),o=t||tt(S(this,this.project),n.FunctionDeclaration,this.project);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const y=Ut(s,this.project);e?y.setParent(e):y.setParent(this.parent),i&&y.subscribe(),y.initChildren();const f=(m=this.inputs)==null?void 0:m.map((b,v)=>b.clone(this,p+"-argument-declaration-"+v+"-id",i));return y.inputs=f,y}getVariableInstances(){return ie(this).filter(i=>i.type===n.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:n.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}createInternalCall(e,t={}){const i={id:t.id||_.UUID.uuid(),version:t.version||1,type:n.InternalCall,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.toShallowJSON(),index:e.internalCalls.length},a=R(i,this.project);return a.setParent(e),a.initChildren(),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}};c(fe,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),c(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),c(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),c(fe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(fe,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUATABLE_UPSTREAM_PROPERTIES]),c(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(fe,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),c(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUATABLE_DOWNSTREAM_PROPERTIES]),c(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let vr=fe;function d5(r){const e=K6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.entity&&r.andChildrenGroup||r.entity&&r.orChildrenGroup||r.andChildrenGroup&&r.orChildrenGroup){const s=Z({id:r.id+"--"+N.InvalidPropertiesCombination,message:`Data type with id "${r.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:T.Error,code:N.InvalidPropertiesCombination,entity:r});a.push(s.error)}return ae(r.errors,a)}function u5(r,e){const t=[],i=[n.CustomEntity,n.ActionDescriptor,n.Property,n.ArgumentDeclaration,n.ReturnDeclaration,n.VariableDeclaration,n.ValueDescriptor,n.DataType],a=`'${F(i,"', '","' or '")}'`;if(r.parent)if(r.id===r.parent)t.push(new E({id:`${r.id}--${r.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.parent);s?i.includes(s.type)||t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a parent reference that isn't pointing to an entity of type ${a}.`,issue:null})):t.push(new E({id:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.entity){if(r.id===r.entity)return t.push(new E({id:`${r.id}--${r.entity}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.entity);s?[n.CustomEntity,n.PrimitiveEntity,n.ActionDescriptor,n.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${r.id}--${r.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.entity}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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 me=class me{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"isNullable");c(this,"isList",null);c(this,"constant");c(this,"asType",null);c(this,"type",n.DataType);c(this,"options");c(this,"parentRelationType");c(this,"like");c(this,"defaultValue",null);c(this,"entity",null);c(this,"andChildrenGroup");c(this,"orChildrenGroup");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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,this.like=e.like||!1}static fromGenerationTarget(e,t){const i=w(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:n.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,like:e.like||!1,inferred:!1,defaultValue:null,entity:s,asType:e.asType,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=u5(i,t);if(a.push(...s,..._e(i)),i.entity){const y=t.get(i.entity);if(y.type===n.CustomEntity){const m=Zn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${F(m.map(v=>v.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.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
33
  ${Yn}`,issue:null}))}}}const o=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),l=o?Kn(o):null;if(l)a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${S(l,t)}" with id '${l.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const y=o.type,f=[n.Property,n.VariableDeclaration,n.ArgumentDeclaration,n.ReturnDeclaration,n.ValueDescriptor];if(f.includes(y)&&(i.parentRelationType&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${y}'.
34
34
  The entitities of type '${F(f,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const m=(p=o.dataType)==null?void 0:p.id;a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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 '${y}', because it already has a 'data-type' child with id '${m}'.
35
35
  The entitities of type '${F(f,"', '","' 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:
36
36
  ${an({describe_entity:m})}
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}))}y===n.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===je.DynamicArgumentTypes||i.parentRelationType===je.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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})),y===n.DataType&&(!i.parentRelationType||!(i.parentRelationType===je.AndDataTypeGroup||i.parentRelationType===je.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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(){const e=[this],t=[],i=[];return this.parent.type===n.DataType?this.parentRelationType===je.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===je.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===n.ActionDescriptor?this.parentRelationType===je.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===je.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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===n.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.like=e.like||this.like,this.inferred=e.inferred||this.inferred,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===n.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===n.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===n.DataType){if(this.parentRelationType===je.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===je.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===n.ActionDescriptor){const o=this.parent;this.parentRelationType===je.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===je.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();i.push(s)}return{affected:g(i),removed:g(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===n.CustomEntity&&this.entity.parent===this){const{affected:i}=this.entity.restore({seenEntities:e});t.push(...i)}if(this.parent.type===n.DataType){const i=this.parent;Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this)}if(this.parent.type===n.DataType){const i=this.parent;this.parentRelationType===je.AndDataTypeGroup?Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this):this.parentRelationType===je.OrDataTypeGroup&&Array.isArray(i.orChildrenGroup)&&i.orChildrenGroup.push(this)}else if(this.parent.type===n.ActionDescriptor){const i=this.parent;this.parentRelationType===je.DynamicArgumentTypes?i.setDynamicArgumentTypes(this):this.parentRelationType===je.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,like:this.like,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:n.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,like:this.like,inferred:this.inferred,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(l=>l.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(l=>l.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,like:this.like,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==n.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=u5(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,v,P,O;const a=this.toJSON(),s=t||tt(YI(this),n.DataType,this.project),o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,l+"-default-value-id",i);p.defaultValue=y||null;const f=(v=this.andChildrenGroup)==null?void 0:v.map((A,k)=>A.clone(this,l+"-and-group-data-type-"+k+"-id",i)),m=(P=this.orChildrenGroup)==null?void 0:P.map((A,k)=>A.clone(this,l+"-or-group-data-type-"+k+"-id",i));if(p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,this.entity&&this.entity.type===n.CustomEntity&&((O=this.entity)==null?void 0:O.parent)===this){const A=this.entity.clone(p,l+"-inferred-entity-id",i);p.setEntity(A)}else this.entity&&p.setEntity(this.entity);return p}merge(e){const t=[],i=[],a=[];if(this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isNullable!==(e==null?void 0:e.isNullable)&&(this.sync({isNullable:e==null?void 0:e.isNullable}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.constant!==(e==null?void 0:e.constant)&&(this.sync({constant:e==null?void 0:e.constant}),t.push(this)),this.like!==(e==null?void 0:e.like)&&(this.sync({like:e==null?void 0:e.like}),t.push(this)),e!=null&&e.inferred){if(e.entity&&e.entity.type===n.CustomEntity&&e.entity.parent===e){const s=e.entity.clone(this,this.id+"--inferred-entity-id",!0);this.setEntity(s),i.push(s)}else e.entity&&(this.setEntity(e.entity),t.push(this));this.inferred||(this.sync({inferred:!0,like:!0}),t.push(this))}else if(this.inferred){if(this.sync({inferred:!1}),t.push(this),this.entity&&this.entity.type===n.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this))}else e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this));if(this.inferred&&e.like&&(this.sync({like:!0}),t.push(this)),e.defaultValue)if(this.defaultValue){const{updated:s,added:o,removed:l}=this.defaultValue.merge(e.defaultValue);t.push(...s),i.push(...o),a.push(...l)}else{const s=e.defaultValue.clone(this,this.id+"--default-value-id",!0);this.setDefaultValue(s),i.push(s)}else if(this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}return{updated:g(t),added:g(i),removed:g(a),self:this}}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}isResolved(){return[n.BuiltInBaseEntity,n.ActionDescriptor].includes(this.parent.type)||Kn(this.parent)?!0:!(!this.entity&&(!this.andChildrenGroup||!this.andChildrenGroup.length)&&(!this.orChildrenGroup||!this.orChildrenGroup.length))}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const i={id:this.id+"--infered-entity",type:n.CustomEntity,version:1,name:S(this,this.project),description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=R(i,this.project);a.sync(i),a.setParent(this),a.initChildren(),this.setEntity(a)}return this.entity&&this.entity.inferFromInputs(e),this.like||this.sync({like:!0}),this}};c(me,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),c(me,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),c(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,"inferred"]),c(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),c(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),c(me,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),c(me,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),c(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let mi=me;function y5(r){var l;const e=N6(),t=r.toJSON();e.safeParse(t).success;const a=h5(r),s=Dn(r),o=[...a,...s];if(r.id==="exec-sequentially-operation-call-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});o.push(p.error)}return r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate(),ae(r.errors,o)}function h5(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),ae(r.errors,e)}const oe=class oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=w(i.declaration);if(o){const l=pD(o,t);a.push(...l)}else{const l=`
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}))}y===n.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===je.DynamicArgumentTypes||i.parentRelationType===je.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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})),y===n.DataType&&(!i.parentRelationType||!(i.parentRelationType===je.AndDataTypeGroup||i.parentRelationType===je.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.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(){const e=[this],t=[],i=[];return this.parent.type===n.DataType?this.parentRelationType===je.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===je.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===n.ActionDescriptor?this.parentRelationType===je.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===je.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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===n.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.like=e.like||this.like,this.inferred=e.inferred||this.inferred,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===n.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===n.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===n.DataType){if(this.parentRelationType===je.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===je.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===n.ActionDescriptor){const o=this.parent;this.parentRelationType===je.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===je.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();i.push(s)}return{affected:g(i),removed:g(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===n.CustomEntity&&this.entity.parent===this){const{affected:i}=this.entity.restore({seenEntities:e});t.push(...i)}if(this.parent.type===n.DataType){const i=this.parent;Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this)}if(this.parent.type===n.DataType){const i=this.parent;this.parentRelationType===je.AndDataTypeGroup?Array.isArray(i.andChildrenGroup)&&i.andChildrenGroup.push(this):this.parentRelationType===je.OrDataTypeGroup&&Array.isArray(i.orChildrenGroup)&&i.orChildrenGroup.push(this)}else if(this.parent.type===n.ActionDescriptor){const i=this.parent;this.parentRelationType===je.DynamicArgumentTypes?i.setDynamicArgumentTypes(this):this.parentRelationType===je.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,like:this.like,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:n.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,like:this.like,inferred:this.inferred,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(l=>l.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(l=>l.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,like:this.like,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==n.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=d5(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,v,P,O;const a=this.toJSON(),s=t||tt(YI(this),n.DataType,this.project),o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,l+"-default-value-id",i);p.defaultValue=y||null;const f=(v=this.andChildrenGroup)==null?void 0:v.map((A,k)=>A.clone(this,l+"-and-group-data-type-"+k+"-id",i)),m=(P=this.orChildrenGroup)==null?void 0:P.map((A,k)=>A.clone(this,l+"-or-group-data-type-"+k+"-id",i));if(p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,this.entity&&this.entity.type===n.CustomEntity&&((O=this.entity)==null?void 0:O.parent)===this){const A=this.entity.clone(p,l+"-inferred-entity-id",i);p.setEntity(A)}else this.entity&&p.setEntity(this.entity);return p}merge(e){const t=[],i=[],a=[];if(this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isNullable!==(e==null?void 0:e.isNullable)&&(this.sync({isNullable:e==null?void 0:e.isNullable}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.constant!==(e==null?void 0:e.constant)&&(this.sync({constant:e==null?void 0:e.constant}),t.push(this)),this.like!==(e==null?void 0:e.like)&&(this.sync({like:e==null?void 0:e.like}),t.push(this)),e!=null&&e.inferred){if(e.entity&&e.entity.type===n.CustomEntity&&e.entity.parent===e){const s=e.entity.clone(this,this.id+"--inferred-entity-id",!0);this.setEntity(s),i.push(s)}else e.entity&&(this.setEntity(e.entity),t.push(this));this.inferred||(this.sync({inferred:!0,like:!0}),t.push(this))}else if(this.inferred){if(this.sync({inferred:!1}),t.push(this),this.entity&&this.entity.type===n.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this))}else e.entity!==this.entity&&(this.setEntity(e.entity),t.push(this));if(this.inferred&&e.like&&(this.sync({like:!0}),t.push(this)),e.defaultValue)if(this.defaultValue){const{updated:s,added:o,removed:l}=this.defaultValue.merge(e.defaultValue);t.push(...s),i.push(...o),a.push(...l)}else{const s=e.defaultValue.clone(this,this.id+"--default-value-id",!0);this.setDefaultValue(s),i.push(s)}else if(this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:new Set});a.push(...o),s.push(...s)}return{updated:g(t),added:g(i),removed:g(a),self:this}}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}isResolved(){return[n.BuiltInBaseEntity,n.ActionDescriptor].includes(this.parent.type)||Kn(this.parent)?!0:!(!this.entity&&(!this.andChildrenGroup||!this.andChildrenGroup.length)&&(!this.orChildrenGroup||!this.orChildrenGroup.length))}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const i={id:this.id+"--infered-entity",type:n.CustomEntity,version:1,name:S(this,this.project),description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=R(i,this.project);a.sync(i),a.setParent(this),a.initChildren(),this.setEntity(a)}return this.entity&&this.entity.inferFromInputs(e),this.like||this.sync({like:!0}),this}};c(me,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),c(me,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),c(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,"inferred"]),c(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),c(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),c(me,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),c(me,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),c(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let mi=me;function p5(r){var l;const e=_6(),t=r.toJSON();e.safeParse(t).success;const a=y5(r),s=Dn(r),o=[...a,...s];if(r.id==="exec-sequentially-operation-call-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});o.push(p.error)}return r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate(),ae(r.errors,o)}function y5(r){const e=[];return r.inputs.forEach(t=>{t.validate()}),ae(r.errors,e)}const oe=class oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=w(i.declaration);if(o){const l=pD(o,t);a.push(...l)}else{const l=`
38
38
  All built-in 'action-descriptor' entity ids are:
39
39
  - ${t.operationDeclarations.map(p=>`${p.id} (${S(p,t)})`).join(`
40
40
  - `)}.
41
41
  `;a.push(new E({id:`${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.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.
42
42
  References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${l}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
43
43
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
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 a;const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addOperation(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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)}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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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)),...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()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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.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(){const e=this.parent.type===n.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.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=y5(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 oe(this.toJSON(),this.project)}};c(oe,"MUTABLE_BASE_PROPERTIES",[]),c(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"x","y"]),c(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),c(oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let Ir=oe;function f5(r){const e=Ej(),t=r.toJSON();e.safeParse(t).success;const a=Ot(r);r.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return ae(r.errors,s)}const le=class le{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"type",n.GlobalEvent);c(this,"inputs",[]);c(this,"calls",[]);c(this,"returnStatements",[]);c(this,"parent");c(this,"implements");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(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 l=w(e.parent);i=t.get(l)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:n.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=Je(i,{},t);if(i=s.modifiedData,a.push(...s.errors,..._e(i)),!e.implements)a.push(new E({id:`${e.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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.
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 a;const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addOperation(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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)}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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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)),...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()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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.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(){const e=this.parent.type===n.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.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=p5(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 oe(this.toJSON(),this.project)}};c(oe,"MUTABLE_BASE_PROPERTIES",[]),c(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"x","y"]),c(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),c(oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let Ir=oe;function h5(r){const e=Tj(),t=r.toJSON();e.safeParse(t).success;const a=Ot(r);r.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return ae(r.errors,s)}const le=class le{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"type",n.GlobalEvent);c(this,"inputs",[]);c(this,"calls",[]);c(this,"returnStatements",[]);c(this,"parent");c(this,"implements");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(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 l=w(e.parent);i=t.get(l)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:n.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=Je(i,{},t);if(i=s.modifiedData,a.push(...s.errors,..._e(i)),!e.implements)a.push(new E({id:`${e.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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
45
  ${So(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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
46
  ${So(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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
47
  ${So(t)}`,issue:null}));else{const p=t.events.find(y=>y.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return this.project.addGlobalEvent(this),{updated:g(e),added:g(t),removed:g(i),self: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!==n.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:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),Ot(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),{affected:g(i),removed:g(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)}),Ot(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:g(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Ot(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=Ot(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:n.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=f5(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Ot(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(){return new le(this.toJSON(),this.project)}getVariableInstances(){return ie(this).filter(i=>i.type===n.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}};c(le,"MUTABLE_BASE_PROPERTIES",["description"]),c(le,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),c(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),c(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),c(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),c(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),c(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),c(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let Ti=le;function m5(r){var o,l;const e=j8(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(o=r.error)==null||o.validate(),(l=r.body)==null||l.validate();const s=[...Dn(r)];return ae(r.errors,s)}const H=class H{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Loop);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"breakStatements",[]);c(this,"continueStatements",[]);c(this,"outputsDeclarations",[]);c(this,"body");c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"currentIterationNumberArgumentDeclaration");c(this,"currentValueArgumentDeclaration",null);c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.Loop,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],outputsDeclarations:[],error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0},declaration:{list:!1,types:[n.ActionDescriptor]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return this.project.addGlobalEvent(this),{updated:g(e),added:g(t),removed:g(i),self: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!==n.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:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),Ot(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),{affected:g(i),removed:g(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)}),Ot(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:g(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Ot(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=Ot(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:n.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=h5(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Ot(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(){return new le(this.toJSON(),this.project)}getVariableInstances(){return ie(this).filter(i=>i.type===n.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}};c(le,"MUTABLE_BASE_PROPERTIES",["description"]),c(le,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),c(le,"BASE_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,...le.INMUTABLE_BASE_PROPERTIES]),c(le,"MUTABLE_META_PROPERTIES",[...le.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),c(le,"INMUTABLE_META_PROPERTIES",[...le.INMUTABLE_BASE_PROPERTIES]),c(le,"META_PROPERTIES",[...le.MUTABLE_META_PROPERTIES,...le.INMUTABLE_META_PROPERTIES]),c(le,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(le,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(le,"UPSTREAM_PROPERTIES",[...le.MUTABLE_UPSTREAM_PROPERTIES,...le.INMUTABLE_UPSTREAM_PROPERTIES]),c(le,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(le,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(le,"DOWNSTREAM_PROPERTIES",[...le.MUTABLE_DOWNSTREAM_PROPERTIES,...le.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(le,"PROPERTIES",[...le.META_PROPERTIES,...le.UPSTREAM_PROPERTIES,...le.DOWNSTREAM_PROPERTIES]);let Ti=le;function f5(r){var o,l;const e=x8(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(o=r.error)==null||o.validate(),(l=r.body)==null||l.validate();const s=[...Dn(r)];return ae(r.errors,s)}const H=class H{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Loop);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"breakStatements",[]);c(this,"continueStatements",[]);c(this,"outputsDeclarations",[]);c(this,"body");c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"currentIterationNumberArgumentDeclaration");c(this,"currentValueArgumentDeclaration",null);c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.Loop,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],outputsDeclarations:[],error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0},declaration:{list:!1,types:[n.ActionDescriptor]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
49
49
  ${Co(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${n.Condition}' entities.
50
50
  ${Co(t)}`,issue:null})):a.push(new E({id:`${e.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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 '${n.Condition}' entities.
51
51
  ${Co(t)}`,issue:null})),{errors:a,modifiedData:i}}static fromReturnDeclarationToBodyArgumentDeclarationName(e){return`Previous iteration results of '${S(e,e.project)}'`}static fromBodyArgumentDeclarationToReturnDeclarationName(e){const t=e.name.replace("Previous iteration results of '","");return t.slice(0,t.length-1)}static fromReturnDeclarationToLoopOutputDeclarationName(e){return`Result list of '${S(e,e.project)}'`}static fromLoopOutputDeclarationToReturnDeclarationName(e){const t=e.name.replace("Result list of '","");return t.slice(0,t.length-1)}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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)}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}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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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.syncChildren(),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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()),outputsDeclarations:this.outputsDeclarations.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:n.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()),outputsDeclarations:this.outputsDeclarations.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===n.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=m5(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 H(this.toJSON(),this.project)}getVariableInstances(){return this.body?ie(this.body).filter(i=>i.type===n.VariableInstance):[]}addReturnStatement(e){return Ve.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return Ve.includes(this.parent.type)&&this.parent.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}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(i=>{i.outputs.forEach(s=>{e.find(l=>l===s||S(l,this.project)===S(s,this.project)&&Ht(l.dataType,s.dataType))||e.push(s)})}),g(e)}syncTerminationStatements(){const e=[],t=[],i=[],a=this.getUniqueReturnDeclarations(),s=[...this.breakStatements,...this.continueStatements];return a.forEach((o,l)=>{o.index!==l&&(o.sync({index:l}),e.push(o))}),s.forEach(o=>{const l=o.outputs,p=a.filter(y=>!l.find(f=>S(y,this.project)===S(f,this.project)&&Ht(y.dataType,f.dataType)));p.length&&e.push(o),p.forEach(y=>{const f=y.clone(o);f.addSelfToProject(),t.push(f)})}),{updated:g(e),added:g(t),removed:g(i),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.syncFixedBodyArgumentDeclarations();e.push(...a),t.push(...s),i.push(...o);const l=this.getUniqueReturnDeclarations(),p=this.body.inputs;l.forEach((b,v)=>{b.index!==v&&(b.sync({index:v}),e.push(b))}),l.forEach(b=>{const v=b.getDataType();let O=p.find(j=>S(j,this.project)===H.fromReturnDeclarationToBodyArgumentDeclarationName(b)&&Ht(j.dataType,b.dataType));if(!O){const j=H.fromReturnDeclarationToBodyArgumentDeclarationName(b),re={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:j,description:`Aggretated list of all previously outputted values from each iteration by the output '${S(b,this.project)}'`,dataType:null,implements:null,index:b.index,required:b.required,parent:this.body.toReference(),writesValues:[]},Ue=R(re,this.project);Ue.setParent(this.body),Ue.initChildren(),Ue.addSelfToProject(),t.push(Ue),O=Ue}O.index!==b.index&&(O.sync({index:b.index}),e.push(O));const A=O.getDataType();let k=A;if(v)if(!A||!Ht(A,v)){if(!k){const j=v.clone(O);j.addSelfToProject(),k=j,t.push(j),e.push(O)}k.merge(v),k.sync({isList:!0})}else k.isList||(k.sync({isList:!0}),e.push(k));if(!v&&!k){const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.sync({isList:!0}),re.setParent(O),re.initChildren(),re.addSelfToProject(),t.push(re)}});const{updated:y,added:f,removed:m}=this.removeExtraBodyArgumentDeclarations();return e.push(...y),t.push(...f),i.push(...m),{updated:g(e),added:g(t),removed:g(i),self:this}}syncOutputsDeclarations(){const e=[],t=[],i=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(v=>S(v,this.project)===H.fromReturnDeclarationToLoopOutputDeclarationName(l)&&Ht(v.dataType,l.dataType));if(!f){const v=H.fromReturnDeclarationToLoopOutputDeclarationName(l),P={id:_.UUID.uuid(),version:1,type:n.ValueDescriptor,name:v,description:`Aggretated list of all previously outputted values from each iteration by the output '${S(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.toReference()},O=R(P,this.project);O.setParent(this),O.initChildren(),O.addSelfToProject(),t.push(O),f=O}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));let b=f.getDataType();if(p)if(!b||!Ht(b,p)){if(!b){const v=p.clone(f);v.addSelfToProject(),b=v,t.push(v),e.push(f)}b.merge(p),b.sync({isList:!0})}else b.isList||(b.sync({isList:!0}),e.push(b));if(!p&&!b){const v={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},P=R(v,this.project);P.sync({isList:!0}),P.setParent(f),P.initChildren(),P.addSelfToProject(),t.push(P)}}),s.filter(l=>!a.find(y=>S(l,this.project)===H.fromReturnDeclarationToLoopOutputDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}syncOutputMaps(){const e=[],t=[],i=[],a=this.outputsDeclarations,s=this.outputs;return a.forEach(l=>{var f;let y=s.find(m=>{var b,v;return((b=m.declaration)==null?void 0:b.id)===l.id&&Ht((v=m.declaration)==null?void 0:v.dataType,l.dataType)});if(y)((f=y.declaration)==null?void 0:f.id)!==l.id&&(y.setDeclaration(l),e.push(y));else{const m={id:_.UUID.uuid(),version:1,type:n.OutputMap,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},b=R(m,this.project);b.setParent(this),b.initChildren(),b.addSelfToProject(),t.push(b),y=b}y.index!==l.index&&(y.sync({index:l.index}),e.push(y))}),s.filter(l=>!a.find(y=>{var f;return((f=l.declaration)==null?void 0:f.id)===y.id})).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}createCurrentIterationNumberArgumentDeclaration(){const e=[],t=[],i=[];let s=this.body.inputs.find(y=>{var f;return y.name===H.CURRENT_ITERATION_NUMBER_ARG_NAME||y.id===((f=this.currentIterationNumberArgumentDeclaration)==null?void 0:f.id)});const o=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!s){const y={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_ITERATION_NUMBER_ARG_NAME,description:"The number of the current iteration",dataType:null,implements:o==null?void 0:o.toJSON(),index:0,required:!0,parent:this.body.toReference(),writesValues:[]},f=R(y,this.project);f.setParent(this.body),f.initChildren(),f.addSelfToProject(),t.push(f),s=f}s.index!==0&&(s.sync({index:0}),e.push(s)),(!s.implements||s.implements.id!==o.id)&&(s.setImplements(o),e.push(s));let p=s.getDataType();if(!p){const y={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:s.toReference()},f=R(y,this.project);f.setParent(s),f.initChildren(),f.addSelfToProject(),t.push(f),p=f}if(!p.entity||p.entity.type!==n.PrimitiveEntity||p.entity.name!==I.Number||p.entity.id!==G["primitive-entity"].number.id){const y=this.project.getBuiltIn(G["primitive-entity"].number.id);p.setEntity(y),e.push(p)}return this.currentIterationNumberArgumentDeclaration=s,{updated:g(e),added:g(t),removed:g(i),self:this}}removeExtraBodyArgumentDeclarations(){const e=[],t=[],i=[],a=this.body.inputs,s=this.getUniqueReturnDeclarations();return a.filter(l=>l===this.currentIterationNumberArgumentDeclaration||l===this.currentValueArgumentDeclaration?!1:!s.find(y=>S(l,this.project)===H.fromReturnDeclarationToBodyArgumentDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}createCurrentValueInputBasedOnInputMap(){var l,p,y,f,m;const e=[],t=[],i=[];switch(this.declaration.id){case q.List:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)}),v=this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["list-loop"].inputs.list.id});if(!v)break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["list-loop"].inputs.list.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(!k){const re={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},Ue=R(re,this.project);Ue.setParent(O),Ue.initChildren(),Ue.addSelfToProject(),t.push(Ue),k=Ue}const j=v.getDataType();k.merge(j),k.sync({isList:!1})}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.ManualFlow:break;case q.Counted:break;case q.ObjectKeys:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)});if(!this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["object-keys-loop"].inputs.object.id}))break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=this.project.getBuiltIn(G["primitive-entity"].string.id);((l=k.entity)==null?void 0:l.id)!==j.id&&(k.setEntity(j),e.push(k))}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),k=re}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.ObjectValues:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)}),v=this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["object-values-loop"].inputs.object.id});if(!v)break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=v.getDataType(),re=((y=j==null?void 0:j.entity)==null?void 0:y.properties)||[];(f=k.orChildrenGroup)==null||f.forEach(Ue=>{const{affected:$r,removed:Pn}=Ue.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...$r),i.push(...Pn)}),re.forEach(Ue=>{const $r=Ue.getDataType();if($r){const Pn=$r.clone(k);Pn.sync({parentRelationType:je.OrDataTypeGroup}),Pn.addSelfToProject(),t.push(Pn)}else{const Pn={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:je.OrDataTypeGroup,parent:k.toReference()},Gr=R(Pn,this.project);Gr.setParent(k),Gr.initChildren(),Gr.addSelfToProject(),t.push(Gr)}})}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),k=re;const Ue=v.getDataType();(((p=Ue==null?void 0:Ue.entity)==null?void 0:p.properties)||[]).forEach(Pn=>{const Gr=Pn.getDataType();if(Gr){const $a=Gr.clone(re);$a.sync({parentRelationType:je.OrDataTypeGroup}),$a.addSelfToProject(),t.push($a)}else{const $a={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:je.OrDataTypeGroup,parent:re.toReference()},Uo=R($a,this.project);Uo.setParent(re),Uo.initChildren(),Uo.addSelfToProject(),t.push(Uo)}})}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.String:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)});if(!this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["string-loop"].inputs.string.id}))break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["string-loop"].inputs.string.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=this.project.getBuiltIn(G["primitive-entity"].string.id);((m=k.entity)==null?void 0:m.id)!==j.id&&(k.setEntity(j),e.push(k))}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),t.push(re),k=re}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}}const{updated:a,added:s,removed:o}=this.removeExtraBodyArgumentDeclarations();return e.push(...a),t.push(...s),i.push(...o),{updated:g(e),added:g(t),removed:g(i),self:this}}syncFixedBodyArgumentDeclarations(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.createCurrentIterationNumberArgumentDeclaration();e.push(...a),t.push(...s),i.push(...o);const{updated:l,added:p,removed:y}=this.createCurrentValueInputBasedOnInputMap();return e.push(...l),t.push(...p),i.push(...y),{updated:g(e),added:g(t),removed:g(i),self:this}}syncInputMaps(){const e=[],t=[],i=[];switch(this.declaration.id){case q.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["list-loop"].inputs.list.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["list-loop"].inputs.list.id){const s=this.project.get(G[n.Loop]["list-loop"].inputs.list.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["list-loop"].inputs.list.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ManualFlow:{this.inputs.forEach(a=>{a.remove(),i.push(a)});break}case q.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["counted-loop"].inputs.number.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["counted-loop"].inputs.number.id){const s=this.project.get(G[n.Loop]["counted-loop"].inputs.number.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["counted-loop"].inputs.number.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["object-keys-loop"].inputs.object.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["object-keys-loop"].inputs.object.id){const s=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["object-values-loop"].inputs.object.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["object-values-loop"].inputs.object.id){const s=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["string-loop"].inputs.string.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["string-loop"].inputs.string.id){const s=this.project.get(G[n.Loop]["string-loop"].inputs.string.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["string-loop"].inputs.string.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:g(e),added:g(t),removed:g(i),self:this}}getCurrentValueBuiltInValueDescriptor(){var t;const e=(t=G[n.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:t.id;return e?this.project.get(e):null}getCurrentIterationNumberBuiltInValueDescriptor(){const e=G[n.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(e)}syncBody(){var o;const e=[],t=[],i=[],a=G[n.Loop][this.declaration.id].body.id,s=this.project.getBuiltIn(a);if(this.body)((o=this.body.implements)==null?void 0:o.id)!==s.id&&(this.body.setImplements(s),this.body.setParent(this),e.push(this.body));else{const l={id:_.UUID.uuid(),version:1,type:n.FunctionDeclaration,name:s.name,description:null,inputs:[],index:null,returnStatements:[],calls:[],collapsed:!1,private:!1,implements:s.toJSON(),x:0,y:0,parent:this.toReference()},p=R(l,this.project);p.initChildren(),p.setParent(this),p.addSelfToProject(),t.push(p)}return{self:this,updated:g(e),added:g(t),removed:g(i)}}syncChildren(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.syncBody();e.push(...a),t.push(...s),i.push(...o);const{updated:l,added:p,removed:y}=this.syncInputMaps();e.push(...l),t.push(...p),i.push(...y);const{updated:f,added:m,removed:b}=this.syncTerminationStatements();e.push(...f),t.push(...m),i.push(...b);const{updated:v,added:P,removed:O}=this.syncBodyArgumentsDeclarations();e.push(...v),t.push(...P),i.push(...O);const{updated:A,added:k,removed:j}=this.syncOutputsDeclarations();e.push(...A),t.push(...k),i.push(...j);const{updated:re,added:Ue,removed:$r}=this.syncOutputMaps();return e.push(...re),t.push(...Ue),i.push(...$r),{self:this,updated:g(e),added:g(t),removed:g(i)}}};c(H,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),c(H,"CURRENT_VALUE_ARG_NAME","Current value"),c(H,"MUTABLE_BASE_PROPERTIES",[]),c(H,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(H,"BASE_PROPERTIES",[...H.MUTABLE_BASE_PROPERTIES,...H.INMUTABLE_BASE_PROPERTIES]),c(H,"MUTABLE_META_PROPERTIES",[...H.MUTABLE_BASE_PROPERTIES,"x","y"]),c(H,"INMUTABLE_META_PROPERTIES",[...H.INMUTABLE_BASE_PROPERTIES]),c(H,"META_PROPERTIES",[...H.MUTABLE_META_PROPERTIES,...H.INMUTABLE_META_PROPERTIES]),c(H,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(H,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(H,"UPSTREAM_PROPERTIES",[...H.MUTABLE_UPSTREAM_PROPERTIES,...H.INMUTABLE_UPSTREAM_PROPERTIES]),c(H,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(H,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(H,"DOWNSTREAM_PROPERTIES",[...H.MUTABLE_DOWNSTREAM_PROPERTIES,...H.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(H,"PROPERTIES",[...H.META_PROPERTIES,...H.UPSTREAM_PROPERTIES,...H.DOWNSTREAM_PROPERTIES]);let Dr=H;function T5(r){const e=T6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(o=>o.validate());const s=[...Dn(r)];return ae(r.errors,s)}const Te=class Te{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(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 f=w(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=w(f);return t.get(m)});let l;if(e.declaration){const f=w(e.declaration);l=t.get(f)}const p={id:e.id,version:1,type:n.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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)}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}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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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.syncChildren(),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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()),outputsDeclarations:this.outputsDeclarations.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:n.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()),outputsDeclarations:this.outputsDeclarations.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===n.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=f5(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 H(this.toJSON(),this.project)}getVariableInstances(){return this.body?ie(this.body).filter(i=>i.type===n.VariableInstance):[]}addReturnStatement(e){return Ve.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return Ve.includes(this.parent.type)&&this.parent.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}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(i=>{i.outputs.forEach(s=>{e.find(l=>l===s||S(l,this.project)===S(s,this.project)&&Ht(l.dataType,s.dataType))||e.push(s)})}),g(e)}syncTerminationStatements(){const e=[],t=[],i=[],a=this.getUniqueReturnDeclarations(),s=[...this.breakStatements,...this.continueStatements];return a.forEach((o,l)=>{o.index!==l&&(o.sync({index:l}),e.push(o))}),s.forEach(o=>{const l=o.outputs,p=a.filter(y=>!l.find(f=>S(y,this.project)===S(f,this.project)&&Ht(y.dataType,f.dataType)));p.length&&e.push(o),p.forEach(y=>{const f=y.clone(o);f.addSelfToProject(),t.push(f)})}),{updated:g(e),added:g(t),removed:g(i),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.syncFixedBodyArgumentDeclarations();e.push(...a),t.push(...s),i.push(...o);const l=this.getUniqueReturnDeclarations(),p=this.body.inputs;l.forEach((b,v)=>{b.index!==v&&(b.sync({index:v}),e.push(b))}),l.forEach(b=>{const v=b.getDataType();let O=p.find(j=>S(j,this.project)===H.fromReturnDeclarationToBodyArgumentDeclarationName(b)&&Ht(j.dataType,b.dataType));if(!O){const j=H.fromReturnDeclarationToBodyArgumentDeclarationName(b),re={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:j,description:`Aggretated list of all previously outputted values from each iteration by the output '${S(b,this.project)}'`,dataType:null,implements:null,index:b.index,required:b.required,parent:this.body.toReference(),writesValues:[]},Ue=R(re,this.project);Ue.setParent(this.body),Ue.initChildren(),Ue.addSelfToProject(),t.push(Ue),O=Ue}O.index!==b.index&&(O.sync({index:b.index}),e.push(O));const A=O.getDataType();let k=A;if(v)if(!A||!Ht(A,v)){if(!k){const j=v.clone(O);j.addSelfToProject(),k=j,t.push(j),e.push(O)}k.merge(v),k.sync({isList:!0})}else k.isList||(k.sync({isList:!0}),e.push(k));if(!v&&!k){const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.sync({isList:!0}),re.setParent(O),re.initChildren(),re.addSelfToProject(),t.push(re)}});const{updated:y,added:f,removed:m}=this.removeExtraBodyArgumentDeclarations();return e.push(...y),t.push(...f),i.push(...m),{updated:g(e),added:g(t),removed:g(i),self:this}}syncOutputsDeclarations(){const e=[],t=[],i=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(v=>S(v,this.project)===H.fromReturnDeclarationToLoopOutputDeclarationName(l)&&Ht(v.dataType,l.dataType));if(!f){const v=H.fromReturnDeclarationToLoopOutputDeclarationName(l),P={id:_.UUID.uuid(),version:1,type:n.ValueDescriptor,name:v,description:`Aggretated list of all previously outputted values from each iteration by the output '${S(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.toReference()},O=R(P,this.project);O.setParent(this),O.initChildren(),O.addSelfToProject(),t.push(O),f=O}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));let b=f.getDataType();if(p)if(!b||!Ht(b,p)){if(!b){const v=p.clone(f);v.addSelfToProject(),b=v,t.push(v),e.push(f)}b.merge(p),b.sync({isList:!0})}else b.isList||(b.sync({isList:!0}),e.push(b));if(!p&&!b){const v={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},P=R(v,this.project);P.sync({isList:!0}),P.setParent(f),P.initChildren(),P.addSelfToProject(),t.push(P)}}),s.filter(l=>!a.find(y=>S(l,this.project)===H.fromReturnDeclarationToLoopOutputDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}syncOutputMaps(){const e=[],t=[],i=[],a=this.outputsDeclarations,s=this.outputs;return a.forEach(l=>{var f;let y=s.find(m=>{var b,v;return((b=m.declaration)==null?void 0:b.id)===l.id&&Ht((v=m.declaration)==null?void 0:v.dataType,l.dataType)});if(y)((f=y.declaration)==null?void 0:f.id)!==l.id&&(y.setDeclaration(l),e.push(y));else{const m={id:_.UUID.uuid(),version:1,type:n.OutputMap,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},b=R(m,this.project);b.setParent(this),b.initChildren(),b.addSelfToProject(),t.push(b),y=b}y.index!==l.index&&(y.sync({index:l.index}),e.push(y))}),s.filter(l=>!a.find(y=>{var f;return((f=l.declaration)==null?void 0:f.id)===y.id})).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}createCurrentIterationNumberArgumentDeclaration(){const e=[],t=[],i=[];let s=this.body.inputs.find(y=>{var f;return y.name===H.CURRENT_ITERATION_NUMBER_ARG_NAME||y.id===((f=this.currentIterationNumberArgumentDeclaration)==null?void 0:f.id)});const o=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!s){const y={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_ITERATION_NUMBER_ARG_NAME,description:"The number of the current iteration",dataType:null,implements:o==null?void 0:o.toJSON(),index:0,required:!0,parent:this.body.toReference(),writesValues:[]},f=R(y,this.project);f.setParent(this.body),f.initChildren(),f.addSelfToProject(),t.push(f),s=f}s.index!==0&&(s.sync({index:0}),e.push(s)),(!s.implements||s.implements.id!==o.id)&&(s.setImplements(o),e.push(s));let p=s.getDataType();if(!p){const y={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:s.toReference()},f=R(y,this.project);f.setParent(s),f.initChildren(),f.addSelfToProject(),t.push(f),p=f}if(!p.entity||p.entity.type!==n.PrimitiveEntity||p.entity.name!==I.Number||p.entity.id!==G["primitive-entity"].number.id){const y=this.project.getBuiltIn(G["primitive-entity"].number.id);p.setEntity(y),e.push(p)}return this.currentIterationNumberArgumentDeclaration=s,{updated:g(e),added:g(t),removed:g(i),self:this}}removeExtraBodyArgumentDeclarations(){const e=[],t=[],i=[],a=this.body.inputs,s=this.getUniqueReturnDeclarations();return a.filter(l=>l===this.currentIterationNumberArgumentDeclaration||l===this.currentValueArgumentDeclaration?!1:!s.find(y=>S(l,this.project)===H.fromReturnDeclarationToBodyArgumentDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),i.push(...y)}),{updated:g(e),added:g(t),removed:g(i),self:this}}createCurrentValueInputBasedOnInputMap(){var l,p,y,f,m;const e=[],t=[],i=[];switch(this.declaration.id){case q.List:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)}),v=this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["list-loop"].inputs.list.id});if(!v)break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["list-loop"].inputs.list.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(!k){const re={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},Ue=R(re,this.project);Ue.setParent(O),Ue.initChildren(),Ue.addSelfToProject(),t.push(Ue),k=Ue}const j=v.getDataType();k.merge(j),k.sync({isList:!1})}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.ManualFlow:break;case q.Counted:break;case q.ObjectKeys:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)});if(!this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["object-keys-loop"].inputs.object.id}))break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=this.project.getBuiltIn(G["primitive-entity"].string.id);((l=k.entity)==null?void 0:l.id)!==j.id&&(k.setEntity(j),e.push(k))}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),k=re}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.ObjectValues:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)}),v=this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["object-values-loop"].inputs.object.id});if(!v)break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=v.getDataType(),re=((y=j==null?void 0:j.entity)==null?void 0:y.properties)||[];(f=k.orChildrenGroup)==null||f.forEach(Ue=>{const{affected:$r,removed:Pn}=Ue.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...$r),i.push(...Pn)}),re.forEach(Ue=>{const $r=Ue.getDataType();if($r){const Pn=$r.clone(k);Pn.sync({parentRelationType:je.OrDataTypeGroup}),Pn.addSelfToProject(),t.push(Pn)}else{const Pn={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:je.OrDataTypeGroup,parent:k.toReference()},Gr=R(Pn,this.project);Gr.setParent(k),Gr.initChildren(),Gr.addSelfToProject(),t.push(Gr)}})}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),k=re;const Ue=v.getDataType();(((p=Ue==null?void 0:Ue.entity)==null?void 0:p.properties)||[]).forEach(Pn=>{const Gr=Pn.getDataType();if(Gr){const $a=Gr.clone(re);$a.sync({parentRelationType:je.OrDataTypeGroup}),$a.addSelfToProject(),t.push($a)}else{const $a={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parentRelationType:je.OrDataTypeGroup,parent:re.toReference()},Uo=R($a,this.project);Uo.setParent(re),Uo.initChildren(),Uo.addSelfToProject(),t.push(Uo)}})}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}case q.String:{const b=this.body.inputs.find(O=>{var A;return O.name===H.CURRENT_VALUE_ARG_NAME||O.id===((A=this.currentValueArgumentDeclaration)==null?void 0:A.id)});if(!this.inputs.find(O=>{var A;return((A=O.declaration)==null?void 0:A.id)===G[n.Loop]["string-loop"].inputs.string.id}))break;const P=this.getCurrentValueBuiltInValueDescriptor();if(b){const O=this.project.get(G[n.Loop]["string-loop"].inputs.string.id);P&&(!b.implements||b.implements.id!==P.id)&&(b.setImplements(P),e.push(b));let k=b.getDataType();if(k){const j=this.project.getBuiltIn(G["primitive-entity"].string.id);((m=k.entity)==null?void 0:m.id)!==j.id&&(k.setEntity(j),e.push(k))}else{const j={id:_.UUID.uuid(),version:1,type:n.DataType,isList:!1,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:[],orChildrenGroup:[],parent:O.toReference()},re=R(j,this.project);re.setParent(O),re.initChildren(),re.addSelfToProject(),t.push(re),k=re}}else{const O={id:_.UUID.uuid(),version:1,type:n.ArgumentDeclaration,name:H.CURRENT_VALUE_ARG_NAME,description:null,index:0,required:!0,implements:P,writesValues:[],dataType:null,parent:this.body.toReference()},A=R(O,this.project);A.initChildren(),A.setParent(this.body),A.addSelfToProject(),P&&(!A.implements||A.implements.id!==P.id)&&(A.setImplements(P),e.push(A)),t.push(A)}break}}const{updated:a,added:s,removed:o}=this.removeExtraBodyArgumentDeclarations();return e.push(...a),t.push(...s),i.push(...o),{updated:g(e),added:g(t),removed:g(i),self:this}}syncFixedBodyArgumentDeclarations(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.createCurrentIterationNumberArgumentDeclaration();e.push(...a),t.push(...s),i.push(...o);const{updated:l,added:p,removed:y}=this.createCurrentValueInputBasedOnInputMap();return e.push(...l),t.push(...p),i.push(...y),{updated:g(e),added:g(t),removed:g(i),self:this}}syncInputMaps(){const e=[],t=[],i=[];switch(this.declaration.id){case q.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["list-loop"].inputs.list.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["list-loop"].inputs.list.id){const s=this.project.get(G[n.Loop]["list-loop"].inputs.list.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["list-loop"].inputs.list.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ManualFlow:{this.inputs.forEach(a=>{a.remove(),i.push(a)});break}case q.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["counted-loop"].inputs.number.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["counted-loop"].inputs.number.id){const s=this.project.get(G[n.Loop]["counted-loop"].inputs.number.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["counted-loop"].inputs.number.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["object-keys-loop"].inputs.object.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["object-keys-loop"].inputs.object.id){const s=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["object-keys-loop"].inputs.object.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["object-values-loop"].inputs.object.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["object-values-loop"].inputs.object.id){const s=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["object-values-loop"].inputs.object.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case q.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===G[n.Loop]["string-loop"].inputs.string.id?a=s:(s.remove(),i.push(s))}),a){if(a.declaration.id!==G[n.Loop]["string-loop"].inputs.string.id){const s=this.project.get(G[n.Loop]["string-loop"].inputs.string.id);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(G[n.Loop]["string-loop"].inputs.string.id),o={id:_.UUID.uuid(),version:1,type:n.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:g(e),added:g(t),removed:g(i),self:this}}getCurrentValueBuiltInValueDescriptor(){var t;const e=(t=G[n.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:t.id;return e?this.project.get(e):null}getCurrentIterationNumberBuiltInValueDescriptor(){const e=G[n.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(e)}syncBody(){var o;const e=[],t=[],i=[],a=G[n.Loop][this.declaration.id].body.id,s=this.project.getBuiltIn(a);if(this.body)((o=this.body.implements)==null?void 0:o.id)!==s.id&&(this.body.setImplements(s),this.body.setParent(this),e.push(this.body));else{const l={id:_.UUID.uuid(),version:1,type:n.FunctionDeclaration,name:s.name,description:null,inputs:[],index:null,returnStatements:[],calls:[],collapsed:!1,private:!1,implements:s.toJSON(),x:0,y:0,parent:this.toReference()},p=R(l,this.project);p.initChildren(),p.setParent(this),p.addSelfToProject(),t.push(p)}return{self:this,updated:g(e),added:g(t),removed:g(i)}}syncChildren(){const e=[],t=[],i=[],{updated:a,added:s,removed:o}=this.syncBody();e.push(...a),t.push(...s),i.push(...o);const{updated:l,added:p,removed:y}=this.syncInputMaps();e.push(...l),t.push(...p),i.push(...y);const{updated:f,added:m,removed:b}=this.syncTerminationStatements();e.push(...f),t.push(...m),i.push(...b);const{updated:v,added:P,removed:O}=this.syncBodyArgumentsDeclarations();e.push(...v),t.push(...P),i.push(...O);const{updated:A,added:k,removed:j}=this.syncOutputsDeclarations();e.push(...A),t.push(...k),i.push(...j);const{updated:re,added:Ue,removed:$r}=this.syncOutputMaps();return e.push(...re),t.push(...Ue),i.push(...$r),{self:this,updated:g(e),added:g(t),removed:g(i)}}};c(H,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),c(H,"CURRENT_VALUE_ARG_NAME","Current value"),c(H,"MUTABLE_BASE_PROPERTIES",[]),c(H,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(H,"BASE_PROPERTIES",[...H.MUTABLE_BASE_PROPERTIES,...H.INMUTABLE_BASE_PROPERTIES]),c(H,"MUTABLE_META_PROPERTIES",[...H.MUTABLE_BASE_PROPERTIES,"x","y"]),c(H,"INMUTABLE_META_PROPERTIES",[...H.INMUTABLE_BASE_PROPERTIES]),c(H,"META_PROPERTIES",[...H.MUTABLE_META_PROPERTIES,...H.INMUTABLE_META_PROPERTIES]),c(H,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(H,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(H,"UPSTREAM_PROPERTIES",[...H.MUTABLE_UPSTREAM_PROPERTIES,...H.INMUTABLE_UPSTREAM_PROPERTIES]),c(H,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(H,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(H,"DOWNSTREAM_PROPERTIES",[...H.MUTABLE_DOWNSTREAM_PROPERTIES,...H.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(H,"PROPERTIES",[...H.META_PROPERTIES,...H.UPSTREAM_PROPERTIES,...H.DOWNSTREAM_PROPERTIES]);let Dr=H;function m5(r){const e=m6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(o=>o.validate());const s=[...Dn(r)];return ae(r.errors,s)}const Te=class Te{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(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 f=w(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=w(f);return t.get(m)});let l;if(e.declaration){const f=w(e.declaration);l=t.get(f)}const p={id:e.id,version:1,type:n.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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 '${n.Condition}' entities.
54
54
  ${Bo(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 '${n.Condition}' entities.
55
55
  ${Bo(t)}`,issue:null})):a.push(new E({id:`${e.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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 '${n.Condition}' entities.
56
56
  ${Bo(t)}`,issue:null})),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:n.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===n.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=T5(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 Te(this.toJSON(),this.project)}};c(Te,"MUTABLE_BASE_PROPERTIES",["operator"]),c(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"MUTABLE_META_PROPERTIES",["x","y"]),c(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),c(Te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Te,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),c(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let Pr=Te;class tD{constructor(){c(this,"initialData")}}class E5{}class b5 extends tD{}class R5{}class g5{}class v5{}class su{}class I5 extends su{}class D5 extends su{}class P5{}class Ca{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==n.GenericReference)e.readsValue=R(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===n.GenericReference){const t=Nt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(ke.includes(e.readsValue.type)){let t=e.parent;dt.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}}class Ba{static initWritesValues(e,t){const i=e.initialData.writesValues.reduce((s,o)=>{if(o.type===n.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const l=R(o,e.project);return l.setValueWriter(e),ke.includes(l.type)&&(l.setParent(t),l.initChildren()),[...s,l]},[]),a=[...e.writesValues];return e.writesValues=g([...a,...i]),e.writesValues}}class A5{}function O5(r){var l;const e=rj(),t=r.toJSON();e.safeParse(t).success,(l=r.dataType)==null||l.validate(),r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),r.internalCalls.forEach(p=>p.validate());const s=[...Dn(r)];if(r.id==="random-company-employee-test-variable-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(p.error)}if(r.id==="company-dto-variable-one-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(p.error)}const o=mu(r);return s.push(...o),ae(r.errors,s)}const ce=class ce{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"dataType",null);c(this,"x");c(this,"y");c(this,"type",n.VariableDeclaration);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(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.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const f=w(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=w(f);return t.get(m)});let l=null;if(e.readsValue){const f=w(e.readsValue);l=t.get(f)}const p={id:e.id,version:1,type:n.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData;const o=tu(i,t);return a.push(...s.errors,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:n.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===n.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=m5(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 Te(this.toJSON(),this.project)}};c(Te,"MUTABLE_BASE_PROPERTIES",["operator"]),c(Te,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"MUTABLE_META_PROPERTIES",["x","y"]),c(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),c(Te,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Te,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),c(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let Pr=Te;class tD{constructor(){c(this,"initialData")}}class T5{}class E5 extends tD{}class b5{}class R5{}class g5{}class su{}class v5 extends su{}class I5 extends su{}class D5{}class Ca{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==n.GenericReference)e.readsValue=R(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===n.GenericReference){const t=Nt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(ke.includes(e.readsValue.type)){let t=e.parent;dt.includes(t.type)||(t=t.parent);const i=e.type===n.InputMap&&e.parent.type===n.Loop;i&&(t=e.parent.parent),e.readsValue.setParent(t),e.readsValue.initChildren(),!i&&t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):i||t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}}class Ba{static initWritesValues(e,t){const i=e.initialData.writesValues.reduce((s,o)=>{if(o.type===n.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const l=R(o,e.project);return l.setValueWriter(e),ke.includes(l.type)&&(l.setParent(t),l.initChildren()),[...s,l]},[]),a=[...e.writesValues];return e.writesValues=g([...a,...i]),e.writesValues}}class P5{}function A5(r){var l;const e=nj(),t=r.toJSON();e.safeParse(t).success,(l=r.dataType)==null||l.validate(),r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),r.internalCalls.forEach(p=>p.validate());const s=[...Dn(r)];if(r.id==="random-company-employee-test-variable-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(p.error)}if(r.id==="company-dto-variable-one-id"){const p=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(p.error)}const o=mu(r);return s.push(...o),ae(r.errors,s)}const ce=class ce{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"dataType",null);c(this,"x");c(this,"y");c(this,"type",n.VariableDeclaration);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(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.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let i=t;if(e.parent){const f=w(e.parent);i=t.get(f)}const a=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=w(f);return t.get(m)});let l=null;if(e.readsValue){const f=w(e.readsValue);l=t.get(f)}const p={id:e.id,version:1,type:n.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},y=R(p,t);return y.setParent(i),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData;const o=tu(i,t);return a.push(...s.errors,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
58
58
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
59
59
  Specifically for variables, their scope is also calculated from their value readers and value writters.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.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()),Ba.initWritesValues(this,this.parent),Ca.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.initialData.inputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return g([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>S(a,this.project)===S(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var i,a;if(!this.dataType){const s=R({id:this.id+"--infered-data-type",version:1,type:n.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,like:!0,inferred:!0,defaultValue:null,parent:this.toReference()},this.project);s.sync({inferred:!0,like:!0}),s.setParent(this),s.initChildren(),this.setDataType(s)}if(this.readsValue){const s=(i=this.readsValue.getDataType())==null?void 0:i.clone(this);return s&&(s.sync({inferred:!0,like:!0}),this.setDataType(s)),this}const e=g([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>S(l,this.project)===S(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):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),Va(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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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===n.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=O5(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 ce(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:n.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([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>S(y,this.project)===S(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>S(l,this.project)===S(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties].filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:_.UUID.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(i=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===i.id})).map(i=>{const a=i.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ce,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),c(ce,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let Ar=ce;function S5(r){const e=lj(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),r.internalCalls.forEach(l=>l.validate());const s=[...Dn(r)];if(r.id==="exec-sequentially-result-variable-id"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}const o=mu(r);return s.push(...o),ae(r.errors,s)}const de=class de{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.VariableInstance);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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){let i=t;if(e.parent){const b=w(e.parent);i=t.get(b)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const v=w(b);return t.get(v)}),l=e.calledBySuccess.map(b=>{const v=w(b);return t.get(v)}),p=e.calledByError.map(b=>{const v=w(b);return t.get(v)});let y=null;if(e.readsValue){const b=w(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:n.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},m=R(f,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0},declaration:{list:!1,types:[n.VariableDeclaration]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.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()),Ba.initWritesValues(this,this.parent),Ca.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.initialData.inputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return g([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>S(a,this.project)===S(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var i,a;if(!this.dataType){const s=R({id:this.id+"--infered-data-type",version:1,type:n.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,like:!0,inferred:!0,defaultValue:null,parent:this.toReference()},this.project);s.sync({inferred:!0,like:!0}),s.setParent(this),s.initChildren(),this.setDataType(s)}if(this.readsValue){const s=(i=this.readsValue.getDataType())==null?void 0:i.clone(this);return s&&(s.sync({inferred:!0,like:!0}),this.setDataType(s)),this}const e=g([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>S(l,this.project)===S(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):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),Va(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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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===n.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=A5(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 ce(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:n.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([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>S(y,this.project)===S(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>S(l,this.project)===S(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties].filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:_.UUID.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(i=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===i.id})).map(i=>{const a=i.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ce,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),c(ce,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let Ar=ce;function O5(r){const e=oj(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),r.internalCalls.forEach(l=>l.validate());const s=[...Dn(r)];if(r.id==="exec-sequentially-result-variable-id"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}const o=mu(r);return s.push(...o),ae(r.errors,s)}const de=class de{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.VariableInstance);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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){let i=t;if(e.parent){const b=w(e.parent);i=t.get(b)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const v=w(b);return t.get(v)}),l=e.calledBySuccess.map(b=>{const v=w(b);return t.get(v)}),p=e.calledByError.map(b=>{const v=w(b);return t.get(v)});let y=null;if(e.readsValue){const b=w(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:n.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:i},m=R(f,t);return m.setParent(i),m.initChildren(),m}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0},declaration:{list:!1,types:[n.VariableDeclaration]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
61
61
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
62
62
  Specifically for variables, their scope is also calculated from their value readers and value writters.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(i=>!(e.find(o=>o.id===i.id)||e.find(o=>o.declaration===i.declaration)))}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(){var e;if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===n.GenericReference){const t=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!t)return this;this.declaration=t}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return Ba.initWritesValues(this,this.parent),Ca.initReadsValue(this),this.initialData.inputs.forEach(t=>{const i=R(t,this.project);return i.setParent(this),i.initChildren(),this.addInput(i),i}),this.initialData.outputs.forEach(t=>{const i=R(t,this.project);return i.setParent(this),i.initChildren(),this.addOutput(i),i}),this.successCalls=this.initialData.successCalls.map(t=>{const i=R(t,this.project);return i.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(i.type)?(i.setParent(this.parent.parent),i.initChildren()):i.type!==n.InternalCall&&(i.setParent(this.parent),i.initChildren()),i}),this.errorCalls=this.initialData.errorCalls.map(t=>{const i=R(t,this.project);return i.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(i.type)?(i.setParent(this.parent.parent),i.initChildren()):i.type!==n.InternalCall&&(i.setParent(this.parent),i.initChildren()),i}),this.internalCalls=this.initialData.internalCalls.reduce((t,i)=>{if(i.type===n.GenericReference){const a=this.project.findSubscribedInstanceFromReference(i);if(!a)return t;const s=a;return s.setParent(this),[...t,s]}else{const a=R(i,this.project);return a.setParent(this),a.initChildren(),[...t,a]}},[]),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(e=this.declaration.dataType)!=null&&e.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),this.declaration.removeInstance(this),{affected:g(i),removed:g(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)}),this.declaration.subscribeInstance(this),{affected:g(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:n.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===n.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=S5(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 de(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([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>S(y,this.project)===S(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>S(l,this.project)===S(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties].filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:_.UUID.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(i=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===i.id})).map(i=>{const a=i.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(de,"MUTABLE_BASE_PROPERTIES",[]),c(de,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),c(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"x","y"]),c(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),c(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),c(de,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(de,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),c(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let Or=de;function C5(r){var s;const e=e6(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}return ae(r.errors,a)}const Ee=class Ee{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"isError");c(this,"type",n.ReturnDeclaration);c(this,"dataType",null);c(this,"readsValue",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s=null;if(e.readsValue){const p=w(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,implements:null,required:e.required,readsValue:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.ReturnStatement,n.Search,n.BreakStatement,n.ContinueStatement]}},t),o=iu(i,t);if(i=s.modifiedData,i.parent){const y=t.get(w(i.parent));if(y&&[n.BreakStatement,n.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(P=>P.id!==y.id),...m.continueStatements.filter(P=>P.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(i=>!(e.find(o=>o.id===i.id)||e.find(o=>o.declaration===i.declaration)))}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(){var e;if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===n.GenericReference){const t=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!t)return this;this.declaration=t}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return Ba.initWritesValues(this,this.parent),Ca.initReadsValue(this),this.initialData.inputs.forEach(t=>{const i=R(t,this.project);return i.setParent(this),i.initChildren(),this.addInput(i),i}),this.initialData.outputs.forEach(t=>{const i=R(t,this.project);return i.setParent(this),i.initChildren(),this.addOutput(i),i}),this.successCalls=this.initialData.successCalls.map(t=>{const i=R(t,this.project);return i.addSuccessCaller(this),[n.BreakStatement,n.ContinueStatement].includes(i.type)?(i.setParent(this.parent.parent),i.initChildren()):i.type!==n.InternalCall&&(i.setParent(this.parent),i.initChildren()),i}),this.errorCalls=this.initialData.errorCalls.map(t=>{const i=R(t,this.project);return i.addErrorCaller(this),[n.BreakStatement,n.ContinueStatement].includes(i.type)?(i.setParent(this.parent.parent),i.initChildren()):i.type!==n.InternalCall&&(i.setParent(this.parent),i.initChildren()),i}),this.internalCalls=this.initialData.internalCalls.reduce((t,i)=>{if(i.type===n.GenericReference){const a=this.project.findSubscribedInstanceFromReference(i);if(!a)return t;const s=a;return s.setParent(this),[...t,s]}else{const a=R(i,this.project);return a.setParent(this),a.initChildren(),[...t,a]}},[]),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(e=this.declaration.dataType)!=null&&e.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{i.push(s),s.removeCall(this)}),this.declaration.removeInstance(this),{affected:g(i),removed:g(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)}),this.declaration.subscribeInstance(this),{affected:g(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:n.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===n.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=O5(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 de(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([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>S(y,this.project)===S(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=rn(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:n.InputMap,parent:this.toReference(),name:null,description:null,declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>S(l,this.project)===S(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties].filter(i=>!this.outputs.find(a=>a.declaration===i)).map(i=>{const a={id:_.UUID.uuid(),version:1,type:n.OutputMap,parent:this.toReference(),declaration:i,index:i.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([n.CustomEntity,n.PrimitiveEntity,n.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(i=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===i.id})).map(i=>{const a=i.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(de,"MUTABLE_BASE_PROPERTIES",[]),c(de,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),c(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"x","y"]),c(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),c(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),c(de,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(de,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUTABLE_UPSTREAM_PROPERTIES]),c(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(de,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let Or=de;function S5(r){var s;const e=Q8(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}return ae(r.errors,a)}const Ee=class Ee{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"isError");c(this,"type",n.ReturnDeclaration);c(this,"dataType",null);c(this,"readsValue",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s=null;if(e.readsValue){const p=w(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:n.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,implements:null,required:e.required,readsValue:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.ReturnStatement,n.Search,n.BreakStatement,n.ContinueStatement]}},t),o=iu(i,t);if(i=s.modifiedData,i.parent){const y=t.get(w(i.parent));if(y&&[n.BreakStatement,n.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(P=>P.id!==y.id),...m.continueStatements.filter(P=>P.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
64
64
  ${du}`,issue:null}));else{const P=(p=(l=b[0])==null?void 0:l.outputs[0])==null?void 0:p.name;P!==i.name&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${i.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This new 'return-declaration' doesn't have the same name "${P}" as the return declarations on the other statements in the same scope.
65
65
  ${du}`,issue:null}))}}else if(y&&y.type===n.ReturnStatement){const f=y.parent;if(f&&Ve.includes(f.type)){const m=f.implements;if(m)if(m.returnsType===M.Fixed){const b=m.fixedReturns.find(j=>j.name===i.name),v=m.fixedReturns.filter(j=>!y.outputs.find(Ue=>Ue.type===n.ReturnDeclaration&&Ue.name===j.name)),P=y.outputs.filter(j=>j.type===n.ReturnDeclaration),O=P.find(j=>j.name===i.name),A=P.length?`The parent entity already implements the following return declarations: ${F(P.map(j=>`'${j.id}' (${j.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",k=v.length?`The parent entity is still missing the following returns in the implementation: ${F(v.map(j=>`'${j.id}' (${j.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?O&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${n.ActionDescriptor} with fixed outputs.
66
66
  Adding a new return would make the implementation invalid. An return with the same name already exists in the parent entity.
@@ -70,9 +70,9 @@ Adding a new return would make the implementation invalid. There are no returns
70
70
  ${A}
71
71
  ${k}`,issue:null}))}else m.returnsType===M.Dynamic||m.returnsType===M.None&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ReturnDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${n.ActionDescriptor} with no outputs.
72
72
  Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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 a;const e=[this],t=[],i=[];if(this.parent.addOutputDeclaration(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),this.parent&&[n.BreakStatement,n.ContinueStatement].includes(this.parent.type)){const s=this.parent.parent,{updated:o,added:l,removed:p}=s.syncChildren();e.push(...o),t.push(...l),i.push(...p)}return{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return Ca.initReadsValue(this),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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:g(i),removed:g(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,i;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,implements:((t=this.implements)==null?void 0:t.toJSON())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i;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,implements:((t=this.implements)==null?void 0:t.toReference())||null,dataType:((i=this.dataType)==null?void 0:i.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=C5(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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ReturnDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",i);return p.dataType=y||null,p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}inferDataType(){const e=Zd(this);if(e){const t=e.clone(this);t&&(t.inferred=!0,this.setDataType(t))}return this}getDataType(){var e;return(!this.dataType||!this.dataType.isResolved()||(e=this.dataType)!=null&&e.inferred)&&this.readsValue&&this.inferDataType(),this.dataType}};c(Ee,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),c(Ee,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"MUTABLE_META_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,"index"]),c(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),c(Ee,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let _t=Ee;function B5(r){var o;const e=g6(),t=r.toJSON();e.safeParse(t).success,r.inputsDeclarations.forEach(l=>l.validate()),r.inputs.forEach(l=>l.validate()),r.outputsDeclarations.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...Dn(r)];if(r.id==="search-person-by-id-id"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}return ae(r.errors,s)}const Ne=class Ne{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"query");c(this,"type",n.Search);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"inputsDeclarations",[]);c(this,"inputs",[]);c(this,"outputsDeclarations",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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 y=w(e.parent);i=t.get(y)}const a=e.calledByEntry.map(y=>{const f=w(y);return t.get(f)}),s=e.calledBySuccess.map(y=>{const f=w(y);return t.get(f)}),o=e.calledByError.map(y=>{const f=w(y);return t.get(f)}),l={id:e.id,version:1,type:n.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(l,t);return p.setParent(i),p.initChildren(),p}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
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 a;const e=[this],t=[],i=[];if(this.parent.addOutputDeclaration(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),this.parent&&[n.BreakStatement,n.ContinueStatement].includes(this.parent.type)){const s=this.parent.parent,{updated:o,added:l,removed:p}=s.syncChildren();e.push(...o),t.push(...l),i.push(...p)}return{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return Ca.initReadsValue(this),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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:g(i),removed:g(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,i;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,implements:((t=this.implements)==null?void 0:t.toJSON())||null,readsValue:((i=this.readsValue)==null?void 0:i.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,i;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,implements:((t=this.implements)==null?void 0:t.toReference())||null,dataType:((i=this.dataType)==null?void 0:i.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=S5(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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ReturnDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",i);return p.dataType=y||null,p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}inferDataType(){const e=Zd(this);if(e){const t=e.clone(this);t&&(t.inferred=!0,this.setDataType(t))}return this}getDataType(){var e;return(!this.dataType||!this.dataType.isResolved()||(e=this.dataType)!=null&&e.inferred)&&this.readsValue&&this.inferDataType(),this.dataType}};c(Ee,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),c(Ee,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"MUTABLE_META_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,"index"]),c(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),c(Ee,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let _t=Ee;function C5(r){var o;const e=R6(),t=r.toJSON();e.safeParse(t).success,r.inputsDeclarations.forEach(l=>l.validate()),r.inputs.forEach(l=>l.validate()),r.outputsDeclarations.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...Dn(r)];if(r.id==="search-person-by-id-id"){const l=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});s.push(l.error)}return ae(r.errors,s)}const Ne=class Ne{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"query");c(this,"type",n.Search);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"inputsDeclarations",[]);c(this,"inputs",[]);c(this,"outputsDeclarations",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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 y=w(e.parent);i=t.get(y)}const a=e.calledByEntry.map(y=>{const f=w(y);return t.get(f)}),s=e.calledBySuccess.map(y=>{const f=w(y);return t.get(f)}),o=e.calledByError.map(y=>{const f=w(y);return t.get(f)}),l={id:e.id,version:1,type:n.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(l,t);return p.setParent(i),p.initChildren(),p}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
74
74
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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===n.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=B5(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 Ne(this.toJSON(),this.project)}};c(Ne,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ne,"BASE_PROPERTIES",[...Ne.MUTABLE_BASE_PROPERTIES,...Ne.INMUTABLE_BASE_PROPERTIES]),c(Ne,"MUTABLE_META_PROPERTIES",[...Ne.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ne,"INMUTABLE_META_PROPERTIES",[...Ne.INMUTABLE_BASE_PROPERTIES]),c(Ne,"META_PROPERTIES",[...Ne.MUTABLE_META_PROPERTIES,...Ne.INMUTABLE_META_PROPERTIES]),c(Ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ne,"UPSTREAM_PROPERTIES",[...Ne.MUTABLE_UPSTREAM_PROPERTIES,...Ne.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ne,"DOWNSTREAM_PROPERTIES",[...Ne.MUTABLE_DOWNSTREAM_PROPERTIES,...Ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ne,"PROPERTIES",[..._t.META_PROPERTIES,..._t.UPSTREAM_PROPERTIES,..._t.DOWNSTREAM_PROPERTIES]);let Sr=Ne;function w5(r){const e=yj(),t=r.toJSON();e.safeParse(t).success,r.functions.forEach(s=>s.validate()),r.events.forEach(s=>s.validate());const a=[];return ae(r.errors,a)}const be=class be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"type",n.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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:n.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:n.Project,type:n.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(..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return{updated:g(e),added:g(t),removed:g(i),self: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:l}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...l)}),{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:n.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=w5(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 be(this.toJSON(),this.project)}};c(be,"MUTABLE_BASE_PROPERTIES",[]),c(be,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),c(be,"MUTABLE_META_PROPERTIES",["x","y"]),c(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),c(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),c(be,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(be,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),c(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),c(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let Cr=be;function _5(r){var l;const e=P6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate();const a=Dn(r),s=N5(r),o=[...a,...s];return ae(r.errors,o)}function N5(r){const e=[],t=bo(r.parent),i=t==null?void 0:t.entity;if(!i)e.push(Z({id:`${r.id}--${D.InternalCallParentMissingDataType}`,code:D.InternalCallParentMissingDataType,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${r.declaration}".`,issue:null,entity:r}).error);else if(![n.CustomEntity,n.BuiltInBaseEntity,n.PrimitiveEntity].includes(i.type))e.push(Z({id:`${r.id}--${D.InternalCallParentDeclarationEntityInvalidType}`,code:D.InternalCallParentDeclarationEntityInvalidType,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
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(){const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(a=>{a.addSuccessCaller(this),e.push(a)}),this.errorCalls.forEach(a=>{a.addErrorCaller(this),e.push(a)}),this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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===n.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=C5(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 Ne(this.toJSON(),this.project)}};c(Ne,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ne,"BASE_PROPERTIES",[...Ne.MUTABLE_BASE_PROPERTIES,...Ne.INMUTABLE_BASE_PROPERTIES]),c(Ne,"MUTABLE_META_PROPERTIES",[...Ne.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ne,"INMUTABLE_META_PROPERTIES",[...Ne.INMUTABLE_BASE_PROPERTIES]),c(Ne,"META_PROPERTIES",[...Ne.MUTABLE_META_PROPERTIES,...Ne.INMUTABLE_META_PROPERTIES]),c(Ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ne,"UPSTREAM_PROPERTIES",[...Ne.MUTABLE_UPSTREAM_PROPERTIES,...Ne.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ne,"DOWNSTREAM_PROPERTIES",[...Ne.MUTABLE_DOWNSTREAM_PROPERTIES,...Ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ne,"PROPERTIES",[..._t.META_PROPERTIES,..._t.UPSTREAM_PROPERTIES,..._t.DOWNSTREAM_PROPERTIES]);let Sr=Ne;function B5(r){const e=pj(),t=r.toJSON();e.safeParse(t).success,r.functions.forEach(s=>s.validate()),r.events.forEach(s=>s.validate());const a=[];return ae(r.errors,a)}const be=class be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"type",n.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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:n.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:n.Project,type:n.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(..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];return{updated:g(e),added:g(t),removed:g(i),self: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:l}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});i.push(...o),a.push(...l)}),{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:n.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=B5(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 be(this.toJSON(),this.project)}};c(be,"MUTABLE_BASE_PROPERTIES",[]),c(be,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),c(be,"MUTABLE_META_PROPERTIES",["x","y"]),c(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),c(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),c(be,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(be,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),c(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),c(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let Cr=be;function w5(r){var l;const e=D6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(p=>p.validate()),r.outputs.forEach(p=>p.validate()),(l=r.error)==null||l.validate();const a=Dn(r),s=_5(r),o=[...a,...s];return ae(r.errors,o)}function _5(r){const e=[],t=bo(r.parent),i=t==null?void 0:t.entity;if(!i)e.push(Z({id:`${r.id}--${D.InternalCallParentMissingDataType}`,code:D.InternalCallParentMissingDataType,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${r.declaration}".`,issue:null,entity:r}).error);else if(![n.CustomEntity,n.BuiltInBaseEntity,n.PrimitiveEntity].includes(i.type))e.push(Z({id:`${r.id}--${D.InternalCallParentDeclarationEntityInvalidType}`,code:D.InternalCallParentDeclarationEntityInvalidType,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
76
76
  This variable's data-type has an 'entity' field that references an entity with id '${i.id}' and of type '${i.type}'.`,issue:null,entity:r}).error);else{const a=Pu(i),s=[];[n.CustomEntity,n.BuiltInBaseEntity,n.PrimitiveEntity].includes(i.type)&&s.push(...i.getAllInteractiveMethods());let o="";a?i.methods.length?o=`
77
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:
78
78
  - ${i.methods.map(y=>y.id).join(`
@@ -101,7 +101,7 @@ ${Yn}`);const b=i.declaration;if(!t.get(b))a.push(new E({id:`${i.id}--${h.Refere
101
101
  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.${m}`,issue:null})):a.push(new E({id:`${i.id}--${D.InternalCallDeclarationNotFoundInParentDatatypeEntity}`,code:D.InternalCallDeclarationNotFoundInParentDatatypeEntity,severity:T.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}".${m}`,issue:null}))}}(l.inputs.length||l.outputs.length||l.internalCalls.length)&&a.push(new E({id:`${i.id}--${h.InvalidInternalCallParentRelation}`,code:h.InvalidInternalCallParentRelation,severity:T.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.
102
102
  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.
103
103
  The you can attach the new internal-call to it.`,issue:null}))}return a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
104
- 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 a;const e=[this],t=[],i=[];return this.parent.addInternalCall(this),e.push(this.parent),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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!==n.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&&dt.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==n.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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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:n.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=_5(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 ue(this.toJSON(),this.project)}};c(ue,"MUTABLE_BASE_PROPERTIES",[]),c(ue,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"index"]),c(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),c(ue,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),c(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Ei=ue;function M5(r){const e=C6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-argument-map-id"){const s=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(s.error)}return ae(r.errors,a)}const Re=class Re{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"name",null);c(this,"description",null);c(this,"declaration",null);c(this,"type",n.InputMap);c(this,"defaultValue",null);c(this,"readsValue",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s=null;if(e.declaration){const y=w(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=w(e.readsValue);o=t.get(y)}const l={id:e.id,version:1,name:e.name||null,type:n.InputMap,index:(a.inputs||[]).length,description:e.description||null,declaration:s,readsValue:o,defaultValue:null,parent:a},p=R(l,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...Ge,n.InputMap]}},t);i=s.modifiedData;const o=t.get(i.parent),l=i.declaration&&(t.get(i.declaration)||t.getBuiltIn(i.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return i.declaration&&((m=f.declaration)==null?void 0:m.id)===i.declaration});if(i.declaration?l?[n.Property,n.ArgumentDeclaration,n.ValueDescriptor].includes(l.type)?o&&l.type===n.ArgumentDeclaration&&![n.FunctionCall,n.Search,n.InternalCall].includes(o.type)?a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${n.ArgumentDeclaration}' with id '${i.declaration}'.
104
+ 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 a;const e=[this],t=[],i=[];return this.parent.addInternalCall(this),e.push(this.parent),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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!==n.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&&dt.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==n.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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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:n.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=w5(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 ue(this.toJSON(),this.project)}};c(ue,"MUTABLE_BASE_PROPERTIES",[]),c(ue,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"index"]),c(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),c(ue,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ue,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),c(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let Ei=ue;function N5(r){const e=S6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-argument-map-id"){const s=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(s.error)}return ae(r.errors,a)}const Re=class Re{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"name",null);c(this,"description",null);c(this,"declaration",null);c(this,"type",n.InputMap);c(this,"defaultValue",null);c(this,"readsValue",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s=null;if(e.declaration){const y=w(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=w(e.readsValue);o=t.get(y)}const l={id:e.id,version:1,name:e.name||null,type:n.InputMap,index:(a.inputs||[]).length,description:e.description||null,declaration:s,readsValue:o,defaultValue:null,parent:a},p=R(l,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...Ge,n.InputMap]}},t);i=s.modifiedData;const o=t.get(i.parent),l=i.declaration&&(t.get(i.declaration)||t.getBuiltIn(i.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return i.declaration&&((m=f.declaration)==null?void 0:m.id)===i.declaration});if(i.declaration?l?[n.Property,n.ArgumentDeclaration,n.ValueDescriptor].includes(l.type)?o&&l.type===n.ArgumentDeclaration&&![n.FunctionCall,n.Search,n.InternalCall].includes(o.type)?a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${n.ArgumentDeclaration}' with id '${i.declaration}'.
105
105
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
106
106
  Only 'function-call', 'search' and 'internal-call' entities can have input-maps whose 'declaration' points to 'argument-declaration' entities.`,issue:null})):o&&l.type===n.Property&&!ke.includes(o.type)?a.push(new E({id:`${i.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${n.InputMap}' with id '${i.id}' has a 'declaration' property pointing to an entity with type '${n.Property}' with id '${i.declaration}'.
107
107
  The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
@@ -119,7 +119,7 @@ Input maps can only be added to variables which hold an entity with properties.`
119
119
  The entity of the data-type has the following properties that can be reads as input maps, ids: '${F(v.properties.map(O=>O.id),"', '","' and '")}'`,issue:null})))}else if(Ge.filter(f=>ke.includes(f)).includes(o.type)){const m=Ru(o),b=m.find(P=>P.id===i.declaration),v=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${F(m.map(P=>P.id),"', '","' and '")}'`;b||a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.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}'.
120
120
  You can't add an input-map to an entity that doesn't have a matching 'argument-declaration'.
121
121
  ${v}`,issue:null}))}}return a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];let i=JSON.parse(JSON.stringify(e));const a=_a(i,this);return i=a.modifiedData,t.push(...a.errors),i.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
122
- 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 a,s;const e=[this],t=[],i=[];if(this.parent.addInput(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),ke.includes(this.parent.type)&&((s=this.parent.getDataType())!=null&&s.inferred)){const o=this.parent.type===n.VariableDeclaration?this.parent:this.parent.declaration;o.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(o,...o.variableInstances)}return{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,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)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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.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.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.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...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()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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,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.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.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=M5(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 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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.InputMap,this.project);a.defaultValue=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.defaultValue)==null?void 0:f.clone(p,l+"--default-value-id",i);return p.defaultValue=y||null,p}getDataType(){var t;if(ke.includes(this.parent.type)){const i=br(this.parent),a=i.getDataType();(!a||a.inferred)&&i.inferDataTypeAndSyncInstancesInputsAndOutputs()}const e=(t=this.declaration)==null?void 0:t.getDataType();if(!e){const i=rn(this);if(i)return i}return e||null}};c(Re,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"MUTABLE_META_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,"index"]),c(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),c(Re,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),c(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let vn=Re;class V5 extends vn{constructor(t,i){super(t,i);c(this,"declaration",null);c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class L5 extends vn{constructor(t,i){super(t,i);c(this,"name",null);c(this,"description",null);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function $5(r){const e=l6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-return-map-id"){const s=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(s.error)}return ae(r.errors,a)}const pe=class pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"type",n.OutputMap);c(this,"parentRelationType");c(this,"declaration");c(this,"writesValues",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s;if(e.declaration){const p=w(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:n.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:Ge.filter(p=>p!==n.Condition)},declaration:{list:!1,types:[n.ReturnDeclaration,n.Property]}},t);i=s.modifiedData;const o=t.get(i.parent);if(o&&Ge.filter(p=>p!==n.Condition).includes(o.type)){const p=o.outputs.find(y=>y.declaration.id===w(i.declaration));if(p)a.push(new E({id:`${i.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${n.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'.
122
+ 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 a,s;const e=[this],t=[],i=[];if(this.parent.addInput(this),e.push(this.parent),(a=this.readsValue)==null||a.addValueReader(this),this.readsValue&&e.push(this.readsValue),ke.includes(this.parent.type)&&((s=this.parent.getDataType())!=null&&s.inferred)){const o=this.parent.type===n.VariableDeclaration?this.parent:this.parent.declaration;o.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(o,...o.variableInstances)}return{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,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)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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),Va(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.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.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.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...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()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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,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.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.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=N5(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 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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.InputMap,this.project);a.defaultValue=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.defaultValue)==null?void 0:f.clone(p,l+"--default-value-id",i);return p.defaultValue=y||null,p}getDataType(){var t;if(ke.includes(this.parent.type)){const i=br(this.parent),a=i.getDataType();(!a||a.inferred)&&i.inferDataTypeAndSyncInstancesInputsAndOutputs()}const e=(t=this.declaration)==null?void 0:t.getDataType();if(!e){const i=rn(this);if(i)return i}return e||null}};c(Re,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"MUTABLE_META_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,"index"]),c(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),c(Re,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(Re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),c(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let vn=Re;class M5 extends vn{constructor(t,i){super(t,i);c(this,"declaration",null);c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class V5 extends vn{constructor(t,i){super(t,i);c(this,"name",null);c(this,"description",null);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function L5(r){const e=o6(),t=r.toJSON();e.safeParse(t).success;const a=[];if(r.id==="exec-sequentially-return-map-id"){const s=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(s.error)}return ae(r.errors,a)}const pe=class pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"type",n.OutputMap);c(this,"parentRelationType");c(this,"declaration");c(this,"writesValues",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i);let s;if(e.declaration){const p=w(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:n.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l;let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:Ge.filter(p=>p!==n.Condition)},declaration:{list:!1,types:[n.ReturnDeclaration,n.Property]}},t);i=s.modifiedData;const o=t.get(i.parent);if(o&&Ge.filter(p=>p!==n.Condition).includes(o.type)){const p=o.outputs.find(y=>y.declaration.id===w(i.declaration));if(p)a.push(new E({id:`${i.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${n.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'.
123
123
  Any value reads can be done with that output-map instead.
124
124
  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 y=t.get(i.declaration);if(y&&ke.includes(o.type)){const f=br(o),m=f.dataType,b=(l=f.dataType)==null?void 0:l.entity;m?b?b.type===n.ActionDescriptor?a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.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.
125
125
  This means it can hold a function-call or operation as its value, to be executed programatically.
@@ -129,7 +129,7 @@ ${uu}`,issue:null})):a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSign
129
129
  ${uu}`,issue:null}))}else if(y){const f=o.outputs.find(m=>m.declaration.id===i.declaration);f&&a.push(new E({id:`${i.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${n.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 '${f.id}' that points to the same declaration.
130
130
  Any value reads can be done with that output-map instead.
131
131
  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,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
132
- 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(){const e=[this],t=[],i=[];return this.parent.addOutput(this),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,Ba.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}),e||(i.push(this.parent),this.parent.removeOutput(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.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),t.push(this.parent),this.parent.addOutput(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:n.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=$5(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 pe(this.toJSON(),this.project)}getDataType(){var t;return((t=this.declaration)==null?void 0:t.getDataType())||null}};c(pe,"MUTABLE_BASE_PROPERTIES",[]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"index"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let In=pe;class G5 extends In{constructor(t,i){super(t,i);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class F5 extends In{constructor(t,i){super(t,i);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function U5(r){var s;const e=kj(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="company-dto-func-declaration-argument-dcl-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}if(r.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}return ae(r.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"type",n.ArgumentDeclaration);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s={id:e.id,version:1,name:e.name,type:n.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,implements:null,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=Je(i,{parent:{list:!1,types:[n.FunctionDeclaration,n.Search,n.Condition]}},t);i=s.modifiedData;const o=ru(i,t);if(i.parent){const l=t.get(w(i.parent));if(l&&Ve.includes(l.type)){const p=l.implements;if(p)if(p.argumentsType===M.Fixed){const y=p.fixedArguments.find(O=>O.name===i.name),f=p.fixedArguments.filter(O=>!l.inputs.find(k=>k.type===n.ArgumentDeclaration&&k.name===O.name)),m=l.inputs.filter(O=>O.type===n.ArgumentDeclaration),b=m.find(O=>O.name===i.name),v=m.length?`The parent entity already implements the following arguments: ${F(m.map(O=>`'${O.id}' (${O.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",P=f.length?`The parent entity is still missing the following arguments in the implementation: ${F(f.map(O=>`'${O.id}' (${O.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";y?b&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${n.ActionDescriptor} with fixed arguments.
132
+ 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(){const e=[this],t=[],i=[];return this.parent.addOutput(this),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,Ba.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}),e||(i.push(this.parent),this.parent.removeOutput(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.writesValues.forEach(i=>{t.push(i),i.setValueWriter(this)}),t.push(this.parent),this.parent.addOutput(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:n.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=L5(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 pe(this.toJSON(),this.project)}getDataType(){var t;return((t=this.declaration)==null?void 0:t.getDataType())||null}};c(pe,"MUTABLE_BASE_PROPERTIES",[]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"index"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let In=pe;class $5 extends In{constructor(t,i){super(t,i);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class G5 extends In{constructor(t,i){super(t,i);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function F5(r){var s;const e=jj(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];if(r.id==="company-dto-func-declaration-argument-dcl-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}if(r.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=Z({id:`${r.id}--${N.PropertyImplementsNonAbstact}`,message:`Property "${S(r,r.project)}" with id "${r.id}" implements a non-abstract property "${S(r,r.project)}" with id "${r.id}".`,issue:null,severity:T.Error,code:N.PropertyImplementsNonAbstact,entity:r});a.push(o.error)}return ae(r.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"type",n.ArgumentDeclaration);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s={id:e.id,version:1,name:e.name,type:n.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,implements:null,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=Je(i,{parent:{list:!1,types:[n.FunctionDeclaration,n.Search,n.Condition]}},t);i=s.modifiedData;const o=ru(i,t);if(i.parent){const l=t.get(w(i.parent));if(l&&Ve.includes(l.type)){const p=l.implements;if(p)if(p.argumentsType===M.Fixed){const y=p.fixedArguments.find(O=>O.name===i.name),f=p.fixedArguments.filter(O=>!l.inputs.find(k=>k.type===n.ArgumentDeclaration&&k.name===O.name)),m=l.inputs.filter(O=>O.type===n.ArgumentDeclaration),b=m.find(O=>O.name===i.name),v=m.length?`The parent entity already implements the following arguments: ${F(m.map(O=>`'${O.id}' (${O.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",P=f.length?`The parent entity is still missing the following arguments in the implementation: ${F(f.map(O=>`'${O.id}' (${O.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";y?b&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${n.ActionDescriptor} with fixed arguments.
133
133
  Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
134
134
  ${v}
135
135
  ${P}`,issue:null})):a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${n.ActionDescriptor} with fixed arguments.
@@ -137,7 +137,7 @@ Adding a new argument would make the implementation invalid. There are no argume
137
137
  ${v}
138
138
  ${P}`,issue:null}))}else p.argumentsType===M.Dynamic||p.argumentsType===M.None&&a.push(new E({id:`${i.id}--${D.NoOverlapWithImplementedSignature}`,code:D.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${n.ArgumentDeclaration}' with id '${i.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${n.ActionDescriptor} with no arguments.
139
139
  Adding a new argument would make the implementation invalid.`,issue:null}))}}return a.push(...s.errors,...o,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
140
- 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(){const e=[this],t=[],i=[];return this.parent.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return Ba.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:g(i),removed:g(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:g(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,t;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,implements:((t=this.implements)==null?void 0:t.toJSON())||null,writesValues:this.writesValues.map(i=>i.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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,writesValues:this.writesValues.map(i=>i.toReference()),implements:((e=this.implements)==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(),...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=U5(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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ArgumentDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",i);return p.dataType=y||null,p}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};c(ge,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"MUTABLE_META_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,"index"]),c(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),c(ge,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),c(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),c(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Br=ge;function x5(r){const e=ud(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}function j5(r,e){const t=[];if(r.parent)if(r.parent){const i=e.get(r.parent);i?[n.InputMap,n.DataType].includes(i.type)?i.type===n.DataType&&i.defaultValue&&t.push(new E({id:`${r.id}--${r.parent}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${i.defaultValue.id}".
140
+ 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(){const e=[this],t=[],i=[];return this.parent.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(a=>{a.setValueWriter(this),e.push(a)}),{updated:g(e),added:g(t),removed:g(i),self: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}setImplements(e){return this.implements=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return Ba.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:g(i),removed:g(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:g(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,t;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,implements:((t=this.implements)==null?void 0:t.toJSON())||null,writesValues:this.writesValues.map(i=>i.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:n.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,writesValues:this.writesValues.map(i=>i.toReference()),implements:((e=this.implements)==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(),...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=F5(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=null,t=null,i=!0){var f;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ArgumentDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",i);return p.dataType=y||null,p}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};c(ge,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"MUTABLE_META_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,"index"]),c(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),c(ge,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),c(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),c(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Br=ge;function U5(r){const e=ud(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}function x5(r,e){const t=[];if(r.parent)if(r.parent){const i=e.get(r.parent);i?[n.InputMap,n.DataType].includes(i.type)?i.type===n.DataType&&i.defaultValue&&t.push(new E({id:`${r.id}--${r.parent}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${i.defaultValue.id}".
141
141
  Data types can only have one 'primitive-value' entity as 'defaultValue'.
142
142
  You can update the existing 'primitive-value' with the 'update' action, for example, like so:
143
143
  \`\`\`json
@@ -149,27 +149,27 @@ You can update the existing 'primitive-value' with the 'update' action, for exam
149
149
  }
150
150
  }
151
151
  }\`\`\`
152
- Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.valueAsType){const i=[],a=[],s=r.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 l=Do(o);t.push(...l),l.length===0&&a.push(o.entityId)}),a.forEach(o=>{const l=e.get(o);l?[n.CustomEntity,n.BuiltInBaseEntity].includes(l.type)||t.push(new E({id:`${r.id}--${o}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${o}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 ve=class ve{constructor(e,t){c(this,"initialData");c(this,"type",n.PrimitiveValue);c(this,"id");c(this,"version");c(this,"name");c(this,"autogeneration",null);c(this,"value",null);c(this,"valueAsType",null);c(this,"errors",[]);c(this,"parent");c(this,"project");c(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=w(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:n.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=j5(i,t);return a.push(...s,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
153
- 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(){const e=[this],t=[],i=[];return this.parent.setDefaultValue(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setValueAsType(e){return this.valueAsType=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:g(i),removed:g(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:n.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=x5(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||tt(this.name,n.PrimitiveValue,this.project);a.id=s;const o=Ut(a,this.project);return e&&o.setParent(e),i&&o.subscribe(),o}merge(e){const t=[],i=[],a=[];return this.valueAsType!==(e==null?void 0:e.valueAsType)&&(this.setValueAsType(e.valueAsType),t.push(this)),this.value!==e.value&&(this.value=e.value,t.push(this)),this.autogeneration!==e.autogeneration&&(this.autogeneration=e.autogeneration,t.push(this)),this.name!==e.name&&(this.name=e.name,t.push(this)),{updated:g(t),added:g(i),removed:g(a),self:this}}};c(ve,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),c(ve,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ve,"BASE_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES,...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"MUTABLE_META_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES]),c(ve,"INMUTABLE_META_PROPERTIES",[...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"META_PROPERTIES",[...ve.MUTABLE_META_PROPERTIES,...ve.INMUTABLE_META_PROPERTIES]),c(ve,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ve,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(ve,"UPSTREAM_PROPERTIES",[...ve.MUTABLE_UPSTREAM_PROPERTIES,...ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),c(ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ve,"DOWNSTREAM_PROPERTIES",[...ve.MUTABLE_DOWNSTREAM_PROPERTIES,...ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ve,"PROPERTIES",[...ve.META_PROPERTIES,...ve.UPSTREAM_PROPERTIES,...ve.DOWNSTREAM_PROPERTIES]);let bi=ve;function k5(r){var s;const e=Z8(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}function q5(r){var s;const e=W8(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}const Ie=class Ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.ContinueStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
152
+ Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.valueAsType){const i=[],a=[],s=r.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 l=Do(o);t.push(...l),l.length===0&&a.push(o.entityId)}),a.forEach(o=>{const l=e.get(o);l?[n.CustomEntity,n.BuiltInBaseEntity].includes(l.type)||t.push(new E({id:`${r.id}--${o}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${o}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 ve=class ve{constructor(e,t){c(this,"initialData");c(this,"type",n.PrimitiveValue);c(this,"id");c(this,"version");c(this,"name");c(this,"autogeneration",null);c(this,"value",null);c(this,"valueAsType",null);c(this,"errors",[]);c(this,"parent");c(this,"project");c(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=w(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:n.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=x5(i,t);return a.push(...s,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
153
+ 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(){const e=[this],t=[],i=[];return this.parent.setDefaultValue(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self:this}}setParent(e){return this.parent=e,this}setValueAsType(e){return this.valueAsType=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:g(i),removed:g(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:n.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=U5(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||tt(this.name,n.PrimitiveValue,this.project);a.id=s;const o=Ut(a,this.project);return e&&o.setParent(e),i&&o.subscribe(),o}merge(e){const t=[],i=[],a=[];return this.valueAsType!==(e==null?void 0:e.valueAsType)&&(this.setValueAsType(e.valueAsType),t.push(this)),this.value!==e.value&&(this.value=e.value,t.push(this)),this.autogeneration!==e.autogeneration&&(this.autogeneration=e.autogeneration,t.push(this)),this.name!==e.name&&(this.name=e.name,t.push(this)),{updated:g(t),added:g(i),removed:g(a),self:this}}};c(ve,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),c(ve,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ve,"BASE_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES,...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"MUTABLE_META_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES]),c(ve,"INMUTABLE_META_PROPERTIES",[...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"META_PROPERTIES",[...ve.MUTABLE_META_PROPERTIES,...ve.INMUTABLE_META_PROPERTIES]),c(ve,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ve,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(ve,"UPSTREAM_PROPERTIES",[...ve.MUTABLE_UPSTREAM_PROPERTIES,...ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),c(ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ve,"DOWNSTREAM_PROPERTIES",[...ve.MUTABLE_DOWNSTREAM_PROPERTIES,...ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ve,"PROPERTIES",[...ve.META_PROPERTIES,...ve.UPSTREAM_PROPERTIES,...ve.DOWNSTREAM_PROPERTIES]);let bi=ve;function j5(r){var s;const e=z8(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}function k5(r){var s;const e=J8(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}const Ie=class Ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.ContinueStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
154
154
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
155
155
  You shouldn't have to manually update a 'parent' property.
156
- Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addContinueStatement(this),e.push(this),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addContinueStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=q5(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 Ie(this.toJSON(),this.project)}};c(Ie,"MUTABLE_BASE_PROPERTIES",[]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",["x","y"]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let Et=Ie;const lt=class lt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.ReturnStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:dt}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
156
+ Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addContinueStatement(this),e.push(this),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addContinueStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=k5(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 Ie(this.toJSON(),this.project)}};c(Ie,"MUTABLE_BASE_PROPERTIES",[]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",["x","y"]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let Et=Ie;const lt=class lt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.ReturnStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:dt}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
157
157
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
158
158
  You shouldn't have to manually update a 'parent' property.
159
- 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(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addReturnStatement(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addReturnStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=k5(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 lt(this.toJSON(),this.project)}};c(lt,"MUTABLE_BASE_PROPERTIES",[]),c(lt,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(lt,"BASE_PROPERTIES",[...Et.MUTABLE_BASE_PROPERTIES,...Et.INMUTABLE_BASE_PROPERTIES]),c(lt,"MUTABLE_META_PROPERTIES",["x","y"]),c(lt,"INMUTABLE_META_PROPERTIES",[...Et.INMUTABLE_BASE_PROPERTIES]),c(lt,"META_PROPERTIES",[...Et.MUTABLE_META_PROPERTIES,...Et.INMUTABLE_META_PROPERTIES]),c(lt,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(lt,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(lt,"UPSTREAM_PROPERTIES",[...Et.MUTABLE_UPSTREAM_PROPERTIES,...Et.INMUTABLE_UPSTREAM_PROPERTIES]),c(lt,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(lt,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(lt,"DOWNSTREAM_PROPERTIES",[...Et.MUTABLE_DOWNSTREAM_PROPERTIES,...Et.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(lt,"PROPERTIES",[..._t.META_PROPERTIES,..._t.UPSTREAM_PROPERTIES,..._t.DOWNSTREAM_PROPERTIES]);let wr=lt;function J5(r){var s;const e=i6(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}const De=class De{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.BreakStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
159
+ 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(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addReturnStatement(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addReturnStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=j5(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 lt(this.toJSON(),this.project)}};c(lt,"MUTABLE_BASE_PROPERTIES",[]),c(lt,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(lt,"BASE_PROPERTIES",[...Et.MUTABLE_BASE_PROPERTIES,...Et.INMUTABLE_BASE_PROPERTIES]),c(lt,"MUTABLE_META_PROPERTIES",["x","y"]),c(lt,"INMUTABLE_META_PROPERTIES",[...Et.INMUTABLE_BASE_PROPERTIES]),c(lt,"META_PROPERTIES",[...Et.MUTABLE_META_PROPERTIES,...Et.INMUTABLE_META_PROPERTIES]),c(lt,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(lt,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(lt,"UPSTREAM_PROPERTIES",[...Et.MUTABLE_UPSTREAM_PROPERTIES,...Et.INMUTABLE_UPSTREAM_PROPERTIES]),c(lt,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(lt,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(lt,"DOWNSTREAM_PROPERTIES",[...Et.MUTABLE_DOWNSTREAM_PROPERTIES,...Et.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(lt,"PROPERTIES",[..._t.META_PROPERTIES,..._t.UPSTREAM_PROPERTIES,..._t.DOWNSTREAM_PROPERTIES]);let wr=lt;function q5(r){var s;const e=r6(),t=r.toJSON();e.safeParse(t).success,r.outputs.forEach(o=>o.validate()),(s=r.throws)==null||s.validate();const a=[];return ae(r.errors,a)}const De=class De{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.BreakStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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=w(e.parent),a=t.get(i),s=e.calledByEntry.map(f=>{const m=w(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=w(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=w(f);return t.get(m)}),p={id:e.id,version:1,type:n.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.Loop]}},t);return i=s.modifiedData,a.push(...s.errors,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
160
160
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
161
161
  You shouldn't have to manually update a 'parent' property.
162
- Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addBreakStatement(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addBreakStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=J5(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 De(this.toJSON(),this.project)}};c(De,"MUTABLE_BASE_PROPERTIES",[]),c(De,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(De,"BASE_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,...De.INMUTABLE_BASE_PROPERTIES]),c(De,"MUTABLE_META_PROPERTIES",["x","y"]),c(De,"INMUTABLE_META_PROPERTIES",[...De.INMUTABLE_BASE_PROPERTIES]),c(De,"META_PROPERTIES",[...De.MUTABLE_META_PROPERTIES,...De.INMUTABLE_META_PROPERTIES]),c(De,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(De,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(De,"UPSTREAM_PROPERTIES",[...De.MUTABLE_UPSTREAM_PROPERTIES,...De.INMUTABLE_UPSTREAM_PROPERTIES]),c(De,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(De,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(De,"DOWNSTREAM_PROPERTIES",[...De.MUTABLE_DOWNSTREAM_PROPERTIES,...De.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(De,"PROPERTIES",[...De.META_PROPERTIES,...De.UPSTREAM_PROPERTIES,...De.DOWNSTREAM_PROPERTIES]);let Ri=De;function W5(r){var s,o;const e=mv(),t=r.toJSON();e.safeParse(t).success,r.fixedArguments.flatMap(l=>l.validate()),r.fixedReturns.flatMap(l=>l.validate()),(s=r.dynamicArgumentTypes)==null||s.validate(),(o=r.dynamicReturnTypes)==null||o.validate();const a=[];return ae(r.errors,a)}const Pe=class Pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"argumentsType");c(this,"returnsType");c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"implementation",null);c(this,"parent",null);c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(o)}const a={id:e.id,version:1,name:e.name,type:n.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=Je(i,{parent:{list:!1,types:[n.CustomEntity,n.DataType]}},t);i=s.modifiedData;const o=i.parent?t.get(i.parent):null;if(o&&o.type===n.CustomEntity){const l=o,y=Zn(l).filter(f=>!f.interactive);if(y.length){let f=y.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(y.map(m=>S(m,m.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(y[0],y[0].project)}").`;f+=`
162
+ Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this],t=[],i=[];return this.calledByEntry.forEach(a=>{a.addCall(this),e.push(a)}),this.calledBySuccess.forEach(a=>{a.addSuccessCall(this),e.push(a)}),this.calledByError.forEach(a=>{a.addErrorCall(this),e.push(a)}),this.parent.addBreakStatement(this),e.push(this.parent),{updated:g(e),added:g(t),removed:g(i),self: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.parent.addBreakStatement(this),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),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:g(i),removed:g(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:g(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:n.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=q5(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 De(this.toJSON(),this.project)}};c(De,"MUTABLE_BASE_PROPERTIES",[]),c(De,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(De,"BASE_PROPERTIES",[...De.MUTABLE_BASE_PROPERTIES,...De.INMUTABLE_BASE_PROPERTIES]),c(De,"MUTABLE_META_PROPERTIES",["x","y"]),c(De,"INMUTABLE_META_PROPERTIES",[...De.INMUTABLE_BASE_PROPERTIES]),c(De,"META_PROPERTIES",[...De.MUTABLE_META_PROPERTIES,...De.INMUTABLE_META_PROPERTIES]),c(De,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(De,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(De,"UPSTREAM_PROPERTIES",[...De.MUTABLE_UPSTREAM_PROPERTIES,...De.INMUTABLE_UPSTREAM_PROPERTIES]),c(De,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(De,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(De,"DOWNSTREAM_PROPERTIES",[...De.MUTABLE_DOWNSTREAM_PROPERTIES,...De.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(De,"PROPERTIES",[...De.META_PROPERTIES,...De.UPSTREAM_PROPERTIES,...De.DOWNSTREAM_PROPERTIES]);let Ri=De;function J5(r){var s,o;const e=mv(),t=r.toJSON();e.safeParse(t).success,r.fixedArguments.flatMap(l=>l.validate()),r.fixedReturns.flatMap(l=>l.validate()),(s=r.dynamicArgumentTypes)==null||s.validate(),(o=r.dynamicReturnTypes)==null||o.validate();const a=[];return ae(r.errors,a)}const Pe=class Pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"argumentsType");c(this,"returnsType");c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"implementation",null);c(this,"parent",null);c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(o)}const a={id:e.id,version:1,name:e.name,type:n.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=Je(i,{parent:{list:!1,types:[n.CustomEntity,n.DataType]}},t);i=s.modifiedData;const o=i.parent?t.get(i.parent):null;if(o&&o.type===n.CustomEntity){const l=o,y=Zn(l).filter(f=>!f.interactive);if(y.length){let f=y.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements multiple '${n.BuiltInBaseEntity}' entities that are non-interactive ("${F(y.map(m=>S(m,m.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements a '${n.BuiltInBaseEntity}' entity that is non-interactive ("${S(y[0],y[0].project)}").`;f+=`
163
163
  ${Yn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:f,issue:null}))}}else if(o&&o.type===n.DataType){const l=o;l.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
164
164
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
165
165
  ${an({describe_entity:l.entity.id})}
166
166
  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,..._e(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
167
- 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(){const e=[this],t=[],i=[];return this.parent?(this.parent.type===n.CustomEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===n.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self:this}):{updated:g(e),added:g(t),removed:g(i),self: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:g(i),removed:g(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:g(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:n.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,l)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:n.ArgumentDeclaration,name:o.name,required:o.required,implements:o.toJSON(),writesValues:[],description:o.description,index:l,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),i=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var v;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:n.GenericReference,entityId:e,entityType:n.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:n.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,implements:f.toJSON(),isError:!1,index:m,dataType:((v=f.dataType)==null?void 0:v.toJSON())||null,parent:b}}),l={id:e+"--return-statement-parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:n.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};i.push(y),a.push(y)}return{id:e,version:this.version,type:n.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:n.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((l,p)=>{const f={id:l.toReference().id+"--input-map-id",version:this.version,type:n.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((l,p)=>{const f={id:l.toReference().id+"--output-map-id",version:this.version,type:n.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.Loop}};a.outputs.push(f)});const s={id:i+"--body-function-declaration-id",version:this.version,type:n.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:n.GenericReference,entityId:i,entityType:n.Loop}};s.inputs=[{id:_.UUID.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],implements:null,index:0,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.FunctionDeclaration}},{id:_.UUID.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],implements:null,index:1,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.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:n.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:i.toReference()};if(this.fixedArguments.forEach((l,p)=>{const y={id:a+tt(l.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((l,p)=>{const y={id:a+tt(l.name,n.OutputMap,this.project),version:this.version,type:n.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:n.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.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:n.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,l)=>{const p={id:i+tt(o.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.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=W5(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=null,t=null,i=!0){var m,b;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ActionDescriptor,this.project);a.fixedArguments=[],a.fixedReturns=[],a.dynamicArgumentTypes=null,a.dynamicReturnTypes=null,a.error=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):this.parent&&p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(m=this.fixedArguments)==null?void 0:m.map((v,P)=>v.clone(this,l+"-argument-value-descriptor-"+P+"-id",i));p.fixedArguments=y;const f=(b=this.fixedReturns)==null?void 0:b.map((v,P)=>v.clone(this,l+"-return-value-descriptor-"+P+"-id",i));return p.fixedReturns=f,this.dynamicArgumentTypes&&(p.dynamicArgumentTypes=this.dynamicArgumentTypes.clone(this,l+"-dynamic-argument-types-id",i)),this.dynamicReturnTypes&&(p.dynamicReturnTypes=this.dynamicReturnTypes.clone(this,l+"-dynamic-return-types-id",i)),this.error&&(p.error=this.error.clone(this,l+"-error-action-descriptor-id",i)),p}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}};c(Pe,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),c(Pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"MUTABLE_META_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES]),c(Pe,"INMUTABLE_META_PROPERTIES",[...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"META_PROPERTIES",[...Pe.MUTABLE_META_PROPERTIES,...Pe.INMUTABLE_META_PROPERTIES]),c(Pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),c(Pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Pe,"DOWNSTREAM_PROPERTIES",[...Pe.MUTABLE_DOWNSTREAM_PROPERTIES,...Pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Pe,"PROPERTIES",[...Pe.META_PROPERTIES,...Pe.UPSTREAM_PROPERTIES,...Pe.DOWNSTREAM_PROPERTIES]);let ne=Pe;function H5(r){var s;const e=v8(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];return ae(r.errors,a)}const Ae=class Ae{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",n.ValueDescriptor);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(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?w(e.parent):null,a=i?t.get(i):null,s=e.parentRelationType===B.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:n.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=R(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.ActionDescriptor]}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=i.parent&&t.get(i.parent),l=o&&Kn(o);return l&&l.type===n.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
167
+ 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(){const e=[this],t=[],i=[];return this.parent?(this.parent.type===n.CustomEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===n.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self:this}):{updated:g(e),added:g(t),removed:g(i),self: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:g(i),removed:g(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:g(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:n.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,l)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:n.ArgumentDeclaration,name:o.name,required:o.required,implements:o.toJSON(),writesValues:[],description:o.description,index:l,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),i=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var v;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:n.GenericReference,entityId:e,entityType:n.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:n.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,implements:f.toJSON(),isError:!1,index:m,dataType:((v=f.dataType)==null?void 0:v.toJSON())||null,parent:b}}),l={id:e+"--return-statement-parent-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:n.GenericReference,entityType:n.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:n.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};i.push(y),a.push(y)}return{id:e,version:this.version,type:n.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:n.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((l,p)=>{const f={id:l.toReference().id+"--input-map-id",version:this.version,type:n.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((l,p)=>{const f={id:l.toReference().id+"--output-map-id",version:this.version,type:n.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.Loop}};a.outputs.push(f)});const s={id:i+"--body-function-declaration-id",version:this.version,type:n.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:n.GenericReference,entityId:i,entityType:n.Loop}};s.inputs=[{id:_.UUID.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],implements:null,index:0,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.FunctionDeclaration}},{id:_.UUID.uuid(),version:this.version,type:n.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],implements:null,index:1,parent:{id:s.id,type:n.GenericReference,entityId:s.id,entityType:n.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:n.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:i.toReference()};if(this.fixedArguments.forEach((l,p)=>{const y={id:a+tt(l.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((l,p)=>{const y={id:a+tt(l.name,n.OutputMap,this.project),version:this.version,type:n.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:n.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:a,entityType:n.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:n.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,l)=>{const p={id:i+tt(o.name,n.InputMap,this.project),version:this.version,type:n.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,parent:{id:_.UUID.uuid(),type:n.GenericReference,entityId:i,entityType:n.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=J5(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=null,t=null,i=!0){var m,b;const a=this.toJSON(),s=t||tt(S(this,this.project),n.ActionDescriptor,this.project);a.fixedArguments=[],a.fixedReturns=[],a.dynamicArgumentTypes=null,a.dynamicReturnTypes=null,a.error=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):this.parent&&p.setParent(this.parent),i&&p.subscribe(),p.initChildren();const y=(m=this.fixedArguments)==null?void 0:m.map((v,P)=>v.clone(this,l+"-argument-value-descriptor-"+P+"-id",i));p.fixedArguments=y;const f=(b=this.fixedReturns)==null?void 0:b.map((v,P)=>v.clone(this,l+"-return-value-descriptor-"+P+"-id",i));return p.fixedReturns=f,this.dynamicArgumentTypes&&(p.dynamicArgumentTypes=this.dynamicArgumentTypes.clone(this,l+"-dynamic-argument-types-id",i)),this.dynamicReturnTypes&&(p.dynamicReturnTypes=this.dynamicReturnTypes.clone(this,l+"-dynamic-return-types-id",i)),this.error&&(p.error=this.error.clone(this,l+"-error-action-descriptor-id",i)),p}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}};c(Pe,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),c(Pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Pe,"BASE_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES,...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"MUTABLE_META_PROPERTIES",[...Pe.MUTABLE_BASE_PROPERTIES]),c(Pe,"INMUTABLE_META_PROPERTIES",[...Pe.INMUTABLE_BASE_PROPERTIES]),c(Pe,"META_PROPERTIES",[...Pe.MUTABLE_META_PROPERTIES,...Pe.INMUTABLE_META_PROPERTIES]),c(Pe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Pe,"UPSTREAM_PROPERTIES",[...Pe.MUTABLE_UPSTREAM_PROPERTIES,...Pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),c(Pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Pe,"DOWNSTREAM_PROPERTIES",[...Pe.MUTABLE_DOWNSTREAM_PROPERTIES,...Pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Pe,"PROPERTIES",[...Pe.META_PROPERTIES,...Pe.UPSTREAM_PROPERTIES,...Pe.DOWNSTREAM_PROPERTIES]);let ne=Pe;function W5(r){var s;const e=g8(),t=r.toJSON();e.safeParse(t).success,(s=r.dataType)==null||s.validate();const a=[];return ae(r.errors,a)}const Ae=class Ae{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",n.ValueDescriptor);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(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?w(e.parent):null,a=i?t.get(i):null,s=e.parentRelationType===B.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:n.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=R(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[n.ActionDescriptor]}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=i.parent&&t.get(i.parent),l=o&&Kn(o);return l&&l.type===n.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
168
168
  You can't modify system entities that are built-in.`,issue:null})),o&&o.type===n.ActionDescriptor&&(!i.parentRelationType||!(i.parentRelationType===B.FixedArguments||i.parentRelationType===B.FixedReturns||i.parentRelationType===B.ReturnedError)?a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either '${B.FixedArguments}', '${B.FixedReturns}', or '${B.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):i.parentRelationType===B.ReturnedError&&o.error&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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}'.
169
169
  An action descriptor can only have one error value descriptor child.
170
170
  Either remove the existing error value descriptor or update it with the 'update' action.
171
171
  You can use the 'describe_entity' action to get more information about the existing error value descriptor like so:
172
- ${an({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var a,s,o,l;const e=[this],t=[],i=[];return this.parentRelationType===B.FixedArguments?(s=(a=this.parent)==null?void 0:a.addFixedArgument)==null||s.call(a,this):this.parentRelationType===B.FixedReturns?(l=(o=this.parent)==null?void 0:o.addFixedReturn)==null||l.call(o,this):this.parentRelationType===B.ReturnedError&&this.parent&&(this.parent.error=this),this.parent&&([n.Search,n.Loop].includes(this.parent.type)&&this.parent.addOutputDeclaration(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self: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:g(i),removed:g(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:g(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:n.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=H5(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(e=null,t=null,i=!0){var f;const a=t||tt(S(this,this.project),n.ValueDescriptor,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l=this.toJSON();l.id=a;const p=Ut(l,this.project);e&&p.setParent(e),i&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",i))||null;return y&&p.setDataType(y),p}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}};c(Ae,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(Ae,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),c(Ae,"BASE_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"MUTABLE_META_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,"index"]),c(Ae,"INMUTABLE_META_PROPERTIES",[...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"META_PROPERTIES",[...Ae.MUTABLE_META_PROPERTIES,...Ae.INMUTABLE_META_PROPERTIES]),c(Ae,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ae,"UPSTREAM_PROPERTIES",[...Ae.MUTABLE_UPSTREAM_PROPERTIES,...Ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(Ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ae,"DOWNSTREAM_PROPERTIES",[...Ae.MUTABLE_DOWNSTREAM_PROPERTIES,...Ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ae,"PROPERTIES",[...Ae.META_PROPERTIES,...Ae.UPSTREAM_PROPERTIES,...Ae.DOWNSTREAM_PROPERTIES]);let _r=Ae;function Y5(r,e){if(!r.type&&!r.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingTypeProperty}`,message:"Last generated entity payload is missing a 'type' property.",severity:T.Error,code:h.MissingTypeProperty,issue:null}),new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:"Last generated entity payload is missing an 'id' property.",severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null};if(r.type){if(!r.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:`Last generated entity, with type "${r.type}" is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null}}else return{errors:[new E({id:`${r.id}--${h.MissingTypeProperty}`,message:`Entity with id "${r.id}" is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})],modifiedData:null};if(r.type===n.GenericReference)return{errors:[new E({id:`${r.id}--${h.RootReference}`,message:`Generic reference entity with id "${r.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:T.Error,code:h.RootReference,issue:null})],modifiedData:null};const t=r,i=e.instances[t.id],a=e.builtInInstances[t.id];if(i&&!a&&t.type!==n.GenericReference){let s=`A previously generated entity with id "${t.id}" already exists in the project state.
172
+ ${an({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var a,s,o,l;const e=[this],t=[],i=[];return this.parentRelationType===B.FixedArguments?(s=(a=this.parent)==null?void 0:a.addFixedArgument)==null||s.call(a,this):this.parentRelationType===B.FixedReturns?(l=(o=this.parent)==null?void 0:o.addFixedReturn)==null||l.call(o,this):this.parentRelationType===B.ReturnedError&&this.parent&&(this.parent.error=this),this.parent&&([n.Search,n.Loop].includes(this.parent.type)&&this.parent.addOutputDeclaration(this),e.push(this.parent)),{updated:g(e),added:g(t),removed:g(i),self: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:g(i),removed:g(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:g(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:n.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=W5(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(e=null,t=null,i=!0){var f;const a=t||tt(S(this,this.project),n.ValueDescriptor,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l=this.toJSON();l.id=a;const p=Ut(l,this.project);e&&p.setParent(e),i&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",i))||null;return y&&p.setDataType(y),p}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}};c(Ae,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(Ae,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),c(Ae,"BASE_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"MUTABLE_META_PROPERTIES",[...Ae.MUTABLE_BASE_PROPERTIES,"index"]),c(Ae,"INMUTABLE_META_PROPERTIES",[...Ae.INMUTABLE_BASE_PROPERTIES]),c(Ae,"META_PROPERTIES",[...Ae.MUTABLE_META_PROPERTIES,...Ae.INMUTABLE_META_PROPERTIES]),c(Ae,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Ae,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ae,"UPSTREAM_PROPERTIES",[...Ae.MUTABLE_UPSTREAM_PROPERTIES,...Ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(Ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ae,"DOWNSTREAM_PROPERTIES",[...Ae.MUTABLE_DOWNSTREAM_PROPERTIES,...Ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ae,"PROPERTIES",[...Ae.META_PROPERTIES,...Ae.UPSTREAM_PROPERTIES,...Ae.DOWNSTREAM_PROPERTIES]);let _r=Ae;function H5(r,e){if(!r.type&&!r.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingTypeProperty}`,message:"Last generated entity payload is missing a 'type' property.",severity:T.Error,code:h.MissingTypeProperty,issue:null}),new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:"Last generated entity payload is missing an 'id' property.",severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null};if(r.type){if(!r.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:`Last generated entity, with type "${r.type}" is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null}}else return{errors:[new E({id:`${r.id}--${h.MissingTypeProperty}`,message:`Entity with id "${r.id}" is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})],modifiedData:null};if(r.type===n.GenericReference)return{errors:[new E({id:`${r.id}--${h.RootReference}`,message:`Generic reference entity with id "${r.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:T.Error,code:h.RootReference,issue:null})],modifiedData:null};const t=r,i=e.instances[t.id],a=e.builtInInstances[t.id];if(i&&!a&&t.type!==n.GenericReference){let s=`A previously generated entity with id "${t.id}" already exists in the project state.
173
173
  Are you trying to update that entity?
174
174
  If so, you should use the 'update' action for core mutable metadata properties, or 'delete' and then 'post' again to replace it.
175
175
  If you are trying to create a new entity, please use a different id, for example: "${au(t,e)}".`;return{errors:[new E({id:`duplicate--${t.id}--${h.EntityIdNotUnique}`,message:s,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:r}}else if(i&&t.type!==n.GenericReference)return{errors:[new E({id:`${t.id}--${h.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: "${au(t,e)}".`,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:r};switch(t.type){case n.Project:return _.validateGenerationTarget(t,e);case n.CustomEntity:return Vr.validateGenerationTarget(t,e);case n.Property:return gr.validateGenerationTarget(t,e);case n.FunctionDeclaration:return vr.validateGenerationTarget(t,e);case n.DataType:return mi.validateGenerationTarget(t,e);case n.Operation:return Ir.validateGenerationTarget(t,e);case n.FunctionCall:return Nr.validateGenerationTarget(t,e);case n.VariableDeclaration:return Ar.validateGenerationTarget(t,e);case n.VariableInstance:return Or.validateGenerationTarget(t,e);case n.GlobalEvent:return Ti.validateGenerationTarget(t,e);case n.InputMap:return vn.validateGenerationTarget(t,e);case n.OutputMap:return In.validateGenerationTarget(t,e);case n.ArgumentDeclaration:return Br.validateGenerationTarget(t,e);case n.ReturnDeclaration:return _t.validateGenerationTarget(t,e);case n.Loop:return Dr.validateGenerationTarget(t,e);case n.Condition:return Pr.validateGenerationTarget(t,e);case n.Search:return Sr.validateGenerationTarget(t,e);case n.InstalledProject:return Cr.validateGenerationTarget(t,e);case n.InternalCall:return Ei.validateGenerationTarget(t,e);case n.PrimitiveValue:return bi.validateGenerationTarget(t,e);case n.ReturnStatement:return wr.validateGenerationTarget(t,e);case n.BreakStatement:return Ri.validateGenerationTarget(t,e);case n.ContinueStatement:return Et.validateGenerationTarget(t,e);case n.ActionDescriptor:return ne.validateGenerationTarget(t,e);case n.ValueDescriptor:return _r.validateGenerationTarget(t,e);case n.BuiltInBaseEntity:case n.PrimitiveEntity:{const s="Did you mean to generate a",l={[n.BuiltInBaseEntity]:`${s} '${n.CustomEntity}' instead?`,[n.PrimitiveEntity]:`${s} '${n.CustomEntity}' instead?`}[t.type]||"";return{errors:[new E({id:`${t.id}--${h.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.
@@ -178,7 +178,7 @@ For entities of type "${r.type}", `;if(t.length>0?a+=`you can update the followi
178
178
  You can also update the following upstream references: `:`
179
179
  But can update the following upstream entity references: `;a+=`${s}'${F(i,"', '","' and '")}'.`}else a+=t.length>0?`
180
180
  And there are no upstream references that can be updated.`:`
181
- There are no upstream references that can be updated.`;return a}function z5(r,e){const t=[];let i=!1;if(Ur.includes(e.type)&&t.push(new E({id:`${e.id}--${h.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:T.Error,code:h.BuiltInEntityGenerated,issue:null})),r.id&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.Error,message:`The 'id' property cannot be updated in the 'update' action payload. The id of the entity is '${r.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),r.type&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.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(Ve.includes(e.type)?r.calls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calls" updated.
181
+ There are no upstream references that can be updated.`;return a}function Y5(r,e){const t=[];let i=!1;if(Ur.includes(e.type)&&t.push(new E({id:`${e.id}--${h.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:T.Error,code:h.BuiltInEntityGenerated,issue:null})),r.id&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.Error,message:`The 'id' property cannot be updated in the 'update' action payload. The id of the entity is '${r.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),r.type&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.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(Ve.includes(e.type)?r.calls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calls" updated.
182
182
  ${Hn}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})):Ge.includes(e.type)&&(r.successCalls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "successCalls" updated.
183
183
  ${Hn}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),r.errorCalls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "errorCalls" updated.
184
184
  ${Hn}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null}))),On.includes(e.type)&&(r.calledBy&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBy" updated.
@@ -189,13 +189,13 @@ ${Hn}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null}))),t
189
189
  If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),i=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach(A=>{r[A]&&!Ia(r[A])&&(t.push(new E({id:`${e.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${A}" set directly. It is a downstream property that points to a downstream nested entity.
190
190
  All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
191
191
  To modify '${A}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null})),i=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach(A=>{r[A]&&!Ia(r[A])&&(t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${A}" updated. It is an inmutable property that is set only when the entity is created.
192
- If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),i=!0)});const O=a.PROPERTIES||[];O.length>0&&Object.keys(r).forEach(A=>{O.includes(A)||t.push(new E({id:`${e.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${A}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:i?Io(e):""};const s=nD(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(r),p={...r,id:e.id,type:e.type},y=ou(p,l);if(t.push(...y),t.length)return{errors:t,modifiedData:null,messageAddition:i?Io(e):""};const m=e.validateGeneratedUpdate(r);return{errors:[...t,...m.errors],modifiedData:m.modifiedData,messageAddition:i?Io(e):""}}function nD(r){switch(r.type){case n.PrimitiveValue:return Zs();case n.CustomEntity:return Id();case n.PrimitiveEntity:return Zs();case n.FunctionDeclaration:return gd();case n.GlobalEvent:return io();case n.DataType:return yd();case n.Property:return Kc();case n.FunctionCall:return ad();case n.Condition:return sd();case n.Operation:return to();case n.VariableDeclaration:return fd();case n.VariableInstance:return md();case n.OutputMap:return id();case n.ReturnDeclaration:return td();case n.ArgumentDeclaration:return Rd();case n.InputMap:return dd();case n.Project:return vd();case n.InstalledProject:return cj();case n.ActionDescriptor:return Xs();case n.ReturnStatement:return ed();case n.Loop:return Xs();case n.Search:return od();case n.ValueDescriptor:return Zc();case n.BuiltInBaseEntity:return Xc();case n.InternalCall:return cd();case n.ContinueStatement:return Qc();case n.BreakStatement:return nd();default:return null}}function rD(r){switch(r.type){case n.PrimitiveValue:return $6();case n.CustomEntity:return e9();case n.PrimitiveEntity:return D8();case n.FunctionDeclaration:return Jj();case n.GlobalEvent:return mj();case n.DataType:return Z6();case n.Property:return S8();case n.FunctionCall:return d6();case n.Condition:return f6();case n.Operation:return w6();case n.VariableDeclaration:return tj();case n.VariableInstance:return sj();case n.OutputMap:return s6();case n.ReturnDeclaration:return X8();case n.ArgumentDeclaration:return xj();case n.InputMap:return O6();case n.Project:return Zj();case n.InstalledProject:return uj();case n.ActionDescriptor:return $8();case n.ReturnStatement:return Y8();case n.Loop:return U8();case n.Search:return b6();case n.ValueDescriptor:return R8();case n.BuiltInBaseEntity:return N8();case n.InternalCall:return I6();case n.ContinueStatement:return q8();case n.BreakStatement:return n6();default:return null}}function Do(r){const e=[];qn(r)||e.push(new E({id:`${r}--${h.InvalidReferenceObjectStructure}`,message:`Reference object with id "${r}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));const t=r.id||"reference-to--"+(r.entityId||"unknown"),i=`Reference object ${r.id?`with id "${r.id}"`:`to entity with id "${r.entityId}" and type "${r.entityType}"`}`;return r.entityId||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityId' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),r.entityType||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityType' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),r.id||e.push(new E({id:`${t}--${h.MissingIdProperty}`,message:`${i} is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})),r.type||e.push(new E({id:`${t}--${h.MissingTypeProperty}`,message:`${i} is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})),e}function ou(r,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${r.id}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" and with id "${r.id}", has an invalid structure: ${v9(t).toString().replace("Validation error: ","")}`,severity:T.Error,code:D.InvalidObjectStructure,issue:t}))}function _e(r,e){const t=[],i=rD(r);if(i){const s=i.safeParse(r);t.push(...ou(r,s))}const a=Lo(r.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(l=>{r[l]&&!Ia(r[l])&&t.push(new E({id:`${r.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the property "${l}" set directly. It is a downstream property that points to a downstream nested entity.
192
+ If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),i=!0)});const O=a.PROPERTIES||[];O.length>0&&Object.keys(r).forEach(A=>{O.includes(A)||t.push(new E({id:`${e.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${A}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:i?Io(e):""};const s=nD(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(r),p={...r,id:e.id,type:e.type},y=ou(p,l);if(t.push(...y),t.length)return{errors:t,modifiedData:null,messageAddition:i?Io(e):""};const m=e.validateGeneratedUpdate(r);return{errors:[...t,...m.errors],modifiedData:m.modifiedData,messageAddition:i?Io(e):""}}function nD(r){switch(r.type){case n.PrimitiveValue:return Zs();case n.CustomEntity:return Id();case n.PrimitiveEntity:return Zs();case n.FunctionDeclaration:return gd();case n.GlobalEvent:return io();case n.DataType:return yd();case n.Property:return Kc();case n.FunctionCall:return ad();case n.Condition:return sd();case n.Operation:return to();case n.VariableDeclaration:return fd();case n.VariableInstance:return md();case n.OutputMap:return id();case n.ReturnDeclaration:return td();case n.ArgumentDeclaration:return Rd();case n.InputMap:return dd();case n.Project:return vd();case n.InstalledProject:return lj();case n.ActionDescriptor:return Xs();case n.ReturnStatement:return ed();case n.Loop:return Xs();case n.Search:return od();case n.ValueDescriptor:return Zc();case n.BuiltInBaseEntity:return Xc();case n.InternalCall:return cd();case n.ContinueStatement:return Qc();case n.BreakStatement:return nd();default:return null}}function rD(r){switch(r.type){case n.PrimitiveValue:return L6();case n.CustomEntity:return Qj();case n.PrimitiveEntity:return I8();case n.FunctionDeclaration:return qj();case n.GlobalEvent:return fj();case n.DataType:return z6();case n.Property:return O8();case n.FunctionCall:return c6();case n.Condition:return h6();case n.Operation:return B6();case n.VariableDeclaration:return ej();case n.VariableInstance:return aj();case n.OutputMap:return a6();case n.ReturnDeclaration:return K8();case n.ArgumentDeclaration:return Uj();case n.InputMap:return A6();case n.Project:return zj();case n.InstalledProject:return dj();case n.ActionDescriptor:return L8();case n.ReturnStatement:return H8();case n.Loop:return F8();case n.Search:return E6();case n.ValueDescriptor:return b8();case n.BuiltInBaseEntity:return _8();case n.InternalCall:return v6();case n.ContinueStatement:return k8();case n.BreakStatement:return t6();default:return null}}function Do(r){const e=[];qn(r)||e.push(new E({id:`${r}--${h.InvalidReferenceObjectStructure}`,message:`Reference object with id "${r}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));const t=r.id||"reference-to--"+(r.entityId||"unknown"),i=`Reference object ${r.id?`with id "${r.id}"`:`to entity with id "${r.entityId}" and type "${r.entityType}"`}`;return r.entityId||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityId' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),r.entityType||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${i} is missing an 'entityType' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),r.id||e.push(new E({id:`${t}--${h.MissingIdProperty}`,message:`${i} is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})),r.type||e.push(new E({id:`${t}--${h.MissingTypeProperty}`,message:`${i} is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})),e}function ou(r,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${r.id}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" and with id "${r.id}", has an invalid structure: ${g9(t).toString().replace("Validation error: ","")}`,severity:T.Error,code:D.InvalidObjectStructure,issue:t}))}function _e(r,e){const t=[],i=rD(r);if(i){const s=i.safeParse(r);t.push(...ou(r,s))}const a=Lo(r.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(l=>{r[l]&&!Ia(r[l])&&t.push(new E({id:`${r.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the property "${l}" set directly. It is a downstream property that points to a downstream nested entity.
193
193
  All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
194
- To modify '${l}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(r).forEach(l=>{o.includes(l)||t.push(new E({id:`${r.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${r.type}" with id "${r.id}" has an unrecognized property "${l}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function Z5(r,e){const t=[];if(!r.parent)return t;const i=e.get(r.parent);return i?(Ur.includes(i==null?void 0:i.type)?t.push(new E({id:`${r.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:T.Error,code:h.BuiltInEntityParent,issue:null})):i.type===n.ActionDescriptor&&e.get(r.parent)&&t.push(new E({id:`${r.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.BuiltInEntityParent,issue:null})),t):[]}function lu(r,e,t){const i=[],a=r[e.key];if(!a)return i.push(new E({id:`${r.id}--${e.key}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${r.type}" entity can be ${F(e.types,", "," or ")}.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entityState:null,errors:i};let s=null;if(typeof a=="string")s=a;else{const l=Do(a);i.push(...l),l.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:i};if(r.id===s)return i.push(new E({id:`${r.id}--${s}--${h.SelfReference}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.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:`${r.id}--${s}--${h.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${F(e.types,"', '","' or '")}'.`,severity:T.Error,code:h.InvalidReference,issue:null})):i.push(new E({id:`${r.id}--${s}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:i}}function Po(r,e,t){const i=[],a=r[e];return a?Array.isArray(a)?{entities:a.map(o=>{let l=null;if(typeof o=="string")l=o;else{const y=Do(o);i.push(...y),y.length===0&&(l=o.entityId)}if(!l)return{entityState:null,errors:[new E({id:`${r.id}--${e}--${h.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReference,issue:null})]};const p=t.get(l)||t.getBuiltIn(l);return p?{entityState:p,errors:[]}:(i.push(new E({id:`${r.id}--${l}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${l}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:i})}),errors:[]}:(i.push(new E({id:`${r.id}--${e}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entities:[],errors:i}):(i.push(new E({id:`${r.id}--${e}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a list of references to "${e}" entities.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entities:[],errors:i})}function cu(r,e,t){const i=[],a=lu(r,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:`${r.id}--${s.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${F(e.types,"', '","' or '")}'.`,issue:null})),r.id===s.id&&i.push(new E({id:`${r.id}--${s.id}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 F(r,e,t){const i=[...r||[]].filter(a=>!!a);if(i.length===1)return i[0];if(i.length===2)return i.join(t);{const a=i.pop();return`${i.join(e)}${t}${a}`}}const Wn=`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.
195
- All pass-through callable entities are: ${F(Ge,", "," and ")}.`,wa=`Entry point entities are the entities which start the execution of a logic chain. They are ${F(Ve,", "," 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. `,iD=`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: ${F(ln,", "," and ")}.`,K5=`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.
194
+ To modify '${l}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(r).forEach(l=>{o.includes(l)||t.push(new E({id:`${r.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${r.type}" with id "${r.id}" has an unrecognized property "${l}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function z5(r,e){const t=[];if(!r.parent)return t;const i=e.get(r.parent);return i?(Ur.includes(i==null?void 0:i.type)?t.push(new E({id:`${r.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.id}" cannot have the parent with id "${i.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:T.Error,code:h.BuiltInEntityParent,issue:null})):i.type===n.ActionDescriptor&&e.get(r.parent)&&t.push(new E({id:`${r.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.BuiltInEntityParent,issue:null})),t):[]}function lu(r,e,t){const i=[],a=r[e.key];if(!a)return i.push(new E({id:`${r.id}--${e.key}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${r.type}" entity can be ${F(e.types,", "," or ")}.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entityState:null,errors:i};let s=null;if(typeof a=="string")s=a;else{const l=Do(a);i.push(...l),l.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:i};if(r.id===s)return i.push(new E({id:`${r.id}--${s}--${h.SelfReference}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.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:`${r.id}--${s}--${h.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${F(e.types,"', '","' or '")}'.`,severity:T.Error,code:h.InvalidReference,issue:null})):i.push(new E({id:`${r.id}--${s}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.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:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:i}}function Po(r,e,t){const i=[],a=r[e];return a?Array.isArray(a)?{entities:a.map(o=>{let l=null;if(typeof o=="string")l=o;else{const y=Do(o);i.push(...y),y.length===0&&(l=o.entityId)}if(!l)return{entityState:null,errors:[new E({id:`${r.id}--${e}--${h.InvalidReference}`,message:`Entity of type "${r.type}" with id "${r.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReference,issue:null})]};const p=t.get(l)||t.getBuiltIn(l);return p?{entityState:p,errors:[]}:(i.push(new E({id:`${r.id}--${l}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${l}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:i})}),errors:[]}:(i.push(new E({id:`${r.id}--${e}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entities:[],errors:i}):(i.push(new E({id:`${r.id}--${e}--${D.InvalidObjectStructure}`,message:`Entity of type "${r.type}" with id "${r.id}" is missing a list of references to "${e}" entities.`,severity:T.Error,code:D.InvalidObjectStructure,issue:null})),{entities:[],errors:i})}function cu(r,e,t){const i=[],a=lu(r,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:`${r.id}--${s.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${F(e.types,"', '","' or '")}'.`,issue:null})),r.id===s.id&&i.push(new E({id:`${r.id}--${s.id}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 F(r,e,t){const i=[...r||[]].filter(a=>!!a);if(i.length===1)return i[0];if(i.length===2)return i.join(t);{const a=i.pop();return`${i.join(e)}${t}${a}`}}const Wn=`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.
195
+ All pass-through callable entities are: ${F(Ge,", "," and ")}.`,wa=`Entry point entities are the entities which start the execution of a logic chain. They are ${F(Ve,", "," 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. `,iD=`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: ${F(ln,", "," and ")}.`,Z5=`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.
196
196
  All callable entity types are: ${F(On,", "," and ")}.`,Hn=`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).
197
197
  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.`,du=`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.
198
- 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'.`,X5=`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.
198
+ 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'.`,K5=`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.
199
199
  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.`,uu=`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.
200
200
  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.`,Yn=`Entities of type '${n.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.`,pu=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${F(An,"', '","' and '")}'.`,aD=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${F($e,"', '","' and '")}'.`,yu=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
201
201
  A 'property' can have a default value through its nested 'data-type' entity.
@@ -216,7 +216,7 @@ ${yu}`,hu=`To establish a connection of a reader and writter value during the ge
216
216
  You can use the 'disconnect_values' generation action to remove the connection between two value holding entities in the same way.`,Oo=`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.
217
217
  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 an(r){return`\`\`\`json
218
218
  ${typeof r=="string"?r:JSON.stringify(r,null,2)}
219
- \`\`\``}function Q5(r,e){let t={};switch(r){case"add_caller":return t.add_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},e.fromError&&(t.add_caller.fromError=e.fromError),an(t);case"remove_caller":return t.remove_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},an(t);case"connect_values":return t.connect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},an(t);case"disconnect_values":return t.disconnect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},an(t);case"update":{const i=`{
219
+ \`\`\``}function X5(r,e){let t={};switch(r){case"add_caller":return t.add_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},e.fromError&&(t.add_caller.fromError=e.fromError),an(t);case"remove_caller":return t.remove_caller={callerEntityId:e.callerEntityId,calleeEntityId:e.calleeEntityId},an(t);case"connect_values":return t.connect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},an(t);case"disconnect_values":return t.disconnect_values={writerEntityId:e.writerEntityId,readerEntityId:e.readerEntityId},an(t);case"update":{const i=`{
220
220
  "update": {
221
221
  "entityId": "${e.entityId}",
222
222
  "data": {
@@ -289,19 +289,19 @@ ${yu}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.In
289
289
  ${pu}`,issue:null})),delete s.readsValue);o.writesValues&&($e.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
290
290
  ${hu}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
291
291
  ${Ao}
292
- ${hu}`,issue:null})),delete s.writesValues);const p=cD(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const l=Object.entries(s);for(const[p,y]of l){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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 ${F(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const v of b){const P=cu(o,{key:p,types:f,optional:m},t);a.push(...P)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.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}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.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 v=cu(o,{key:p,types:f,optional:m},t);a.push(...v)}}return{errors:a,modifiedData:o}}function ek(r,e,t="calledBy"){const i=[];if(!r)return[];const a=e.get(r);if(!a)return i.push(new E({id:`${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${r}" 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([...Ge,...Ve].includes(a.type))return[];if(Le.includes(a.type)){const s=a.calledBy||[],o=s.length?`
292
+ ${hu}`,issue:null})),delete s.writesValues);const p=cD(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const l=Object.entries(s);for(const[p,y]of l){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.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 ${F(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const v of b){const P=cu(o,{key:p,types:f,optional:m},t);a.push(...P)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.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}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.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 v=cu(o,{key:p,types:f,optional:m},t);a.push(...v)}}return{errors:a,modifiedData:o}}function Q5(r,e,t="calledBy"){const i=[];if(!r)return[];const a=e.get(r);if(!a)return i.push(new E({id:`${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${r}" 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([...Ge,...Ve].includes(a.type))return[];if(Le.includes(a.type)){const s=a.calledBy||[],o=s.length?`
293
293
 
294
294
  This ${a.type} is called by ${F(s.map(l=>`${l.type} with id "${l.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}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
295
295
  ${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
296
296
  Termination entities are ${F(Le,", "," and ")}.${o}`,issue:null}))}else i.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
297
- All caller entity types are: ${F(ln,", "," and ")}.`,issue:null}));return i}function tk(r,e,t="calledByError"){const i=[];if(!r)return[];const a=e.get(r);if(!a)return i.push(new E({id:`${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${r}" 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(Ge.includes(a.type))return[];if(Le.includes(a.type)){const s=a.calledBy||[],o=s.length?`
297
+ All caller entity types are: ${F(ln,", "," and ")}.`,issue:null}));return i}function ek(r,e,t="calledByError"){const i=[];if(!r)return[];const a=e.get(r);if(!a)return i.push(new E({id:`${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${r}" 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(Ge.includes(a.type))return[];if(Le.includes(a.type)){const s=a.calledBy||[],o=s.length?`
298
298
 
299
299
  This ${a.type} is called by ${F(s.map(l=>`${l.type} with id "${l.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}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
300
300
  ${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
301
301
  Termination entities are ${F(Le,", "," and ")}.${o}`,issue:null}))}else Ve.includes(a.type)?i.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
302
302
  ${wa}`,issue:null})):i.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
303
303
  For any error branch caller, for the 'calledByError' property of an entity, you specifically need to reference a pass-through callable entity.
304
- ${Wn}`,issue:null}));return i}function nk(r,e){const t=[],i=e.get(r);if(!i)t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The 'readsValue' property references an entity with id '${r}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(i.type===n.PrimitiveValue){const s=i.parent;let o=!1;if(s.type===n.InputMap)t.push(new E({id:`last-action--${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
304
+ ${Wn}`,issue:null}));return i}function tk(r,e){const t=[],i=e.get(r);if(!i)t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The 'readsValue' property references an entity with id '${r}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(i.type===n.PrimitiveValue){const s=i.parent;let o=!1;if(s.type===n.InputMap)t.push(new E({id:`last-action--${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
305
305
  All value writting entity types are: ${F($e,", "," and ")}.
306
306
 
307
307
  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===n.DataType){const l=s,p=l.parent;$e.includes(p.type)?t.push(new E({id:`last-action--${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.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.
@@ -319,7 +319,7 @@ All value writting entity types are: ${F($e,", "," and ")}.`,issue:null}));retur
319
319
  - ${r.globalEventActionDescriptors.map(e=>`${e.id} (${S(e,r)})`).join(`
320
320
  - `)}`}function Co(r){return`All reserved action decriptor ids for '${n.Loop}' entities are:
321
321
  - ${r.loopDeclarations.map(e=>`${e.id} (${S(e,r)})`).join(`
322
- - `)}`}function rk(r){return`All reserved action decriptor ids for '${n.Operation}' entities are:
322
+ - `)}`}function nk(r){return`All reserved action decriptor ids for '${n.Operation}' entities are:
323
323
  - ${r.operationDeclarations.map(e=>`${e.id} (${S(e,r)})`).join(`
324
324
  - `)}`}function Bo(r){return`All reserved action decriptor ids for '${n.Condition}' entities are:
325
325
  - ${r.conditionDeclarations.map(e=>`${e.id} (${S(e,r)})`).join(`
@@ -336,11 +336,11 @@ ${a}`,issue:null})):i.parent.type!==n.Project&&t.push(new E({id:`last-action--${
336
336
  All built-in 'action-descriptor' entities that define 'operation' entity, are (IDs):
337
337
  - ${e.operationDeclarations.map(s=>`${s.id} (${S(s,e)}).`).join(`
338
338
  - `)}
339
- `;return i?i.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):i.type===n.ActionDescriptor?e.operationDeclarations.find(o=>o.id===r)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):i.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' 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--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${r}' that isn't yet found in the project.${a}`,issue:null})),t}function ik(r,e){const t=[];if(!r)return[];const i=e.getBuiltIn(r),a=`
339
+ `;return i?i.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as operations instances.${a}`,issue:null})):i.type===n.ActionDescriptor?e.operationDeclarations.find(o=>o.id===r)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity but it isn't one of the allowed operation descriptors.${a}`,issue:null})):i.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' 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--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${r}' that isn't yet found in the project.${a}`,issue:null})),t}function rk(r,e){const t=[];if(!r)return[];const i=e.getBuiltIn(r),a=`
340
340
  All built-in 'action-descriptor' entities that define 'condition' entity, are (IDs):
341
341
  - ${e.conditionDeclarations.map(s=>`${s.id} (${S(s,e)}).`).join(`
342
342
  - `)}
343
- `;return i?i.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):i.type===n.ActionDescriptor?e.conditionDeclarations.find(o=>o.id===r)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity but it isn't one of the allowed condition descriptors.${a}`,issue:null})):i.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${r}' 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--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${r}' that isn't yet found in the project.${a}`,issue:null})),t}function ak(r,e){const t=[];if(!r)return[];const i=e.getBuiltIn(r),a=`
343
+ `;return i?i.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):i.type===n.ActionDescriptor?e.conditionDeclarations.find(o=>o.id===r)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity but it isn't one of the allowed condition descriptors.${a}`,issue:null})):i.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${r}' 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--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${r}' that isn't yet found in the project.${a}`,issue:null})),t}function ik(r,e){const t=[];if(!r)return[];const i=e.getBuiltIn(r),a=`
344
344
  All built-in 'action-descriptor' entities that define 'loop' entity, are (IDs):
345
345
  - ${e.loopDeclarations.map(s=>`${s.id} (${S(s,e)}).`).join(`
346
346
  - `)}`;return i?i.type===n.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):i.type===n.ActionDescriptor?e.loopDeclarations.find(o=>o.id===r)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${r}' is of type '${i.type}' entity but it isn't one of the allowed loop descriptors.${a}`,issue:null})):i.type!==n.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${r}' 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--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${r}' that isn't yet found in the project.${a}`,issue:null})),t}function yD(r,e,t){var p,y,f,m;if(t.compatible)return"";const i=`entity of type "${r.type}" with id "${r.id}"`,a=`entity with id "${r.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,l=Eo(`${i} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===$t.AIsListBIsNot?`${l}
@@ -360,14 +360,14 @@ The only use for declaring global callable entities is for a 'variable-declarati
360
360
  Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:r}));else{const t=La(r);if(!t.reachable){let i=`This '${r.type}' entity "${S(r,r.project)}" with id "${r.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${S(t.entryPoint,r.project)}".`;i+=`
361
361
  This is because there are termination statements in the call chain before reaching this '${r.type}'.
362
362
  If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
363
- This '${r.type}' is blocked `;t.blocks.forEach((s,o)=>{const l=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${S(l,r.project)}" with id "${l.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new dr({id:`${r.id}--${D.UnreachableEntity}`,code:D.UnreachableEntity,severity:T.Warning,message:`${i}${a}`,issue:null,entity:r}))}}return ae(r.errors,e)}function mu(r){const e=[];if(!r.internalCalls.length)return e;if(r.readsValue){const t=Z({id:`${r.id}--${N.VariableReadsValueAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" reads a value. A variable with internal calls can't read a value.`,issue:null,severity:T.Error,code:N.VariableReadsValueAndInternalCall,entity:r});e.push(t.error)}if(r.writesValues.length){const t=Z({id:`${r.id}--${N.VariableWritesValuesAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" writes values. A variable with internal calls can't write a value.`,issue:null,severity:T.Error,code:N.VariableWritesValuesAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedInputs().length){const t=Z({id:`${r.id}--${N.VariableHasInputsAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" has inputs. A variable with internal calls can't have inputs.`,issue:null,severity:T.Error,code:N.VariableHasInputsAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedOutputs().length){const t=Z({id:`${r.id}--${N.VariableHasOutputsAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" has outputs. A variable with internal calls can't have outputs.`,issue:null,severity:T.Error,code:N.VariableHasOutputsAndInternalCall,entity:r});e.push(t.error)}if(r.calledBy.length){const t=Z({id:`${r.id}--${N.VariableIsCalledAndHasInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,issue:null,severity:T.Error,code:N.VariableIsCalledAndHasInternalCall,entity:r});e.push(t.error)}if([...r.successCalls,...r.errorCalls].length){const t=Z({id:`${r.id}--${N.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" calls other entities. A variable with internal calls can't call other entities.`,issue:null,severity:T.Error,code:N.VariableCallsOthersAndHasInternalCall,entity:r});e.push(t.error)}return e}function sk(r){var o;const e=p6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...Dn(r)];return ae(r.errors,s)}const Oe=class Oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.FunctionCall);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"process",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=w(i.declaration);if(o){const l=uD(o,t);a.push(...l)}else{const l=t.functions.length?`
363
+ This '${r.type}' is blocked `;t.blocks.forEach((s,o)=>{const l=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${S(l,r.project)}" with id "${l.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new dr({id:`${r.id}--${D.UnreachableEntity}`,code:D.UnreachableEntity,severity:T.Warning,message:`${i}${a}`,issue:null,entity:r}))}}return ae(r.errors,e)}function mu(r){const e=[];if(!r.internalCalls.length)return e;if(r.readsValue){const t=Z({id:`${r.id}--${N.VariableReadsValueAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" reads a value. A variable with internal calls can't read a value.`,issue:null,severity:T.Error,code:N.VariableReadsValueAndInternalCall,entity:r});e.push(t.error)}if(r.writesValues.length){const t=Z({id:`${r.id}--${N.VariableWritesValuesAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" writes values. A variable with internal calls can't write a value.`,issue:null,severity:T.Error,code:N.VariableWritesValuesAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedInputs().length){const t=Z({id:`${r.id}--${N.VariableHasInputsAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" has inputs. A variable with internal calls can't have inputs.`,issue:null,severity:T.Error,code:N.VariableHasInputsAndInternalCall,entity:r});e.push(t.error)}if(r.getUsedOutputs().length){const t=Z({id:`${r.id}--${N.VariableHasOutputsAndInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" has outputs. A variable with internal calls can't have outputs.`,issue:null,severity:T.Error,code:N.VariableHasOutputsAndInternalCall,entity:r});e.push(t.error)}if(r.calledBy.length){const t=Z({id:`${r.id}--${N.VariableIsCalledAndHasInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,issue:null,severity:T.Error,code:N.VariableIsCalledAndHasInternalCall,entity:r});e.push(t.error)}if([...r.successCalls,...r.errorCalls].length){const t=Z({id:`${r.id}--${N.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${S(r,r.project)}" with id "${r.id}" calls other entities. A variable with internal calls can't call other entities.`,issue:null,severity:T.Error,code:N.VariableCallsOthersAndHasInternalCall,entity:r});e.push(t.error)}return e}function ak(r){var o;const e=u6(),t=r.toJSON();e.safeParse(t).success,r.inputs.forEach(l=>l.validate()),r.outputs.forEach(l=>l.validate()),(o=r.error)==null||o.validate();const s=[...Dn(r)];return ae(r.errors,s)}const Oe=class Oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",n.FunctionCall);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"process",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(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=w(e.parent);i=t.get(m)}const a=w(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=w(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=w(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=w(m);return t.get(b)}),y={id:e.id,version:1,type:n.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:i},f=R(y,t);return f.setParent(i),f.initChildren(),f}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Je(i,{parent:{list:!1,types:[...dt,n.Project],optional:!0}},t);i=s.modifiedData,a.push(...s.errors,..._e(i));const o=w(i.declaration);if(o){const l=uD(o,t);a.push(...l)}else{const l=t.functions.length?`
364
364
  All global 'function-declaration' entity ids are:
365
365
  - ${t.functions.map(p=>`${p.id} (${S(p,t)})`).join(`
366
366
  - `)}.`:`
367
367
  The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new E({id:`${i.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.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.
368
368
  References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${l}`,issue:null}))}return{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
369
369
  If an entity is called by another, they must be in the same scope, which means they have the same parent.
370
- 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 a;const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addFunctionCall(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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===n.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=w(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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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=gu(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 l=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:_.UUID.uuid(),type:n.OutputMap,version:1,declaration:s,index:l,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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:n.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===n.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=sk(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 Oe(this.toJSON(),this.project)}};c(Oe,"MUTABLE_BASE_PROPERTIES",[]),c(Oe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Oe,"BASE_PROPERTIES",[...Oe.MUTABLE_BASE_PROPERTIES,...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"MUTABLE_META_PROPERTIES",["x","y"]),c(Oe,"INMUTABLE_META_PROPERTIES",[...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"META_PROPERTIES",[...Oe.MUTABLE_META_PROPERTIES,...Oe.INMUTABLE_META_PROPERTIES]),c(Oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Oe,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(Oe,"UPSTREAM_PROPERTIES",[...Oe.MUTABLE_UPSTREAM_PROPERTIES,...Oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(Oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Oe,"DOWNSTREAM_PROPERTIES",[...Oe.MUTABLE_DOWNSTREAM_PROPERTIES,...Oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Oe,"PROPERTIES",[...Oe.META_PROPERTIES,...Oe.UPSTREAM_PROPERTIES,...Oe.DOWNSTREAM_PROPERTIES]);let Nr=Oe;function hD(r){var e,t,i;switch(r.id){case G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=r.project.entities.filter(f=>!!f.implements.find(m=>m.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((b=m.getDefaultValue())==null?void 0:b.value)===!0}))){const m=a[0].properties.find(v=>v.implements&&v.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),b=(e=m==null?void 0:m.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(m!=null&&m.dataType){const v=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],P=R({id:v+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},r.project);return P.setParent(m==null?void 0:m.dataType),P.initChildren(),P.addSelfToProject(),{newEntities:[P]}}return{newEntities:[]}}const o=r.project.get(G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),l=wo(o,"Main database");if(l.errors.length>0)return{newEntities:[]};const p=l.implemented.properties.find(f=>f.implements&&f.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),y=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},r.project);m.setParent(p==null?void 0:p.dataType),m.initChildren(),m.addSelfToProject()}return{newEntities:[l.implemented]}}}return{newEntities:[]}}function fD(r){return r.implements.filter(t=>t.type===n.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=r.project.entities.filter(p=>p.implements.find(y=>y.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=r.properties.find(p=>p.implements&&p.implements.id===G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id),l=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!l){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},r.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function wo(r,e,t){const i=t||tt(e,n.CustomEntity,r.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:n.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[r],x:0,y:0,parent:r.project},l=vo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=hD(r),y=R(o,r.project);y.setParent(r.project),y.initChildren();const f=r.properties.map(v=>{const P=s+"-"+tt(S(v,r.project),n.Property,r.project),O=v.clone(y,P);return O.abstract=!1,O.implements=v,O.setParent(y),y.addProperty(O),O}),m=r.abstractMethods.map(v=>{const P=s+tt(v.name,n.FunctionDeclaration,r.project),O=v.implementAsFunctionDeclaration(P),A={id:P+"-parent-ref-id",type:n.GenericReference,entityId:i,entityType:n.CustomEntity},k={...O,implements:v,parent:A},j=R(k,r.project);return y.addMethod(j),j.setParent(y),j.initChildren(),j.implements=v,j});o.properties=f,o.methods=m;const b=fD(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}function _o(r,e){const t=Mr(r);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=_o(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function mD(r,e,t=new Set){const i=zn(r),a=zn(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),l=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),g([...p,...mD(y,e,t)])),[]);return g([...o,...l])}function Na(r,e){const t=_o(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function ok(r,e){return!!_o(r,e).last}function lk(r){if(Ve.includes(r.type))return r;if([...On,n.VariableDeclaration].includes(r.type)){const e=r.parent;return Ve.includes(e.type)?e:null}return null}function Tu(r,e){if(!r||!e)throw new Error("Both entities must be defined to find a common ancestor");if(r===e)return r;const t=r.parent;if(t){if(t===e)return e;if(t.type===n.Project)return null}else return null;const i=e.parent;if(i){if(i===r)return r;if(i.type===n.Project)return null}else return null;return Tu(t,i)}function Ke(r){if(ko.includes(r.type)){if(r.type===n.FunctionDeclaration){const e=r.parent;if(e.type===n.CustomEntity)return e;if(e.type===n.Loop)return e}return r}else{const e=r.parent;return e?Ke(e):null}}function ck(r){return r.type===n.VariableDeclaration?[r]:Ge.includes(r.type)?[...r.inputs,...r.outputs||[]]:r.type===n.ReturnStatement?r.outputs:Fr.includes(r.type)||r.type===n.FunctionDeclaration?r.inputs:[]}function dk(r){const e=zn(r),t=[],i=[];wu.includes(r.type)&&t.push(...Eu(r));const a=e.filter(s=>{const o=t.includes(s);return o?!1:On.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>Na(o,s)?-1:0),i.sort((s,o)=>Na(o,s)?-1:0),[...t,...i,...a]}function TD(r){return[...r].sort((e,t)=>Na(t,e)?-1:0)}function uk(r){const e=TD(r),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];Na(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function bt(r){const e=r.map(t=>Ke(t));return g(e)}function Eu(r){return Ge.includes(r.type)?[...bt(r.successCalls),...bt(r.errorCalls)]:Ve.includes(r.type)?bt(r.calls):[]}function pk(r,e){return Eu(r).includes(e)}function bu(r){return r.writesValues||[]}function yk(r,e){return bu(r).includes(e)}function ED(r){var e;return ke.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function hk(r){return r.writesValues}function bD(r=[]){return r.map(ED).filter(e=>!!e)}function No(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>ke.includes(e.type))}function RD(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&ke.includes(e.type))}function gD(r){return ke.includes(r.type)?r:null}function vD(r){return r.writesValues.map(gD).filter(e=>!!e)}function ID(r=[]){return r.reduce((e,t)=>t.type===n.OutputMap?[...e,...vD(t)]:e,[])}function Be(r){return Ge.includes(r.type)?[...sn(bt(r.successCalls)),...sn(bt(r.errorCalls))]:Ve.includes(r.type)?sn(bt(r.calls)):[]}function fk(r){return Ge.includes(r.type)?[...sn(bt(r.successCalls)),...sn(bt(r.errorCalls))]:Ve.includes(r.type)?sn(bt(r.calls)):[]}function DD(r,e=new Set){return r.writesValues.filter(i=>ke.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...ie(a,e)],[])}function PD(r,e=new Set){var i;return(((i=r.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>ke.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...ie(s,e)],[])}function ie(r,e=new Set){if(e.has(r.id))return[];if(r.type===n.ReturnStatement)return RD(r.outputs).reduce((i,a)=>[...i,...ie(a,e)],[]);if(r.type===n.FunctionCall||r.type===n.Operation||r.type===n.Condition)return[...Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]),...bD(r.inputs),...ID(r.outputs)].reduce((s,o)=>[...s,...ie(o,e)],[]);if(Fr.includes(r.type)){const t=No(r.inputs),a=Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...ie(o,e)],[])}if(r.type===n.FunctionDeclaration){const t=[...No(r.inputs)],a=Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...ie(o)],[])}if(ke.includes(r.type)){e.add(r.id);const i=Be(r).reduce((a,s)=>{const o=Ke(s);return[...a,...ie(o||s,e)]},[]);return[r,...i,...PD(r,e),...DD(r,e)]}return[]}function Ot(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...zn(r).reduce((a,s)=>[...a,s,...Ot(s,e)],[])])}function sn(r){return r.reduce((e,t)=>t.type===n.ReturnStatement||t.type===n.ContinueStatement||t.type===n.BreakStatement?[...e,t]:[...e,t,...Be(t)],[])}function AD(r){const e=r.entities||[],t=[...e,...r.functions||[],...r.events||[],...r.projects||[]],i=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...No(y.inputs),...sn(bt(y.calls)),...y.returnStatements],[]),o=r.functions.reduce((p,y)=>[...p,...sn(bt(y.calls)),...y.returnStatements],[]),l=r.events.reduce((p,y)=>[...p,...sn(bt(y.calls)),...y.returnStatements],[]);return[...t,...i,...a,...s,...o,...l]}function OD(r,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case n.FunctionCall:return i.inputs.find(a=>a.id===r.id)!==void 0||i.outputs.find(a=>a.id===r.id)!==void 0;case n.Condition:return i.successCalls.find(a=>a.id===r.id)!==void 0||i.errorCalls.find(a=>a.id===r.id)!==void 0||i.inputs.find(a=>a.id===r.id)!==void 0;case n.Operation:return i.outputs.find(a=>a.id===r.id)!==void 0;case n.VariableDeclaration:return Ge.includes(r.type)?SD(r).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case n.CustomEntity:return i.properties.find(a=>a.id===r.id)!==void 0||i.methods.find(a=>a.id===r.id)!==void 0;case n.FunctionDeclaration:return i.inputs.find(a=>a.id===r.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===r.id)!==void 0;default:return!1}})}function mk(r){const e=AD(r.project);return OD(r,e)}function Mr(r){const e=[];if(On.includes(r.type)){r.calledBy.forEach(a=>{const s=Ke(a);s&&e.push(s)});const i=[...r.inputs||[],...r.outputs||[]].map(a=>vu(a)).filter(a=>a!==null);e.push(...g(i))}if(ke.includes(r.type)){const t=vu(r);t&&e.push(t)}return g(e)}function Ru(r){return r.type===n.FunctionCall||r.type===n.InternalCall?r.declaration.inputs:[n.Operation,n.Condition,n.Loop].includes(r.type)?r.declaration.fixedArguments:r.type===n.FunctionDeclaration||Fr.includes(r.type)?r.inputs:r.type===n.Search?r.inputsDeclarations:[]}function Tk(r,e){return e.type===n.Condition?e.inputs.find(t=>t.declaration.id===r.id):e.type===n.FunctionCall||e.type===n.Operation?e.inputs.find(t=>t.declaration.id===r.id):null}function SD(r){return Ge.includes(r.type)?r.inputs:[]}function gu(r){var e;return r.type===n.FunctionCall?((e=r.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[n.Operation,n.Condition,n.Loop].includes(r.type)?r.declaration.fixedReturns:r.type===n.Search?r.outputsDeclarations:Le.includes(r.type)?r.outputs:[]}function Ek(r,e){return e.type===n.Condition?null:e.type===n.FunctionCall||e.type===n.Operation?e.outputs.find(t=>t.declaration.id===r.id):null}function bk(r){return r.type===n.Condition?[]:Ge.includes(r.type)?r.outputs:[]}function vu(r){const e=r.readsValue;return e?Ke(e):null}function CD(r){const e=r.internalCalls||[];return g(bt(g(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function gi(r){const e=bu(r),t=[];return e.forEach(i=>{if(ke.includes(i.type))t.push(i);else if(An.includes(i.type)){const a=i.parent;t.push(a)}}),t}function g(r){const e=new Set;return r.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function zn(r,e=!1){const t=[];if(r.type===n.Project&&t.push(...(r==null?void 0:r.entities)||[],...(r==null?void 0:r.functions)||[],...(r==null?void 0:r.variableDeclarations)||[],...(r==null?void 0:r.variableInstances)||[],...(r==null?void 0:r.searches)||[],...(r==null?void 0:r.loops)||[],...(r==null?void 0:r.operations)||[],...(r==null?void 0:r.conditions)||[],...(r==null?void 0:r.functionCalls)||[],...(r==null?void 0:r.events)||[],...(r==null?void 0:r.projects)||[]),dt.includes(r.type)&&t.push(...(r==null?void 0:r.detachedChildren)||[]),r.type===n.CustomEntity){const i=[...r.suggestedMethods,...r.methods].flatMap(a=>a.collapsed&&e?[]:zn(a));t.push(...i)}if(r.type===n.Condition){const i=r.successCalls.map(s=>Ke(s)),a=r.errorCalls.map(s=>Ke(s));t.push(...i,...a)}if(Fr.includes(r.type)){if(r.collapsed&&e)return[];const i=r.inputs.map(s=>gi(s)).flat(),a=r.calls.map(s=>Ke(s));t.push(...g(i),...a)}if(Ge.includes(r.type)&&r.type!==n.Condition){const i=r==null?void 0:r.outputs.map(o=>gi(o)).flat(),a=r.successCalls.map(o=>Ke(o)),s=r.errorCalls.map(o=>Ke(o));t.push(...g(i),...a,...s)}if(ke.includes(r.type)){const i=gi(r),a=CD(r);t.push(...i,...a)}if(r.type===n.Loop){const i=r.outputs.map(o=>gi(o)).flat();if(r.body){const o=zn(r.body,e);t.push(...o)}const a=r.errorCalls.map(o=>Ke(o)),s=r.successCalls.map(o=>Ke(o));t.push(...g(i),...s,...a)}if(r.type===n.FunctionDeclaration){if(r.collapsed&&e)return[];const i=r.inputs.map(s=>gi(s)).flat(),a=r.calls.map(s=>Ke(s));t.push(...g(i),...a)}return g(t)}function BD(r,e=!1){const t=zn(r,e),i=[...t,...t.reduce((a,s)=>[...a,...BD(s,e)],[])];return g(i)}function wD(r){const e=Mr(r),t=[...e,...e.reduce((i,a)=>[...i,...wD(a)],[])];return g(t)}function Mo(r){return r.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...Mo(t),...Vo(t)]:[...e,t.name],[])}function Vo(r){return r.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...Vo(t),...Mo(t)]:[...e,t.name],[])}function Iu(r){return r.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Iu(t),...Du(t)]:[...e,t],[])}function Du(r){return r.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Du(t),...Iu(t)]:[...e,t],[])}function _D(r){return[...Vo(r),...Mo(r)].filter((t,i,a)=>a.indexOf(t)===i)}function ND(r){return r.implements.length===0&&r.extends.length===0?null:r.implements.find(i=>i.type===n.BuiltInBaseEntity&&i.name===L.PERSISTED_ENTITY)?r:[...r.implements,...r.extends].reduce((i,a)=>{if(a.type===n.CustomEntity){const s=ND(a);if(s)return s}return i},null)}function Rk(r){const e=r.extends.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function gk(r){const e=r.implements.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function MD(r){const e=r.extends.find(t=>t.type===n.CustomEntity);return e&&e.type===n.CustomEntity?e:null}function Zn(r){const e=[...r.implements,...r.extends].reduce((t,i)=>i.type===n.BuiltInBaseEntity?[...t,i]:i.type===n.CustomEntity?[...t,...Zn(i)]:t,[]);return g(e)}function Pu(r){return r.type===n.PrimitiveEntity?!0:r.type===n.BuiltInBaseEntity?r.interactive:!Zn(r).find(i=>!i.interactive)}function vk(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function Au(r){return r.parent!==r.project?!1:n.VariableDeclaration===r.type?r.project.variableDeclarations.includes(r):n.VariableInstance===r.type?r.project.variableInstances.includes(r):n.FunctionCall===r.type?r.project.functionCalls.includes(r):n.Condition===r.type?r.project.conditions.includes(r):n.Operation===r.type?r.project.operations.includes(r):n.Loop===r.type?r.project.loops.includes(r):n.Search===r.type?r.project.searches.includes(r):!1}function VD(r){if([...Ve,n.CustomEntity,n.InstalledProject,n.Project].includes(r.type)||Au(r))return!1;const e=Mr(r);return e.length===0?!0:e.some(t=>VD(t))}function Ou(r){return[...Ve,n.CustomEntity,n.InstalledProject,n.Project].includes(r.type)||Au(r)?!1:Mr(r).length===0}function LD(r,e=0){if(Ou(r)){const t=Mr(r);return t.length===0?r:t.map(a=>LD(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function $D(r){const e=[];if(Ou(r))e.push(r);else return[];return Mr(r).forEach(i=>{e.push(...$D(i))}),e}function GD(r){return r.type===n.FunctionDeclaration&&r.parent!==r.project&&!![n.CustomEntity,n.Loop,n.InstalledProject].includes(r.parent.type)}function Ik(r,e){const t=new Map;return r.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function Lo(r){switch(r){case n.CustomEntity:return Vr;case n.FunctionDeclaration:return vr;case n.VariableDeclaration:return Ar;case n.VariableInstance:return Or;case n.FunctionCall:return Nr;case n.Operation:return Ir;case n.Condition:return Pr;case n.ReturnStatement:return wr;case n.Loop:return Dr;case n.Search:return Sr;case n.InputMap:return vn;case n.OutputMap:return In;case n.ArgumentDeclaration:return Br;case n.ReturnDeclaration:return _t;case n.Property:return gr;case n.InstalledProject:return Cr;case n.Project:return _;case n.BuiltInBaseEntity:return Gt;default:return null}}function Rt(r,e){if(dt.includes(r.type))return r;if(Ur.includes(r.type))return null;const t=r.parent;if(!t)return null;if(t.type===n.GenericReference){const i=w(t);if(!i)return null;const a=e.get(i);return a?Rt(a,e):null}else return t===e?e:Rt(t,e)}function Su(r,e){if(Ur.includes(r.type)||e.getBuiltIn(r.id))return null;const t=Nt(r.parent,e);return t?t===e?dt.includes(r.type)?r:null:t.type===n.CustomEntity?r:Su(t,e):null}function $o(r,e,t){if(r===e||e===t||r===t)return!1;const i=Rt(e.parent,t);return i===r?!0:$o(i,e,t)}var Go=(r=>(r.SameBothLocal="same-both-local",r.AInB="a-in-b",r.BInA="b-in-a",r.ParallelInCommonParent="parallel-in-common-parent",r.ParallelInProject="parallel-in-project",r.AIsGlobalBIsNot="a-is-global-b-is-not",r.BIsGlobalAIsNot="b-is-global-a-is-not",r.SameBothGlobal="same-both-global",r))(Go||{});function Ma(r,e,t){const i=Rt(r,t),a=Rt(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+r.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==n.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===n.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===n.Project&&a.type!==n.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==n.Project&&a.type===n.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if($o(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if($o(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Tu(i,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Rt(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function FD(r,e,t){const i=Ma(r,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(r===e)return r;let a=Rt(r.parent,t);if(a){if(a===e)return e;if(a.type===n.Project)return r}else return r;for(;a;){if(a){if(a===e)return e;if(a.type===n.Project)return r}else return r;a=Rt(a.parent,t)}let s=Rt(e.parent,t);if(s){if(s===r)return r;if(s.type===n.Project)return e}else return e;for(;s;){if(s){if(s===r)return r;if(s.type===n.Project)return e}else return e;s=Rt(s.parent,t)}return null}function UD(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,i)=>{const a=FD(t,i,i.project);return!a||a===i?t:i},r[0])}function Nt(r,e){let t;return typeof r=="string"?t=r:r.type===n.GenericReference?t=w(r):t=r.id,t===e.id?e:e.get(t)}function Kn(r){if(!r)return null;if(Ur.includes(r.type))return r;if(r.type===n.Project)return null;if(r.project.getBuiltIn(r.id))return r;const e=r.parent;return!e||e.type===n.Project?null:Kn(e)}function Va(r,e){var t;if(r.readsValue){const i=Nt(r.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else r.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function La(r){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function i(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=Su(r,r.project);return r.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))});let l;if(Ge.includes(s.type)&&(l=s),l){const p=La(l);p.reachable||Be(r).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),r.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))});let l;if(Ge.includes(s.type)&&(l=s),l){const p=La(l);p.reachable||Be(r).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),r.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))}),s===a)return;let l;if(s.type===n.FunctionDeclaration){const p=Ke(s);if(p.type===n.CustomEntity)return;p.type===n.Loop&&(l=p)}if(l){const p=La(l);p.reachable||p.blocks.forEach(y=>{i(s,y.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Dk(r){return ko.includes(r.type)?r.type===n.FunctionDeclaration?!GD(r):!0:!1}function Pk(r){if(n.ActionDescriptor===r.type){if(r.project.operationDeclarations.find(s=>s.id===r.id))return n.Operation;if(r.project.globalEventActionDescriptors.find(s=>s.id===r.id))return n.GlobalEvent;if(r.project.loopDeclarations.find(s=>s.id===r.id))return n.Loop;if(r.project.conditionDeclarations.find(s=>s.id===r.id))return n.Condition}return r.type}function Ak(r,e){const t=[];if(r.parent)if(r.id===r.parent)t.push(new E({id:`${r.id}--${r.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.parent);i?[n.Project,n.DataType].includes(i.type)||t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return r.implements&&Array.isArray(r.implements)?r.implements.forEach(i=>{if(r.id===i){t.push(new E({id:`${r.id}--${i}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${r.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${r.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' property that isn't an array.`,issue:null})),r.extends&&Array.isArray(r.extends)&&r.extends.forEach(i=>{const a=e.get(i);a?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${r.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 Se=class Se{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",n.CustomEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(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=w(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:n.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},l=R(o,t);return l.setParent(i),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Ak(i,t),o=vo(i,t);a.push(...s,...o,..._e(i));const l=i.parent?t.get(i.parent):null;if(l&&l.type===n.DataType){const p=l;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
370
+ 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 a;const e=[this],t=[],i=[];return this.parent===this.project&&this.project.addFunctionCall(this),(a=this.process)==null||a.writesValues.forEach(s=>{s.setValueWriter(this.process),e.push(s)}),this.successCalls.forEach(s=>{s.addSuccessCaller(this),e.push(s)}),this.errorCalls.forEach(s=>{s.addErrorCaller(this),e.push(s)}),this.calledBySuccess.forEach(s=>{s.addSuccessCall(this),e.push(s)}),this.calledByError.forEach(s=>{s.addErrorCall(this),e.push(s)}),this.calledByEntry.forEach(s=>{s.addCall(this),e.push(s)}),{updated:g(e),added:g(t),removed:g(i),self: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===n.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=w(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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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),[n.BreakStatement,n.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==n.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=gu(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 l=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:_.UUID.uuid(),type:n.OutputMap,version:1,declaration:s,index:l,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}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:g(i),removed:g(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:g(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:n.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===n.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=ak(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 Oe(this.toJSON(),this.project)}};c(Oe,"MUTABLE_BASE_PROPERTIES",[]),c(Oe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Oe,"BASE_PROPERTIES",[...Oe.MUTABLE_BASE_PROPERTIES,...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"MUTABLE_META_PROPERTIES",["x","y"]),c(Oe,"INMUTABLE_META_PROPERTIES",[...Oe.INMUTABLE_BASE_PROPERTIES]),c(Oe,"META_PROPERTIES",[...Oe.MUTABLE_META_PROPERTIES,...Oe.INMUTABLE_META_PROPERTIES]),c(Oe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Oe,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(Oe,"UPSTREAM_PROPERTIES",[...Oe.MUTABLE_UPSTREAM_PROPERTIES,...Oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(Oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(Oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Oe,"DOWNSTREAM_PROPERTIES",[...Oe.MUTABLE_DOWNSTREAM_PROPERTIES,...Oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Oe,"PROPERTIES",[...Oe.META_PROPERTIES,...Oe.UPSTREAM_PROPERTIES,...Oe.DOWNSTREAM_PROPERTIES]);let Nr=Oe;function hD(r){var e,t,i;switch(r.id){case G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=r.project.entities.filter(f=>!!f.implements.find(m=>m.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((b=m.getDefaultValue())==null?void 0:b.value)===!0}))){const m=a[0].properties.find(v=>v.implements&&v.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),b=(e=m==null?void 0:m.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(m!=null&&m.dataType){const v=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],P=R({id:v+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},r.project);return P.setParent(m==null?void 0:m.dataType),P.initChildren(),P.addSelfToProject(),{newEntities:[P]}}return{newEntities:[]}}const o=r.project.get(G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),l=wo(o,"Main database");if(l.errors.length>0)return{newEntities:[]};const p=l.implemented.properties.find(f=>f.implements&&f.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id),y=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},r.project);m.setParent(p==null?void 0:p.dataType),m.initChildren(),m.addSelfToProject()}return{newEntities:[l.implemented]}}}return{newEntities:[]}}function fD(r){return r.implements.filter(t=>t.type===n.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=r.project.entities.filter(p=>p.implements.find(y=>y.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===G["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=r.properties.find(p=>p.implements&&p.implements.id===G["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id),l=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!l){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:n.PrimitiveValue,name:I.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},r.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function wo(r,e,t){const i=t||tt(e,n.CustomEntity,r.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:n.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[r],x:0,y:0,parent:r.project},l=vo(o,r.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=hD(r),y=R(o,r.project);y.setParent(r.project),y.initChildren();const f=r.properties.map(v=>{const P=s+"-"+tt(S(v,r.project),n.Property,r.project),O=v.clone(y,P);return O.abstract=!1,O.implements=v,O.setParent(y),y.addProperty(O),O}),m=r.abstractMethods.map(v=>{const P=s+tt(v.name,n.FunctionDeclaration,r.project),O=v.implementAsFunctionDeclaration(P),A={id:P+"-parent-ref-id",type:n.GenericReference,entityId:i,entityType:n.CustomEntity},k={...O,implements:v,parent:A},j=R(k,r.project);return y.addMethod(j),j.setParent(y),j.initChildren(),j.implements=v,j});o.properties=f,o.methods=m;const b=fD(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}function _o(r,e){const t=Mr(r);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=_o(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function mD(r,e,t=new Set){const i=zn(r),a=zn(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),l=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),g([...p,...mD(y,e,t)])),[]);return g([...o,...l])}function Na(r,e){const t=_o(r,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function sk(r,e){return!!_o(r,e).last}function ok(r){if(Ve.includes(r.type))return r;if([...On,n.VariableDeclaration].includes(r.type)){const e=r.parent;return Ve.includes(e.type)?e:null}return null}function Tu(r,e){if(!r||!e)throw new Error("Both entities must be defined to find a common ancestor");if(r===e)return r;const t=r.parent;if(t){if(t===e)return e;if(t.type===n.Project)return null}else return null;const i=e.parent;if(i){if(i===r)return r;if(i.type===n.Project)return null}else return null;return Tu(t,i)}function Ke(r){if(ko.includes(r.type)){if(r.type===n.FunctionDeclaration){const e=r.parent;if(e.type===n.CustomEntity)return e;if(e.type===n.Loop)return e}return r}else{const e=r.parent;return e?Ke(e):null}}function lk(r){return r.type===n.VariableDeclaration?[r]:Ge.includes(r.type)?[...r.inputs,...r.outputs||[]]:r.type===n.ReturnStatement?r.outputs:Fr.includes(r.type)||r.type===n.FunctionDeclaration?r.inputs:[]}function ck(r){const e=zn(r),t=[],i=[];wu.includes(r.type)&&t.push(...Eu(r));const a=e.filter(s=>{const o=t.includes(s);return o?!1:On.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>Na(o,s)?-1:0),i.sort((s,o)=>Na(o,s)?-1:0),[...t,...i,...a]}function TD(r){return[...r].sort((e,t)=>Na(t,e)?-1:0)}function dk(r){const e=TD(r),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];Na(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function bt(r){const e=r.map(t=>Ke(t));return g(e)}function Eu(r){return Ge.includes(r.type)?[...bt(r.successCalls),...bt(r.errorCalls)]:Ve.includes(r.type)?bt(r.calls):[]}function uk(r,e){return Eu(r).includes(e)}function bu(r){return r.writesValues||[]}function pk(r,e){return bu(r).includes(e)}function ED(r){var e;return ke.includes((e=r==null?void 0:r.readsValue)==null?void 0:e.type)?r.readsValue:null}function yk(r){return r.writesValues}function bD(r=[]){return r.map(ED).filter(e=>!!e)}function No(r=[]){return r.map(e=>e.writesValues).flat().filter(e=>ke.includes(e.type))}function RD(r=[]){return r.map(e=>e.readsValue).filter(e=>!!e&&ke.includes(e.type))}function gD(r){return ke.includes(r.type)?r:null}function vD(r){return r.writesValues.map(gD).filter(e=>!!e)}function ID(r=[]){return r.reduce((e,t)=>t.type===n.OutputMap?[...e,...vD(t)]:e,[])}function Be(r){return Ge.includes(r.type)?[...sn(bt(r.successCalls)),...sn(bt(r.errorCalls))]:Ve.includes(r.type)?sn(bt(r.calls)):[]}function hk(r){return Ge.includes(r.type)?[...sn(bt(r.successCalls)),...sn(bt(r.errorCalls))]:Ve.includes(r.type)?sn(bt(r.calls)):[]}function DD(r,e=new Set){return r.writesValues.filter(i=>ke.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...ie(a,e)],[])}function PD(r,e=new Set){var i;return(((i=r.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>ke.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...ie(s,e)],[])}function ie(r,e=new Set){if(e.has(r.id))return[];if(r.type===n.ReturnStatement)return RD(r.outputs).reduce((i,a)=>[...i,...ie(a,e)],[]);if(r.type===n.FunctionCall||r.type===n.Operation||r.type===n.Condition)return[...Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]),...bD(r.inputs),...ID(r.outputs)].reduce((s,o)=>[...s,...ie(o,e)],[]);if(Fr.includes(r.type)){const t=No(r.inputs),a=Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...ie(o,e)],[])}if(r.type===n.FunctionDeclaration){const t=[...No(r.inputs)],a=Be(r).reduce((s,o)=>{const l=Ke(o);return[...s,...ie(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...ie(o)],[])}if(ke.includes(r.type)){e.add(r.id);const i=Be(r).reduce((a,s)=>{const o=Ke(s);return[...a,...ie(o||s,e)]},[]);return[r,...i,...PD(r,e),...DD(r,e)]}return[]}function Ot(r,e=new Set){return e.has(r.id)?[]:(e.add(r.id),[...zn(r).reduce((a,s)=>[...a,s,...Ot(s,e)],[])])}function sn(r){return r.reduce((e,t)=>t.type===n.ReturnStatement||t.type===n.ContinueStatement||t.type===n.BreakStatement?[...e,t]:[...e,t,...Be(t)],[])}function AD(r){const e=r.entities||[],t=[...e,...r.functions||[],...r.events||[],...r.projects||[]],i=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...No(y.inputs),...sn(bt(y.calls)),...y.returnStatements],[]),o=r.functions.reduce((p,y)=>[...p,...sn(bt(y.calls)),...y.returnStatements],[]),l=r.events.reduce((p,y)=>[...p,...sn(bt(y.calls)),...y.returnStatements],[]);return[...t,...i,...a,...s,...o,...l]}function OD(r,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case n.FunctionCall:return i.inputs.find(a=>a.id===r.id)!==void 0||i.outputs.find(a=>a.id===r.id)!==void 0;case n.Condition:return i.successCalls.find(a=>a.id===r.id)!==void 0||i.errorCalls.find(a=>a.id===r.id)!==void 0||i.inputs.find(a=>a.id===r.id)!==void 0;case n.Operation:return i.outputs.find(a=>a.id===r.id)!==void 0;case n.VariableDeclaration:return Ge.includes(r.type)?SD(r).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case n.CustomEntity:return i.properties.find(a=>a.id===r.id)!==void 0||i.methods.find(a=>a.id===r.id)!==void 0;case n.FunctionDeclaration:return i.inputs.find(a=>a.id===r.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===r.id)!==void 0;default:return!1}})}function fk(r){const e=AD(r.project);return OD(r,e)}function Mr(r){const e=[];if(On.includes(r.type)){r.calledBy.forEach(a=>{const s=Ke(a);s&&e.push(s)});const i=[...r.inputs||[],...r.outputs||[]].map(a=>vu(a)).filter(a=>a!==null);e.push(...g(i))}if(ke.includes(r.type)){const t=vu(r);t&&e.push(t)}return g(e)}function Ru(r){return r.type===n.FunctionCall||r.type===n.InternalCall?r.declaration.inputs:[n.Operation,n.Condition,n.Loop].includes(r.type)?r.declaration.fixedArguments:r.type===n.FunctionDeclaration||Fr.includes(r.type)?r.inputs:r.type===n.Search?r.inputsDeclarations:[]}function mk(r,e){return e.type===n.Condition?e.inputs.find(t=>t.declaration.id===r.id):e.type===n.FunctionCall||e.type===n.Operation?e.inputs.find(t=>t.declaration.id===r.id):null}function SD(r){return Ge.includes(r.type)?r.inputs:[]}function gu(r){var e;return r.type===n.FunctionCall?((e=r.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[n.Operation,n.Condition,n.Loop].includes(r.type)?r.declaration.fixedReturns:r.type===n.Search?r.outputsDeclarations:Le.includes(r.type)?r.outputs:[]}function Tk(r,e){return e.type===n.Condition?null:e.type===n.FunctionCall||e.type===n.Operation?e.outputs.find(t=>t.declaration.id===r.id):null}function Ek(r){return r.type===n.Condition?[]:Ge.includes(r.type)?r.outputs:[]}function vu(r){const e=r.readsValue;return e?Ke(e):null}function CD(r){const e=r.internalCalls||[];return g(bt(g(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function gi(r){const e=bu(r),t=[];return e.forEach(i=>{if(ke.includes(i.type))t.push(i);else if(An.includes(i.type)){const a=i.parent;t.push(a)}}),t}function g(r){const e=new Set;return r.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function zn(r,e=!1){const t=[];if(r.type===n.Project&&t.push(...(r==null?void 0:r.entities)||[],...(r==null?void 0:r.functions)||[],...(r==null?void 0:r.variableDeclarations)||[],...(r==null?void 0:r.variableInstances)||[],...(r==null?void 0:r.searches)||[],...(r==null?void 0:r.loops)||[],...(r==null?void 0:r.operations)||[],...(r==null?void 0:r.conditions)||[],...(r==null?void 0:r.functionCalls)||[],...(r==null?void 0:r.events)||[],...(r==null?void 0:r.projects)||[]),dt.includes(r.type)&&t.push(...(r==null?void 0:r.detachedChildren)||[]),r.type===n.CustomEntity){const i=[...r.suggestedMethods,...r.methods].flatMap(a=>a.collapsed&&e?[]:zn(a));t.push(...i)}if(r.type===n.Condition){const i=r.successCalls.map(s=>Ke(s)),a=r.errorCalls.map(s=>Ke(s));t.push(...i,...a)}if(Fr.includes(r.type)){if(r.collapsed&&e)return[];const i=r.inputs.map(s=>gi(s)).flat(),a=r.calls.map(s=>Ke(s));t.push(...g(i),...a)}if(Ge.includes(r.type)&&r.type!==n.Condition){const i=r==null?void 0:r.outputs.map(o=>gi(o)).flat(),a=r.successCalls.map(o=>Ke(o)),s=r.errorCalls.map(o=>Ke(o));t.push(...g(i),...a,...s)}if(ke.includes(r.type)){const i=gi(r),a=CD(r);t.push(...i,...a)}if(r.type===n.Loop){const i=r.outputs.map(o=>gi(o)).flat();if(r.body){const o=zn(r.body,e);t.push(...o)}const a=r.errorCalls.map(o=>Ke(o)),s=r.successCalls.map(o=>Ke(o));t.push(...g(i),...s,...a)}if(r.type===n.FunctionDeclaration){if(r.collapsed&&e)return[];const i=r.inputs.map(s=>gi(s)).flat(),a=r.calls.map(s=>Ke(s));t.push(...g(i),...a)}return g(t)}function BD(r,e=!1){const t=zn(r,e),i=[...t,...t.reduce((a,s)=>[...a,...BD(s,e)],[])];return g(i)}function wD(r){const e=Mr(r),t=[...e,...e.reduce((i,a)=>[...i,...wD(a)],[])];return g(t)}function Mo(r){return r.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...Mo(t),...Vo(t)]:[...e,t.name],[])}function Vo(r){return r.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,n.CustomEntity,...Vo(t),...Mo(t)]:[...e,t.name],[])}function Iu(r){return r.extends.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Iu(t),...Du(t)]:[...e,t],[])}function Du(r){return r.implements.reduce((e,t)=>t.type===n.CustomEntity?[...e,t,...Du(t),...Iu(t)]:[...e,t],[])}function _D(r){return[...Vo(r),...Mo(r)].filter((t,i,a)=>a.indexOf(t)===i)}function ND(r){return r.implements.length===0&&r.extends.length===0?null:r.implements.find(i=>i.type===n.BuiltInBaseEntity&&i.name===L.PERSISTED_ENTITY)?r:[...r.implements,...r.extends].reduce((i,a)=>{if(a.type===n.CustomEntity){const s=ND(a);if(s)return s}return i},null)}function bk(r){const e=r.extends.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function Rk(r){const e=r.implements.find(t=>t.type===n.BuiltInBaseEntity);return e&&e.type===n.BuiltInBaseEntity?e:null}function MD(r){const e=r.extends.find(t=>t.type===n.CustomEntity);return e&&e.type===n.CustomEntity?e:null}function Zn(r){const e=[...r.implements,...r.extends].reduce((t,i)=>i.type===n.BuiltInBaseEntity?[...t,i]:i.type===n.CustomEntity?[...t,...Zn(i)]:t,[]);return g(e)}function Pu(r){return r.type===n.PrimitiveEntity?!0:r.type===n.BuiltInBaseEntity?r.interactive:!Zn(r).find(i=>!i.interactive)}function gk(r){return r.parent===r.project&&r.project.variableDeclarations.includes(r)}function Au(r){return r.parent!==r.project?!1:n.VariableDeclaration===r.type?r.project.variableDeclarations.includes(r):n.VariableInstance===r.type?r.project.variableInstances.includes(r):n.FunctionCall===r.type?r.project.functionCalls.includes(r):n.Condition===r.type?r.project.conditions.includes(r):n.Operation===r.type?r.project.operations.includes(r):n.Loop===r.type?r.project.loops.includes(r):n.Search===r.type?r.project.searches.includes(r):!1}function VD(r){if([...Ve,n.CustomEntity,n.InstalledProject,n.Project].includes(r.type)||Au(r))return!1;const e=Mr(r);return e.length===0?!0:e.some(t=>VD(t))}function Ou(r){return[...Ve,n.CustomEntity,n.InstalledProject,n.Project].includes(r.type)||Au(r)?!1:Mr(r).length===0}function LD(r,e=0){if(Ou(r)){const t=Mr(r);return t.length===0?r:t.map(a=>LD(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function $D(r){const e=[];if(Ou(r))e.push(r);else return[];return Mr(r).forEach(i=>{e.push(...$D(i))}),e}function GD(r){return r.type===n.FunctionDeclaration&&r.parent!==r.project&&!![n.CustomEntity,n.Loop,n.InstalledProject].includes(r.parent.type)}function vk(r,e){const t=new Map;return r.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function Lo(r){switch(r){case n.CustomEntity:return Vr;case n.FunctionDeclaration:return vr;case n.VariableDeclaration:return Ar;case n.VariableInstance:return Or;case n.FunctionCall:return Nr;case n.Operation:return Ir;case n.Condition:return Pr;case n.ReturnStatement:return wr;case n.Loop:return Dr;case n.Search:return Sr;case n.InputMap:return vn;case n.OutputMap:return In;case n.ArgumentDeclaration:return Br;case n.ReturnDeclaration:return _t;case n.Property:return gr;case n.InstalledProject:return Cr;case n.Project:return _;case n.BuiltInBaseEntity:return Gt;default:return null}}function Rt(r,e){if(dt.includes(r.type))return r;if(Ur.includes(r.type))return null;const t=r.parent;if(!t)return null;if(t.type===n.GenericReference){const i=w(t);if(!i)return null;const a=e.get(i);return a?Rt(a,e):null}else return t===e?e:Rt(t,e)}function Su(r,e){if(Ur.includes(r.type)||e.getBuiltIn(r.id))return null;const t=Nt(r.parent,e);return t?t===e?dt.includes(r.type)?r:null:t.type===n.CustomEntity?r:Su(t,e):null}function $o(r,e,t){if(r===e||e===t||r===t)return!1;const i=Rt(e.parent,t);return i===r?!0:$o(i,e,t)}var Go=(r=>(r.SameBothLocal="same-both-local",r.AInB="a-in-b",r.BInA="b-in-a",r.ParallelInCommonParent="parallel-in-common-parent",r.ParallelInProject="parallel-in-project",r.AIsGlobalBIsNot="a-is-global-b-is-not",r.BIsGlobalAIsNot="b-is-global-a-is-not",r.SameBothGlobal="same-both-global",r))(Go||{});function Ma(r,e,t){const i=Rt(r,t),a=Rt(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+r.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==n.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===n.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===n.Project&&a.type!==n.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==n.Project&&a.type===n.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if($o(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if($o(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Tu(i,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Rt(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function FD(r,e,t){const i=Ma(r,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(r===e)return r;let a=Rt(r.parent,t);if(a){if(a===e)return e;if(a.type===n.Project)return r}else return r;for(;a;){if(a){if(a===e)return e;if(a.type===n.Project)return r}else return r;a=Rt(a.parent,t)}let s=Rt(e.parent,t);if(s){if(s===r)return r;if(s.type===n.Project)return e}else return e;for(;s;){if(s){if(s===r)return r;if(s.type===n.Project)return e}else return e;s=Rt(s.parent,t)}return null}function UD(r){return r.length===0?null:r.length===1?r[0]:r.reduce((t,i)=>{const a=FD(t,i,i.project);return!a||a===i?t:i},r[0])}function Nt(r,e){let t;return typeof r=="string"?t=r:r.type===n.GenericReference?t=w(r):t=r.id,t===e.id?e:e.get(t)}function Kn(r){if(!r)return null;if(Ur.includes(r.type))return r;if(r.type===n.Project)return null;if(r.project.getBuiltIn(r.id))return r;const e=r.parent;return!e||e.type===n.Project?null:Kn(e)}function Va(r,e){var t;if(r.readsValue){const i=Nt(r.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else r.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function La(r){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function i(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=Su(r,r.project);return r.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))});let l;if(Ge.includes(s.type)&&(l=s),l){const p=La(l);p.reachable||Be(r).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),r.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))});let l;if(Ge.includes(s.type)&&(l=s),l){const p=La(l);p.reachable||Be(r).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),r.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{Le.includes(p.type)&&p!==r&&(Be(r).find(m=>m===p)||i(s,p))}),s===a)return;let l;if(s.type===n.FunctionDeclaration){const p=Ke(s);if(p.type===n.CustomEntity)return;p.type===n.Loop&&(l=p)}if(l){const p=La(l);p.reachable||p.blocks.forEach(y=>{i(s,y.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Ik(r){return ko.includes(r.type)?r.type===n.FunctionDeclaration?!GD(r):!0:!1}function Dk(r){if(n.ActionDescriptor===r.type){if(r.project.operationDeclarations.find(s=>s.id===r.id))return n.Operation;if(r.project.globalEventActionDescriptors.find(s=>s.id===r.id))return n.GlobalEvent;if(r.project.loopDeclarations.find(s=>s.id===r.id))return n.Loop;if(r.project.conditionDeclarations.find(s=>s.id===r.id))return n.Condition}return r.type}function Pk(r,e){const t=[];if(r.parent)if(r.id===r.parent)t.push(new E({id:`${r.id}--${r.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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(r.parent);i?[n.Project,n.DataType].includes(i.type)||t.push(new E({id:`${r.id}--${r.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${r.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", is referencing an entity with id "${r.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return r.implements&&Array.isArray(r.implements)?r.implements.forEach(i=>{if(r.id===i){t.push(new E({id:`${r.id}--${i}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${r.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${r.id}--${i}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${D.InvalidObjectStructure}`,code:D.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", has an 'implements' property that isn't an array.`,issue:null})),r.extends&&Array.isArray(r.extends)&&r.extends.forEach(i=>{const a=e.get(i);a?[n.CustomEntity,n.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${r.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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:`${r.id}--${i}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.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 Se=class Se{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",n.CustomEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(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=w(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:n.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},l=R(o,t);return l.setParent(i),l.initChildren(),l}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Pk(i,t),o=vo(i,t);a.push(...s,...o,..._e(i));const l=i.parent?t.get(i.parent):null;if(l&&l.type===n.DataType){const p=l;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
371
371
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
372
372
  ${an({describe_entity:p.entity.id})}
373
- 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 g([...this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]),...this.implements.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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];if(this.parent.type===n.DataType){const a=this.parent;a.entity=this,e.push(a)}else this.project.addCustomEntity(this);return{updated:g(e),added:g(t),removed:g(i),self: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=>{a9(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)}),s9(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),l=R(o,this.project);if(l.suggestion=!0,l.setParent(this),l.initChildren(),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(l)})}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.methods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),{affected:g(i),removed:g(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:g(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:n.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===n.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===n.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===n.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=i9(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(e=null,t=null,i=!0){var b,v,P;const a=this.toJSON(),s=t||tt(S(this,this.project),n.CustomEntity,this.project);a.properties=[],a.methods=[],a.abstractMethods=[];const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const y=(b=this.properties)==null?void 0:b.map((O,A)=>O.clone(this,l+"-property-"+A+"-id",i));p.properties=y;const f=(v=this.methods)==null?void 0:v.map((O,A)=>O.clone(this,l+"-method-"+A+"-id",i));p.methods=f;const m=(P=this.abstractMethods)==null?void 0:P.map((O,A)=>O.clone(this,l+"-abstract-method-"+A+"-id",i));return p.abstractMethods=m,p}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return wo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(i=>i.type===n.CustomEntity||i.type===n.BuiltInBaseEntity&&i.interactive);return g([...this.methods,...this.extends.flatMap(i=>i.getAllInteractiveMethods()),...e.flatMap(i=>i.getAllInteractiveMethods())])}inferFromInputs(e){if(this.parent.type!==n.DataType||!this.parent.inferred)return this;const t=[];e.forEach(s=>{t.find(l=>S(l,this.project)===S(s,this.project))||t.push(s)});const i=this.properties.filter(s=>!s.getDataType());t.forEach(s=>{const o=i.find(m=>S(m,this.project)===S(s,this.project));if(!o)return;const p=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),y=rn(p),f=y==null?void 0:y.clone(o,o.id+"--data-type",!0);f&&o.setDataType(f),s.setDeclaration(o)});const a=[];return t.forEach(s=>{if(!s.declaration){a.push(s);return}}),a.length===0?this:(a.forEach(s=>{const o=this.properties.find(v=>S(v,this.project)===S(s,this.project));if(o){if(s.setDeclaration(o),!o.getDataType()){const P=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),O=rn(P),A=O==null?void 0:O.clone(o,o.id+"--data-type",!0);A&&o.setDataType(A)}return}const l={id:s.id+"--inferred-property",type:n.Property,version:1,name:S(s,this.project),description:s.description,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,index:s.index,implements:null,dataType:null,parent:this.toReference()},p=R(l,this.project);p.setParent(this),p.initChildren();const f=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),m=rn(f),b=m==null?void 0:m.clone(p,l.id+"--data-type",!0);return b&&p.setDataType(b),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(Se,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Se,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Se,"BASE_PROPERTIES",[...Se.MUTABLE_BASE_PROPERTIES,...Se.INMUTABLE_BASE_PROPERTIES]),c(Se,"MUTABLE_META_PROPERTIES",[...Se.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Se,"INMUTABLE_META_PROPERTIES",[...Se.INMUTABLE_BASE_PROPERTIES]),c(Se,"META_PROPERTIES",[...Se.MUTABLE_META_PROPERTIES,...Se.INMUTABLE_META_PROPERTIES]),c(Se,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Se,"UPSTREAM_PROPERTIES",[...Se.MUTABLE_UPSTREAM_PROPERTIES,...Se.INMUTABLE_UPSTREAM_PROPERTIES]),c(Se,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Se,"DOWNSTREAM_PROPERTIES",[...Se.MUTABLE_DOWNSTREAM_PROPERTIES,...Se.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Se,"PROPERTIES",[...Se.META_PROPERTIES,...Se.UPSTREAM_PROPERTIES,...Se.DOWNSTREAM_PROPERTIES]);let Vr=Se;function Ok(r){const e=V8(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}class Gt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",n.BuiltInBaseEntity);c(this,"abstract",!1);c(this,"static");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"interactive",!1);c(this,"errors",[]);c(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 g(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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:n.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=Ok(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 Gt(this.toJSON(),this.project)}implement(e,t){return wo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(i=>i.type===n.BuiltInBaseEntity&&i.interactive||i.type===n.PrimitiveEntity).forEach(i=>{i instanceof Gt&&e.push(...i.getAllInteractiveMethods())})),g(e)}}function Sk(r){const e=A8(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}class Ft{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",n.PrimitiveEntity);c(this,"static");c(this,"abstract");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(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})}get extendedProperties(){return g(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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:n.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=Sk(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 Ft(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(i=>i.type===n.BuiltInBaseEntity&&i.interactive||i.type===n.PrimitiveEntity).forEach(i=>{i instanceof Gt&&e.push(...i.getAllInteractiveMethods())}),g(e)}}function Ut(r,e){if(!r)throw new Error("Entity is null");const t=e.findSubscribedInstance(r);switch(r.type){case n.PrimitiveValue:return t||new bi(r,e);case n.CustomEntity:return t||new Vr(r,e);case n.PrimitiveEntity:return t||new Ft(r,e);case n.FunctionDeclaration:return t||new vr(r,e);case n.GlobalEvent:return t||new Ti(r,e);case n.DataType:return t||new mi(r,e);case n.Property:return t||new gr(r,e);case n.FunctionCall:return t||new Nr(r,e);case n.Condition:return t||new Pr(r,e);case n.Operation:return t||new Ir(r,e);case n.VariableDeclaration:return t||new Ar(r,e);case n.VariableInstance:return t||new Or(r,e);case n.OutputMap:return t||new In(r,e);case n.ReturnDeclaration:return t||new _t(r,e);case n.ArgumentDeclaration:return t||new Br(r,e);case n.InputMap:return t||new vn(r,e);case n.Project:return t||new _(r);case n.InstalledProject:return t||new Cr(r,e);case n.ActionDescriptor:return t||new ne(r,e);case n.ReturnStatement:return t||new wr(r,e);case n.Loop:return t||new Dr(r,e);case n.Search:return t||new Sr(r,e);case n.ValueDescriptor:return t||new _r(r,e);case n.BuiltInBaseEntity:return t||new Gt(r,e);case n.InternalCall:return t||new Ei(r,e);case n.ContinueStatement:return t||new Et(r,e);case n.BreakStatement:return t||new Ri(r,e);default:throw new Error("Invalid entity type: "+r.type)}}function R(r,e){if(!r)throw new Error("Entity is null");const t=Ut(r,e);return t.subscribe(),t}function Ck(r,e){if(!r)throw new Error("Entity is null");switch(r.type){case n.PrimitiveValue:return bi.fromGenerationTarget(r,e);case n.CustomEntity:return Vr.fromGenerationTarget(r,e);case n.FunctionDeclaration:return vr.fromGenerationTarget(r,e);case n.GlobalEvent:return Ti.fromGenerationTarget(r,e);case n.DataType:return mi.fromGenerationTarget(r,e);case n.Property:return gr.fromGenerationTarget(r,e);case n.FunctionCall:return Nr.fromGenerationTarget(r,e);case n.Condition:return Pr.fromGenerationTarget(r,e);case n.Operation:return Ir.fromGenerationTarget(r,e);case n.VariableDeclaration:return Ar.fromGenerationTarget(r,e);case n.VariableInstance:return Or.fromGenerationTarget(r,e);case n.OutputMap:return In.fromGenerationTarget(r,e);case n.ReturnDeclaration:return _t.fromGenerationTarget(r,e);case n.ArgumentDeclaration:return Br.fromGenerationTarget(r,e);case n.InputMap:return vn.fromGenerationTarget(r,e);case n.InstalledProject:return Cr.fromGenerationTarget(r,e);case n.ReturnStatement:return wr.fromGenerationTarget(r,e);case n.Loop:return Dr.fromGenerationTarget(r,e);case n.Search:return Sr.fromGenerationTarget(r,e);case n.ActionDescriptor:return ne.fromGenerationTarget(r,e);case n.ValueDescriptor:return _r.fromGenerationTarget(r,e);case n.InternalCall:return Ei.fromGenerationTarget(r,e);case n.ContinueStatement:return Et.fromGenerationTarget(r,e);case n.BreakStatement:return Ri.fromGenerationTarget(r,e);default:throw new Error("Invalid entity type: "+r.type)}}const Q=class Q{constructor(e){c(this,"initialData");c(this,"id");c(this,"version");c(this,"type",n.Project);c(this,"name",null);c(this,"description",null);c(this,"x");c(this,"y");c(this,"entities",[]);c(this,"projects",[]);c(this,"functions",[]);c(this,"events",[]);c(this,"variableDeclarations",[]);c(this,"variableInstances",[]);c(this,"conditions",[]);c(this,"operations",[]);c(this,"functionCalls",[]);c(this,"loops",[]);c(this,"searches",[]);c(this,"primitives",[]);c(this,"builtInBaseEntities",[]);c(this,"operationDeclarations",[]);c(this,"globalEventActionDescriptors",[]);c(this,"loopDeclarations",[]);c(this,"loopDeclarationsBodies",[]);c(this,"conditionDeclarations",[]);c(this,"valueDescriptors",[]);c(this,"dataTypes",[]);c(this,"project");c(this,"instances",{});c(this,"builtInInstances",{});c(this,"errors",[]);c(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;try{(!Q.UUID||Q.UUID.isBackup)&&(Q.UUID=Bs==null?void 0:Bs()),Q.UUID||(Q.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:t=>t})}catch(t){console.error("Error initializing UUID module",t),Q.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:i=>i}}}static injectUUIDModule(e){Q.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(..._e(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(){const e=[this],t=[],i=[];return{updated:g(e),added:g(t),removed:g(i),self: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+"--"+Q.UUID.uuid()+"--ref",type:n.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=Xj(),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 Q(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!==n.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=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return g([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.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(l=>l.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===L.PERSISTED_ENTITY)||null}};c(Q,"UUID",{isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),c(Q,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Q,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Q,"BASE_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,...Q.INMUTABLE_BASE_PROPERTIES]),c(Q,"MUTABLE_META_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Q,"INMUTABLE_META_PROPERTIES",[...Q.INMUTABLE_BASE_PROPERTIES]),c(Q,"META_PROPERTIES",[...Q.MUTABLE_META_PROPERTIES,...Q.INMUTABLE_META_PROPERTIES]),c(Q,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Q,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),c(Q,"UPSTREAM_PROPERTIES",[...Q.MUTABLE_UPSTREAM_PROPERTIES,...Q.INMUTABLE_UPSTREAM_PROPERTIES]),c(Q,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),c(Q,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Q,"DOWNSTREAM_PROPERTIES",[...Q.MUTABLE_DOWNSTREAM_PROPERTIES,...Q.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Q,"PROPERTIES",[...Q.META_PROPERTIES,...Q.UPSTREAM_PROPERTIES,...Q.DOWNSTREAM_PROPERTIES]);let _=Q;class xD extends ne{constructor(t){super(xt,t);c(this,"id",we.Parallel);c(this,"name",we.Parallel);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",xt);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=xt.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=xt.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=xt.error?R(xt.error,this.project):null}}class jD extends ne{constructor(t){super(ut,t);c(this,"id",ut.id);c(this,"name",ut.name);c(this,"description",ut.description);c(this,"version",ut.version);c(this,"autoexecutable",!1);c(this,"initialData",ut);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=ut.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ut.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ut.error?R(ut.error,this.project):null}}class kD extends ne{constructor(t){super(dn,t);c(this,"id",we.Sequential);c(this,"name",we.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",dn);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=dn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=dn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=dn.error?R(dn.error,this.project):null}}function Bk(r){const e=[new kD(r),new xD(r),new jD(r),new ne(Pi,r),new ne(Qn,r),new ne(er,r),new ne(ja,r),new ne(zo,r),new ne(Xo,r),new ne(Ko,r),new ne(Fa,r),new ne(Ii,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}class qD extends Gt{constructor(t){super(Fe,t);c(this,"initialData");c(this,"id",L.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",L.PERSISTED_ENTITY);c(this,"description",Fe.description);c(this,"type",n.BuiltInBaseEntity);c(this,"abstract",Fe.abstract);c(this,"static",Fe.static);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=Fe,this.project=t,this.id=Fe.id,this.version=Fe.version,this.name=Fe.name,this.static=Fe.static,this.abstract=Fe.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 wk(r){const e=[new qD(r),new Gt(es,r),new Gt(Bn,r),new Gt(Ml,r),new Gt(Qa,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.builtInBaseEntities=e,e}function _k(r){const e=[new Ft(x,r),new Ft(Sn,r),new Ft(te,r),new Ft(Ye,r),new Ft(Cn,r),new Ft(cn,r),new Ft(Ga,r),new Ft(Jo,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.primitives=e,e}function Nk(r){const e=[new ne(as,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.globalEventActionDescriptors=e,e}function Mk(r){const e=[new ne(Ka,r),new ne(tr,r),new ne(Za,r),new ne(Si,r),new ne(Bi,r),new ne(ll,r)];e.forEach(i=>{i.initChildren(),r.subscribeBuiltInInstance(i)}),r.loopDeclarations=e;const t=[new ne(bl,r),new ne(za,r),new ne(hl,r),new ne(Uf,r),new ne(Xf,r),new ne(ul,r)];return t.forEach(i=>{i.initChildren(),r.subscribeBuiltInInstance(i)}),r.loopDeclarationsBodies=t,e}function Vk(r){const e=[new _r(Gl,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.valueDescriptors=e,e}function Lk(r){const e=[new ne(nr,r),new ne(jr,r)];return e.forEach(t=>{t.initChildren()}),r.conditionDeclarations=e,e}const Lr={},Fo={};async function $k(r,e={}){const t={...tv};return t.id=r.id,e.empty?{data:{id:r.id,type:n.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function JD(r){const e=new _(r);return _k(e),wk(e),Bk(e),Nk(e),Mk(e),Vk(e),Lk(e),e.getAllBuiltIn().forEach(i=>{e.builtInInstances[i.id]||(e.builtInInstances[i.id]=i)}),e.initChildren(),e}async function Gk(r,e={}){if(r.id&&Lr[r.id])return Lr[r.id];if(r.id&&Fo[r.id])return await Fo[r.id],Lr[r.id];const t=$k(r,e);r.id&&(Fo[r.id]=t);const i=await t;if(i.data){const a=JD(i.data);return Lr[r.id]=a,r.id&&delete Fo[r.id],a}return null}function Fk(r){return Lr[r.id]&&delete Lr[r.id],null}const Uk="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=hu,u.ActionDescriptorState=ne,u.ActionDescriptorValuesType=M,u.ActionInputMapState=L5,u.ActionOutputMapState=F5,u.AppendToListOperationInputIds=iy,u.AppendToListOperationOutputIds=ay,u.ArgumentDeclarationState=Br,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=du,u.BUILT_IN_BASE_ENTITY_IDS=G,u.BUILT_IN_ENTITY_TYPES=Ur,u.BaseCanvasDraggableState=R5,u.BaseEntityNames=L,u.BaseState=b5,u.BaseValueDescriptorIds=qo,u.BreakStatementState=Ri,u.BuiltInBaseEntityState=Gt,u.CACHED_PROJECTS_BY_ID=Lr,u.CALLABLE_ENTITIES_EXPLANATION=K5,u.CALLABLE_TYPES=On,u.CALLER_ENTITIES_EXPLANATION=iD,u.CALLER_TYPES=ln,u.CALLS_UPDATE_EXPLANATION=Hn,u.COMPARISON_CONDITIONS=WT,u.CONDITIONS=IP,u.CUSTOM_ENTITY_OPERATIONS=Ih,u.CallableEntityClass=v5,u.CallerEntityClass=su,u.ChildEntityState=g5,u.ComparisonOperatorTypes=Me,u.ConditionState=Pr,u.ContinueStatementState=Et,u.CreateNewInputIds=zy,u.CreateNewOutputIds=Zy,u.CustomEntityState=Vr,u.DRAGGABLE_CALLABLE_TYPES=jo,u.DRAGGABLE_CALLER_TYPES=wu,u.DRAGGABLE_ELEMENT_TYPES=ko,u.DRAGGABLE_EXECUTABLE_TYPES=HD,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=xo,u.DataTypeCompatibilityTypes=$t,u.DataTypeParentChildRelation=je,u.DataTypeState=mi,u.ENTITIES_WITH_VALLUES_EXPLANATION=Ao,u.ENTITY_TYPES=YD,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=dt,u.ENTITY_WITH_NAMES_TYPES=_u,u.ENTITY_WITH_VALUE_TYPES=Bu,u.ENTRY_POINT_ENTITIES_EXPLANATION=wa,u.ENTRY_POINT_TYPES=Ve,u.EVENT_TYPES=Fr,u.EXECUTABLE_TYPES=WD,u.EXECUTION_OPERATIONS=Yy,u.EntityError=dr,u.EntityErrorSeverity=T,u.EntityGenerationError=E,u.EntityGenerationErrorCode=h,u.EntityInstanceErrorCode=N,u.EntityOperations=Xe,u.EntityType=n,u.EntityWithLogicScopeClass=A5,u.EntityWithValueClass=P5,u.EntryPointEntityClass=I5,u.ExecutionOperations=we,u.FunctionCallState=Nr,u.FunctionDeclarationState=vr,u.GLOBAL_EVENT_DECLARATIONS=DP,u.GetLastInListOperationInputIds=Wp,u.GetLastInListOperationOutputIds=Hp,u.GlobalEventNames=on,u.GlobalEventState=Ti,u.HTTPOperations=Qe,u.HTTP_OPERATIONS=rf,u.InputMapState=vn,u.InstalledProjectState=Cr,u.InternalCallState=Ei,u.JoinListOperationInputIds=pp,u.JoinListOperationOutputIds=yp,u.JoinStringOperationInputIds=Xu,u.JoinStringOperationOutputIds=Qu,u.LIST_OPERATIONS=Ey,u.ListOperations=Y,u.LoopState=Dr,u.LoopTypes=q,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Yn,u.NUMBER_OPERATIONS=Ku,u.NumberAdditionOperationInputIds=Gu,u.NumberAdditionOperationOutputIds=Fu,u.NumberOperations=ct,u.OPERATION_DECLARATIONS=ZD,u.OperationState=Ir,u.OutputMapParentChildRelation=Cu,u.OutputMapState=In,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=Oo,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Wn,u.PASS_THROUGH_CALLABLE_TYPES=Ge,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=yu,u.ParallelExecutionOperation=xD,u.ParallelExecutionOperationInputIds=by,u.ParallelExecutionOperationOutputIds=Ry,u.PassThroughCallableEntityClass=D5,u.PersistedEntity=qD,u.PersistedEntityMethods=St,u.PrimitiveEntityState=Ft,u.PrimitiveTypes=I,u.PrimitiveValueState=bi,u.ProjectState=_,u.PropertyState=gr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=X5,u.ReturnDeclarationState=_t,u.ReturnStatementState=wr,u.STANDALONE_CONDITIONS=UT,u.STRING_OPERATIONS=up,u.ScopeCompatibilityType=Go,u.SearchState=Sr,u.SequentialExecutionOperation=kD,u.SequentialExecutionOperationInputIds=$y,u.SequentialExecutionOperationOutputIds=Gy,u.SharedEntityErrorCode=D,u.SharedStateFunctionality=tD,u.SplitListOperationInputIds=Sp,u.SplitListOperationOutputIds=Cp,u.StandaloneOperatorTypes=Mt,u.StringOperations=Ce,u.TERMINATION_TYPES=Le,u.USER_MANAGED_ENTITY_TYPES=zD,u.UserManagedEntityStateFunctionality=E5,u.VALUE_READING_ENTITIES_EXPLANATION=pu,u.VALUE_READING_TYPES=An,u.VALUE_WRITING_ENTITIES_EXPLANATION=aD,u.VALUE_WRITING_TYPES=$e,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=uu,u.VARIABLE_TYPES=ke,u.ValidationInputIds=ch,u.ValidationOutputIds=dh,u.ValueAutogenerationType=qe,u.ValueDescriptorParentChildRelation=B,u.ValueDescriptorState=_r,u.ValueReadingEntityClass=Ca,u.ValueWritingEntityClass=Ba,u.VariableDeclarationState=Ar,u.VariableInputMapState=V5,u.VariableInstanceState=Or,u.VariableOutputMapState=G5,u.WaitOperation=jD,u.WaitOperationInputIds=By,u.WaitOperationOutputIds=wy,u.appendToListOperation=ja,u.appendToListOperationElementToAppendArgument=el,u.appendToListOperationElementToAppendArgumentParentRef=yy,u.appendToListOperationElementToAppendArgumentRef=ly,u.appendToListOperationError=Ty,u.appendToListOperationErrorParentRef=my,u.appendToListOperationListArgument=Qo,u.appendToListOperationListArgumentParentRef=py,u.appendToListOperationListArgumentRef=sy,u.appendToListOperationListDataType=oy,u.appendToListOperationResultListDataType=uy,u.appendToListOperationResultListReturn=fy,u.appendToListOperationResultListReturnParentRef=hy,u.appendToListOperationResultListReturnRef=dy,u.appendToListOperationSecondListDataType=cy,u.asGenerationActionExample=an,u.baseHttpRequestFunctionDeclaration=Pi,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=ol,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=nf,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=tf,u.baseHttpRequestFunctionDeclarationRef=Kh,u.baseHttpRequestFunctionDeclarationRefEight=Qh,u.baseHttpRequestFunctionDeclarationRefFive=zh,u.baseHttpRequestFunctionDeclarationRefFour=Yh,u.baseHttpRequestFunctionDeclarationRefNine=ef,u.baseHttpRequestFunctionDeclarationRefSeven=Xh,u.baseHttpRequestFunctionDeclarationRefSix=Zh,u.baseHttpRequestFunctionDeclarationRefThree=Hh,u.baseHttpRequestFunctionDeclarationRefTwo=Wh,u.booleanPrototype=Sn,u.capitalizeFirstLetter=Eo,u.checkAreCustomEntitiesCompatibleAsDataType=UI,u.checkAreDataTypesCompatible=Ht,u.checkArePropertiesCompatibleAsDataType=FI,u.checkIsBranchDependentButNotDirectlyOnBranch=Na,u.checkIsBranchDependentOnBranch=ok,u.checkIsCallableEntityReachable=La,u.checkIsCanvasEntity=Dk,u.checkIsDetachedBranch=VD,u.checkIsDetachedBranchShallow=Ou,u.checkIsGlobalVariable=vk,u.checkIsGloballyDeclared=Au,u.checkIsMethod=GD,u.checkIsNestedScope=$o,u.checkScopeCompatibility=Ma,u.countedLoopActionDescriptor=Ka,u.countedLoopActionDescriptorStringArgumentDeclaration=im,u.countedLoopActionDescriptorStringArgumentDeclarationDataType=nm,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValue=em,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValueParentRef=Qf,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeParentRef=tm,u.countedLoopActionDescriptorStringArgumentDeclarationParentRef=rm,u.countedLoopBodyActionDescriptor=bl,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=El,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=sm,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=am,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=om,u.createEntityError=Z,u.createNewInstanceOperation=Qn,u.createNewInstanceOperationEntityToInstanciateArgument=ih,u.createNewInstanceOperationEntityToInstanciateArgumentRef=th,u.createNewInstanceOperationEntityToInstanciateDataType=nh,u.createNewInstanceOperationError=lh,u.createNewInstanceOperationErrorParentRef=oh,u.createNewInstanceOperationNewEntityDataArgument=eh,u.createNewInstanceOperationNewEntityDataArgumentDataType=Qy,u.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=Xy,u.createNewInstanceOperationNewEntityDataArgumentParentRef=Ky,u.createNewInstanceOperationOutputEntityDeclaration=sh,u.createNewInstanceOperationOutputEntityDeclarationParentRef=ah,u.createNewInstanceOperationRef=rh,u.createSemanticId=tt,u.createStateFromGenerationTargetType=Ck,u.createStateFromType=Ut,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=Ml,u.cronJobBuiltInBaseEntityExpressionProperty=LT,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=RP,u.cronJobBuiltInBaseEntityExpressionPropertyRef=MT,u.cronJobBuiltInBaseEntityRef=VT,u.cronJobTriggeredFunctionDeclarationBlueprint=Nl,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=_T,u.customEntityToZodSchema=dE,u.dataTypeCompatibilityToErrorExplanation=yD,u.datePrototype=cn,u.dateValueAutogenerationSchema=Yc,u.deletePersistedEntityMethod=_l,u.deletePersistedEntityMethodParentRef=dT,u.deleteRootProject=Fk,u.endpointBuiltInBaseEntity=es,u.endpointBuiltInBaseEntityRef=Tm,u.endpointBuiltInBaseEntityRefFour=Xm,u.endpointBuiltInBaseEntityRefThree=Am,u.endpointBuiltInBaseEntityRefTwo=vm,u.endpointBuiltInCorsProperty=Em,u.endpointBuiltInCorsPropertyDataType=mm,u.endpointBuiltInCorsPropertyDataTypeRef=hm,u.endpointBuiltInCorsPropertyRef=fm,u.endpointBuiltInMethodProperty=gl,u.endpointBuiltInMethodPropertyDataType=Pm,u.endpointBuiltInMethodPropertyDataTypeRef=Im,u.endpointBuiltInMethodPropertyRef=Dm,u.endpointBuiltInPathProperty=Rl,u.endpointBuiltInPathPropertyDataType=gm,u.endpointBuiltInPathPropertyDataTypeRef=bm,u.endpointBuiltInPathPropertyRef=Rm,u.endpointPathParamsArgumentDeclaration=Il,u.endpointPathParamsArgumentDeclarationRef=Lm,u.endpointPathParamsVariableDataType=$m,u.endpointPathParamsVariableDataTypeRef=Vm,u.endpointReachedTriggerActionDescriptor=Cl,u.endpointReachedTriggerActionDescriptorRef=Gm,u.endpointReachedTriggerActionDescriptorRefFour=xm,u.endpointReachedTriggerActionDescriptorRefThree=Um,u.endpointReachedTriggerActionDescriptorRefTwo=Fm,u.endpointRequestBodyArgumentDeclaration=Pl,u.endpointRequestBodyArgumentDeclarationRef=Bm,u.endpointRequestBodyVariableDataType=wm,u.endpointRequestHeadersArgumentDeclaration=vl,u.endpointRequestHeadersArgumentDeclarationRef=Sm,u.endpointRequestHeadersVariableDataType=Cm,u.endpointRequestHeadersVariableDataTypeRef=Om,u.endpointRequestQueryParamsArgumentDeclaration=Dl,u.endpointRequestQueryParamsArgumentDeclarationRef=Nm,u.endpointRequestQueryParamsVariableDataType=Mm,u.endpointRequestQueryParamsVariableDataTypeRef=_m,u.endpointResponseBodyDataType=Zm,u.endpointResponseBodyReturnDeclaration=Sl,u.endpointResponseBodyReturnDeclarationRef=zm,u.endpointResponseCodeDataType=km,u.endpointResponseCodeReturnDeclaration=Al,u.endpointResponseCodeReturnDeclarationRef=jm,u.endpointResponseHeadersDataType=Hm,u.endpointResponseHeadersDataTypeRef=Jm,u.endpointResponseHeadersReturnDeclaration=Ol,u.endpointResponseHeadersReturnDeclarationRef=Wm,u.endpointReturnStatementRef=qm,u.endpointReturnStatementRefThree=Km,u.endpointReturnStatementRefTwo=Ym,u.enumOptionsProperty=$u,u.enumOptionsPropertyDataType=Vu,u.enumOptionsPropertyDataTypeRef=Nu,u.enumOptionsPropertyRef=Mu,u.enumPrototype=Cn,u.enumPrototypeRef=Lu,u.executionBuiltInEntity=Ll,u.executionBuiltInEntityAbortMethod=Vl,u.executionBuiltInEntityAbortMethodParentRef=$T,u.filterOutDuplicateEntities=g,u.filterOutDuplicateErrors=T8,u.findReferenceToSelfInList=OD,u.findReferencesToSelfInProject=mk,u.flattenCalls=sn,u.flattenCanvasAncestorsUntil=_o,u.flattenCustomEntityExtensionAndImplementationTypes=_D,u.flattenCustomEntityExtensionTypes=Vo,u.flattenCustomEntityExtensions=Iu,u.flattenCustomEntityImplementations=Du,u.flattenCustomEntityImplementionTypes=Mo,u.flattenDerivedCanvasEntities=Ot,u.flattenDetachedBranch=$D,u.flattenElementCalls=Be,u.flattenElementCallsOnTheSameScope=fk,u.flattenProjectElements=AD,u.flattenRelatedCanvasElementsOnTheLeft=wD,u.flattenRelatedCanvasElementsOnTheRight=BD,u.flattenVariableReads=PD,u.flattenVariableWrites=DD,u.flattenVariables=ie,u.fromZodParseToEntityGenerationErrors=ou,u.generate=RO,u.generateActionExample=Q5,u.generateExecutionDataType=Q3,u.generateMutablePropertiesExplanation=Io,u.generateRandomBoolean=LE,u.generateRandomDate=hE,u.generateRandomDateAfter=uE,u.generateRandomDateBefore=pE,u.generateRandomDateBetweenRange=yE,u.generateRandomNumber=wE,u.generateRandomNumberAfter=SE,u.generateRandomNumberBefore=CE,u.generateRandomNumberBetweenRange=BE,u.generateRandomText=VE,u.generateRandomTextAfter=_E,u.generateRandomTextBefore=NE,u.generateRandomTextBetweenRange=ME,u.generateUniqueUUID=OE,u.getAllActionDescriptorsForConditions=Bo,u.getAllActionDescriptorsForGlobalEvents=So,u.getAllActionDescriptorsForLoops=Co,u.getAllActionDescriptorsForOperations=rk,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=dD,u.getBaseBuiltInEntities=Zn,u.getBaseSchemaBasedOnType=nD,u.getBuiltInEntityOwner=Kn,u.getCallableEntityReferenceSchema=He,u.getCallableEntityTypeSchema=Av,u.getCallerEntityReferenceSchema=vj,u.getCallerEntityTypeSchema=gj,u.getCalls=Eu,u.getCanvasEntitiesDerivedFromInternalCalls=CD,u.getCanvasEntitiesDerivedFromWrites=gi,u.getCanvasEntityDerivedFromValueReadingEntity=vu,u.getCanvasEntityReferenceSchema=Fj,u.getCanvasEntityTypeSchema=Gj,u.getChildrenEntityWithValues=ck,u.getCommonAncestor=Tu,u.getCommonChildren=mD,u.getDeclaration=br,u.getDeepestScope=UD,u.getDraggableCallableEntityReferenceSchema=Sv,u.getDraggableCallableEntityTypeSchema=Ov,u.getDraggableCallerEntityReferenceSchema=Dj,u.getDraggableCallerEntityTypeSchema=Ij,u.getDraggableExecutableEntityReferenceSchema=Sj,u.getDraggableExecutableEntityTypeSchema=Oj,u.getDraggablePassThroughCallableEntityReferenceSchema=co,u.getDraggablePassThroughCallableEntityTypeSchema=lo,u.getDraggablePlayableEntityReferenceSchema=Nj,u.getDraggablePlayableEntityTypeSchema=_j,u.getEntityArgumentDeclarations=Ru,u.getEntityInputMaps=SD,u.getEntityOutputMaps=bk,u.getEntityReferenceSchema=$j,u.getEntityReturnDeclarations=gu,u.getEntityTypeSchema=Lj,u.getEntityWithLogicScopeReferenceSchema=bn,u.getEntityWithLogicScopeTypeSchema=Cj,u.getEntityWithValueReferenceSchema=Pv,u.getEntityWithValueTypeSchema=Rj,u.getEntryPointEntityReferenceSchema=We,u.getEntryPointEntityTypeSchema=kn,u.getEventEntityReferenceSchema=so,u.getEventEntityTypeSchema=ao,u.getExecutableEntityReferenceSchema=Aj,u.getExecutableEntityTypeSchema=Pj,u.getExtendedBuiltInEntity=Rk,u.getExtendedCustomEntity=MD,u.getGenerationTargetSchemaBasedOnType=rD,u.getHeadIfPartOfDetachedBranch=LD,u.getHighestScope=FD,u.getImplementedBuiltInEntity=gk,u.getIsInteractive=Pu,u.getLastInListOperation=Xo,u.getLastInListOperationError=ry,u.getLastInListOperationErrorParentRef=ny,u.getLastInListOperationInputListArgument=Qp,u.getLastInListOperationInputListArgumentParentRef=Xp,u.getLastInListOperationInputListArgumentRef=Yp,u.getLastInListOperationInputListDataType=zp,u.getLastInListOperationOutputElementDataType=Kp,u.getLastInListOperationOutputElementReturn=ty,u.getLastInListOperationOutputElementReturnParentRef=ey,u.getLastInListOperationOutputElementReturnRef=Zp,u.getLinkedEntitiesFromArgumentDeclaration=hk,u.getLowestPersistedEntityImplementation=ND,u.getParentCanvasEntities=bt,u.getParentCanvasEntity=Ke,u.getParentEntryPoint=lk,u.getPassThroughCallableEntityReferenceSchema=ye,u.getPassThroughCallableEntityTypeSchema=oo,u.getPlayableEntityReferenceSchema=wj,u.getPlayableEntityTypeSchema=Bj,u.getProject=Gk,u.getPrototypeByType=Lo,u.getReferenceEntityId=w,u.getReferencedEntitiesStateOrErrors=Po,u.getReferencedEntityStateOrErrors=lu,u.getRelatedCanvasElementsOnTheLeft=Mr,u.getRelatedCanvasElementsOnTheRight=zn,u.getRootEntryPointScopeOwner=Su,u.getScopeOwner=Rt,u.getTerminationReferenceSchema=Vj,u.getTerminationTypeSchema=Mj,u.getUsedArgFromDeclaration=Tk,u.getUsedReturnFromDeclaration=Ek,u.getValueReadingEntityReferenceSchema=Dv,u.getValueReadingEntityTypeSchema=En,u.getValueWritingEntityReferenceSchema=bj,u.getValueWritingEntityTypeSchema=ba,u.getVariableFromInputMapping=ED,u.getVariableFromReturnVariablePointer=gD,u.getVariableReferenceSchema=jn,u.getVariableTypeSchema=yr,u.getVariablesFromArgumentDeclarations=No,u.getVariablesFromInputMaps=bD,u.getVariablesFromOutputMapping=vD,u.getVariablesFromOutputMaps=ID,u.getVariablesFromReturnDeclarations=RD,u.getVariablesInSameOrHigherScope=Kd,u.getWrites=bu,u.groupCallsBasedOnParallelizableExecution=uk,u.handleAfterEntityImplementationSideEffects=fD,u.handleBeforeEntityImplementationSideEffects=hD,u.httpRequestBodyArgument=Wa,u.httpRequestBodyArgumentRef=Lh,u.httpRequestBodyDataType=$h,u.httpRequestHeadersArgument=Ja,u.httpRequestHeadersArgumentRef=Mh,u.httpRequestHeadersDataType=Vh,u.httpRequestMethodArgument=ka,u.httpRequestMethodArgumentRef=_h,u.httpRequestMethodDataType=Nh,u.httpRequestMethodDataTypeRef=Bh,u.httpRequestQueryParamsArgument=al,u.httpRequestQueryParamsArgumentRef=Sh,u.httpRequestQueryParamsDataType=Ch,u.httpRequestVariableURLArgument=qa,u.httpRequestVariableURLArgumentRef=Ah,u.httpRequestVariableURLDataType=Oh,u.httpRequestVariableURLDataTypeRef=Dh,u.httpResponseBodyReturnDataType=Jh,u.httpResponseBodyReturnDataTypeRef=kh,u.httpResponseBodyReturnReturn=Di,u.httpResponseBodyReturnReturnRef=qh,u.httpResponseCodeDataType=Fh,u.httpResponseCodeReturn=sl,u.httpResponseCodeReturnRef=Gh,u.httpResponseHeadersDataType=jh,u.httpResponseHeadersDataTypeRef=Uh,u.httpResponseHeadersReturn=Ha,u.httpResponseHeadersReturnRef=xh,u.implement=wo,u.inferArgumentDeclarationDataType=xI,u.inferDataType=rn,u.inferInputMapDataType=jI,u.inferOutputMapDataType=JI,u.inferReturnDeclarationDataType=Zd,u.inferVariableDeclarationDataType=qI,u.inferVariableInstanceDataType=kI,u.initProject=JD,u.iterateOverListActionDescriptorListArgumentDeclaration=uf,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=cf,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=lf,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=df,u.iterateOverListLoopActionDescriptor=tr,u.iterateOverListLoopBodyActionDescriptor=za,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Ya,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=yf,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=pf,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=hf,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ef,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=mf,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=ff,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Tf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=_f,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=Bf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=Cf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=wf,u.iterateOverObjectKeysLoopActionDescriptor=Si,u.iterateOverObjectKeysLoopBodyActionDescriptor=Uf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=fl,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Mf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Nf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Vf,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ff,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=$f,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Lf,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Gf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=qf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=jf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=xf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=kf,u.iterateOverObjectValuesLoopActionDescriptor=Bi,u.iterateOverObjectValuesLoopBodyActionDescriptor=Xf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=ml,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Wf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Jf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Hf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Kf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=zf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Yf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Zf,u.iterateOverStringActionDescriptorStringArgumentDeclaration=vf,u.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=Rf,u.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=bf,u.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=gf,u.iterateOverStringLoopActionDescriptor=Za,u.iterateOverStringLoopBodyActionDescriptor=hl,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=pl,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Df,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=If,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Pf,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=yl,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Of,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Af,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Sf,u.joinListOperation=zo,u.joinListOperationError=Op,u.joinListOperationErrorParentRef=Ap,u.joinListOperationFirstListArgument=gp,u.joinListOperationFirstListArgumentParentRef=Rp,u.joinListOperationFirstListArgumentRef=hp,u.joinListOperationFirstListDataType=fp,u.joinListOperationResultListDataType=bp,u.joinListOperationResultListReturn=Pp,u.joinListOperationResultListReturnParentRef=Dp,u.joinListOperationResultListReturnRef=Ep,u.joinListOperationSecondListArgument=Ip,u.joinListOperationSecondListArgumentParentRef=vp,u.joinListOperationSecondListArgumentRef=mp,u.joinListOperationSecondListDataType=Tp,u.joinListWithLastSeparator=F,u.joinStringOperation=Ii,u.joinStringOperationError=dp,u.joinStringOperationErrorParentRef=cp,u.joinStringOperationFirstStringArgument=Ua,u.joinStringOperationFirstStringArgumentParentRef=sp,u.joinStringOperationFirstStringArgumentRef=ep,u.joinStringOperationFirstStringDataType=tp,u.joinStringOperationResultStringDataType=ap,u.joinStringOperationResultStringReturn=vi,u.joinStringOperationResultStringReturnParentRef=lp,u.joinStringOperationResultStringReturnRef=ip,u.joinStringOperationSecondStringArgument=xa,u.joinStringOperationSecondStringArgumentParentRef=op,u.joinStringOperationSecondStringArgumentRef=np,u.joinStringOperationSecondStringDataType=rp,u.jsonPrototype=Jo,u.keyValueParamBuiltInBaseEntity=Qa,u.keyValueParamBuiltInBaseEntityNameProperty=dm,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=nP,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=cm,u.keyValueParamBuiltInBaseEntityNamePropertyRef=lm,u.keyValueParamBuiltInBaseEntityValueProperty=ym,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=iP,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=pm,u.keyValueParamBuiltInBaseEntityValuePropertyRef=um,u.lowercaseFirstLetter=GI,u.manualFlowActionDescriptorDeclarationArgumentDeclaration=dl,u.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=sf,u.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=af,u.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=of,u.manualFlowLoopActionDescriptor=ll,u.manualFlowLoopBodyActionDescriptor=ul,u.mapActionDescriptorToTypeItRepresents=Pk,u.mergeEntityErrorsList=E8,u.mergeListOfEntities=Ik,u.methodDefaultValue=wh,u.mockClientProject=tv,u.moreThanOrEqualCondition=jr,u.moreThanOrEqualConditionLeftHandArgument=kT,u.moreThanOrEqualConditionLeftHandArgumentParentRef=jT,u.moreThanOrEqualConditionRightHandArgument=JT,u.moreThanOrEqualConditionRightHandArgumentParentRef=qT,u.notEmptyCondition=nr,u.notEmptyConditionArgument=FT,u.notEmptyConditionRef=GT,u.numberAdditionOperation=Fa,u.numberAdditionOperationError=Zu,u.numberAdditionOperationErrorParentRef=zu,u.numberAdditionOperationFirstNumberArgument=Wo,u.numberAdditionOperationFirstNumberArgumentRef=Uu,u.numberAdditionOperationFirstNumberDataType=xu,u.numberAdditionOperationRef=Wu,u.numberAdditionOperationRefThree=Yu,u.numberAdditionOperationRefTwo=Hu,u.numberAdditionOperationResultNumberDataType=Ju,u.numberAdditionOperationResultNumberReturn=Yo,u.numberAdditionOperationResultNumberReturnRef=qu,u.numberAdditionOperationSecondNumberArgument=Ho,u.numberAdditionOperationSecondNumberArgumentRef=ju,u.numberAdditionOperationSecondNumberDataType=ku,u.numberPrototype=te,u.numberValueAutogenerationSchema=Hc,u.parallelExecutionOperation=xt,u.parallelExecutionOperationError=Cy,u.parallelExecutionOperationErrorParentRef=Sy,u.parallelExecutionOperationListOfExecutionResultsDataType=Py,u.parallelExecutionOperationListOfExecutionResultsReturn=nl,u.parallelExecutionOperationListOfExecutionResultsReturnRef=Dy,u.parallelExecutionOperationListOfFunctionsArgument=tl,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Iy,u.parallelExecutionOperationListOfFunctionsArgumentRef=vy,u.parallelExecutionOperationListOfFunctionsBlueprint=gy,u.parallelExecutionOperationRef=Ay,u.parallelExecutionOperationRefThree=Oy,u.persistedBuiltInBaseEntity=Fe,u.persistedBuiltInBaseEntityCreatedAtProperty=OT,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=PT,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=EP,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=AT,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=DT,u.persistedBuiltInBaseEntityDatabaseProperty=Ni,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=hP,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=fT,u.persistedBuiltInBaseEntityDatabasePropertyRef=hT,u.persistedBuiltInBaseEntityDeletedAtProperty=IT,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=gT,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=TP,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=vT,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=RT,u.persistedBuiltInBaseEntityIdentifierProperty=bT,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=mT,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=ET,u.persistedBuiltInBaseEntityIdentifierPropertyRef=TT,u.persistedBuiltInBaseEntityUpdatedAtProperty=wT,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=CT,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=bP,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=BT,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=ST,u.processOutputGlobalValueDescriptorDataType=YT,u.processOutputGlobalValueDescriptorReturn=Gl,u.processOutputGlobalValueDescriptorReturnRef=HT,u.projectPublicationCompletedGlobalEvent=as,u.propertyToZodSchema=cE,u.relationalDatabaseBuiltInBaseEntity=Bn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=wl,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=lT,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=cT,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=oT,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=Bl,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=aT,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=sT,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=ts,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Qm,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=eT,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=is,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=rT,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=iT,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=rs,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=cP,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=nT,u.relationalDatabaseBuiltInBaseEntityRef=xr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=ns,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=oP,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=tT,u.resolveActionDescriptorName=eD,u.resolveBaseEntityName=KI,u.resolveBuiltInBaseEntityDataTypeLabel=Xd,u.resolveConditionOperatorLabel=go,u.resolveCustomEntityDataTypeLabel=Qd,u.resolveDataType=bo,u.resolveDataTypeLabel=YI,u.resolveEntityDataTypeLabel=ZI,u.resolveEntityName=S,u.resolveFirstCallsSecond=pk,u.resolveFirstWritesSecond=yk,u.resolvePrimitiveEntityName=QI,u.resolvePropertyDataTypeLabel=zI,u.resolveSearchName=XI,u.resolveVariableDataTypeLabel=r5,u.resolveVariableDeclarationDataTypeLabel=Rr,u.resolveVariableInstanceDataTypeLabel=HI,u.resolveVariableScope=e5,u.sequentialExecutionOperation=dn,u.sequentialExecutionOperationError=Hy,u.sequentialExecutionOperationErrorParentRef=Wy,u.sequentialExecutionOperationListOfExecutionResultsDataType=ky,u.sequentialExecutionOperationListOfExecutionResultsReturn=il,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Jy,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=jy,u.sequentialExecutionOperationListOfFunctionsArgument=rl,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=xy,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=qy,u.sequentialExecutionOperationListOfFunctionsArgumentRef=Uy,u.sequentialExecutionOperationListOfFunctionsBlueprint=Fy,u.softDeletePersistedEntityMethod=pT,u.softDeletePersistedEntityMethodParentRef=uT,u.sortCallsBasedOnExecutionDependencies=TD,u.sortChildrenEntitiesBasedOnExecutionDependencies=dk,u.splitListOperation=Ko,u.splitListOperationError=Jp,u.splitListOperationErrorParentRef=qp,u.splitListOperationFirstOutputListDataType=Mp,u.splitListOperationFirstOutputListReturn=Up,u.splitListOperationFirstOutputListReturnParentRef=Fp,u.splitListOperationFirstOutputListReturnRef=Zo,u.splitListOperationInputListArgument=Lp,u.splitListOperationInputListArgumentParentRef=Vp,u.splitListOperationInputListArgumentRef=Bp,u.splitListOperationInputListDataType=wp,u.splitListOperationSecondOutputListDataType=xp,u.splitListOperationSecondOutputListReturn=kp,u.splitListOperationSecondOutputListReturnParentRef=jp,u.splitListOperationSplitIndexArgument=Gp,u.splitListOperationSplitIndexArgumentParentRef=$p,u.splitListOperationSplitIndexArgumentRef=_p,u.splitListOperationSplitIndexDataType=Np,u.stringPrototype=x,u.stringValueAutogenerationSchema=Wc,u.suggestNewIdForEntity=au,u.test_primitive_entities_export=Uk,u.toCamelCase=t5,u.toEntityState=Nt,u.toKebabCase=WI,u.toLowerCaseKebabCase=Ro,u.toPascalCase=n5,u.untypedObjectPrototype=Ye,u.updateErrorsList=ae,u.updateValueReader=Va,u.urlDefaultValue=Ph,u.uuidPrototype=Ga,u.validateArgumentDeclarationName=ru,u.validateCalledByErrorIdInAction=tk,u.validateCalledByIdInAction=ek,u.validateCallers=cD,u.validateConditionEntityDeclaration=ik,u.validateCustomEntityName=vo,u.validateDataOperation=er,u.validateDataOperationDataToValidateArgument=hh,u.validateDataOperationDataToValidateArgumentParentRef=yh,u.validateDataOperationDataToValidateArgumentRef=uh,u.validateDataOperationDataToValidateDataType=ph,u.validateDataOperationEntityToMatchTypeArgument=Eh,u.validateDataOperationEntityToMatchTypeArgumentParentRef=Th,u.validateDataOperationEntityToMatchTypeArgumentRef=fh,u.validateDataOperationEntityToMatchTypeDataType=mh,u.validateDataOperationError=vh,u.validateDataOperationErrorParentRef=gh,u.validateDataOperationOutputEntityDeclaration=Rh,u.validateDataOperationOutputEntityDeclarationParentRef=bh,u.validateEntryCaller=lD,u.validateErrorCaller=oD,u.validateFunctionCallDeclaration=uD,u.validateFunctionDeclarationName=eu,u.validateGeneratedEntityParentIsNotBuiltInEntity=Z5,u.validateGeneration=Y5,u.validateGenerationTarget=_e,u.validateGenerationUpdate=z5,u.validateLoopEntityDeclaration=ak,u.validateName=i5,u.validateOperationEntityDeclaration=pD,u.validatePropertyName=nu,u.validateReachability=Dn,u.validateReadsValueInActionPayload=nk,u.validateReferenceObject=Do,u.validateReferenceToOne=cu,u.validateReferences=Je,u.validateReturnDeclarationName=iu,u.validateSuccessCaller=sD,u.validateValueReaderGenerationUpdate=_a,u.validateValueWritter=fu,u.validateVariableDeclarationName=tu,u.validateVariableInternalCallUse=mu,u.valueAutogenerationCurrentDateAndTimeSchema=rv,u.valueAutogenerationGenericSchema=qs,u.valueAutogenerationOptions=zc,u.valueAutogenerationOptionsSchema=nv,u.valueAutogenerationRandomBooleanSchema=Jc,u.valueAutogenerationRandomDateBetweenSchema=pv,u.valueAutogenerationRandomDateFromSchema=dv,u.valueAutogenerationRandomDateSchema=Hs,u.valueAutogenerationRandomDateUntilSchema=uv,u.valueAutogenerationRandomNumberBetweenSchema=sv,u.valueAutogenerationRandomNumberFromSchema=iv,u.valueAutogenerationRandomNumberSchema=Js,u.valueAutogenerationRandomNumberUntilSchema=av,u.valueAutogenerationRandomSchema=pa,u.valueAutogenerationRandomTextBetweenSchema=cv,u.valueAutogenerationRandomTextFromSchema=ov,u.valueAutogenerationRandomTextSchema=Ws,u.valueAutogenerationRandomTextUntilSchema=lv,u.valueAutogenerationRangeValueTypesSchema=ua,u.valueAutogenerationUniqueSchema=qc,u.waitOperation=ut,u.waitOperationMillisecondsNumberArgument=Xn,u.waitOperationMillisecondsNumberArgumentRef=_y,u.waitOperationMillisecondsNumberDataType=Ny,u.waitOperationOperationError=Ly,u.waitOperationOperationErrorParentRef=Vy,u.waitOperationRef=My,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
373
+ 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 g([...this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]),...this.implements.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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this],t=[],i=[];if(this.parent.type===n.DataType){const a=this.parent;a.entity=this,e.push(a)}else this.project.addCustomEntity(this);return{updated:g(e),added:g(t),removed:g(i),self: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=>{i9(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)}),a9(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),l=R(o,this.project);if(l.suggestion=!0,l.setParent(this),l.initChildren(),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(l)})}),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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.methods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...l)}),{affected:g(i),removed:g(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:g(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:n.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===n.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===n.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===n.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=r9(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(e=null,t=null,i=!0){var b,v,P;const a=this.toJSON(),s=t||tt(S(this,this.project),n.CustomEntity,this.project);a.properties=[],a.methods=[],a.abstractMethods=[];const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),i&&p.subscribe(),p.initChildren();const y=(b=this.properties)==null?void 0:b.map((O,A)=>O.clone(this,l+"-property-"+A+"-id",i));p.properties=y;const f=(v=this.methods)==null?void 0:v.map((O,A)=>O.clone(this,l+"-method-"+A+"-id",i));p.methods=f;const m=(P=this.abstractMethods)==null?void 0:P.map((O,A)=>O.clone(this,l+"-abstract-method-"+A+"-id",i));return p.abstractMethods=m,p}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return wo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(i=>i.type===n.CustomEntity||i.type===n.BuiltInBaseEntity&&i.interactive);return g([...this.methods,...this.extends.flatMap(i=>i.getAllInteractiveMethods()),...e.flatMap(i=>i.getAllInteractiveMethods())])}inferFromInputs(e){if(this.parent.type!==n.DataType||!this.parent.inferred)return this;const t=[];e.forEach(s=>{t.find(l=>S(l,this.project)===S(s,this.project))||t.push(s)});const i=this.properties.filter(s=>!s.getDataType());t.forEach(s=>{const o=i.find(m=>S(m,this.project)===S(s,this.project));if(!o)return;const p=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),y=rn(p),f=y==null?void 0:y.clone(o,o.id+"--data-type",!0);f&&o.setDataType(f),s.setDeclaration(o)});const a=[];return t.forEach(s=>{if(!s.declaration){a.push(s);return}}),a.length===0?this:(a.forEach(s=>{const o=this.properties.find(v=>S(v,this.project)===S(s,this.project));if(o){if(s.setDeclaration(o),!o.getDataType()){const P=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),O=rn(P),A=O==null?void 0:O.clone(o,o.id+"--data-type",!0);A&&o.setDataType(A)}return}const l={id:s.id+"--inferred-property",type:n.Property,version:1,name:S(s,this.project),description:s.description,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,index:s.index,implements:null,dataType:null,parent:this.toReference()},p=R(l,this.project);p.setParent(this),p.initChildren();const f=br(s.parent).getMasterInputWithValueWritterFromAllInstances(s),m=rn(f),b=m==null?void 0:m.clone(p,l.id+"--data-type",!0);return b&&p.setDataType(b),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(Se,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Se,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Se,"BASE_PROPERTIES",[...Se.MUTABLE_BASE_PROPERTIES,...Se.INMUTABLE_BASE_PROPERTIES]),c(Se,"MUTABLE_META_PROPERTIES",[...Se.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Se,"INMUTABLE_META_PROPERTIES",[...Se.INMUTABLE_BASE_PROPERTIES]),c(Se,"META_PROPERTIES",[...Se.MUTABLE_META_PROPERTIES,...Se.INMUTABLE_META_PROPERTIES]),c(Se,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Se,"UPSTREAM_PROPERTIES",[...Se.MUTABLE_UPSTREAM_PROPERTIES,...Se.INMUTABLE_UPSTREAM_PROPERTIES]),c(Se,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Se,"DOWNSTREAM_PROPERTIES",[...Se.MUTABLE_DOWNSTREAM_PROPERTIES,...Se.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Se,"PROPERTIES",[...Se.META_PROPERTIES,...Se.UPSTREAM_PROPERTIES,...Se.DOWNSTREAM_PROPERTIES]);let Vr=Se;function Ak(r){const e=M8(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}class Gt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",n.BuiltInBaseEntity);c(this,"abstract",!1);c(this,"static");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"interactive",!1);c(this,"errors",[]);c(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 g(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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:n.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=Ak(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 Gt(this.toJSON(),this.project)}implement(e,t){return wo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(i=>i.type===n.BuiltInBaseEntity&&i.interactive||i.type===n.PrimitiveEntity).forEach(i=>{i instanceof Gt&&e.push(...i.getAllInteractiveMethods())})),g(e)}}function Ok(r){const e=P8(),t=r.toJSON();e.safeParse(t).success;const a=[];return ae(r.errors,a)}class Ft{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",n.PrimitiveEntity);c(this,"static");c(this,"abstract");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(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})}get extendedProperties(){return g(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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:n.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=Ok(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 Ft(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(i=>i.type===n.BuiltInBaseEntity&&i.interactive||i.type===n.PrimitiveEntity).forEach(i=>{i instanceof Gt&&e.push(...i.getAllInteractiveMethods())}),g(e)}}function Ut(r,e){if(!r)throw new Error("Entity is null");const t=e.findSubscribedInstance(r);switch(r.type){case n.PrimitiveValue:return t||new bi(r,e);case n.CustomEntity:return t||new Vr(r,e);case n.PrimitiveEntity:return t||new Ft(r,e);case n.FunctionDeclaration:return t||new vr(r,e);case n.GlobalEvent:return t||new Ti(r,e);case n.DataType:return t||new mi(r,e);case n.Property:return t||new gr(r,e);case n.FunctionCall:return t||new Nr(r,e);case n.Condition:return t||new Pr(r,e);case n.Operation:return t||new Ir(r,e);case n.VariableDeclaration:return t||new Ar(r,e);case n.VariableInstance:return t||new Or(r,e);case n.OutputMap:return t||new In(r,e);case n.ReturnDeclaration:return t||new _t(r,e);case n.ArgumentDeclaration:return t||new Br(r,e);case n.InputMap:return t||new vn(r,e);case n.Project:return t||new _(r);case n.InstalledProject:return t||new Cr(r,e);case n.ActionDescriptor:return t||new ne(r,e);case n.ReturnStatement:return t||new wr(r,e);case n.Loop:return t||new Dr(r,e);case n.Search:return t||new Sr(r,e);case n.ValueDescriptor:return t||new _r(r,e);case n.BuiltInBaseEntity:return t||new Gt(r,e);case n.InternalCall:return t||new Ei(r,e);case n.ContinueStatement:return t||new Et(r,e);case n.BreakStatement:return t||new Ri(r,e);default:throw new Error("Invalid entity type: "+r.type)}}function R(r,e){if(!r)throw new Error("Entity is null");const t=Ut(r,e);return t.subscribe(),t}function Sk(r,e){if(!r)throw new Error("Entity is null");switch(r.type){case n.PrimitiveValue:return bi.fromGenerationTarget(r,e);case n.CustomEntity:return Vr.fromGenerationTarget(r,e);case n.FunctionDeclaration:return vr.fromGenerationTarget(r,e);case n.GlobalEvent:return Ti.fromGenerationTarget(r,e);case n.DataType:return mi.fromGenerationTarget(r,e);case n.Property:return gr.fromGenerationTarget(r,e);case n.FunctionCall:return Nr.fromGenerationTarget(r,e);case n.Condition:return Pr.fromGenerationTarget(r,e);case n.Operation:return Ir.fromGenerationTarget(r,e);case n.VariableDeclaration:return Ar.fromGenerationTarget(r,e);case n.VariableInstance:return Or.fromGenerationTarget(r,e);case n.OutputMap:return In.fromGenerationTarget(r,e);case n.ReturnDeclaration:return _t.fromGenerationTarget(r,e);case n.ArgumentDeclaration:return Br.fromGenerationTarget(r,e);case n.InputMap:return vn.fromGenerationTarget(r,e);case n.InstalledProject:return Cr.fromGenerationTarget(r,e);case n.ReturnStatement:return wr.fromGenerationTarget(r,e);case n.Loop:return Dr.fromGenerationTarget(r,e);case n.Search:return Sr.fromGenerationTarget(r,e);case n.ActionDescriptor:return ne.fromGenerationTarget(r,e);case n.ValueDescriptor:return _r.fromGenerationTarget(r,e);case n.InternalCall:return Ei.fromGenerationTarget(r,e);case n.ContinueStatement:return Et.fromGenerationTarget(r,e);case n.BreakStatement:return Ri.fromGenerationTarget(r,e);default:throw new Error("Invalid entity type: "+r.type)}}const Q=class Q{constructor(e){c(this,"initialData");c(this,"id");c(this,"version");c(this,"type",n.Project);c(this,"name",null);c(this,"description",null);c(this,"x");c(this,"y");c(this,"entities",[]);c(this,"projects",[]);c(this,"functions",[]);c(this,"events",[]);c(this,"variableDeclarations",[]);c(this,"variableInstances",[]);c(this,"conditions",[]);c(this,"operations",[]);c(this,"functionCalls",[]);c(this,"loops",[]);c(this,"searches",[]);c(this,"primitives",[]);c(this,"builtInBaseEntities",[]);c(this,"operationDeclarations",[]);c(this,"globalEventActionDescriptors",[]);c(this,"loopDeclarations",[]);c(this,"loopDeclarationsBodies",[]);c(this,"conditionDeclarations",[]);c(this,"valueDescriptors",[]);c(this,"dataTypes",[]);c(this,"project");c(this,"instances",{});c(this,"builtInInstances",{});c(this,"errors",[]);c(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;try{(!Q.UUID||Q.UUID.isBackup)&&(Q.UUID=Bs==null?void 0:Bs()),Q.UUID||(Q.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:t=>t})}catch(t){console.error("Error initializing UUID module",t),Q.UUID={isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:i=>i}}}static injectUUIDModule(e){Q.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(..._e(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(){const e=[this],t=[],i=[];return{updated:g(e),added:g(t),removed:g(i),self: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+"--"+Q.UUID.uuid()+"--ref",type:n.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=Kj(),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 Q(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!==n.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=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Be(i);return[...t,...a.filter(s=>s.type===n.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=ie(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return g([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=ie(i).filter(o=>o.type===n.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(l=>l.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===L.PERSISTED_ENTITY)||null}};c(Q,"UUID",{isBackup:!0,uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),c(Q,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Q,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Q,"BASE_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,...Q.INMUTABLE_BASE_PROPERTIES]),c(Q,"MUTABLE_META_PROPERTIES",[...Q.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Q,"INMUTABLE_META_PROPERTIES",[...Q.INMUTABLE_BASE_PROPERTIES]),c(Q,"META_PROPERTIES",[...Q.MUTABLE_META_PROPERTIES,...Q.INMUTABLE_META_PROPERTIES]),c(Q,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Q,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),c(Q,"UPSTREAM_PROPERTIES",[...Q.MUTABLE_UPSTREAM_PROPERTIES,...Q.INMUTABLE_UPSTREAM_PROPERTIES]),c(Q,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),c(Q,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Q,"DOWNSTREAM_PROPERTIES",[...Q.MUTABLE_DOWNSTREAM_PROPERTIES,...Q.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Q,"PROPERTIES",[...Q.META_PROPERTIES,...Q.UPSTREAM_PROPERTIES,...Q.DOWNSTREAM_PROPERTIES]);let _=Q;class xD extends ne{constructor(t){super(xt,t);c(this,"id",we.Parallel);c(this,"name",we.Parallel);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",xt);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=xt.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=xt.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=xt.error?R(xt.error,this.project):null}}class jD extends ne{constructor(t){super(ut,t);c(this,"id",ut.id);c(this,"name",ut.name);c(this,"description",ut.description);c(this,"version",ut.version);c(this,"autoexecutable",!1);c(this,"initialData",ut);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=ut.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ut.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ut.error?R(ut.error,this.project):null}}class kD extends ne{constructor(t){super(dn,t);c(this,"id",we.Sequential);c(this,"name",we.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",dn);c(this,"type",n.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=dn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=dn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=dn.error?R(dn.error,this.project):null}}function Ck(r){const e=[new kD(r),new xD(r),new jD(r),new ne(Pi,r),new ne(Qn,r),new ne(er,r),new ne(ja,r),new ne(zo,r),new ne(Xo,r),new ne(Ko,r),new ne(Fa,r),new ne(Ii,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.operationDeclarations=e,e}class qD extends Gt{constructor(t){super(Fe,t);c(this,"initialData");c(this,"id",L.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",L.PERSISTED_ENTITY);c(this,"description",Fe.description);c(this,"type",n.BuiltInBaseEntity);c(this,"abstract",Fe.abstract);c(this,"static",Fe.static);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=Fe,this.project=t,this.id=Fe.id,this.version=Fe.version,this.name=Fe.name,this.static=Fe.static,this.abstract=Fe.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 Bk(r){const e=[new qD(r),new Gt(es,r),new Gt(Bn,r),new Gt(Ml,r),new Gt(Qa,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.builtInBaseEntities=e,e}function wk(r){const e=[new Ft(x,r),new Ft(Sn,r),new Ft(te,r),new Ft(Ye,r),new Ft(Cn,r),new Ft(cn,r),new Ft(Ga,r),new Ft(Jo,r)];return e.forEach(t=>{r.subscribeBuiltInInstance(t)}),r.primitives=e,e}function _k(r){const e=[new ne(as,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.globalEventActionDescriptors=e,e}function Nk(r){const e=[new ne(Ka,r),new ne(tr,r),new ne(Za,r),new ne(Si,r),new ne(Bi,r),new ne(ll,r)];e.forEach(i=>{i.initChildren(),r.subscribeBuiltInInstance(i)}),r.loopDeclarations=e;const t=[new ne(bl,r),new ne(za,r),new ne(hl,r),new ne(Uf,r),new ne(Xf,r),new ne(ul,r)];return t.forEach(i=>{i.initChildren(),r.subscribeBuiltInInstance(i)}),r.loopDeclarationsBodies=t,e}function Mk(r){const e=[new _r(Gl,r)];return e.forEach(t=>{t.initChildren(),r.subscribeBuiltInInstance(t)}),r.valueDescriptors=e,e}function Vk(r){const e=[new ne(nr,r),new ne(jr,r)];return e.forEach(t=>{t.initChildren()}),r.conditionDeclarations=e,e}const Lr={},Fo={};async function Lk(r,e={}){const t={...tv};return t.id=r.id,e.empty?{data:{id:r.id,type:n.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function JD(r){const e=new _(r);return wk(e),Bk(e),Ck(e),_k(e),Nk(e),Mk(e),Vk(e),e.getAllBuiltIn().forEach(i=>{e.builtInInstances[i.id]||(e.builtInInstances[i.id]=i)}),e.initChildren(),e}async function $k(r,e={}){if(r.id&&Lr[r.id])return Lr[r.id];if(r.id&&Fo[r.id])return await Fo[r.id],Lr[r.id];const t=Lk(r,e);r.id&&(Fo[r.id]=t);const i=await t;if(i.data){const a=JD(i.data);return Lr[r.id]=a,r.id&&delete Fo[r.id],a}return null}function Gk(r){return Lr[r.id]&&delete Lr[r.id],null}const Fk="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=hu,u.ActionDescriptorState=ne,u.ActionDescriptorValuesType=M,u.ActionInputMapState=V5,u.ActionOutputMapState=G5,u.AppendToListOperationInputIds=iy,u.AppendToListOperationOutputIds=ay,u.ArgumentDeclarationState=Br,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=du,u.BUILT_IN_BASE_ENTITY_IDS=G,u.BUILT_IN_ENTITY_TYPES=Ur,u.BaseCanvasDraggableState=b5,u.BaseEntityNames=L,u.BaseState=E5,u.BaseValueDescriptorIds=qo,u.BreakStatementState=Ri,u.BuiltInBaseEntityState=Gt,u.CACHED_PROJECTS_BY_ID=Lr,u.CALLABLE_ENTITIES_EXPLANATION=Z5,u.CALLABLE_TYPES=On,u.CALLER_ENTITIES_EXPLANATION=iD,u.CALLER_TYPES=ln,u.CALLS_UPDATE_EXPLANATION=Hn,u.COMPARISON_CONDITIONS=WT,u.CONDITIONS=IP,u.CUSTOM_ENTITY_OPERATIONS=Ih,u.CallableEntityClass=g5,u.CallerEntityClass=su,u.ChildEntityState=R5,u.ComparisonOperatorTypes=Me,u.ConditionState=Pr,u.ContinueStatementState=Et,u.CreateNewInputIds=zy,u.CreateNewOutputIds=Zy,u.CustomEntityState=Vr,u.DRAGGABLE_CALLABLE_TYPES=jo,u.DRAGGABLE_CALLER_TYPES=wu,u.DRAGGABLE_ELEMENT_TYPES=ko,u.DRAGGABLE_EXECUTABLE_TYPES=HD,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=xo,u.DataTypeCompatibilityTypes=$t,u.DataTypeParentChildRelation=je,u.DataTypeState=mi,u.ENTITIES_WITH_VALLUES_EXPLANATION=Ao,u.ENTITY_TYPES=YD,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=dt,u.ENTITY_WITH_NAMES_TYPES=_u,u.ENTITY_WITH_VALUE_TYPES=Bu,u.ENTRY_POINT_ENTITIES_EXPLANATION=wa,u.ENTRY_POINT_TYPES=Ve,u.EVENT_TYPES=Fr,u.EXECUTABLE_TYPES=WD,u.EXECUTION_OPERATIONS=Yy,u.EntityError=dr,u.EntityErrorSeverity=T,u.EntityGenerationError=E,u.EntityGenerationErrorCode=h,u.EntityInstanceErrorCode=N,u.EntityOperations=Xe,u.EntityType=n,u.EntityWithLogicScopeClass=P5,u.EntityWithValueClass=D5,u.EntryPointEntityClass=v5,u.ExecutionOperations=we,u.FunctionCallState=Nr,u.FunctionDeclarationState=vr,u.GLOBAL_EVENT_DECLARATIONS=DP,u.GetLastInListOperationInputIds=Wp,u.GetLastInListOperationOutputIds=Hp,u.GlobalEventNames=on,u.GlobalEventState=Ti,u.HTTPOperations=Qe,u.HTTP_OPERATIONS=rf,u.InputMapState=vn,u.InstalledProjectState=Cr,u.InternalCallState=Ei,u.JoinListOperationInputIds=pp,u.JoinListOperationOutputIds=yp,u.JoinStringOperationInputIds=Xu,u.JoinStringOperationOutputIds=Qu,u.LIST_OPERATIONS=Ey,u.ListOperations=Y,u.LoopState=Dr,u.LoopTypes=q,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Yn,u.NUMBER_OPERATIONS=Ku,u.NumberAdditionOperationInputIds=Gu,u.NumberAdditionOperationOutputIds=Fu,u.NumberOperations=ct,u.OPERATION_DECLARATIONS=ZD,u.OperationState=Ir,u.OutputMapParentChildRelation=Cu,u.OutputMapState=In,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=Oo,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Wn,u.PASS_THROUGH_CALLABLE_TYPES=Ge,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=yu,u.ParallelExecutionOperation=xD,u.ParallelExecutionOperationInputIds=by,u.ParallelExecutionOperationOutputIds=Ry,u.PassThroughCallableEntityClass=I5,u.PersistedEntity=qD,u.PersistedEntityMethods=St,u.PrimitiveEntityState=Ft,u.PrimitiveTypes=I,u.PrimitiveValueState=bi,u.ProjectState=_,u.PropertyState=gr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=K5,u.ReturnDeclarationState=_t,u.ReturnStatementState=wr,u.STANDALONE_CONDITIONS=UT,u.STRING_OPERATIONS=up,u.ScopeCompatibilityType=Go,u.SearchState=Sr,u.SequentialExecutionOperation=kD,u.SequentialExecutionOperationInputIds=$y,u.SequentialExecutionOperationOutputIds=Gy,u.SharedEntityErrorCode=D,u.SharedStateFunctionality=tD,u.SplitListOperationInputIds=Sp,u.SplitListOperationOutputIds=Cp,u.StandaloneOperatorTypes=Mt,u.StringOperations=Ce,u.TERMINATION_TYPES=Le,u.USER_MANAGED_ENTITY_TYPES=zD,u.UserManagedEntityStateFunctionality=T5,u.VALUE_READING_ENTITIES_EXPLANATION=pu,u.VALUE_READING_TYPES=An,u.VALUE_WRITING_ENTITIES_EXPLANATION=aD,u.VALUE_WRITING_TYPES=$e,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=uu,u.VARIABLE_TYPES=ke,u.ValidationInputIds=ch,u.ValidationOutputIds=dh,u.ValueAutogenerationType=qe,u.ValueDescriptorParentChildRelation=B,u.ValueDescriptorState=_r,u.ValueReadingEntityClass=Ca,u.ValueWritingEntityClass=Ba,u.VariableDeclarationState=Ar,u.VariableInputMapState=M5,u.VariableInstanceState=Or,u.VariableOutputMapState=$5,u.WaitOperation=jD,u.WaitOperationInputIds=By,u.WaitOperationOutputIds=wy,u.appendToListOperation=ja,u.appendToListOperationElementToAppendArgument=el,u.appendToListOperationElementToAppendArgumentParentRef=yy,u.appendToListOperationElementToAppendArgumentRef=ly,u.appendToListOperationError=Ty,u.appendToListOperationErrorParentRef=my,u.appendToListOperationListArgument=Qo,u.appendToListOperationListArgumentParentRef=py,u.appendToListOperationListArgumentRef=sy,u.appendToListOperationListDataType=oy,u.appendToListOperationResultListDataType=uy,u.appendToListOperationResultListReturn=fy,u.appendToListOperationResultListReturnParentRef=hy,u.appendToListOperationResultListReturnRef=dy,u.appendToListOperationSecondListDataType=cy,u.asGenerationActionExample=an,u.baseHttpRequestFunctionDeclaration=Pi,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=ol,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=nf,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=tf,u.baseHttpRequestFunctionDeclarationRef=Kh,u.baseHttpRequestFunctionDeclarationRefEight=Qh,u.baseHttpRequestFunctionDeclarationRefFive=zh,u.baseHttpRequestFunctionDeclarationRefFour=Yh,u.baseHttpRequestFunctionDeclarationRefNine=ef,u.baseHttpRequestFunctionDeclarationRefSeven=Xh,u.baseHttpRequestFunctionDeclarationRefSix=Zh,u.baseHttpRequestFunctionDeclarationRefThree=Hh,u.baseHttpRequestFunctionDeclarationRefTwo=Wh,u.booleanPrototype=Sn,u.capitalizeFirstLetter=Eo,u.checkAreCustomEntitiesCompatibleAsDataType=UI,u.checkAreDataTypesCompatible=Ht,u.checkArePropertiesCompatibleAsDataType=FI,u.checkIsBranchDependentButNotDirectlyOnBranch=Na,u.checkIsBranchDependentOnBranch=sk,u.checkIsCallableEntityReachable=La,u.checkIsCanvasEntity=Ik,u.checkIsDetachedBranch=VD,u.checkIsDetachedBranchShallow=Ou,u.checkIsGlobalVariable=gk,u.checkIsGloballyDeclared=Au,u.checkIsMethod=GD,u.checkIsNestedScope=$o,u.checkScopeCompatibility=Ma,u.countedLoopActionDescriptor=Ka,u.countedLoopActionDescriptorStringArgumentDeclaration=im,u.countedLoopActionDescriptorStringArgumentDeclarationDataType=nm,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValue=em,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeDefaultValueParentRef=Qf,u.countedLoopActionDescriptorStringArgumentDeclarationDataTypeParentRef=tm,u.countedLoopActionDescriptorStringArgumentDeclarationParentRef=rm,u.countedLoopBodyActionDescriptor=bl,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclaration=El,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=sm,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=am,u.countedLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=om,u.createEntityError=Z,u.createNewInstanceOperation=Qn,u.createNewInstanceOperationEntityToInstanciateArgument=ih,u.createNewInstanceOperationEntityToInstanciateArgumentRef=th,u.createNewInstanceOperationEntityToInstanciateDataType=nh,u.createNewInstanceOperationError=lh,u.createNewInstanceOperationErrorParentRef=oh,u.createNewInstanceOperationNewEntityDataArgument=eh,u.createNewInstanceOperationNewEntityDataArgumentDataType=Qy,u.createNewInstanceOperationNewEntityDataArgumentDataTypeParentRef=Xy,u.createNewInstanceOperationNewEntityDataArgumentParentRef=Ky,u.createNewInstanceOperationOutputEntityDeclaration=sh,u.createNewInstanceOperationOutputEntityDeclarationParentRef=ah,u.createNewInstanceOperationRef=rh,u.createSemanticId=tt,u.createStateFromGenerationTargetType=Sk,u.createStateFromType=Ut,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=Ml,u.cronJobBuiltInBaseEntityExpressionProperty=LT,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=RP,u.cronJobBuiltInBaseEntityExpressionPropertyRef=MT,u.cronJobBuiltInBaseEntityRef=VT,u.cronJobTriggeredFunctionDeclarationBlueprint=Nl,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=_T,u.customEntityToZodSchema=dE,u.dataTypeCompatibilityToErrorExplanation=yD,u.datePrototype=cn,u.dateValueAutogenerationSchema=Yc,u.deletePersistedEntityMethod=_l,u.deletePersistedEntityMethodParentRef=dT,u.deleteRootProject=Gk,u.endpointBuiltInBaseEntity=es,u.endpointBuiltInBaseEntityRef=Tm,u.endpointBuiltInBaseEntityRefFour=Xm,u.endpointBuiltInBaseEntityRefThree=Am,u.endpointBuiltInBaseEntityRefTwo=vm,u.endpointBuiltInCorsProperty=Em,u.endpointBuiltInCorsPropertyDataType=mm,u.endpointBuiltInCorsPropertyDataTypeRef=hm,u.endpointBuiltInCorsPropertyRef=fm,u.endpointBuiltInMethodProperty=gl,u.endpointBuiltInMethodPropertyDataType=Pm,u.endpointBuiltInMethodPropertyDataTypeRef=Im,u.endpointBuiltInMethodPropertyRef=Dm,u.endpointBuiltInPathProperty=Rl,u.endpointBuiltInPathPropertyDataType=gm,u.endpointBuiltInPathPropertyDataTypeRef=bm,u.endpointBuiltInPathPropertyRef=Rm,u.endpointPathParamsArgumentDeclaration=Il,u.endpointPathParamsArgumentDeclarationRef=Lm,u.endpointPathParamsVariableDataType=$m,u.endpointPathParamsVariableDataTypeRef=Vm,u.endpointReachedTriggerActionDescriptor=Cl,u.endpointReachedTriggerActionDescriptorRef=Gm,u.endpointReachedTriggerActionDescriptorRefFour=xm,u.endpointReachedTriggerActionDescriptorRefThree=Um,u.endpointReachedTriggerActionDescriptorRefTwo=Fm,u.endpointRequestBodyArgumentDeclaration=Pl,u.endpointRequestBodyArgumentDeclarationRef=Bm,u.endpointRequestBodyVariableDataType=wm,u.endpointRequestHeadersArgumentDeclaration=vl,u.endpointRequestHeadersArgumentDeclarationRef=Sm,u.endpointRequestHeadersVariableDataType=Cm,u.endpointRequestHeadersVariableDataTypeRef=Om,u.endpointRequestQueryParamsArgumentDeclaration=Dl,u.endpointRequestQueryParamsArgumentDeclarationRef=Nm,u.endpointRequestQueryParamsVariableDataType=Mm,u.endpointRequestQueryParamsVariableDataTypeRef=_m,u.endpointResponseBodyDataType=Zm,u.endpointResponseBodyReturnDeclaration=Sl,u.endpointResponseBodyReturnDeclarationRef=zm,u.endpointResponseCodeDataType=km,u.endpointResponseCodeReturnDeclaration=Al,u.endpointResponseCodeReturnDeclarationRef=jm,u.endpointResponseHeadersDataType=Hm,u.endpointResponseHeadersDataTypeRef=Jm,u.endpointResponseHeadersReturnDeclaration=Ol,u.endpointResponseHeadersReturnDeclarationRef=Wm,u.endpointReturnStatementRef=qm,u.endpointReturnStatementRefThree=Km,u.endpointReturnStatementRefTwo=Ym,u.enumOptionsProperty=$u,u.enumOptionsPropertyDataType=Vu,u.enumOptionsPropertyDataTypeRef=Nu,u.enumOptionsPropertyRef=Mu,u.enumPrototype=Cn,u.enumPrototypeRef=Lu,u.executionBuiltInEntity=Ll,u.executionBuiltInEntityAbortMethod=Vl,u.executionBuiltInEntityAbortMethodParentRef=$T,u.filterOutDuplicateEntities=g,u.filterOutDuplicateErrors=m8,u.findReferenceToSelfInList=OD,u.findReferencesToSelfInProject=fk,u.flattenCalls=sn,u.flattenCanvasAncestorsUntil=_o,u.flattenCustomEntityExtensionAndImplementationTypes=_D,u.flattenCustomEntityExtensionTypes=Vo,u.flattenCustomEntityExtensions=Iu,u.flattenCustomEntityImplementations=Du,u.flattenCustomEntityImplementionTypes=Mo,u.flattenDerivedCanvasEntities=Ot,u.flattenDetachedBranch=$D,u.flattenElementCalls=Be,u.flattenElementCallsOnTheSameScope=hk,u.flattenProjectElements=AD,u.flattenRelatedCanvasElementsOnTheLeft=wD,u.flattenRelatedCanvasElementsOnTheRight=BD,u.flattenVariableReads=PD,u.flattenVariableWrites=DD,u.flattenVariables=ie,u.fromZodParseToEntityGenerationErrors=ou,u.generate=RO,u.generateActionExample=X5,u.generateExecutionDataType=X3,u.generateMutablePropertiesExplanation=Io,u.generateRandomBoolean=LE,u.generateRandomDate=hE,u.generateRandomDateAfter=uE,u.generateRandomDateBefore=pE,u.generateRandomDateBetweenRange=yE,u.generateRandomNumber=wE,u.generateRandomNumberAfter=SE,u.generateRandomNumberBefore=CE,u.generateRandomNumberBetweenRange=BE,u.generateRandomText=VE,u.generateRandomTextAfter=_E,u.generateRandomTextBefore=NE,u.generateRandomTextBetweenRange=ME,u.generateUniqueUUID=OE,u.getAllActionDescriptorsForConditions=Bo,u.getAllActionDescriptorsForGlobalEvents=So,u.getAllActionDescriptorsForLoops=Co,u.getAllActionDescriptorsForOperations=nk,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=dD,u.getBaseBuiltInEntities=Zn,u.getBaseSchemaBasedOnType=nD,u.getBuiltInEntityOwner=Kn,u.getCallableEntityReferenceSchema=He,u.getCallableEntityTypeSchema=Av,u.getCallerEntityReferenceSchema=gj,u.getCallerEntityTypeSchema=Rj,u.getCalls=Eu,u.getCanvasEntitiesDerivedFromInternalCalls=CD,u.getCanvasEntitiesDerivedFromWrites=gi,u.getCanvasEntityDerivedFromValueReadingEntity=vu,u.getCanvasEntityReferenceSchema=Gj,u.getCanvasEntityTypeSchema=$j,u.getChildrenEntityWithValues=lk,u.getCommonAncestor=Tu,u.getCommonChildren=mD,u.getDeclaration=br,u.getDeepestScope=UD,u.getDraggableCallableEntityReferenceSchema=Sv,u.getDraggableCallableEntityTypeSchema=Ov,u.getDraggableCallerEntityReferenceSchema=Ij,u.getDraggableCallerEntityTypeSchema=vj,u.getDraggableExecutableEntityReferenceSchema=Oj,u.getDraggableExecutableEntityTypeSchema=Aj,u.getDraggablePassThroughCallableEntityReferenceSchema=co,u.getDraggablePassThroughCallableEntityTypeSchema=lo,u.getDraggablePlayableEntityReferenceSchema=_j,u.getDraggablePlayableEntityTypeSchema=wj,u.getEntityArgumentDeclarations=Ru,u.getEntityInputMaps=SD,u.getEntityOutputMaps=Ek,u.getEntityReferenceSchema=Lj,u.getEntityReturnDeclarations=gu,u.getEntityTypeSchema=Vj,u.getEntityWithLogicScopeReferenceSchema=bn,u.getEntityWithLogicScopeTypeSchema=Sj,u.getEntityWithValueReferenceSchema=Pv,u.getEntityWithValueTypeSchema=bj,u.getEntryPointEntityReferenceSchema=We,u.getEntryPointEntityTypeSchema=kn,u.getEventEntityReferenceSchema=so,u.getEventEntityTypeSchema=ao,u.getExecutableEntityReferenceSchema=Pj,u.getExecutableEntityTypeSchema=Dj,u.getExtendedBuiltInEntity=bk,u.getExtendedCustomEntity=MD,u.getGenerationTargetSchemaBasedOnType=rD,u.getHeadIfPartOfDetachedBranch=LD,u.getHighestScope=FD,u.getImplementedBuiltInEntity=Rk,u.getIsInteractive=Pu,u.getLastInListOperation=Xo,u.getLastInListOperationError=ry,u.getLastInListOperationErrorParentRef=ny,u.getLastInListOperationInputListArgument=Qp,u.getLastInListOperationInputListArgumentParentRef=Xp,u.getLastInListOperationInputListArgumentRef=Yp,u.getLastInListOperationInputListDataType=zp,u.getLastInListOperationOutputElementDataType=Kp,u.getLastInListOperationOutputElementReturn=ty,u.getLastInListOperationOutputElementReturnParentRef=ey,u.getLastInListOperationOutputElementReturnRef=Zp,u.getLinkedEntitiesFromArgumentDeclaration=yk,u.getLowestPersistedEntityImplementation=ND,u.getParentCanvasEntities=bt,u.getParentCanvasEntity=Ke,u.getParentEntryPoint=ok,u.getPassThroughCallableEntityReferenceSchema=ye,u.getPassThroughCallableEntityTypeSchema=oo,u.getPlayableEntityReferenceSchema=Bj,u.getPlayableEntityTypeSchema=Cj,u.getProject=$k,u.getPrototypeByType=Lo,u.getReferenceEntityId=w,u.getReferencedEntitiesStateOrErrors=Po,u.getReferencedEntityStateOrErrors=lu,u.getRelatedCanvasElementsOnTheLeft=Mr,u.getRelatedCanvasElementsOnTheRight=zn,u.getRootEntryPointScopeOwner=Su,u.getScopeOwner=Rt,u.getTerminationReferenceSchema=Mj,u.getTerminationTypeSchema=Nj,u.getUsedArgFromDeclaration=mk,u.getUsedReturnFromDeclaration=Tk,u.getValueReadingEntityReferenceSchema=Dv,u.getValueReadingEntityTypeSchema=En,u.getValueWritingEntityReferenceSchema=Ej,u.getValueWritingEntityTypeSchema=ba,u.getVariableFromInputMapping=ED,u.getVariableFromReturnVariablePointer=gD,u.getVariableReferenceSchema=jn,u.getVariableTypeSchema=yr,u.getVariablesFromArgumentDeclarations=No,u.getVariablesFromInputMaps=bD,u.getVariablesFromOutputMapping=vD,u.getVariablesFromOutputMaps=ID,u.getVariablesFromReturnDeclarations=RD,u.getVariablesInSameOrHigherScope=Kd,u.getWrites=bu,u.groupCallsBasedOnParallelizableExecution=dk,u.handleAfterEntityImplementationSideEffects=fD,u.handleBeforeEntityImplementationSideEffects=hD,u.httpRequestBodyArgument=Wa,u.httpRequestBodyArgumentRef=Lh,u.httpRequestBodyDataType=$h,u.httpRequestHeadersArgument=Ja,u.httpRequestHeadersArgumentRef=Mh,u.httpRequestHeadersDataType=Vh,u.httpRequestMethodArgument=ka,u.httpRequestMethodArgumentRef=_h,u.httpRequestMethodDataType=Nh,u.httpRequestMethodDataTypeRef=Bh,u.httpRequestQueryParamsArgument=al,u.httpRequestQueryParamsArgumentRef=Sh,u.httpRequestQueryParamsDataType=Ch,u.httpRequestVariableURLArgument=qa,u.httpRequestVariableURLArgumentRef=Ah,u.httpRequestVariableURLDataType=Oh,u.httpRequestVariableURLDataTypeRef=Dh,u.httpResponseBodyReturnDataType=Jh,u.httpResponseBodyReturnDataTypeRef=kh,u.httpResponseBodyReturnReturn=Di,u.httpResponseBodyReturnReturnRef=qh,u.httpResponseCodeDataType=Fh,u.httpResponseCodeReturn=sl,u.httpResponseCodeReturnRef=Gh,u.httpResponseHeadersDataType=jh,u.httpResponseHeadersDataTypeRef=Uh,u.httpResponseHeadersReturn=Ha,u.httpResponseHeadersReturnRef=xh,u.implement=wo,u.inferArgumentDeclarationDataType=xI,u.inferDataType=rn,u.inferInputMapDataType=jI,u.inferOutputMapDataType=JI,u.inferReturnDeclarationDataType=Zd,u.inferVariableDeclarationDataType=qI,u.inferVariableInstanceDataType=kI,u.initProject=JD,u.iterateOverListActionDescriptorListArgumentDeclaration=uf,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=cf,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=lf,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=df,u.iterateOverListLoopActionDescriptor=tr,u.iterateOverListLoopBodyActionDescriptor=za,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclaration=Ya,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=yf,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=pf,u.iterateOverListLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=hf,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ef,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=mf,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=ff,u.iterateOverListLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Tf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclaration=_f,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataType=Bf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationDataTypeParentRef=Cf,u.iterateOverObjectKeysActionDescriptorObjectArgumentDeclarationParentRef=wf,u.iterateOverObjectKeysLoopActionDescriptor=Si,u.iterateOverObjectKeysLoopBodyActionDescriptor=Uf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclaration=fl,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Mf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Nf,u.iterateOverObjectKeysLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Vf,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Ff,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=$f,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Lf,u.iterateOverObjectKeysLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Gf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclaration=qf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataType=jf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationDataTypeParentRef=xf,u.iterateOverObjectValuesActionDescriptorObjectArgumentDeclarationParentRef=kf,u.iterateOverObjectValuesLoopActionDescriptor=Bi,u.iterateOverObjectValuesLoopBodyActionDescriptor=Xf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclaration=ml,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Wf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=Jf,u.iterateOverObjectValuesLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Hf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclaration=Kf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=zf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Yf,u.iterateOverObjectValuesLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Zf,u.iterateOverStringActionDescriptorStringArgumentDeclaration=vf,u.iterateOverStringActionDescriptorStringArgumentDeclarationDataType=Rf,u.iterateOverStringActionDescriptorStringArgumentDeclarationDataTypeParentRef=bf,u.iterateOverStringActionDescriptorStringArgumentDeclarationParentRef=gf,u.iterateOverStringLoopActionDescriptor=Za,u.iterateOverStringLoopBodyActionDescriptor=hl,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclaration=pl,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataType=Df,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationDataTypeParentRef=If,u.iterateOverStringLoopBodyActionDescriptorCurrentValueArgumentDeclarationParentRef=Pf,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclaration=yl,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataType=Of,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationDataTypeParentRef=Af,u.iterateOverStringLoopBodyActionDescriptorIterationNumberArgumentDeclarationParentRef=Sf,u.joinListOperation=zo,u.joinListOperationError=Op,u.joinListOperationErrorParentRef=Ap,u.joinListOperationFirstListArgument=gp,u.joinListOperationFirstListArgumentParentRef=Rp,u.joinListOperationFirstListArgumentRef=hp,u.joinListOperationFirstListDataType=fp,u.joinListOperationResultListDataType=bp,u.joinListOperationResultListReturn=Pp,u.joinListOperationResultListReturnParentRef=Dp,u.joinListOperationResultListReturnRef=Ep,u.joinListOperationSecondListArgument=Ip,u.joinListOperationSecondListArgumentParentRef=vp,u.joinListOperationSecondListArgumentRef=mp,u.joinListOperationSecondListDataType=Tp,u.joinListWithLastSeparator=F,u.joinStringOperation=Ii,u.joinStringOperationError=dp,u.joinStringOperationErrorParentRef=cp,u.joinStringOperationFirstStringArgument=Ua,u.joinStringOperationFirstStringArgumentParentRef=sp,u.joinStringOperationFirstStringArgumentRef=ep,u.joinStringOperationFirstStringDataType=tp,u.joinStringOperationResultStringDataType=ap,u.joinStringOperationResultStringReturn=vi,u.joinStringOperationResultStringReturnParentRef=lp,u.joinStringOperationResultStringReturnRef=ip,u.joinStringOperationSecondStringArgument=xa,u.joinStringOperationSecondStringArgumentParentRef=op,u.joinStringOperationSecondStringArgumentRef=np,u.joinStringOperationSecondStringDataType=rp,u.jsonPrototype=Jo,u.keyValueParamBuiltInBaseEntity=Qa,u.keyValueParamBuiltInBaseEntityNameProperty=dm,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=nP,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=cm,u.keyValueParamBuiltInBaseEntityNamePropertyRef=lm,u.keyValueParamBuiltInBaseEntityValueProperty=ym,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=iP,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=pm,u.keyValueParamBuiltInBaseEntityValuePropertyRef=um,u.lowercaseFirstLetter=GI,u.manualFlowActionDescriptorDeclarationArgumentDeclaration=dl,u.manualFlowActionDescriptorDeclarationArgumentDeclarationDataType=sf,u.manualFlowActionDescriptorDeclarationArgumentDeclarationDataTypeParentRef=af,u.manualFlowActionDescriptorDeclarationArgumentDeclarationParentRef=of,u.manualFlowLoopActionDescriptor=ll,u.manualFlowLoopBodyActionDescriptor=ul,u.mapActionDescriptorToTypeItRepresents=Dk,u.mergeEntityErrorsList=T8,u.mergeListOfEntities=vk,u.methodDefaultValue=wh,u.mockClientProject=tv,u.moreThanOrEqualCondition=jr,u.moreThanOrEqualConditionLeftHandArgument=kT,u.moreThanOrEqualConditionLeftHandArgumentParentRef=jT,u.moreThanOrEqualConditionRightHandArgument=JT,u.moreThanOrEqualConditionRightHandArgumentParentRef=qT,u.notEmptyCondition=nr,u.notEmptyConditionArgument=FT,u.notEmptyConditionRef=GT,u.numberAdditionOperation=Fa,u.numberAdditionOperationError=Zu,u.numberAdditionOperationErrorParentRef=zu,u.numberAdditionOperationFirstNumberArgument=Wo,u.numberAdditionOperationFirstNumberArgumentRef=Uu,u.numberAdditionOperationFirstNumberDataType=xu,u.numberAdditionOperationRef=Wu,u.numberAdditionOperationRefThree=Yu,u.numberAdditionOperationRefTwo=Hu,u.numberAdditionOperationResultNumberDataType=Ju,u.numberAdditionOperationResultNumberReturn=Yo,u.numberAdditionOperationResultNumberReturnRef=qu,u.numberAdditionOperationSecondNumberArgument=Ho,u.numberAdditionOperationSecondNumberArgumentRef=ju,u.numberAdditionOperationSecondNumberDataType=ku,u.numberPrototype=te,u.numberValueAutogenerationSchema=Hc,u.parallelExecutionOperation=xt,u.parallelExecutionOperationError=Cy,u.parallelExecutionOperationErrorParentRef=Sy,u.parallelExecutionOperationListOfExecutionResultsDataType=Py,u.parallelExecutionOperationListOfExecutionResultsReturn=nl,u.parallelExecutionOperationListOfExecutionResultsReturnRef=Dy,u.parallelExecutionOperationListOfFunctionsArgument=tl,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Iy,u.parallelExecutionOperationListOfFunctionsArgumentRef=vy,u.parallelExecutionOperationListOfFunctionsBlueprint=gy,u.parallelExecutionOperationRef=Ay,u.parallelExecutionOperationRefThree=Oy,u.persistedBuiltInBaseEntity=Fe,u.persistedBuiltInBaseEntityCreatedAtProperty=OT,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=PT,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=EP,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=AT,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=DT,u.persistedBuiltInBaseEntityDatabaseProperty=Ni,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=hP,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=fT,u.persistedBuiltInBaseEntityDatabasePropertyRef=hT,u.persistedBuiltInBaseEntityDeletedAtProperty=IT,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=gT,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=TP,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=vT,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=RT,u.persistedBuiltInBaseEntityIdentifierProperty=bT,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=mT,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=ET,u.persistedBuiltInBaseEntityIdentifierPropertyRef=TT,u.persistedBuiltInBaseEntityUpdatedAtProperty=wT,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=CT,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=bP,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=BT,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=ST,u.processOutputGlobalValueDescriptorDataType=YT,u.processOutputGlobalValueDescriptorReturn=Gl,u.processOutputGlobalValueDescriptorReturnRef=HT,u.projectPublicationCompletedGlobalEvent=as,u.propertyToZodSchema=cE,u.relationalDatabaseBuiltInBaseEntity=Bn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=wl,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=lT,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=cT,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=oT,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=Bl,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=aT,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=sT,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=ts,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Qm,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=eT,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=is,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=rT,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=iT,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=rs,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=cP,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=nT,u.relationalDatabaseBuiltInBaseEntityRef=xr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=ns,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=oP,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=tT,u.resolveActionDescriptorName=eD,u.resolveBaseEntityName=KI,u.resolveBuiltInBaseEntityDataTypeLabel=Xd,u.resolveConditionOperatorLabel=go,u.resolveCustomEntityDataTypeLabel=Qd,u.resolveDataType=bo,u.resolveDataTypeLabel=YI,u.resolveEntityDataTypeLabel=ZI,u.resolveEntityName=S,u.resolveFirstCallsSecond=uk,u.resolveFirstWritesSecond=pk,u.resolvePrimitiveEntityName=QI,u.resolvePropertyDataTypeLabel=zI,u.resolveSearchName=XI,u.resolveVariableDataTypeLabel=n5,u.resolveVariableDeclarationDataTypeLabel=Rr,u.resolveVariableInstanceDataTypeLabel=HI,u.resolveVariableScope=Q3,u.sequentialExecutionOperation=dn,u.sequentialExecutionOperationError=Hy,u.sequentialExecutionOperationErrorParentRef=Wy,u.sequentialExecutionOperationListOfExecutionResultsDataType=ky,u.sequentialExecutionOperationListOfExecutionResultsReturn=il,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Jy,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=jy,u.sequentialExecutionOperationListOfFunctionsArgument=rl,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=xy,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=qy,u.sequentialExecutionOperationListOfFunctionsArgumentRef=Uy,u.sequentialExecutionOperationListOfFunctionsBlueprint=Fy,u.softDeletePersistedEntityMethod=pT,u.softDeletePersistedEntityMethodParentRef=uT,u.sortCallsBasedOnExecutionDependencies=TD,u.sortChildrenEntitiesBasedOnExecutionDependencies=ck,u.splitListOperation=Ko,u.splitListOperationError=Jp,u.splitListOperationErrorParentRef=qp,u.splitListOperationFirstOutputListDataType=Mp,u.splitListOperationFirstOutputListReturn=Up,u.splitListOperationFirstOutputListReturnParentRef=Fp,u.splitListOperationFirstOutputListReturnRef=Zo,u.splitListOperationInputListArgument=Lp,u.splitListOperationInputListArgumentParentRef=Vp,u.splitListOperationInputListArgumentRef=Bp,u.splitListOperationInputListDataType=wp,u.splitListOperationSecondOutputListDataType=xp,u.splitListOperationSecondOutputListReturn=kp,u.splitListOperationSecondOutputListReturnParentRef=jp,u.splitListOperationSplitIndexArgument=Gp,u.splitListOperationSplitIndexArgumentParentRef=$p,u.splitListOperationSplitIndexArgumentRef=_p,u.splitListOperationSplitIndexDataType=Np,u.stringPrototype=x,u.stringValueAutogenerationSchema=Wc,u.suggestNewIdForEntity=au,u.test_primitive_entities_export=Fk,u.toCamelCase=e5,u.toEntityState=Nt,u.toKebabCase=WI,u.toLowerCaseKebabCase=Ro,u.toPascalCase=t5,u.untypedObjectPrototype=Ye,u.updateErrorsList=ae,u.updateValueReader=Va,u.urlDefaultValue=Ph,u.uuidPrototype=Ga,u.validateArgumentDeclarationName=ru,u.validateCalledByErrorIdInAction=ek,u.validateCalledByIdInAction=Q5,u.validateCallers=cD,u.validateConditionEntityDeclaration=rk,u.validateCustomEntityName=vo,u.validateDataOperation=er,u.validateDataOperationDataToValidateArgument=hh,u.validateDataOperationDataToValidateArgumentParentRef=yh,u.validateDataOperationDataToValidateArgumentRef=uh,u.validateDataOperationDataToValidateDataType=ph,u.validateDataOperationEntityToMatchTypeArgument=Eh,u.validateDataOperationEntityToMatchTypeArgumentParentRef=Th,u.validateDataOperationEntityToMatchTypeArgumentRef=fh,u.validateDataOperationEntityToMatchTypeDataType=mh,u.validateDataOperationError=vh,u.validateDataOperationErrorParentRef=gh,u.validateDataOperationOutputEntityDeclaration=Rh,u.validateDataOperationOutputEntityDeclarationParentRef=bh,u.validateEntryCaller=lD,u.validateErrorCaller=oD,u.validateFunctionCallDeclaration=uD,u.validateFunctionDeclarationName=eu,u.validateGeneratedEntityParentIsNotBuiltInEntity=z5,u.validateGeneration=H5,u.validateGenerationTarget=_e,u.validateGenerationUpdate=Y5,u.validateLoopEntityDeclaration=ik,u.validateName=r5,u.validateOperationEntityDeclaration=pD,u.validatePropertyName=nu,u.validateReachability=Dn,u.validateReadsValueInActionPayload=tk,u.validateReferenceObject=Do,u.validateReferenceToOne=cu,u.validateReferences=Je,u.validateReturnDeclarationName=iu,u.validateSuccessCaller=sD,u.validateValueReaderGenerationUpdate=_a,u.validateValueWritter=fu,u.validateVariableDeclarationName=tu,u.validateVariableInternalCallUse=mu,u.valueAutogenerationCurrentDateAndTimeSchema=rv,u.valueAutogenerationGenericSchema=qs,u.valueAutogenerationOptions=zc,u.valueAutogenerationOptionsSchema=nv,u.valueAutogenerationRandomBooleanSchema=Jc,u.valueAutogenerationRandomDateBetweenSchema=pv,u.valueAutogenerationRandomDateFromSchema=dv,u.valueAutogenerationRandomDateSchema=Hs,u.valueAutogenerationRandomDateUntilSchema=uv,u.valueAutogenerationRandomNumberBetweenSchema=sv,u.valueAutogenerationRandomNumberFromSchema=iv,u.valueAutogenerationRandomNumberSchema=Js,u.valueAutogenerationRandomNumberUntilSchema=av,u.valueAutogenerationRandomSchema=pa,u.valueAutogenerationRandomTextBetweenSchema=cv,u.valueAutogenerationRandomTextFromSchema=ov,u.valueAutogenerationRandomTextSchema=Ws,u.valueAutogenerationRandomTextUntilSchema=lv,u.valueAutogenerationRangeValueTypesSchema=ua,u.valueAutogenerationUniqueSchema=qc,u.waitOperation=ut,u.waitOperationMillisecondsNumberArgument=Xn,u.waitOperationMillisecondsNumberArgumentRef=_y,u.waitOperationMillisecondsNumberDataType=Ny,u.waitOperationOperationError=Ly,u.waitOperationOperationErrorParentRef=Vy,u.waitOperationRef=My,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});