@elyx-code/project-logic-tree 0.0.7062 → 0.0.7063
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.
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueI
|
|
|
3
3
|
Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueInScope}))}return i}function B$(s,u){const i=[];s.name||i.push(new Ne({id:`${s.id}--${Pe.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Ee.Error,code:Pe.EmptyName}));const r=s.parent&&ss(s.parent,u)||u;if(!r)i.push(new Ne({id:`${s.id}--parent-reference--${Te.ReferencedEntityNotFound}`,message:`The entity with id '${s.parent}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Ee.Error,code:Te.ReferencedEntityNotFound}));else{const c=V$(r).filter(e=>e.name===s.name);c.length&&i.push(new Ne({id:`${s.id}--${Pe.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique in its scope or higher scopes. Entity with id "${c[0].id}" has the same name.
|
|
4
4
|
Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueInScope}))}return i}function M$(s,u){const i=[];s.name||i.push(new Ne({id:`${s.id}--${Pe.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Ee.Error,code:Pe.EmptyName}));const r=oe(s.parent);if(!r)i.push(new Ne({id:`${s.id}--parent-reference--${Te.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${s.id}" and type "${s.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:Ee.Error,code:Te.InvalidReferenceObjectStructure}));else{const a=u.get(r);if(!a)i.push(new Ne({id:`${s.id}--parent-reference--${Te.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Ee.Error,code:Te.ReferencedEntityNotFound}));else{const e=a.properties.filter(f=>f.name===s.name);e.length&&i.push(new Ne({id:`${s.id}--${Pe.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique among all properties in the parent entity. Entity with id "${e[0].id}" has the same name.
|
|
5
5
|
Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueInScope}))}}return i}function G$(s,u){const i=[];s.name||i.push(new Ne({id:`${s.id}--${Pe.EmptyName}`,message:`Entity with id "${s.id}" and type "${s.type}" has an empty name. Please provide a 'name' string.`,severity:Ee.Error,code:Pe.EmptyName}));const r=oe(s.parent);if(!r)i.push(new Ne({id:`${s.id}--parent-reference--${Te.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${s.id}" and type "${s.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:Ee.Error,code:Te.InvalidReferenceObjectStructure}));else{const a=u.get(r);if(!a)i.push(new Ne({id:`${s.id}--parent-reference--${Te.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:Ee.Error,code:Te.ReferencedEntityNotFound}));else{const e=xB(a).filter(f=>f.name===s.name);e.length&&i.push(new Ne({id:`${s.id}--${Pe.NameNotUniqueInScope}`,message:`Entity with id "${s.id}" and type "${s.type}" has a name "${s.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${e[0].id}" has the same name.
|
|
6
|
-
Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueInScope}))}}return i}function eRi(s,u){switch(s.type){case d.DefinitionEntity:return $$(s,u);case d.FunctionDeclaration:return L$(s,u);case d.VariableDeclaration:return B$(s,u);case d.Property:return M$(s,u);case d.ArgumentDeclaration:return G$(s,u);default:return[]}}function yc(s,u){var r;const i=s;switch(s.type){case d.FunctionCall:case d.InternalCall:return ss(s.declaration,u).codeName;case d.ActionDescriptor:case d.DefinitionEntity:case d.VariableDeclaration:case d.ValueDescriptor:case d.FunctionDeclaration:return s.codeName||null;case d.Property:case d.ArgumentDeclaration:{if(s.codeName)return s.codeName;if((r=s.implements)!=null&&r.length){const a=s.implements.find(c=>{const e=ss(c,u);return!!(e!=null&&e.codeName)});if(a)return ss(a,u).codeName||null}break}case d.InputMap:case d.OutputMap:case d.VariableInstance:{if(s.declaration){const a=ss(s.declaration,u);return yc(a,u)||""}break}}return i.codeName||null}function k$(s,u){let i=s;if(!!u.some(a=>a===i)){const a=s.split(" "),c=a.pop()||"",e=parseInt(c);return!isNaN(e)?a.push(`${e+1}`):(a.push(c),a.push("1")),i=a.join(" "),k$(i,u)}return i}function ap(s,u){let i=s;if(!!u.some(a=>a.name===i)){const a=s.split(" "),c=a.pop()||"",e=parseInt(c);return!isNaN(e)?a.push(`${e+1}`):(a.push(c),a.push("1")),i=a.join(" "),ap(i,u)}return i}function pNe(s,u){const r=s.project.getDefinitionEntities(new Set([s.id])).filter(a=>a.id!==s.id&&a.name.toLowerCase()===s.name.toLowerCase());if(r.length){const a=ap(s.name,r);s.metaSync({name:a},u)}}function tRi(s){switch(s){case _t.List:return"Loop over list items";case _t.ManualFlow:return"Manual flow control loop";case _t.ObjectKeys:return"Loop over object keys";case _t.ObjectValues:return"Loop over object values";case _t.Counted:return"Loop given number of times";case _t.String:return"Loop over text characters";case ui.PrimitiveEqual:return"Is equal to";case ui.PrimitiveNotEqual:return"Is not equal to";case ui.Empty:return"Is empty";case ui.NotEmpty:return"Is present";case _e.DeleteKey:return"Delete property from object";case _e.DeleteNestedKey:return"Delete nested property from object";case _e.HasKey:return"Check if object has property";case _e.HasNestedKey:return"Check if object has nested property";case _e.IsInstanceOfType:return"Check if object is instance of type";case _e.KeyValueEquals:return"Check if object property equals value";case _e.NestedKeyValueEquals:return"Check if object nested property equals value";case _e.ReadKey:return"Read property from object";case _e.ReadNestedKey:return"Read nested property from object";case _e.Validate:return"Validate object structure";case _e.WriteKey:return"Write property to object";case _e.WriteNestedKey:return"Write nested property to object";case _e.WriteSafeNestedKeyRecursively:return"Write safe nested property to object recursively";case _e.Merge:return"Merge objects";case _e.Entries:return"Get a list with the object keys, and values";case _e.Keys:return"Get a list with the object keys";case _e.Values:return"Get a list with the object values";case et.DecodeBase64:return"Decode Base64 text to bytes";case et.EncodeBase64:return"Encode bytes to Base64 text";case et.DecodeBase64Url:return"Decode Base64URL text to bytes";case et.EncodeBase64Url:return"Encode bytes to Base64URL text";case et.DecodeHex:return"Decode Hex text to bytes";case et.EncodeHex:return"Encode bytes to Hex text";case et.FromBytesToString:return"Convert bytes to text";case et.ToBytes:return"Convert text to bytes";case et.ToString:return"Convert value to text";case et.GetTypeOf:return"Get data type of value";case et.ToNumber:return"Convert value to number";case ce.Addition:return"Sum numbers";case ce.Subtraction:return"Subtract numbers";case ce.Multiplication:return"Multiply numbers";case ce.Division:return"Divide numbers";case ce.Remainder:return"Get remainder of numbers";case ce.Absolute:return"Get absolute value of numbers";case ce.Acos:return"Get arc cosine of numbers";case ce.Asin:return"Get arc sine of numbers";case ce.Atan:return"Get arc tangent of numbers";case ce.Ceil:return"Round numbers up";case ce.Cos:return"Get cosine of numbers";case ce.Floor:return"Round numbers down";case ce.LogNatural:return"Get natural logarithm of numbers";case ce.Log10:return"Get base-10 logarithm of numbers";case ce.MaxOf:return"Get maximum of numbers";case ce.MinOf:return"Get minimum of numbers";case ce.Round:return"Round numbers to nearest integer";case ce.Sin:return"Get sine of numbers";case ce.SquareRoot:return"Get square root of numbers";case ce.Tan:return"Get tangent of numbers";case ce.Negate:return"Negate numbers";case ce.Atan2:return"Get arc tangent of two numbers";case ce.Exp:return"Get exponential of numbers";case ce.Average:return"Get average of numbers";case ce.Clamp:return"Clamp numbers within range";case ce.CubeRoot:return"Get cube root of numbers";case ce.LessThan:return"Check if numbers are less than";case ce.LessThanOrEqual:return"Check if numbers are less than or equal to";case ce.MoreThan:return"Check if numbers are more than";case ce.MoreThanOrEqual:return"Check if numbers are more than or equal to";case ce.MapRange:return"Map numbers from one range to another";case ce.Median:return"Get median of numbers";case ce.NthRoot:return"Get nth root of numbers";case ce.PercentOf:return"Get percentage of numbers";case ce.PercentageChange:return"Get percentage change between numbers";case ce.RoundToDecimals:return"Round numbers to given decimal places";case ce.Sign:return"Get sign of numbers";case ce.SnapToStep:return"Snap numbers to nearest step";case st.GenerateRandomBase64:return"Generate random Base64 text";case st.GenerateRandomBytes:return"Generate random bytes";case st.GenerateRandomFloat:return"Generate random decimal number";case st.GenerateRandomInteger:return"Generate random whole number";case st.GenerateRandomHexadecimal:return"Generate random hexadecimal text";case st.GenerateRandomUUIDv4:return"Generate random UUID v4";case st.GenerateShortIdentifier:return"Generate short unique identifier";case ao.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return null}}function cNe(s,u,i){const a=`${BI(s)}-${u}-id`;return i.instances[a]?L.UUID.uuid():a}function OP(s,u){let i="",r=null;if(s.parent){const c=u.get(s.parent);c&&(r=c)}let a="";return r&&(a=`${BI(ye(r,u))}-`),i=`${a}${BI(ye(s,u))}-id`,u.instances[i]?L.UUID.uuid():i}function Gn(s,u,i="uuid"){return i==="semantic"?cNe(ye(s,u),s.type,u):L.UUID.uuid()}const iRi=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function U$(s){return typeof s=="string"&&iRi.test(s)}const rRi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function _P(s){return typeof s=="string"&&rRi.test(s)}function nRi(s){return s instanceof Error&&s.name==="ZodError"&&"issues"in s&&Array.isArray(s.issues)}var aRi=class extends Error{constructor(u,i){super(u,i);D(this,"name");D(this,"details");this.name="ZodValidationError",this.details=sRi(i)}toString(){return this.message}};function sRi(s){if(s){const u=s.cause;if(nRi(u))return u.issues}return[]}function lRi(s){return s.length!==0}function Cj(s){return s.description??""}var oRi=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function dRi(s){if(s.length===1){let u=s[0];return typeof u=="symbol"&&(u=Cj(u)),u.toString()||'""'}return s.reduce((u,i)=>{if(typeof i=="number")return u+"["+i.toString()+"]";if(typeof i=="symbol"&&(i=Cj(i)),i.includes('"'))return u+'["'+uRi(i)+'"]';if(!oRi.test(i))return u+'["'+i+'"]';const r=u.length===0?"":".";return u+r+i},"")}function uRi(s){return s.replace(/"/g,'\\"')}var pRi="; ",cRi=99,fNe="Validation error",fRi=": ",yRi=", or ";function hRi(s={}){const{issueSeparator:u=pRi,unionSeparator:i=yRi,prefixSeparator:r=fRi,prefix:a=fNe,includePath:c=!0,maxIssuesInMessage:e=cRi}=s;return f=>{const h=f.slice(0,e).map(m=>fI({issue:m,issueSeparator:u,unionSeparator:i,includePath:c})).join(u);return mRi(h,a,r)}}function fI(s){const{issue:u,issueSeparator:i,unionSeparator:r,includePath:a}=s;if(u.code===Ct.invalid_union)return u.unionErrors.reduce((c,e)=>{const f=e.issues.map(h=>fI({issue:h,issueSeparator:i,unionSeparator:r,includePath:a})).join(i);return c.includes(f)||c.push(f),c},[]).join(r);if(u.code===Ct.invalid_arguments)return[u.message,...u.argumentsError.issues.map(c=>fI({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(u.code===Ct.invalid_return_type)return[u.message,...u.returnTypeError.issues.map(c=>fI({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(a&&lRi(u.path)){if(u.path.length===1){const c=u.path[0];if(typeof c=="number")return`${u.message} at index ${c}`}return`${u.message} at "${dRi(u.path)}"`}return u.message}function mRi(s,u,i){return u!==null?s.length>0?[u,s].join(i):u:s.length>0?s:fNe}function TRi(s,u={}){const r=vRi(u)([s]);return new aRi(r,{cause:new ru([s])})}function vRi(s){return"messageBuilder"in s?s.messageBuilder:hRi(s)}async function yNe(s,u={}){var c;const i=X.YieldTracker.from(u),r=[...ta(s),...ks(s)];await i.tick();const a=vi(s.errors,r);return await((c=s.dataType)==null?void 0:c.validateAsync({tracker:i})),a}function hNe(s){var i;(i=s.dataType)==null||i.validate();const u=[...ta(s),...ks(s)];return vi(s.errors,u)}const ERi=Object.freeze(Object.defineProperty({__proto__:null,validate:hNe,validateAsync:yNe},Symbol.toStringTag,{value:"Module"}));function mNe(s){return s.listAdded.forEach(u=>{const i=s.project.get(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_ADDED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_ADDED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,i,s))}),s.listUpdated.forEach(u=>{const i=s.project.get(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_UPDATED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_UPDATED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,i,s))}),s.listRemoved.forEach(u=>{const i=s.project.get(u.id)||s.project.getDeleted(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_REMOVED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_REMOVED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,i,s))}),s}async function TNe(s,u={}){const i=X.YieldTracker.from(u),r=[];for(const a of s.listAdded){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_ADDED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_ADDED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,c,s))),await i.tick()}for(const a of s.listUpdated){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_UPDATED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_UPDATED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,c,s))),await i.tick()}for(const a of s.listRemoved){const c=s.project.get(a.id)||s.project.getDeleted(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_REMOVED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_REMOVED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,c,s))),await i.tick()}return await Promise.all(r),s}var TD=(s=>(s.Manual="manual",s.Automatic="automatic",s))(TD||{}),z=(s=>(s.Added="added",s.Updated="updated",s.Removed="removed",s.Affected="affected",s))(z||{}),_=(s=>(s.AddSuccessCall="add-success-call",s.AddErrorCall="add-error-call",s.AddCall="add-call",s.SetParent="set-parent",s.SetStandaloneParent="set-standalone-parent",s.AfterAllChildrenInitialized="after-all-children-initialized",s.UpdateWithShallowTransfer="update-with-shallow-transfer",s.UpdateWithGenerationTarget="update-with-generation-target",s.RemoveFromParent="remove-from-parent",s.RemoveEntity="remove-entity",s.RestoreEntity="restore-entity",s.CloneEntity="clone-entity",s.AddInput="add-input",s.RemoveInput="remove-input",s.SetDataType="set-data-type",s.RemoveDataType="remove-data-type",s.SetAdditionalPropertiesDataType="set-additional-properties-data-type",s.RemoveAdditionalPropertiesDataType="remove-additional-properties-data-type",s.SetAllPropertiesImplement="set-all-properties-implement",s.RemoveAllPropertiesImplement="remove-all-properties-implement",s.RemoveValueReader="remove-value-reader",s.AddValueReader="add-value-reader",s.RemoveValueWriter="remove-value-writer",s.SetValueWriter="set-value-writer",s.AddEntryCaller="add-entry-caller",s.AddSuccessCaller="add-success-caller",s.AddErrorCaller="add-error-caller",s.RemoveCall="remove-call",s.RemoveCaller="remove-caller",s.RemoveChildGroup="remove-child-group",s.AddToAndGroup="add-to-and-group",s.AddToOrGroup="add-to-or-group",s.RemoveUnrecognizedInputs="remove-unrecognized-inputs",s.RemoveUnrecognizedOutputs="remove-unrecognized-outputs",s.SyncInputs="sync-inputs",s.SyncOutputs="sync-outputs",s.SetImplements="set-implements",s.SetExtends="set-extends",s.SetExtension="set-extension",s.AddImplementation="add-implementation",s.RemoveImplementation="remove-implementation",s.AddProperty="add-property",s.RemoveProperty="remove-property",s.AddMethod="add-method",s.RemoveMethod="remove-method",s.AddAbstractMethod="add-abstract-method",s.RemoveAbstractMethod="remove-abstract-method",s.SetValueAsTypeSingle="set-value-as-type-single",s.SetValueAsTypeList="set-value-as-type-list",s.SetValueAsType="set-value-as-type",s.RemoveErrorCatching="remove-error-catching",s.RemoveAllErrorCallers="remove-all-error-callers",s.RemoveAllSuccessCallers="remove-all-success-callers",s.RemoveAllCallers="remove-all-callers",s.RemoveAllErrorCalls="remove-all-error-calls",s.SetDataTypeEntityValue="set-data-type-entity-value",s.MergeDataTypes="merge-data-types",s.SetDataTypeForeignKeyRef="set-data-type-foreign-key-ref",s.SetErrorEntity="set-error-entity",s.AddValueAsTypeToList="add-value-as-type-to-list",s.RemoveValueAsTypeFromList="remove-value-as-type-from-list",s.CreateFromGenerationTarget="create-from-generation-target",s.ConnectExternalAccount="connect-external-account",s.ChangeExternalAccountConnectionUsed="change-external-account-connection-used",s.MoveInlineDefToCanvas="move-inline-def-to-canvas",s.CreateDefFromValue="create-def-from-value",s.PrettifyCanvas="prettify-canvas",s.SetPrimitiveDefaultValue="set-primitive-default-value",s.MakeArgRequired="make-argument-required",s.MakeArgNonRequired="make-argument-non-required",s.RecalculateArg="recalculate-arg",s.RenameArg="rename-argument",s.ChangeArgDescription="changed-argument-description",s.RemoveArgBaseImplementation="remove-argument-base-implementation",s.AddArgBaseImplementation="add-argument-base-implementation",s.ChangeArgDataType="change-argument-data-type",s.RecalculateCondition="recalculate-condition",s.ChangeTypeOfCondition="change-type-of-condition",s.RenameDefinition="rename-definition",s.RecalculateDef="recalculate-definition",s.ChangeDefDescription="changed-definition-description",s.RemoveDefBaseImplementation="remove-definition-base-implementation",s.AddDefBaseImplementation="add-definition-base-implementation",s.RemoveDefExtension="remove-definition-extension",s.SetDefExtends="set-definition-extension",s.MakeDefStatic="make-def-static",s.MakeDefNonStatic="make-def-non-static",s.MakeDefAbstract="make-def-abstract",s.MakeDefNonAbstract="make-def-non-abstract",s.RecalculateFuncCall="recalculate-function-call",s.ChangeFuncCallDeclaration="change-function-call-declaration",s.RenameFuncDecl="rename-function-declaration",s.ChangeFuncDeclDescription="changed-function-declaration-description",s.RecalculateFuncDecl="recalculate-function-declaration",s.SetFuncDeclBaseImplementation="set-function-declaration-base-implementation",s.ChangeFuncDeclOutputDataType="change-function-declaration-output-data-type",s.RecalculateGlobalEvent="recalculate-global-event",s.ChangeGlobalEventDescription="changed-global-event-description",s.ChangeGlobalEventType="changed-global-event-type",s.RecalculateInputMap="recalculate-input",s.ChangeInputMapDescription="changed-input-description",s.ChangeInputMapDataType="change-input-data-type",s.RecalculateLoop="recalculate-loop",s.ChangeLoopType="changed-loop-type",s.ChangeLoopOutputDataType="change-loop-output-data-type",s.RecalculateOperation="recalculate-operation",s.ChangeOperationType="changed-operation-type",s.RecalculateOutputMap="recalculate-output",s.ChangeOutputMapDataType="change-output-data-type",s.RecalculateProperty="recalculate-property",s.MakePropertyRequired="make-property-required",s.MakePropertyNonRequired="make-property-non-required",s.MakePropertyConstant="make-property-constant",s.MakePropertyNonConstant="make-property-non-constant",s.MakePropertyUnique="make-property-unique",s.MakePropertyNonUnique="make-property-non-unique",s.MakePropertyStatic="make-property-static",s.MakePropertyNonStatic="make-property-non-static",s.MakePropertyAbstract="make-property-abstract",s.MakePropertyNonAbstract="make-property-non-abstract",s.RenameProperty="rename-property",s.ChangePropertyDescription="changed-property-description",s.RemovePropertyBaseImplementation="remove-property-base-implementation",s.AddPropertyBaseImplementation="add-property-base-implementation",s.ChangePropertyDataType="change-property-data-type",s.RecalculateSearch="recalculate-search",s.RenameSearch="rename-search",s.ChangeSearchDescription="changed-search-description",s.ChangeSearchQuery="changed-search-query",s.MakeValueDescriptorRequired="make-value-descriptor-required",s.MakeSearchInputRequired="make-search-input-required",s.MakeValueDescriptorNonRequired="make-value-descriptor-non-required",s.MakeSearchInputNonRequired="make-search-input-non-required",s.RenameValueDescriptor="rename-value-descriptor",s.RenameSearchInput="rename-search-input",s.ChangeValueDescriptorDescription="changed-value-descriptor-description",s.ChangeSearchInputDescription="changed-search-input-description",s.ChangeValueDescriptorDataType="change-value-descriptor-data-type",s.RecalculateVarDecl="recalculate-variable-declaration",s.MakeVarDeclConstant="make-variable-declaration-constant",s.MakeVarDeclNonConstant="make-variable-declaration-non-constant",s.RenameVarDecl="rename-variable-declaration",s.ChangeVarDeclDescription="changed-variable-declaration-description",s.ChangeVarDeclDataType="change-variable-declaration-data-type",s.RecalculateVarInst="recalculate-variable-instance",s.ChangeVarInstDeclaration="change-variable-instance-declaration",s.HideFuncDeclBody="hide-function-declaration-body",s.ShowFuncDeclBody="show-function-declaration-body",s.HideGlobalEventBody="hide-global-event-body",s.ShowGlobalEventBody="show-global-event-body",s.HideLoopBody="hide-loop-body",s.ShowLoopBody="show-loop-body",s.HideTriggerBody="hide-trigger-body",s.ShowTriggerBody="show-trigger-body",s.AddNestedAndCondition="add-nested-and-condition",s.AddInputToCondition="add-input-to-condition",s.RecalculateNode="recalculate-node",s.AddInputToFuncDecl="add-input-to-function-declaration",s.ChangeInternalCallToThrowErrors="change-internal-call-to-throw-errors",s.ChangeInternalCallToCatchErrors="change-internal-call-to-catch-errors",s.AddErrorOutputToInternalCall="add-error-output-to-internal-call",s.ChangeLoopToThrowErrors="change-loop-to-throw-errors",s.ChangeLoopToCatchErrors="change-loop-to-catch-errors",s.RecalculateLoopBody="recalculate-loop-body",s.RecalculateMethod="recalculate-method",s.AddArgToLoopBody="add-arg-to-loop-body",s.AddArgToMethod="add-arg-to-method",s.RecalculateNestedCondition="recalculate-nested-condition",s.ChangeNodeToThrowErrors="change-node-to-throw-errors",s.ChangeNodeToCatchErrors="change-node-to-catch-errors",s.ChangeOperationToThrowErrors="change-operation-to-throw-errors",s.ChangeOperationToCatchErrors="change-operation-to-catch-errors",s.ChangeFuncCallToThrowErrors="change-function-call-to-throw-errors",s.ChangeFuncCallToCatchErrors="change-function-call-to-catch-errors",s.ChangeSearchToThrowErrors="change-search-to-throw-errors",s.ChangeSearchToCatchErrors="change-search-to-catch-errors",s.ChangeVarDeclToThrowErrors="change-variable-declaration-to-throw-errors",s.ChangeVarDeclToCatchErrors="change-variable-declaration-to-catch-errors",s.ChangeVarInstToThrowErrors="change-variable-instance-to-throw-errors",s.ChangeVarInstToCatchErrors="change-variable-instance-to-catch-errors",s.AddErrorOutputToNode="add-error-output-to-node",s.AddErrorOutputToOperation="add-error-output-to-operation",s.AddErrorOutputToFuncCall="add-error-output-to-function-call",s.AddErrorOutputToSearch="add-error-output-to-search",s.AddErrorOutputToVarDecl="add-error-output-to-variable-declaration",s.AddErrorOutputToVarInst="add-error-output-to-variable-instance",s.AddInputToNode="add-input-to-node",s.AddInputToOperation="add-input-to-operation",s.AddInputToFuncCall="add-input-to-function-call",s.AddInputToSearch="add-input-to-search",s.AddPropertyToVarDecl="add-property-to-variable-declaration",s.AddPropertyToVarInst="add-property-to-variable-instance",s.AddMethodToDef="add-method-to-definition",s.ReSyncRowTransformer="re-sync-row-transformer",s.ManuallyAddRowTransformer="manually-add-row-transformer",s.AddPropertyToDef="add-property-to-definition",s.RestablishExternalAccountConnection="restablish-external-account-connection",s.AddThrownError="add-thrown-error",s.RecalculateTerminationStatement="recalculate-termination-statement",s.RecalculateReturnStmt="recalculate-return-statement",s.RecalculateContinueStmt="recalculate-continue-statement",s.RecalculateBreakStmt="recalculate-break-statement",s.AddPropertyToTerminationStatement="add-property-to-termination-statement",s.AddPropertyToReturnStmt="add-property-to-return-statement",s.AddPropertyToContinueStmt="add-property-to-continue-statement",s.AddPropertyToBreakStmt="add-property-to-break-statement",s.SetLiteralValueToExplicitlyEmpty="set-literal-value-to-explicitly-empty",s.ModifyLiteralValue="modify-literal-value",s.RemoveLiteralValue="remove-literal-value",s.ModifyLiteralValueAsType="modify-literal-value-as-type",s.UpdateProjectMetadata="update-project-metadata",s.RenameProject="rename-project",s.ChangeProjectDescription="change-project-description",s.RestoreNode="restore-node",s.RestoreDef="restore-definition",s.RestoreFuncDecl="restore-function-declaration",s.RestoreGlobalEvent="restore-global-event",s.RestoreSearch="restore-search",s.RestoreVarDecl="restore-variable-declaration",s.RestoreVarInst="restore-variable-instance",s.RestoreFuncCall="restore-function-call",s.RestoreOperation="restore-operation",s.RestoreCondition="restore-condition",s.RestoreReturnStmt="restore-return-statement",s.RestoreContinueStmt="restore-continue-statement",s.RestoreBreakStmt="restore-break-statement",s.RestoreInstalledProject="restore-installed-project",s.RestoreLoop="restore-loop",s.CreateNewDef="create-new-definition",s.CreateNewFuncDecl="create-new-function-declaration",s.CreateNewGlobalEvent="create-new-global-event",s.CreateNewSearch="create-new-search",s.CreateNewVarDecl="create-new-variable-declaration",s.CreateNewVarInst="create-new-variable-instance",s.CreateNewFuncCall="create-new-function-call",s.CreateNewOperation="create-new-operation",s.CreateNewCondition="create-new-condition",s.CreateNewReturnStmt="create-new-return-statement",s.CreateNewContinueStmt="create-new-continue-statement",s.CreateNewBreakStmt="create-new-break-statement",s.CreateNewInternalCall="create-new-internal-call",s.CreateNewLoop="create-new-loop",s.ImplementBuiltInFunctionalityAsDef="implement-built-in-functionality-as-definition",s.ImplementAbstractEntityAsDef="implement-abstract-entity-as-definition",s.ImplementNewHTTPEndpoint="implement-new-http-endpoint",s.ImplementNewScheduledTrigger="implement-new-scheduled-trigger",s.ImplementNewPersistedEntity="implement-new-persisted-entity",s.AddedNewRowTransformer="added-new-row-transformer",s.AddedSQLConnectionConfig="added-sql-connection-config",s.AddedNewSSLConnectionConfig="added-new-ssl-connection-config",s.AddedGoogleConnection="added-google-connection",s.AddedSlackConnection="added-slack-connection",s.AddedNewExternalAccountConnection="added-new-external-account-connection",s.AddedGoogleDriveConnection="added-google-drive-connection",s.AddedGoogleSheetsConnection="added-google-sheets-connection",s.AddedGoogleSlidesConnection="added-google-slides-connection",s.AddedGoogleMailConnection="added-gmail-connection",s.ManuallyCreateIndividualNode="manually-create-individual-node",s.UpdateNode="update-node",s.CreateNewProjectPublicationCompletedEvent="create-new-project-publication-completed-event",s.CreateNewCountedLoop="create-new-counted-loop",s.CreateNewListLoop="create-new-list-loop",s.CreateNewManualFlowLoop="create-new-manual-flow-loop",s.CreateNewObjectKeysLoop="create-new-object-keys-loop",s.CreateNewObjectValuesLoop="create-new-object-values-loop",s.CreateNewStringLoop="create-new-string-loop",s.CreateNewIsFalseCondition="create-new-is-false-condition",s.CreateNewIsTrueCondition="create-new-is-true-condition",s.CreateNewAndCondition="create-new-and-condition",s.CreateNewOrCondition="create-new-or-condition",s.DisconnectNodes="disconnect-nodes",s.DisconnectExecutions="disconnect-executions",s.DisconnectValues="disconnect-values",s.ConnectNodes="connect-nodes",s.ConnectExecution="connect-execution",s.ConnectValues="connect-values",s.ConnectValueToNewInput="connect-value-to-new-input",s.ConnectValueToNewOperationInput="connect-value-to-new-operation-input",s.ConnectValueToNewConditionInput="connect-value-to-new-condition-input",s.ConnectValueToNewSearchInput="connect-value-to-new-search-input",s.ConnectValueToNewVarDeclProperty="connect-value-to-new-variable-declaration-property",s.ConnectValueToNewVarInstProperty="connect-value-to-new-variable-instance-property",s.ConnectValueToNewReturnStmtProperty="connect-value-to-new-return-statement-property",s.ConnectValueToNewContinueStmtProperty="connect-value-to-new-continue-statement-property",s.ConnectValueToNewBreakStmtProperty="connect-value-to-new-break-statement-property",s.ConnectNewFuncDeclArgToValue="connect-new-function-argument-to-value",s.RemoveNodes="remove-nodes",s.RemoveNode="remove-node",s.InitialLoadAutomaticCanvasRefresh="initial-load-automatic-canvas-refresh",s.MoveNodes="move-nodes",s.MoveNode="move-node",s.CloneNodes="clone-nodes",s.CloneNode="clone-node",s.GenerateSQLMigrationOnPersistedEntityUpdate="generate-sql-migration-on-persisted-entity-update",s))(_||{}),Fe=(s=>(s.ActionOwnerEntityNotEditable="action-owner-entity-not-editable",s.ActionCounterpartEntityNotEditable="action-counterpart-entity-not-editable",s.ActionOwnerEntityNonDeletable="action-owner-entity-non-deletable",s.GlobalVariableDeclarationCannnotCatchError="global-variable-declaration-cannot-catch-error",s.GlobalVariableDeclarationCannotReadValue="global-variable-declaration-cannot-read-value",s.GlobalVariableDeclarationCannotBeCalled="global-variable-declaration-cannot-be-called",s.GlobalVariableDeclarationCannotCallFromError="global-variable-declaration-cannot-call-from-error",s.ValueReadingOverridesConstantProperty="value-reading-overrides-constant-property",s.DefaultValueOverridesConstantProperty="default-value-overrides-constant-property",s.ValueReadingOverridesConstantVariable="value-reading-overrides-constant-variable",s.DefaultValueOverridesConstantVariable="default-value-overrides-constant-variable",s.CannotSuccessCallItself="cannot-success-call-itself",s.CannotErrorCallItself="cannot-error-call-itself",s.CannotEntryCallItself="cannot-entry-call-itself",s.CannotValueWriteItself="cannot-value-write-itself",s.CannotBeCalledBeforeDeclaration="cannot-be-called-before-declaration",s.CannotBeCalledInParallelBranchToDeclaration="cannot-be-called-in-parallel-branch-to-declaration",s.CannotBeHigherScopeThanDeclaration="cannot-be-higher-scope-than-declaration",s.InputsInGlobalVariableDeclarationsCannotReadValues="inputs-in-global-variable-declarations-cannot-read-values",s))(Fe||{});class vNe{constructor({id:u,action:i,errorReason:r,owner:a,counterpart:c,rootAction:e},f){D(this,"id");D(this,"action");D(this,"errorReason");D(this,"owner",null);D(this,"counterpart",null);D(this,"rootAction",!1);D(this,"parent");this.id=u,this.action=i,this.errorReason=r||null,this.owner=a||null,this.counterpart=c||null,this.rootAction=e||!1,this.parent=f}}class Z extends X.Events{constructor(i,r,a,c,e=!1,f=""){super(f?f+"-cs-events":"anonymous-cs-events");D(this,"id",L.UUID.uuid());D(this,"seenEntities",[]);D(this,"added",{});D(this,"updated",{});D(this,"removed",{});D(this,"affected",{});D(this,"self",null);D(this,"author");D(this,"timestamp");D(this,"open",!0);D(this,"startedClose",!1);D(this,"dirty",!0);D(this,"submitting",!1);D(this,"lockedVersions",!1);D(this,"type","manual");D(this,"autoclose",!1);D(this,"actionName","");D(this,"project");D(this,"events",new Map);D(this,"ignoreNonEditable",!1);D(this,"ignoreNonDeletable",!1);D(this,"logger");if(this.project=i,this.author=r||L.sessionAuthor||"",this.timestamp=a,this.self=c,this.autoclose=e,this.actionName=f,this.logger=X.Logger.module("cs:"+(this.actionName?this.actionName+":":"")+this.id),this.autoclose&&!this.actionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get index(){const i=this.project.history.indexOf(this);return i===-1?null:i}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var i;return!(this.isEmpty&&this.self&&!this.affected[(i=this.self)==null?void 0:i.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get listAffected(){return Object.values(this.affected)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}event(i){this.logger.log(`ChangeSet Event: ${i.action} (${i.id})`);const r=new vNe(i,this);this.events.set(i.id,r),this.emit("change-set-event",r)}discardOrphans(){this.added[this.project.id]&&(this.updatedIds.forEach(e=>{const f=this.updated[e];this.added[e]=f,delete this.updated[e]}),this.removedIds.forEach(e=>{this.remove(e)}));const i=[...this.addedIds,...this.updatedIds],a=this.project.toFlatIds().filter(e=>!this.project.diggestedBuiltInBaseEntitiesIds.has(e));if(i.filter(e=>!a.includes(e)).forEach(e=>{const f=this.get(e);this.logger.warn(`[discardOrphans] Entity ${f==null?void 0:f.type} with id "${e}" present in change-set but not in project. Removing from change-set.`),this.remove(e)}),this.added[this.project.id]){const e=[...this.addedIds,...this.updatedIds];this.project.toFlatIds().filter(v=>!this.project.diggestedBuiltInBaseEntitiesIds.has(v)).filter(v=>!e.includes(v)).forEach(v=>{const b=this.project.get(v);this.add(b,"added")})}}async discardOrphansAsync(i={}){const r=X.YieldTracker.from(i),a=this.project.toFlatIds();if(this.added[this.project.id]){for(const h of this.updatedIds){const m=this.updated[h];this.added[h]=m,delete this.updated[h],await r.tick()}for(const h of this.removedIds)this.remove(h),await r.tick()}const c=[...this.addedIds,...this.updatedIds],e=a.filter(h=>!this.project.diggestedBuiltInBaseEntitiesIds.has(h)),f=c.filter(h=>!e.includes(h));for(const h of f){const m=this.get(h);this.logger.warn(`[discardOrphansAsync] Entity ${m==null?void 0:m.type} with id "${h}" present in change-set but not in project. Removing from change-set.`),this.remove(h),await r.tick()}if(this.added[this.project.id]){const h=[...this.addedIds,...this.updatedIds],v=a.filter(b=>!this.project.diggestedBuiltInBaseEntitiesIds.has(b)).filter(b=>!h.includes(b));for(const b of v){const A=this.project.get(b);this.add(A,"added"),await r.tick()}}}captureAllChangesInVersionInstances(){[...this.addedIds,...this.updatedIds].forEach(r=>{const a=this.project.get(r);if(!a){const e=this.added[r],f=this.updated[r],h=e||f;throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${r}" was ${e?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()}),this.removedIds.forEach(r=>{const a=this.project.getDeleted(r);if(!a){const e=this.removed[r];throw new Error(`Entity ${(e==null?void 0:e.type)||"of unknown type"} with id "${r}" was removed but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()})}async captureAllChangesInVersionInstancesAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds];for(const c of a){const e=this.project.get(c);if(!e){const h=this.added[c],m=this.updated[c],v=h||m;throw new Error(`Entity ${(v==null?void 0:v.type)||"of unknown type"} with id "${c}" was ${h?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}for(const c of this.removedIds){const e=this.project.getDeleted(c);if(!e){const h=this.removed[c];throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${c}" was removed but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}}async attemptAutocloseAsync(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&await this.closeAsync(),this}async closeAsync(i={}){const r=X.YieldTracker.from(i),a={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;const c=i.awaitBeforeClose??!0,e=i.awaitExternalPersist??!0;return this.startedClose||(this.startedClose=!0,c?await this.beforeCloseAsync({tracker:r}):this.beforeCloseAsync({tracker:r})),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],await this.discardOrphansAsync({tracker:r}),await this.sanitizeAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r}),this.lockedVersions||(await this.captureAllChangesInVersionInstancesAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r})),this.open=!1,this.isEmpty?(this.logger.warn(`[ChangeSet.closeAsync] Empty change-set (${this.id}) discarded upon closing.`),this.dirty=!1,this.project.discardChangeSet(this),this.logger.log("[ChangeSet.closeAsync] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this):(this.project.emit(ki.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),e?a.persistType==="parallel"?await this.project.persistChangeSetInParallel(this):await this.project.persistChangeSetSequentially(this):a.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this)}attemptAutoclose(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&this.close(),this}recursiveCaptureUpstreamVersions(){if(this.lockedVersions)return;[...this.addedIds,...this.updatedIds,...this.removedIds].forEach(r=>{const a=this.get(r),{added:c,updated:e,removed:f,affected:h}=a.recursiveCaptureUpstreamVersions(this.timestamp);for(const m of c)this.add(m,"added");for(const m of e)this.add(m,"updated");for(const m of f)this.add(m,"removed");for(const m of h)this.add(m,"affected")})}async recursiveCaptureUpstreamVersionsAsync(i={}){if(this.lockedVersions)return;const r=X.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds,...this.removedIds];for await(const c of a){const e=this.get(c),{added:f,updated:h,removed:m,affected:v}=e.recursiveCaptureUpstreamVersions(this.timestamp);for(const b of f)this.add(b,"added");for(const b of h)this.add(b,"updated");for(const b of m)this.add(b,"removed");for(const b of v)this.add(b,"affected");await r.tick()}}sanitize(){this.listAdded.forEach(i=>{i.previousVersion=null})}async sanitizeAsync(i={}){const r=X.YieldTracker.from(i);for(const a of this.listAdded)a.previousVersion=null,await r.tick()}syncDependents(){return[...this.list,...this.listAffected].forEach(i=>{const r=this.project.get(i.id);!r||r.deleted||OI(r,this.project)||r==null||r.syncDependents(this)}),this}async syncDependentsAsync(i={}){const r=X.YieldTracker.from(i);for(const a of[...this.list,...this.listAffected]){const c=this.project.get(a.id);!c||c.deleted||OI(c,this.project)||(c==null||c.syncDependents(this),await r.tick())}return this}async beforeCloseAsync(i={}){const r=X.YieldTracker.from(i);await this.project.emitAsync(ki.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),await this.syncDependentsAsync({tracker:r}),await this.emitAsyncProjectSideEffects({tracker:r}),await this.project.emitAsync(ki.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}beforeClose(){this.project.emit(ki.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),this.syncDependents(),this.emitProjectSideEffects(),this.project.emit(ki.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}teardown(){this.destroy()}emitProjectSideEffects(){return mNe(this)}async emitAsyncProjectSideEffects(i={}){return TNe(this,i)}close(i={}){const r={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;if(this.startedClose||(this.startedClose=!0,this.beforeClose()),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.discardOrphans(),this.sanitize(),this.captureAllChangesInVersionInstances(),this.lockedVersions||(this.recursiveCaptureUpstreamVersions(),this.captureAllChangesInVersionInstances()),this.open=!1,this.isEmpty)return this.logger.warn(`[ChangeSet.close] Empty change-set (${this.id}) discarded upon closing.`),this.project.discardChangeSet(this),this.logger.log("[ChangeSet.close] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this;if(this.added[this.project.id]&&this.updatedIds.length)throw new Error("No 'updated' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(this.added[this.project.id]&&this.removedIds.length)throw new Error("No 'removed' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(!this.updated[this.project.id]&&!this.added[this.project.id])throw new Error("Change-set must also have the project entity as 'updated' or 'added'. All changes must propagate upstream until the root project entity.");return this.project.emit(ki.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),r.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this}addDependentsToAffected(i){Object.values(i.detachedDependents).forEach(r=>{const{entity:a,field:c}=r;this.has(a.id)||this.add(a,"affected")})}get(i){return this.added[i]?this.added[i]:this.updated[i]?this.updated[i]:this.removed[i]?this.removed[i]:null}remove(i){return this.has(i)&&(delete this.added[i],delete this.updated[i],delete this.removed[i],delete this.affected[i],this.seenEntities=this.seenEntities.filter(r=>r!==i)),this}add(i,r,a={preventRecursion:!1}){var e,f,h,m;if(!this.open||!this.dirty)return this;if(OI(i,this.project))return this;if(this.seenEntities.indexOf(i.id)===-1&&this.seenEntities.push(i.id),r==="removed"){if(this.added[i.id])return delete this.added[i.id],delete this.affected[i.id],delete this.updated[i.id],this.seenEntities=this.seenEntities.filter(b=>b!==i.id),delete this.project.deletedInstances[i.id],this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasRemoved(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.captureVersion();const v=(e=i.knownVersions)==null?void 0:e.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.removed[i.id]=v,this}if(r==="added"){if(this.removed[i.id])return this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasAdded(i.id)&&!this.lockedVersions&&!a.preventRecursion){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.previousVersion=null,i.captureVersion();const v=(f=i.knownVersions)==null?void 0:f.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.added[i.id]=v,delete this.affected[i.id],this.addDependentsToAffected(i),this}if(r==="updated"){if(this.removed[i.id])return this;if(this.added[i.id])return i.captureVersion(),this.addDependentsToAffected(i),this;if(this.affected[i.id]&&delete this.affected[i.id],!this.hasUpdated(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.activeVersion=!0,i.captureVersion();const v=(h=i.knownVersions)==null?void 0:h.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.updated[i.id]=v,this.addDependentsToAffected(i),this}if(r==="affected"){if(this.removed[i.id])return this;if(this.added[i.id])return this;if(this.updated[i.id])return this;if(this.affected[i.id]=i,!this.lockedVersions){const v=i.version+"--"+this.id,b=((m=i.knownVersions)==null?void 0:m.get(v))||i.snapshot();i.apply(b),i.knownVersions=i.knownVersions?i.knownVersions.set(v,b):new Map().set(v,b)}}return this}toJSON(){var f;const i={},r={},a={},c=new Set;for(const h of Object.values(this.added))i[h.id]=h.toShallowJSON();for(const h of Object.values(this.updated))r[h.id]=h.toShallowJSON();for(const h of Object.values(this.removed))a[h.id]=h.toShallowJSON();for(const h of Object.values(this.affected))c.add(h.id);const e=this.get(((f=this.self)==null?void 0:f.id)||"");return{added:i,updated:r,removed:a,affected:Array.from(c),self:e?e.toShallowJSON():null,seenEntities:this.seenEntities,actionName:this.actionName}}has(i){return!!this.added[i]||!!this.removed[i]||!!this.updated[i]||!!this.affected[i]}hasAdded(i){return!!this.added[i]}hasUpdated(i){return!!this.updated[i]}hasRemoved(i){return!!this.removed[i]}hasAffected(i){return!!this.affected[i]}}function bRi(s){return new Set([...Object.keys(s.added),...Object.keys(s.updated),...Object.keys(s.removed),...Array.from(s.affected)])}function PP(s,u,i){var f;const r=new Date().toISOString(),a=new Z(i,L.sessionAuthor,r,i);if(a.lockedVersions=!0,s===u)throw X.Logger.error("From: ",s),X.Logger.error("To: ",u),new Error("Cannot generate transitional change set between the same two versions or change-sets");let c;if(s==="initial"?c=!0:u==="initial"?c=!1:U(s.timestamp).isBefore(U(u.timestamp))?c=!0:c=!1,X.Logger.log("Transitioning from ",s==="initial"?"initial":s.index),X.Logger.log("Transitioning to ",u==="initial"?"initial":u.index),X.Logger.log("Is forward: ",c),c){const h=u,m=h.index,v=s==="initial"?0:s.index;X.Logger.log("ownIndex: ",m),X.Logger.log("startIndex: ",v),X.Logger.log("CH ID: ",h.id);const b=m===v?[i.history[m]]:i.history.slice(v+1,m+1);if(b.sort((A,w)=>U(A.timestamp).isAfter(U(w.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");X.Logger.log("REDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{NP(A,w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),R.addSelfToProject(a),a.timestamp=R.createdAt,a.add(R,z.Added,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})},w=>{var $;const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),($=R.removeFromParent)==null||$.call(R,a),R.unsubscribe(),R.unsubscribeFromDependencies(),i.subscribeDeletedInstance(R),a.timestamp=R.createdAt,a.add(R,z.Removed,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);const $=w.version+"--"+A.id;R.restoreVersion($),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})})})}else{const h=s,m=h.index,v=u==="initial"?0:u.index;X.Logger.log("CH ID: ",h.id);const b=m===v?[i.history[m]]:i.history.slice(v+1,m+1);if(b.sort((A,w)=>U(w.timestamp).isAfter(U(A.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");X.Logger.log("UNDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{NP(A,w=>{var $;const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);w.previousVersion&&(R.restoreVersion(w.previousVersion),($=R.removeFromParent)==null||$.call(R,a),R.unsubscribe(),R.unsubscribeFromDependencies(),i.subscribeDeletedInstance(R)),a.timestamp=R.createdAt,a.add(R,z.Removed,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.previousVersion),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.previousVersion),R.addSelfToProject(a),a.timestamp=R.createdAt,a.add(R,z.Added,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(R.version),a.timestamp=R.createdAt,a.add(R,z.Affected,{preventRecursion:!0})})})}let e;if(u==="initial"){const h=Array.from(((f=i.knownVersions)==null?void 0:f.values())||[]).reduce((m,v)=>!m||U(v.createdAt).isBefore(U(m.createdAt))?v:m,null);if(!h)throw new Error("No oldest version found");e=h.createdAt}else e=u.timestamp;return a.open=!1,{transitionalChangeSet:a,transitionTime:r,timeOfOriginalTargetChanges:e}}function NP(s,u,i,r,a){var h;if(!(s!=null&&s.self))throw new Error("Change set must have a valid `self` entity state to be traversed");const c=((h=s.self)==null?void 0:h.type)===d.Project?s.self:s.self.project,e=new Qn(s.self,{allBuiltInEntityIds:c.diggestedBuiltInBaseEntitiesIds});X.Logger.log("changeSet.added: ",Object.keys(s.added).length),X.Logger.log("changeSet.updated: ",Object.keys(s.updated).length),X.Logger.log("changeSet.removed: ",Object.keys(s.removed).length);const f={...s.added,...s.updated,...s.removed,...s.affected};e.order=Object.keys(f),e.flatRecord=f,e.orderEntities(),X.Logger.log("All entities: ",e.order.map((m,v)=>`${v+1}: ${f[m].type} - ${m}`).join(`,
|
|
6
|
+
Please provide a unique 'name' string.`,severity:Ee.Error,code:Pe.NameNotUniqueInScope}))}}return i}function eRi(s,u){switch(s.type){case d.DefinitionEntity:return $$(s,u);case d.FunctionDeclaration:return L$(s,u);case d.VariableDeclaration:return B$(s,u);case d.Property:return M$(s,u);case d.ArgumentDeclaration:return G$(s,u);default:return[]}}function yc(s,u){var r;const i=s;switch(s.type){case d.FunctionCall:case d.InternalCall:return ss(s.declaration,u).codeName;case d.ActionDescriptor:case d.DefinitionEntity:case d.VariableDeclaration:case d.ValueDescriptor:case d.FunctionDeclaration:return s.codeName||null;case d.Property:case d.ArgumentDeclaration:{if(s.codeName)return s.codeName;if((r=s.implements)!=null&&r.length){const a=s.implements.find(c=>{const e=ss(c,u);return!!(e!=null&&e.codeName)});if(a)return ss(a,u).codeName||null}break}case d.InputMap:case d.OutputMap:case d.VariableInstance:{if(s.declaration){const a=ss(s.declaration,u);return yc(a,u)||""}break}}return i.codeName||null}function k$(s,u,i=" "){let r=s;if(!!u.some(c=>c===r)){const c=s.split(i),e=c.pop()||"",f=parseInt(e);return!isNaN(f)?c.push(`${f+1}`):(c.push(e),c.push("1")),r=c.join(i),k$(r,u,i)}return r}function ap(s,u,i=" "){let r=s;if(!!u.some(c=>c.name===r)){const c=s.split(i),e=c.pop()||"",f=parseInt(e);return!isNaN(f)?c.push(`${f+1}`):(c.push(e),c.push("1")),r=c.join(i),ap(r,u,i)}return r}function pNe(s,u){const r=s.project.getDefinitionEntities(new Set([s.id])).filter(a=>a.id!==s.id&&a.name.toLowerCase()===s.name.toLowerCase());if(r.length){const a=ap(s.name,r);s.metaSync({name:a},u)}}function tRi(s){switch(s){case _t.List:return"Loop over list items";case _t.ManualFlow:return"Manual flow control loop";case _t.ObjectKeys:return"Loop over object keys";case _t.ObjectValues:return"Loop over object values";case _t.Counted:return"Loop given number of times";case _t.String:return"Loop over text characters";case ui.PrimitiveEqual:return"Is equal to";case ui.PrimitiveNotEqual:return"Is not equal to";case ui.Empty:return"Is empty";case ui.NotEmpty:return"Is present";case _e.DeleteKey:return"Delete property from object";case _e.DeleteNestedKey:return"Delete nested property from object";case _e.HasKey:return"Check if object has property";case _e.HasNestedKey:return"Check if object has nested property";case _e.IsInstanceOfType:return"Check if object is instance of type";case _e.KeyValueEquals:return"Check if object property equals value";case _e.NestedKeyValueEquals:return"Check if object nested property equals value";case _e.ReadKey:return"Read property from object";case _e.ReadNestedKey:return"Read nested property from object";case _e.Validate:return"Validate object structure";case _e.WriteKey:return"Write property to object";case _e.WriteNestedKey:return"Write nested property to object";case _e.WriteSafeNestedKeyRecursively:return"Write safe nested property to object recursively";case _e.Merge:return"Merge objects";case _e.Entries:return"Get a list with the object keys, and values";case _e.Keys:return"Get a list with the object keys";case _e.Values:return"Get a list with the object values";case et.DecodeBase64:return"Decode Base64 text to bytes";case et.EncodeBase64:return"Encode bytes to Base64 text";case et.DecodeBase64Url:return"Decode Base64URL text to bytes";case et.EncodeBase64Url:return"Encode bytes to Base64URL text";case et.DecodeHex:return"Decode Hex text to bytes";case et.EncodeHex:return"Encode bytes to Hex text";case et.FromBytesToString:return"Convert bytes to text";case et.ToBytes:return"Convert text to bytes";case et.ToString:return"Convert value to text";case et.GetTypeOf:return"Get data type of value";case et.ToNumber:return"Convert value to number";case ce.Addition:return"Sum numbers";case ce.Subtraction:return"Subtract numbers";case ce.Multiplication:return"Multiply numbers";case ce.Division:return"Divide numbers";case ce.Remainder:return"Get remainder of numbers";case ce.Absolute:return"Get absolute value of numbers";case ce.Acos:return"Get arc cosine of numbers";case ce.Asin:return"Get arc sine of numbers";case ce.Atan:return"Get arc tangent of numbers";case ce.Ceil:return"Round numbers up";case ce.Cos:return"Get cosine of numbers";case ce.Floor:return"Round numbers down";case ce.LogNatural:return"Get natural logarithm of numbers";case ce.Log10:return"Get base-10 logarithm of numbers";case ce.MaxOf:return"Get maximum of numbers";case ce.MinOf:return"Get minimum of numbers";case ce.Round:return"Round numbers to nearest integer";case ce.Sin:return"Get sine of numbers";case ce.SquareRoot:return"Get square root of numbers";case ce.Tan:return"Get tangent of numbers";case ce.Negate:return"Negate numbers";case ce.Atan2:return"Get arc tangent of two numbers";case ce.Exp:return"Get exponential of numbers";case ce.Average:return"Get average of numbers";case ce.Clamp:return"Clamp numbers within range";case ce.CubeRoot:return"Get cube root of numbers";case ce.LessThan:return"Check if numbers are less than";case ce.LessThanOrEqual:return"Check if numbers are less than or equal to";case ce.MoreThan:return"Check if numbers are more than";case ce.MoreThanOrEqual:return"Check if numbers are more than or equal to";case ce.MapRange:return"Map numbers from one range to another";case ce.Median:return"Get median of numbers";case ce.NthRoot:return"Get nth root of numbers";case ce.PercentOf:return"Get percentage of numbers";case ce.PercentageChange:return"Get percentage change between numbers";case ce.RoundToDecimals:return"Round numbers to given decimal places";case ce.Sign:return"Get sign of numbers";case ce.SnapToStep:return"Snap numbers to nearest step";case st.GenerateRandomBase64:return"Generate random Base64 text";case st.GenerateRandomBytes:return"Generate random bytes";case st.GenerateRandomFloat:return"Generate random decimal number";case st.GenerateRandomInteger:return"Generate random whole number";case st.GenerateRandomHexadecimal:return"Generate random hexadecimal text";case st.GenerateRandomUUIDv4:return"Generate random UUID v4";case st.GenerateShortIdentifier:return"Generate short unique identifier";case ao.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return null}}function cNe(s,u,i){const a=`${BI(s)}-${u}-id`;return i.instances[a]?L.UUID.uuid():a}function OP(s,u){let i="",r=null;if(s.parent){const c=u.get(s.parent);c&&(r=c)}let a="";return r&&(a=`${BI(ye(r,u))}-`),i=`${a}${BI(ye(s,u))}-id`,u.instances[i]?L.UUID.uuid():i}function Gn(s,u,i="uuid"){return i==="semantic"?cNe(ye(s,u),s.type,u):L.UUID.uuid()}const iRi=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function U$(s){return typeof s=="string"&&iRi.test(s)}const rRi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function _P(s){return typeof s=="string"&&rRi.test(s)}function nRi(s){return s instanceof Error&&s.name==="ZodError"&&"issues"in s&&Array.isArray(s.issues)}var aRi=class extends Error{constructor(u,i){super(u,i);D(this,"name");D(this,"details");this.name="ZodValidationError",this.details=sRi(i)}toString(){return this.message}};function sRi(s){if(s){const u=s.cause;if(nRi(u))return u.issues}return[]}function lRi(s){return s.length!==0}function Cj(s){return s.description??""}var oRi=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function dRi(s){if(s.length===1){let u=s[0];return typeof u=="symbol"&&(u=Cj(u)),u.toString()||'""'}return s.reduce((u,i)=>{if(typeof i=="number")return u+"["+i.toString()+"]";if(typeof i=="symbol"&&(i=Cj(i)),i.includes('"'))return u+'["'+uRi(i)+'"]';if(!oRi.test(i))return u+'["'+i+'"]';const r=u.length===0?"":".";return u+r+i},"")}function uRi(s){return s.replace(/"/g,'\\"')}var pRi="; ",cRi=99,fNe="Validation error",fRi=": ",yRi=", or ";function hRi(s={}){const{issueSeparator:u=pRi,unionSeparator:i=yRi,prefixSeparator:r=fRi,prefix:a=fNe,includePath:c=!0,maxIssuesInMessage:e=cRi}=s;return f=>{const h=f.slice(0,e).map(m=>fI({issue:m,issueSeparator:u,unionSeparator:i,includePath:c})).join(u);return mRi(h,a,r)}}function fI(s){const{issue:u,issueSeparator:i,unionSeparator:r,includePath:a}=s;if(u.code===Ct.invalid_union)return u.unionErrors.reduce((c,e)=>{const f=e.issues.map(h=>fI({issue:h,issueSeparator:i,unionSeparator:r,includePath:a})).join(i);return c.includes(f)||c.push(f),c},[]).join(r);if(u.code===Ct.invalid_arguments)return[u.message,...u.argumentsError.issues.map(c=>fI({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(u.code===Ct.invalid_return_type)return[u.message,...u.returnTypeError.issues.map(c=>fI({issue:c,issueSeparator:i,unionSeparator:r,includePath:a}))].join(i);if(a&&lRi(u.path)){if(u.path.length===1){const c=u.path[0];if(typeof c=="number")return`${u.message} at index ${c}`}return`${u.message} at "${dRi(u.path)}"`}return u.message}function mRi(s,u,i){return u!==null?s.length>0?[u,s].join(i):u:s.length>0?s:fNe}function TRi(s,u={}){const r=vRi(u)([s]);return new aRi(r,{cause:new ru([s])})}function vRi(s){return"messageBuilder"in s?s.messageBuilder:hRi(s)}async function yNe(s,u={}){var c;const i=X.YieldTracker.from(u),r=[...ta(s),...ks(s)];await i.tick();const a=vi(s.errors,r);return await((c=s.dataType)==null?void 0:c.validateAsync({tracker:i})),a}function hNe(s){var i;(i=s.dataType)==null||i.validate();const u=[...ta(s),...ks(s)];return vi(s.errors,u)}const ERi=Object.freeze(Object.defineProperty({__proto__:null,validate:hNe,validateAsync:yNe},Symbol.toStringTag,{value:"Module"}));function mNe(s){return s.listAdded.forEach(u=>{const i=s.project.get(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_ADDED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_ADDED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,i,s))}),s.listUpdated.forEach(u=>{const i=s.project.get(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_UPDATED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_UPDATED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,i,s))}),s.listRemoved.forEach(u=>{const i=s.project.get(u.id)||s.project.getDeleted(u.id);(i==null?void 0:i.type)===d.DefinitionEntity&&i.parent.type!==d.DataType&&(s.project.emit(ki.EXPLICIT_DEFINITION_ENTITY_REMOVED,i,s),Ni(i,be.PERSISTED_ENTITY)?s.project.emit(ki.PERSISTED_DEFINITION_ENTITY_REMOVED,i,s):Ni(i,be.RELATIONAL_DATABASE)&&s.project.emit(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,i,s))}),s}async function TNe(s,u={}){const i=X.YieldTracker.from(u),r=[];for(const a of s.listAdded){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_ADDED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_ADDED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_ADDED,c,s))),await i.tick()}for(const a of s.listUpdated){const c=s.project.get(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_UPDATED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_UPDATED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_UPDATED,c,s))),await i.tick()}for(const a of s.listRemoved){const c=s.project.get(a.id)||s.project.getDeleted(a.id);(c==null?void 0:c.type)===d.DefinitionEntity&&c.parent.type!==d.DataType&&(r.push(s.project.emitAsync(ki.EXPLICIT_DEFINITION_ENTITY_REMOVED,c,s)),Ni(c,be.PERSISTED_ENTITY)?r.push(s.project.emitAsync(ki.PERSISTED_DEFINITION_ENTITY_REMOVED,c,s)):Ni(c,be.RELATIONAL_DATABASE)&&r.push(s.project.emitAsync(ki.RELATIONAL_DATABASE_DEFINITION_ENTITY_REMOVED,c,s))),await i.tick()}return await Promise.all(r),s}var TD=(s=>(s.Manual="manual",s.Automatic="automatic",s))(TD||{}),z=(s=>(s.Added="added",s.Updated="updated",s.Removed="removed",s.Affected="affected",s))(z||{}),_=(s=>(s.AddSuccessCall="add-success-call",s.AddErrorCall="add-error-call",s.AddCall="add-call",s.SetParent="set-parent",s.SetStandaloneParent="set-standalone-parent",s.AfterAllChildrenInitialized="after-all-children-initialized",s.UpdateWithShallowTransfer="update-with-shallow-transfer",s.UpdateWithGenerationTarget="update-with-generation-target",s.RemoveFromParent="remove-from-parent",s.RemoveEntity="remove-entity",s.RestoreEntity="restore-entity",s.CloneEntity="clone-entity",s.AddInput="add-input",s.RemoveInput="remove-input",s.SetDataType="set-data-type",s.RemoveDataType="remove-data-type",s.SetAdditionalPropertiesDataType="set-additional-properties-data-type",s.RemoveAdditionalPropertiesDataType="remove-additional-properties-data-type",s.SetAllPropertiesImplement="set-all-properties-implement",s.RemoveAllPropertiesImplement="remove-all-properties-implement",s.RemoveValueReader="remove-value-reader",s.AddValueReader="add-value-reader",s.RemoveValueWriter="remove-value-writer",s.SetValueWriter="set-value-writer",s.AddEntryCaller="add-entry-caller",s.AddSuccessCaller="add-success-caller",s.AddErrorCaller="add-error-caller",s.RemoveCall="remove-call",s.RemoveCaller="remove-caller",s.RemoveChildGroup="remove-child-group",s.AddToAndGroup="add-to-and-group",s.AddToOrGroup="add-to-or-group",s.RemoveUnrecognizedInputs="remove-unrecognized-inputs",s.RemoveUnrecognizedOutputs="remove-unrecognized-outputs",s.SyncInputs="sync-inputs",s.SyncOutputs="sync-outputs",s.SetImplements="set-implements",s.SetExtends="set-extends",s.SetExtension="set-extension",s.AddImplementation="add-implementation",s.RemoveImplementation="remove-implementation",s.AddProperty="add-property",s.RemoveProperty="remove-property",s.AddMethod="add-method",s.RemoveMethod="remove-method",s.AddAbstractMethod="add-abstract-method",s.RemoveAbstractMethod="remove-abstract-method",s.SetValueAsTypeSingle="set-value-as-type-single",s.SetValueAsTypeList="set-value-as-type-list",s.SetValueAsType="set-value-as-type",s.RemoveErrorCatching="remove-error-catching",s.RemoveAllErrorCallers="remove-all-error-callers",s.RemoveAllSuccessCallers="remove-all-success-callers",s.RemoveAllCallers="remove-all-callers",s.RemoveAllErrorCalls="remove-all-error-calls",s.SetDataTypeEntityValue="set-data-type-entity-value",s.MergeDataTypes="merge-data-types",s.SetDataTypeForeignKeyRef="set-data-type-foreign-key-ref",s.SetErrorEntity="set-error-entity",s.AddValueAsTypeToList="add-value-as-type-to-list",s.RemoveValueAsTypeFromList="remove-value-as-type-from-list",s.CreateFromGenerationTarget="create-from-generation-target",s.ConnectExternalAccount="connect-external-account",s.ChangeExternalAccountConnectionUsed="change-external-account-connection-used",s.MoveInlineDefToCanvas="move-inline-def-to-canvas",s.CreateDefFromValue="create-def-from-value",s.PrettifyCanvas="prettify-canvas",s.SetPrimitiveDefaultValue="set-primitive-default-value",s.MakeArgRequired="make-argument-required",s.MakeArgNonRequired="make-argument-non-required",s.RecalculateArg="recalculate-arg",s.RenameArg="rename-argument",s.ChangeArgDescription="changed-argument-description",s.RemoveArgBaseImplementation="remove-argument-base-implementation",s.AddArgBaseImplementation="add-argument-base-implementation",s.ChangeArgDataType="change-argument-data-type",s.RecalculateCondition="recalculate-condition",s.ChangeTypeOfCondition="change-type-of-condition",s.RenameDefinition="rename-definition",s.RecalculateDef="recalculate-definition",s.ChangeDefDescription="changed-definition-description",s.RemoveDefBaseImplementation="remove-definition-base-implementation",s.AddDefBaseImplementation="add-definition-base-implementation",s.RemoveDefExtension="remove-definition-extension",s.SetDefExtends="set-definition-extension",s.MakeDefStatic="make-def-static",s.MakeDefNonStatic="make-def-non-static",s.MakeDefAbstract="make-def-abstract",s.MakeDefNonAbstract="make-def-non-abstract",s.RecalculateFuncCall="recalculate-function-call",s.ChangeFuncCallDeclaration="change-function-call-declaration",s.RenameFuncDecl="rename-function-declaration",s.ChangeFuncDeclDescription="changed-function-declaration-description",s.RecalculateFuncDecl="recalculate-function-declaration",s.SetFuncDeclBaseImplementation="set-function-declaration-base-implementation",s.ChangeFuncDeclOutputDataType="change-function-declaration-output-data-type",s.RecalculateGlobalEvent="recalculate-global-event",s.ChangeGlobalEventDescription="changed-global-event-description",s.ChangeGlobalEventType="changed-global-event-type",s.RecalculateInputMap="recalculate-input",s.ChangeInputMapDescription="changed-input-description",s.ChangeInputMapDataType="change-input-data-type",s.RecalculateLoop="recalculate-loop",s.ChangeLoopType="changed-loop-type",s.ChangeLoopOutputDataType="change-loop-output-data-type",s.RecalculateOperation="recalculate-operation",s.ChangeOperationType="changed-operation-type",s.RecalculateOutputMap="recalculate-output",s.ChangeOutputMapDataType="change-output-data-type",s.RecalculateProperty="recalculate-property",s.MakePropertyRequired="make-property-required",s.MakePropertyNonRequired="make-property-non-required",s.MakePropertyConstant="make-property-constant",s.MakePropertyNonConstant="make-property-non-constant",s.MakePropertyUnique="make-property-unique",s.MakePropertyNonUnique="make-property-non-unique",s.MakePropertyStatic="make-property-static",s.MakePropertyNonStatic="make-property-non-static",s.MakePropertyAbstract="make-property-abstract",s.MakePropertyNonAbstract="make-property-non-abstract",s.RenameProperty="rename-property",s.ChangePropertyDescription="changed-property-description",s.RemovePropertyBaseImplementation="remove-property-base-implementation",s.AddPropertyBaseImplementation="add-property-base-implementation",s.ChangePropertyDataType="change-property-data-type",s.RecalculateSearch="recalculate-search",s.RenameSearch="rename-search",s.ChangeSearchDescription="changed-search-description",s.ChangeSearchQuery="changed-search-query",s.MakeValueDescriptorRequired="make-value-descriptor-required",s.MakeSearchInputRequired="make-search-input-required",s.MakeValueDescriptorNonRequired="make-value-descriptor-non-required",s.MakeSearchInputNonRequired="make-search-input-non-required",s.RenameValueDescriptor="rename-value-descriptor",s.RenameSearchInput="rename-search-input",s.ChangeValueDescriptorDescription="changed-value-descriptor-description",s.ChangeSearchInputDescription="changed-search-input-description",s.ChangeValueDescriptorDataType="change-value-descriptor-data-type",s.RecalculateVarDecl="recalculate-variable-declaration",s.MakeVarDeclConstant="make-variable-declaration-constant",s.MakeVarDeclNonConstant="make-variable-declaration-non-constant",s.RenameVarDecl="rename-variable-declaration",s.ChangeVarDeclDescription="changed-variable-declaration-description",s.ChangeVarDeclDataType="change-variable-declaration-data-type",s.RecalculateVarInst="recalculate-variable-instance",s.ChangeVarInstDeclaration="change-variable-instance-declaration",s.HideFuncDeclBody="hide-function-declaration-body",s.ShowFuncDeclBody="show-function-declaration-body",s.HideGlobalEventBody="hide-global-event-body",s.ShowGlobalEventBody="show-global-event-body",s.HideLoopBody="hide-loop-body",s.ShowLoopBody="show-loop-body",s.HideTriggerBody="hide-trigger-body",s.ShowTriggerBody="show-trigger-body",s.AddNestedAndCondition="add-nested-and-condition",s.AddInputToCondition="add-input-to-condition",s.RecalculateNode="recalculate-node",s.AddInputToFuncDecl="add-input-to-function-declaration",s.ChangeInternalCallToThrowErrors="change-internal-call-to-throw-errors",s.ChangeInternalCallToCatchErrors="change-internal-call-to-catch-errors",s.AddErrorOutputToInternalCall="add-error-output-to-internal-call",s.ChangeLoopToThrowErrors="change-loop-to-throw-errors",s.ChangeLoopToCatchErrors="change-loop-to-catch-errors",s.RecalculateLoopBody="recalculate-loop-body",s.RecalculateMethod="recalculate-method",s.AddArgToLoopBody="add-arg-to-loop-body",s.AddArgToMethod="add-arg-to-method",s.RecalculateNestedCondition="recalculate-nested-condition",s.ChangeNodeToThrowErrors="change-node-to-throw-errors",s.ChangeNodeToCatchErrors="change-node-to-catch-errors",s.ChangeOperationToThrowErrors="change-operation-to-throw-errors",s.ChangeOperationToCatchErrors="change-operation-to-catch-errors",s.ChangeFuncCallToThrowErrors="change-function-call-to-throw-errors",s.ChangeFuncCallToCatchErrors="change-function-call-to-catch-errors",s.ChangeSearchToThrowErrors="change-search-to-throw-errors",s.ChangeSearchToCatchErrors="change-search-to-catch-errors",s.ChangeVarDeclToThrowErrors="change-variable-declaration-to-throw-errors",s.ChangeVarDeclToCatchErrors="change-variable-declaration-to-catch-errors",s.ChangeVarInstToThrowErrors="change-variable-instance-to-throw-errors",s.ChangeVarInstToCatchErrors="change-variable-instance-to-catch-errors",s.AddErrorOutputToNode="add-error-output-to-node",s.AddErrorOutputToOperation="add-error-output-to-operation",s.AddErrorOutputToFuncCall="add-error-output-to-function-call",s.AddErrorOutputToSearch="add-error-output-to-search",s.AddErrorOutputToVarDecl="add-error-output-to-variable-declaration",s.AddErrorOutputToVarInst="add-error-output-to-variable-instance",s.AddInputToNode="add-input-to-node",s.AddInputToOperation="add-input-to-operation",s.AddInputToFuncCall="add-input-to-function-call",s.AddInputToSearch="add-input-to-search",s.AddPropertyToVarDecl="add-property-to-variable-declaration",s.AddPropertyToVarInst="add-property-to-variable-instance",s.AddMethodToDef="add-method-to-definition",s.ReSyncRowTransformer="re-sync-row-transformer",s.ManuallyAddRowTransformer="manually-add-row-transformer",s.AddPropertyToDef="add-property-to-definition",s.RestablishExternalAccountConnection="restablish-external-account-connection",s.AddThrownError="add-thrown-error",s.RecalculateTerminationStatement="recalculate-termination-statement",s.RecalculateReturnStmt="recalculate-return-statement",s.RecalculateContinueStmt="recalculate-continue-statement",s.RecalculateBreakStmt="recalculate-break-statement",s.AddPropertyToTerminationStatement="add-property-to-termination-statement",s.AddPropertyToReturnStmt="add-property-to-return-statement",s.AddPropertyToContinueStmt="add-property-to-continue-statement",s.AddPropertyToBreakStmt="add-property-to-break-statement",s.SetLiteralValueToExplicitlyEmpty="set-literal-value-to-explicitly-empty",s.ModifyLiteralValue="modify-literal-value",s.RemoveLiteralValue="remove-literal-value",s.ModifyLiteralValueAsType="modify-literal-value-as-type",s.UpdateProjectMetadata="update-project-metadata",s.RenameProject="rename-project",s.ChangeProjectDescription="change-project-description",s.RestoreNode="restore-node",s.RestoreDef="restore-definition",s.RestoreFuncDecl="restore-function-declaration",s.RestoreGlobalEvent="restore-global-event",s.RestoreSearch="restore-search",s.RestoreVarDecl="restore-variable-declaration",s.RestoreVarInst="restore-variable-instance",s.RestoreFuncCall="restore-function-call",s.RestoreOperation="restore-operation",s.RestoreCondition="restore-condition",s.RestoreReturnStmt="restore-return-statement",s.RestoreContinueStmt="restore-continue-statement",s.RestoreBreakStmt="restore-break-statement",s.RestoreInstalledProject="restore-installed-project",s.RestoreLoop="restore-loop",s.CreateNewDef="create-new-definition",s.CreateNewFuncDecl="create-new-function-declaration",s.CreateNewGlobalEvent="create-new-global-event",s.CreateNewSearch="create-new-search",s.CreateNewVarDecl="create-new-variable-declaration",s.CreateNewVarInst="create-new-variable-instance",s.CreateNewFuncCall="create-new-function-call",s.CreateNewOperation="create-new-operation",s.CreateNewCondition="create-new-condition",s.CreateNewReturnStmt="create-new-return-statement",s.CreateNewContinueStmt="create-new-continue-statement",s.CreateNewBreakStmt="create-new-break-statement",s.CreateNewInternalCall="create-new-internal-call",s.CreateNewLoop="create-new-loop",s.ImplementBuiltInFunctionalityAsDef="implement-built-in-functionality-as-definition",s.ImplementAbstractEntityAsDef="implement-abstract-entity-as-definition",s.ImplementNewHTTPEndpoint="implement-new-http-endpoint",s.ImplementNewScheduledTrigger="implement-new-scheduled-trigger",s.ImplementNewPersistedEntity="implement-new-persisted-entity",s.AddedNewRowTransformer="added-new-row-transformer",s.AddedSQLConnectionConfig="added-sql-connection-config",s.AddedNewSSLConnectionConfig="added-new-ssl-connection-config",s.AddedGoogleConnection="added-google-connection",s.AddedSlackConnection="added-slack-connection",s.AddedNewExternalAccountConnection="added-new-external-account-connection",s.AddedGoogleDriveConnection="added-google-drive-connection",s.AddedGoogleSheetsConnection="added-google-sheets-connection",s.AddedGoogleSlidesConnection="added-google-slides-connection",s.AddedGoogleMailConnection="added-gmail-connection",s.ManuallyCreateIndividualNode="manually-create-individual-node",s.UpdateNode="update-node",s.CreateNewProjectPublicationCompletedEvent="create-new-project-publication-completed-event",s.CreateNewCountedLoop="create-new-counted-loop",s.CreateNewListLoop="create-new-list-loop",s.CreateNewManualFlowLoop="create-new-manual-flow-loop",s.CreateNewObjectKeysLoop="create-new-object-keys-loop",s.CreateNewObjectValuesLoop="create-new-object-values-loop",s.CreateNewStringLoop="create-new-string-loop",s.CreateNewIsFalseCondition="create-new-is-false-condition",s.CreateNewIsTrueCondition="create-new-is-true-condition",s.CreateNewAndCondition="create-new-and-condition",s.CreateNewOrCondition="create-new-or-condition",s.DisconnectNodes="disconnect-nodes",s.DisconnectExecutions="disconnect-executions",s.DisconnectValues="disconnect-values",s.ConnectNodes="connect-nodes",s.ConnectExecution="connect-execution",s.ConnectValues="connect-values",s.ConnectValueToNewInput="connect-value-to-new-input",s.ConnectValueToNewOperationInput="connect-value-to-new-operation-input",s.ConnectValueToNewConditionInput="connect-value-to-new-condition-input",s.ConnectValueToNewSearchInput="connect-value-to-new-search-input",s.ConnectValueToNewVarDeclProperty="connect-value-to-new-variable-declaration-property",s.ConnectValueToNewVarInstProperty="connect-value-to-new-variable-instance-property",s.ConnectValueToNewReturnStmtProperty="connect-value-to-new-return-statement-property",s.ConnectValueToNewContinueStmtProperty="connect-value-to-new-continue-statement-property",s.ConnectValueToNewBreakStmtProperty="connect-value-to-new-break-statement-property",s.ConnectNewFuncDeclArgToValue="connect-new-function-argument-to-value",s.RemoveNodes="remove-nodes",s.RemoveNode="remove-node",s.InitialLoadAutomaticCanvasRefresh="initial-load-automatic-canvas-refresh",s.MoveNodes="move-nodes",s.MoveNode="move-node",s.CloneNodes="clone-nodes",s.CloneNode="clone-node",s.GenerateSQLMigrationOnPersistedEntityUpdate="generate-sql-migration-on-persisted-entity-update",s))(_||{}),Fe=(s=>(s.ActionOwnerEntityNotEditable="action-owner-entity-not-editable",s.ActionCounterpartEntityNotEditable="action-counterpart-entity-not-editable",s.ActionOwnerEntityNonDeletable="action-owner-entity-non-deletable",s.GlobalVariableDeclarationCannnotCatchError="global-variable-declaration-cannot-catch-error",s.GlobalVariableDeclarationCannotReadValue="global-variable-declaration-cannot-read-value",s.GlobalVariableDeclarationCannotBeCalled="global-variable-declaration-cannot-be-called",s.GlobalVariableDeclarationCannotCallFromError="global-variable-declaration-cannot-call-from-error",s.ValueReadingOverridesConstantProperty="value-reading-overrides-constant-property",s.DefaultValueOverridesConstantProperty="default-value-overrides-constant-property",s.ValueReadingOverridesConstantVariable="value-reading-overrides-constant-variable",s.DefaultValueOverridesConstantVariable="default-value-overrides-constant-variable",s.CannotSuccessCallItself="cannot-success-call-itself",s.CannotErrorCallItself="cannot-error-call-itself",s.CannotEntryCallItself="cannot-entry-call-itself",s.CannotValueWriteItself="cannot-value-write-itself",s.CannotBeCalledBeforeDeclaration="cannot-be-called-before-declaration",s.CannotBeCalledInParallelBranchToDeclaration="cannot-be-called-in-parallel-branch-to-declaration",s.CannotBeHigherScopeThanDeclaration="cannot-be-higher-scope-than-declaration",s.InputsInGlobalVariableDeclarationsCannotReadValues="inputs-in-global-variable-declarations-cannot-read-values",s))(Fe||{});class vNe{constructor({id:u,action:i,errorReason:r,owner:a,counterpart:c,rootAction:e},f){D(this,"id");D(this,"action");D(this,"errorReason");D(this,"owner",null);D(this,"counterpart",null);D(this,"rootAction",!1);D(this,"parent");this.id=u,this.action=i,this.errorReason=r||null,this.owner=a||null,this.counterpart=c||null,this.rootAction=e||!1,this.parent=f}}class Z extends X.Events{constructor(i,r,a,c,e=!1,f=""){super(f?f+"-cs-events":"anonymous-cs-events");D(this,"id",L.UUID.uuid());D(this,"seenEntities",[]);D(this,"added",{});D(this,"updated",{});D(this,"removed",{});D(this,"affected",{});D(this,"self",null);D(this,"author");D(this,"timestamp");D(this,"open",!0);D(this,"startedClose",!1);D(this,"dirty",!0);D(this,"submitting",!1);D(this,"lockedVersions",!1);D(this,"type","manual");D(this,"autoclose",!1);D(this,"actionName","");D(this,"project");D(this,"events",new Map);D(this,"ignoreNonEditable",!1);D(this,"ignoreNonDeletable",!1);D(this,"logger");if(this.project=i,this.author=r||L.sessionAuthor||"",this.timestamp=a,this.self=c,this.autoclose=e,this.actionName=f,this.logger=X.Logger.module("cs:"+(this.actionName?this.actionName+":":"")+this.id),this.autoclose&&!this.actionName)throw new Error("Auto-close change-set must have an auto-close action name.")}get index(){const i=this.project.history.indexOf(this);return i===-1?null:i}get isEmpty(){return Object.keys(this.added).length===0&&Object.keys(this.updated).length===0&&Object.keys(this.removed).length===0}get isValid(){var i;return!(this.isEmpty&&this.self&&!this.affected[(i=this.self)==null?void 0:i.id])}get list(){return[...Object.values(this.added),...Object.values(this.updated),...Object.values(this.removed)]}get listAdded(){return Object.values(this.added)}get listUpdated(){return Object.values(this.updated)}get listRemoved(){return Object.values(this.removed)}get listAffected(){return Object.values(this.affected)}get addedIds(){return Object.keys(this.added)}get updatedIds(){return Object.keys(this.updated)}get removedIds(){return Object.keys(this.removed)}get affectedIds(){return Object.keys(this.affected)}event(i){this.logger.log(`ChangeSet Event: ${i.action} (${i.id})`);const r=new vNe(i,this);this.events.set(i.id,r),this.emit("change-set-event",r)}discardOrphans(){this.added[this.project.id]&&(this.updatedIds.forEach(e=>{const f=this.updated[e];this.added[e]=f,delete this.updated[e]}),this.removedIds.forEach(e=>{this.remove(e)}));const i=[...this.addedIds,...this.updatedIds],a=this.project.toFlatIds().filter(e=>!this.project.diggestedBuiltInBaseEntitiesIds.has(e));if(i.filter(e=>!a.includes(e)).forEach(e=>{const f=this.get(e);this.logger.warn(`[discardOrphans] Entity ${f==null?void 0:f.type} with id "${e}" present in change-set but not in project. Removing from change-set.`),this.remove(e)}),this.added[this.project.id]){const e=[...this.addedIds,...this.updatedIds];this.project.toFlatIds().filter(v=>!this.project.diggestedBuiltInBaseEntitiesIds.has(v)).filter(v=>!e.includes(v)).forEach(v=>{const b=this.project.get(v);this.add(b,"added")})}}async discardOrphansAsync(i={}){const r=X.YieldTracker.from(i),a=this.project.toFlatIds();if(this.added[this.project.id]){for(const h of this.updatedIds){const m=this.updated[h];this.added[h]=m,delete this.updated[h],await r.tick()}for(const h of this.removedIds)this.remove(h),await r.tick()}const c=[...this.addedIds,...this.updatedIds],e=a.filter(h=>!this.project.diggestedBuiltInBaseEntitiesIds.has(h)),f=c.filter(h=>!e.includes(h));for(const h of f){const m=this.get(h);this.logger.warn(`[discardOrphansAsync] Entity ${m==null?void 0:m.type} with id "${h}" present in change-set but not in project. Removing from change-set.`),this.remove(h),await r.tick()}if(this.added[this.project.id]){const h=[...this.addedIds,...this.updatedIds],v=a.filter(b=>!this.project.diggestedBuiltInBaseEntitiesIds.has(b)).filter(b=>!h.includes(b));for(const b of v){const A=this.project.get(b);this.add(A,"added"),await r.tick()}}}captureAllChangesInVersionInstances(){[...this.addedIds,...this.updatedIds].forEach(r=>{const a=this.project.get(r);if(!a){const e=this.added[r],f=this.updated[r],h=e||f;throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${r}" was ${e?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()}),this.removedIds.forEach(r=>{const a=this.project.getDeleted(r);if(!a){const e=this.removed[r];throw new Error(`Entity ${(e==null?void 0:e.type)||"of unknown type"} with id "${r}" was removed but isn't found in the project state when capturing version for change-set.`)}const c=this.get(r);a.version===c.version&&a.captureVersion()})}async captureAllChangesInVersionInstancesAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds];for(const c of a){const e=this.project.get(c);if(!e){const h=this.added[c],m=this.updated[c],v=h||m;throw new Error(`Entity ${(v==null?void 0:v.type)||"of unknown type"} with id "${c}" was ${h?"added":"updated"} but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}for(const c of this.removedIds){const e=this.project.getDeleted(c);if(!e){const h=this.removed[c];throw new Error(`Entity ${(h==null?void 0:h.type)||"of unknown type"} with id "${c}" was removed but isn't found in the project state when capturing version for change-set.`)}const f=this.get(c);e.version===f.version&&e.captureVersion(),await r.tick()}}async attemptAutocloseAsync(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&await this.closeAsync(),this}async closeAsync(i={}){const r=X.YieldTracker.from(i),a={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;const c=i.awaitBeforeClose??!0,e=i.awaitExternalPersist??!0;return this.startedClose||(this.startedClose=!0,c?await this.beforeCloseAsync({tracker:r}):this.beforeCloseAsync({tracker:r})),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],await this.discardOrphansAsync({tracker:r}),await this.sanitizeAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r}),this.lockedVersions||(await this.captureAllChangesInVersionInstancesAsync({tracker:r}),await this.recursiveCaptureUpstreamVersionsAsync({tracker:r})),this.open=!1,this.isEmpty?(this.logger.warn(`[ChangeSet.closeAsync] Empty change-set (${this.id}) discarded upon closing.`),this.dirty=!1,this.project.discardChangeSet(this),this.logger.log("[ChangeSet.closeAsync] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this):(this.project.emit(ki.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),e?a.persistType==="parallel"?await this.project.persistChangeSetInParallel(this):await this.project.persistChangeSetSequentially(this):a.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this)}attemptAutoclose(i,r){var a;return this.autoclose&&this.actionName&&this.actionName===i&&(this.self&&r===((a=this.self)==null?void 0:a.id)||!this.self)&&this.close(),this}recursiveCaptureUpstreamVersions(){if(this.lockedVersions)return;[...this.addedIds,...this.updatedIds,...this.removedIds].forEach(r=>{const a=this.get(r),{added:c,updated:e,removed:f,affected:h}=a.recursiveCaptureUpstreamVersions(this.timestamp);for(const m of c)this.add(m,"added");for(const m of e)this.add(m,"updated");for(const m of f)this.add(m,"removed");for(const m of h)this.add(m,"affected")})}async recursiveCaptureUpstreamVersionsAsync(i={}){if(this.lockedVersions)return;const r=X.YieldTracker.from(i),a=[...this.addedIds,...this.updatedIds,...this.removedIds];for await(const c of a){const e=this.get(c),{added:f,updated:h,removed:m,affected:v}=e.recursiveCaptureUpstreamVersions(this.timestamp);for(const b of f)this.add(b,"added");for(const b of h)this.add(b,"updated");for(const b of m)this.add(b,"removed");for(const b of v)this.add(b,"affected");await r.tick()}}sanitize(){this.listAdded.forEach(i=>{i.previousVersion=null})}async sanitizeAsync(i={}){const r=X.YieldTracker.from(i);for(const a of this.listAdded)a.previousVersion=null,await r.tick()}syncDependents(){return[...this.list,...this.listAffected].forEach(i=>{const r=this.project.get(i.id);!r||r.deleted||OI(r,this.project)||r==null||r.syncDependents(this)}),this}async syncDependentsAsync(i={}){const r=X.YieldTracker.from(i);for(const a of[...this.list,...this.listAffected]){const c=this.project.get(a.id);!c||c.deleted||OI(c,this.project)||(c==null||c.syncDependents(this),await r.tick())}return this}async beforeCloseAsync(i={}){const r=X.YieldTracker.from(i);await this.project.emitAsync(ki.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),await this.syncDependentsAsync({tracker:r}),await this.emitAsyncProjectSideEffects({tracker:r}),await this.project.emitAsync(ki.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}beforeClose(){this.project.emit(ki.BEFORE_CHANGE_SET_CLOSE_BEFORE_SIDE_EFFECTS,this),this.syncDependents(),this.emitProjectSideEffects(),this.project.emit(ki.BEFORE_CHANGE_SET_CLOSE_AFTER_SIDE_EFFECTS,this),this.teardown()}teardown(){this.destroy()}emitProjectSideEffects(){return mNe(this)}async emitAsyncProjectSideEffects(i={}){return TNe(this,i)}close(i={}){const r={persistType:"sequential",...i};if(!this.open||this.startedClose)return this.logger.warn(`Change-set (${this.id}) is already closed or in the process of closing.`),this;if(this.startedClose||(this.startedClose=!0,this.beforeClose()),!this.isValid&&this.self&&!this.added[this.self.id]&&!this.updated[this.self.id]&&this.removed[this.self.id],this.discardOrphans(),this.sanitize(),this.captureAllChangesInVersionInstances(),this.lockedVersions||(this.recursiveCaptureUpstreamVersions(),this.captureAllChangesInVersionInstances()),this.open=!1,this.isEmpty)return this.logger.warn(`[ChangeSet.close] Empty change-set (${this.id}) discarded upon closing.`),this.project.discardChangeSet(this),this.logger.log("[ChangeSet.close] Closing pending change-sets..."),this.project.closePersistChangeSetsSequentially(),this;if(this.added[this.project.id]&&this.updatedIds.length)throw new Error("No 'updated' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(this.added[this.project.id]&&this.removedIds.length)throw new Error("No 'removed' entities should be present in the change-set when the project entity is in the 'added' list. New projects can only have newly added entities");if(!this.updated[this.project.id]&&!this.added[this.project.id])throw new Error("Change-set must also have the project entity as 'updated' or 'added'. All changes must propagate upstream until the root project entity.");return this.project.emit(ki.CHANGE_SET_CLOSED_BEFORE_PERSIST,this),r.persistType==="parallel"?this.project.persistChangeSetInParallel(this):this.project.persistChangeSetSequentially(this),this.destroy(),this}addDependentsToAffected(i){Object.values(i.detachedDependents).forEach(r=>{const{entity:a,field:c}=r;this.has(a.id)||this.add(a,"affected")})}get(i){return this.added[i]?this.added[i]:this.updated[i]?this.updated[i]:this.removed[i]?this.removed[i]:null}remove(i){return this.has(i)&&(delete this.added[i],delete this.updated[i],delete this.removed[i],delete this.affected[i],this.seenEntities=this.seenEntities.filter(r=>r!==i)),this}add(i,r,a={preventRecursion:!1}){var e,f,h,m;if(!this.open||!this.dirty)return this;if(OI(i,this.project))return this;if(this.seenEntities.indexOf(i.id)===-1&&this.seenEntities.push(i.id),r==="removed"){if(this.added[i.id])return delete this.added[i.id],delete this.affected[i.id],delete this.updated[i.id],this.seenEntities=this.seenEntities.filter(b=>b!==i.id),delete this.project.deletedInstances[i.id],this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasRemoved(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.captureVersion();const v=(e=i.knownVersions)==null?void 0:e.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.removed[i.id]=v,this}if(r==="added"){if(this.removed[i.id])return this;if(this.updated[i.id]&&delete this.updated[i.id],this.affected[i.id]&&delete this.affected[i.id],!this.hasAdded(i.id)&&!this.lockedVersions&&!a.preventRecursion){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.previousVersion=null,i.captureVersion();const v=(f=i.knownVersions)==null?void 0:f.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.added[i.id]=v,delete this.affected[i.id],this.addDependentsToAffected(i),this}if(r==="updated"){if(this.removed[i.id])return this;if(this.added[i.id])return i.captureVersion(),this.addDependentsToAffected(i),this;if(this.affected[i.id]&&delete this.affected[i.id],!this.hasUpdated(i.id)&&!this.lockedVersions&&(i.increaseVersion(this.timestamp),!a.preventRecursion)){const{added:b,updated:A,removed:w,affected:R}=i.recursiveCaptureUpstreamVersions(this.timestamp);for(const O of b)this.add(O,"added");for(const O of A)this.add(O,"updated");for(const O of w)this.add(O,"removed");for(const O of R)this.add(O,"affected")}i.activeVersion=!0,i.captureVersion();const v=(h=i.knownVersions)==null?void 0:h.get(i.version);if(!v)throw Error(`Version ${i.version} should have a cached version instance but it wasn't found when adding entity to change-set`);return this.updated[i.id]=v,this.addDependentsToAffected(i),this}if(r==="affected"){if(this.removed[i.id])return this;if(this.added[i.id])return this;if(this.updated[i.id])return this;if(this.affected[i.id]=i,!this.lockedVersions){const v=i.version+"--"+this.id,b=((m=i.knownVersions)==null?void 0:m.get(v))||i.snapshot();i.apply(b),i.knownVersions=i.knownVersions?i.knownVersions.set(v,b):new Map().set(v,b)}}return this}toJSON(){var f;const i={},r={},a={},c=new Set;for(const h of Object.values(this.added))i[h.id]=h.toShallowJSON();for(const h of Object.values(this.updated))r[h.id]=h.toShallowJSON();for(const h of Object.values(this.removed))a[h.id]=h.toShallowJSON();for(const h of Object.values(this.affected))c.add(h.id);const e=this.get(((f=this.self)==null?void 0:f.id)||"");return{added:i,updated:r,removed:a,affected:Array.from(c),self:e?e.toShallowJSON():null,seenEntities:this.seenEntities,actionName:this.actionName}}has(i){return!!this.added[i]||!!this.removed[i]||!!this.updated[i]||!!this.affected[i]}hasAdded(i){return!!this.added[i]}hasUpdated(i){return!!this.updated[i]}hasRemoved(i){return!!this.removed[i]}hasAffected(i){return!!this.affected[i]}}function bRi(s){return new Set([...Object.keys(s.added),...Object.keys(s.updated),...Object.keys(s.removed),...Array.from(s.affected)])}function PP(s,u,i){var f;const r=new Date().toISOString(),a=new Z(i,L.sessionAuthor,r,i);if(a.lockedVersions=!0,s===u)throw X.Logger.error("From: ",s),X.Logger.error("To: ",u),new Error("Cannot generate transitional change set between the same two versions or change-sets");let c;if(s==="initial"?c=!0:u==="initial"?c=!1:U(s.timestamp).isBefore(U(u.timestamp))?c=!0:c=!1,X.Logger.log("Transitioning from ",s==="initial"?"initial":s.index),X.Logger.log("Transitioning to ",u==="initial"?"initial":u.index),X.Logger.log("Is forward: ",c),c){const h=u,m=h.index,v=s==="initial"?0:s.index;X.Logger.log("ownIndex: ",m),X.Logger.log("startIndex: ",v),X.Logger.log("CH ID: ",h.id);const b=m===v?[i.history[m]]:i.history.slice(v+1,m+1);if(b.sort((A,w)=>U(A.timestamp).isAfter(U(w.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");X.Logger.log("REDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{NP(A,w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),R.addSelfToProject(a),a.timestamp=R.createdAt,a.add(R,z.Added,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})},w=>{var $;const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.version),($=R.removeFromParent)==null||$.call(R,a),R.unsubscribe(),R.unsubscribeFromDependencies(),i.subscribeDeletedInstance(R),a.timestamp=R.createdAt,a.add(R,z.Removed,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);const $=w.version+"--"+A.id;R.restoreVersion($),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})})})}else{const h=s,m=h.index,v=u==="initial"?0:u.index;X.Logger.log("CH ID: ",h.id);const b=m===v?[i.history[m]]:i.history.slice(v+1,m+1);if(b.sort((A,w)=>U(w.timestamp).isAfter(U(A.timestamp))?1:-1),!b.length)throw new Error("No change sets in the history between the history indexes provided");X.Logger.log("UNDO change-set: ",b[0].id," ",b[0].timestamp),b.forEach(A=>{NP(A,w=>{var $;const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);w.previousVersion&&(R.restoreVersion(w.previousVersion),($=R.removeFromParent)==null||$.call(R,a),R.unsubscribe(),R.unsubscribeFromDependencies(),i.subscribeDeletedInstance(R)),a.timestamp=R.createdAt,a.add(R,z.Removed,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.previousVersion),a.timestamp=R.createdAt,a.add(R,z.Updated,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(w.previousVersion),R.addSelfToProject(a),a.timestamp=R.createdAt,a.add(R,z.Added,{preventRecursion:!0})},w=>{const R=i.instances[w.id]||i.deletedInstances[w.id];let O="";try{O=ye(w,i)}catch{}if(!R)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" doesn't have an 'activeVersion' set.`);if(!R.knownVersions)throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value.`);if(!R.knownVersions.get(w.version))throw new Error(`Entity ${w.type} ${O?`"${O}" `:""}with id "${w.id}" has an active version instance missing the 'knownVersions' property value for version "${w.version}".`);R.restoreVersion(R.version),a.timestamp=R.createdAt,a.add(R,z.Affected,{preventRecursion:!0})})})}let e;if(u==="initial"){const h=Array.from(((f=i.knownVersions)==null?void 0:f.values())||[]).reduce((m,v)=>!m||U(v.createdAt).isBefore(U(m.createdAt))?v:m,null);if(!h)throw new Error("No oldest version found");e=h.createdAt}else e=u.timestamp;return a.open=!1,{transitionalChangeSet:a,transitionTime:r,timeOfOriginalTargetChanges:e}}function NP(s,u,i,r,a){var h;if(!(s!=null&&s.self))throw new Error("Change set must have a valid `self` entity state to be traversed");const c=((h=s.self)==null?void 0:h.type)===d.Project?s.self:s.self.project,e=new Qn(s.self,{allBuiltInEntityIds:c.diggestedBuiltInBaseEntitiesIds});X.Logger.log("changeSet.added: ",Object.keys(s.added).length),X.Logger.log("changeSet.updated: ",Object.keys(s.updated).length),X.Logger.log("changeSet.removed: ",Object.keys(s.removed).length);const f={...s.added,...s.updated,...s.removed,...s.affected};e.order=Object.keys(f),e.flatRecord=f,e.orderEntities(),X.Logger.log("All entities: ",e.order.map((m,v)=>`${v+1}: ${f[m].type} - ${m}`).join(`,
|
|
7
7
|
`)),X.Logger.log("Traversing additions"),e.visit(async m=>{if(s.added[m.id])try{u(m)}catch(v){X.Logger.error("Error: ",v)}}),X.Logger.log("Traversing updates"),e.visit(async m=>{if(s.updated[m.id])try{i(m)}catch(v){X.Logger.error("Error: ",v)}}),X.Logger.log("Traversing removals"),e.visit(async(m,v)=>{if(s.removed[m.id])try{r(m)}catch(b){X.Logger.error("Error: ",b)}}),X.Logger.log("Traversing affected"),e.visit(async(m,v)=>{if(s.affected[m.id])try{a(m)}catch(b){X.Logger.error("Error: ",b)}})}function VP(s,u,i){const r=s+1;return u.splice(r,u.length-r,i),u.length-1}function ARi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.editable=!0})}function gRi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.deletable=!0})}function IRi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.editable=!0,i.deletable=!0})}function RRi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.editable=!1})}function DRi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.deletable=!1})}function wRi(s){[...s.listUpdated,...s.listAdded].forEach(u=>{const i=s.project.get(u.id);i.editable=!1,i.deletable=!1})}function CRi(s,u){u?s.metaSync({editable:!1,deletable:!1},u):(s.editable=!1,s.deletable=!1),He(s,new Set,{ignoreBuiltInBaseEntities:!0}).forEach(r=>{u?r.metaSync({editable:!1,deletable:!1},u):(r.editable=!1,r.deletable=!1)})}function ORi(s,u){u?s.metaSync({editable:!0,deletable:!0},u):(s.editable=!0,s.deletable=!0),He(s,new Set,{ignoreBuiltInBaseEntities:!0}).forEach(r=>{u?r.metaSync({editable:!0,deletable:!0},u):(r.editable=!0,r.deletable=!0)})}function _Ri(s){const{projectRecord:u,chain:i,projectId:r,sort:a,order:c}=s,e=a?(i||[]).sort((v,b)=>{const A=v.updated[r],w=b.updated[r];return U(A.createdAt).valueOf()-U(w.createdAt).valueOf()}):i||[],f={...u};e.forEach(v=>{Object.values(v.removed).forEach(A=>{delete f[A.id]}),Object.values(v.added).forEach(A=>{f[A.id]=A}),Object.values(v.updated).forEach(A=>{f[A.id]=A});const b=v.updated[r];f[r]=b});let h=null;if(c){const v=new Qn;v.flatRecord=f,v.orderEntities(),h=v.order}return{project:f[r],record:f,order:h}}class j${constructor(u){D(this,"version");D(this,"previousVersion");D(this,"createdAt");D(this,"deleted",!1);D(this,"author");this.version=u.version,this.previousVersion=u.previousVersion,this.createdAt=U(u.createdAt).toISOString(),this.deleted=u.deleted,this.author=u.author}baseMetaSync(u,i,r){this.deleted=u.deleted!==void 0?u.deleted:this.deleted}}class kn extends j${constructor(i){super(i);D(this,"deletable",!0);D(this,"editable",!0);this.deletable=i.deletable,this.editable=i.editable}checkCanEditWithCounterpartAndSideEffects(i,r,a,c){var e,f;return!this.checkCanEdit(i,c)||!this.checkCanEdit(r,c)?(this.checkCanEdit(r,c)?(X.Logger.warn(`[${a}] User is not allowed to edit this ${i.type} entity with id: ${i.id}`),c==null||c.event({id:`${a}-${i.id}--${r.id}--${Fe.ActionOwnerEntityNotEditable}`,action:a,owner:i,counterpart:r,errorReason:Fe.ActionOwnerEntityNotEditable,rootAction:((f=c==null?void 0:c.self)==null?void 0:f.id)===i.id&&(c==null?void 0:c.actionName)===a})):(X.Logger.warn(`[${a}] User is not allowed to edit this ${i.type} entity with id: ${i.id} because its counterpart ${r.type} with id: ${r.id} is not editable`),c==null||c.event({id:`${a}-${i.id}--${r.id}--${Fe.ActionCounterpartEntityNotEditable}`,action:a,owner:i,counterpart:r,errorReason:Fe.ActionCounterpartEntityNotEditable,rootAction:((e=c==null?void 0:c.self)==null?void 0:e.id)===i.id&&(c==null?void 0:c.actionName)===a})),c==null||c.attemptAutoclose(a,i.id),!1):!0}checkCanEditFromScopeOwner(i,r){const a=ci(i,i.project);return a?this.checkCanEdit(a,r):!0}checkCanEditFromScopeOwnerWithSideEffects(i,r,a){var e;const c=this.checkCanEditFromScopeOwner(i,a);return!c&&!(a!=null&&a.ignoreNonEditable)&&(X.Logger.warn(`[${r}] User is not allowed to edit this ${i.type} entity with id: ${i.id}`),a==null||a.event({id:`${r}-${i.id}--${Fe.ActionOwnerEntityNotEditable}`,action:r,owner:i,errorReason:Fe.ActionOwnerEntityNotEditable,rootAction:((e=a==null?void 0:a.self)==null?void 0:e.id)===i.id&&(a==null?void 0:a.actionName)===r}),a==null||a.attemptAutoclose(r,i.id)),c}checkCanEdit(i,r){var a;return(a=i.project)!=null&&a.initialized?i.type===d.BuiltInBaseEntity||i.type===d.PrimitiveEntity?!1:i.initialized?!(i.project.diggestedBuiltInBaseEntitiesIds.has(i.id)||i.parent&&!(this.checkCanEdit(i.parent,r)&&i.editable)&&!(r!=null&&r.ignoreNonEditable)||!i.editable&&!(r!=null&&r.ignoreNonEditable)):!0:!0}checkCanDelete(i,r){var a;return i.type!==d.Project&&i.project.diggestedBuiltInBaseEntitiesIds.has(i.id)?!1:i.type===d.Project||(a=i.parent)!=null&&a.deleted?!0:!(!i.deletable&&!(r!=null&&r.ignoreNonDeletable))}baseMetaSync(i,r,a){this.deletable=i.deletable!==void 0?i.deletable:this.deletable,this.editable=i.editable!==void 0?i.editable:this.editable;const c={...i,deleted:this.checkCanDelete(r,a)?i.deleted:!1};super.baseMetaSync(c,r,a)}}var ENe=(s=>(s.ArgumentDataTypeEntityField="data-type-entity-field",s.ArgumentDataTypeField="data-type-field",s.ArgumentImplementsField="argument-implements-field",s))(ENe||{});const zi=class zi extends kn{constructor(i,r){super(i);D(this,"initialData");D(this,"id");D(this,"name");D(this,"codeName",null);D(this,"description",null);D(this,"index");D(this,"required");D(this,"constant",!0);D(this,"type",d.ArgumentDeclaration);D(this,"defaultValue",null);D(this,"dataType",null);D(this,"writesValues",[]);D(this,"implements",[]);D(this,"project");D(this,"errors",[]);D(this,"parent");D(this,"detachedDependents",{});D(this,"knownVersions",null);D(this,"activeVersion",!1);D(this,"initialized",!1);D(this,"startedInitialization",!1);D(this,"suggestion",!1);D(this,"_codeNativeValueValidation",null);this.initialData=i,this.project=r,this.id=i.id,this.index=i.index,this.name=i.name,this.description=i.description,this.codeName=i.codeName,this.required=i.required,this.constant=!0}static new(i=null){return{id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:(i==null?void 0:i.author)||L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:"",codeName:null,description:"",index:0,required:!1,constant:!0,implements:[],dataType:null,defaultValue:null,writesValues:[],parent:null}}static fromGenerationTarget(i,r,a){const c=a===void 0?r.addChangeSet(new Z(r,L.sessionAuthor,U().toISOString(),r,!0,_.CreateFromGenerationTarget)):a,e=oe(i.parent),f=r.get(e),h={id:i.id,version:L.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||U().toISOString(),author:(c==null?void 0:c.author)||L.sessionAuthor,previousVersion:null,deleted:!1,name:i.name,deletable:!0,editable:!0,type:d.ArgumentDeclaration,index:f.inputs.length,defaultValue:null,codeName:i.codeName||null,description:i.description||null,required:i.required??!1,constant:!0,implements:[],dataType:null,writesValues:[],parent:f.toReference()},m=we(h,r);return m.hydrateAncestors(),m.setParent(f,c),m.addSelfToProject(c),c==null||c.add(m,z.Added),m.initChildren(c),c||m.captureVersion(),m}static validateGenerationTarget(i,r){let a=JSON.parse(JSON.stringify(i));const c=[],e=[],f=ya(a,{parent:{list:!1,types:[d.FunctionDeclaration,d.Search,d.Condition]}},r);c.push(...f.explanations),a=f.modifiedData;const h=G$(a,r);if(a.parent){const v=r.get(oe(a.parent));if(v&&Ti.includes(v.type)){const b=v.implements;if(b){const A=b.inputs.find(x=>x.name===a.name),w=b.inputs.filter(x=>!v.inputs.find(W=>W.type===d.ArgumentDeclaration&&W.name===x.name)),R=v.inputs.filter(x=>x.type===d.ArgumentDeclaration),O=R.find(x=>x.name===a.name),$=R.length?`The parent entity already implements the following arguments: ${qt(R.map(x=>`'${x.id}' (${x.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",G=w.length?`The parent entity is still missing the following arguments in the implementation: ${qt(w.map(x=>`'${x.id}' (${x.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";A?O&&e.push(new Ne({id:`${a.id}--${Pe.NoOverlapWithImplementedSignature}`,code:Pe.NoOverlapWithImplementedSignature,severity:Ee.Error,message:`Entity of type '${d.ArgumentDeclaration}' with id '${a.id}' should not exist in a parent entity of type '${v.type}' with id '${v.id}' that implements a ${d.ActionDescriptor} with fixed arguments.
|
|
8
8
|
Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
|
|
9
9
|
${$}
|
|
@@ -46,7 +46,7 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
|
|
|
46
46
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
47
47
|
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writers of its inputs, or the value readers of its outputs.`})),{errors:r,explanations:a,modifiedData:i}}subscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]||(this.detachedDependents[r.entity.id]=r)}),this}unsubscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]&&delete this.detachedDependents[r.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const r=[],a=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);r.push(...h.updated),a.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}onDetachedDependencyRemoved(i,r,a){const c=[],e=[],f=[],h=[];if(r==="loop-parent-field"){const{updated:m,added:v,removed:b}=this.remove({ignoreUpstream:!1},a);c.push(...m),e.push(...v),f.push(...b)}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}onDetachedDependencyRestored(i,r,a){const c=[],e=[],f=[],h=[];if(r==="loop-parent-field"){const{updated:m,added:v,removed:b}=this.restore({},a);c.push(...m),e.push(...v),f.push(...b)}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}unsubscribeFromDependencies(){var i,r,a,c,e,f,h,m,v,b,A,w,R;return(i=this.parent)==null||i.unsubscribeDependents([{entity:this,field:"loop-parent-field"}]),(c=(a=(r=this.dataType)==null?void 0:r.entity)==null?void 0:a.unsubscribeDependents)==null||c.call(a,[{entity:this,field:"loop-data-type-entity-field"}]),(f=(e=this.dataType)==null?void 0:e.unsubscribeDependents)==null||f.call(e,[{entity:this,field:"loop-data-type-field"}]),(b=(v=(m=(h=this.body)==null?void 0:h.dataType)==null?void 0:m.entity)==null?void 0:v.unsubscribeDependents)==null||b.call(v,[{entity:this,field:"loop-body-data-type-entity-field"}]),(R=(w=(A=this.body)==null?void 0:A.dataType)==null?void 0:w.unsubscribeDependents)==null||R.call(w,[{entity:this,field:"loop-body-data-type-field"}]),this}subscribeToDependencies(){var i,r,a,c,e,f,h,m,v,b,A,w,R;return(i=this.parent)==null||i.subscribeDependents([{entity:this,field:"loop-parent-field"}]),(c=(a=(r=this.dataType)==null?void 0:r.entity)==null?void 0:a.subscribeDependents)==null||c.call(a,[{entity:this,field:"loop-data-type-entity-field"}]),(f=(e=this.dataType)==null?void 0:e.subscribeDependents)==null||f.call(e,[{entity:this,field:"loop-data-type-field"}]),(b=(v=(m=(h=this.body)==null?void 0:h.dataType)==null?void 0:m.entity)==null?void 0:v.subscribeDependents)==null||b.call(v,[{entity:this,field:"loop-body-data-type-entity-field"}]),(R=(w=(A=this.body)==null?void 0:A.dataType)==null?void 0:w.subscribeDependents)==null||R.call(w,[{entity:this,field:"loop-body-data-type-field"}]),this}increaseVersion(i){var r;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((r=this.knownVersions)!=null&&r.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=L.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new Pi(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Pi(this,this.project);return this.apply(i)}apply(i){const r=this.toMeta();return i.metaSync(r,null),i.inputs=[...this.inputs],i.outputs=[...this.outputs],i.error=this.error,i.successCalls=[...this.successCalls],i.errorCalls=[...this.errorCalls],i.declaration=this.declaration,i.body=this.body,i.calledByEntry=[...this.calledByEntry],i.calledBySuccess=[...this.calledBySuccess],i.calledByError=[...this.calledByError],i.writesValues=[...this.writesValues],i.dataType=this.dataType,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const r=[],a=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);r.push(this.parent,...f.updated),a.push(...f.added),c.push(...f.removed)}return{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}async restoreVersion(i,r){var m;const a=[],c=[],e=[],f=[];if(this.version===i&&(r!=null&&r.skipIfSameVersion))return{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this};if(!this.knownVersions){const v=new Map;for(const[b,A]of this.knownVersions||new Map){if(v.set(b,A),A.activeVersion=!1,A.knownVersions)for(const[w,R]of A.knownVersions)v.set(w,R);A.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const v=await this.APILoadVersion({},i);if(!v)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Pi(v,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.inputs=[...h.inputs],this.outputs=[...h.outputs],this.error=h.error,this.successCalls=[...h.successCalls],this.errorCalls=[...h.errorCalls],this.declaration=h.declaration,this.body=h.body,this.calledBySuccess=[...h.calledBySuccess],this.calledByError=[...h.calledByError],this.calledByEntry=[...h.calledByEntry],this.writesValues=[...h.writesValues],this.dataType=h.dataType,this.parent=h.parent,{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}updateWithShallowTransfer(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,r),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent){const a=oe(i.parent),c=this.project.get(a),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(r),c)this.setParent(c,r),this.addSelfToProject(r);else throw r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${a}' that isn't found in the project`)}else throw r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.declaration){const a=oe(i.declaration),c=this.project.get(a);c&&this.setDeclaration(c)}if(i.calledByEntry.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addEntryCaller(e,r),e.addCall(this,r))}),[...this.calledByEntry].forEach(a=>{i.calledByEntry.find(e=>oe(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.calledBySuccess.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addSuccessCaller(e,r),e.addSuccessCall(this,r))}),[...this.calledBySuccess].forEach(a=>{i.calledBySuccess.find(e=>oe(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.calledByError.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addErrorCaller(e,r),e.addErrorCall(this,r))}),[...this.calledByError].forEach(a=>{i.calledByError.find(e=>oe(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.dataType){const a=oe(i.dataType),c=this.project.get(a);c&&this.setDataType(c,r)}else this.setDataType(null,r);return i.outputs.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addOutput(e,r),e.setParent(this,r))}),[...this.outputs].forEach(a=>{i.outputs.find(e=>oe(e)===a.id)||(this.removeOutput(a,r),a.removeFromParent(r))}),i.inputs.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addInput(e,r),e.setParent(this,r))}),[...this.inputs].forEach(a=>{i.inputs.find(e=>oe(e)===a.id)||(this.removeInput(a,r),a.removeFromParent(r))}),i.writesValues.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&(this.addValueReader(e,r),e.setValueWriter(this,r))}),[...this.writesValues].forEach(a=>{i.writesValues.find(e=>oe(e)===a.id)||(this.removeValueReader(a,r),a.setValueWriter(null,r))}),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithGenerationTarget))){var a,c,e;if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,r),i.parent){const f=oe(i.parent),h=this.project.get(f),m=this.parent;if(m&&m.id!==(h==null?void 0:h.id)&&this.removeFromParent(r),h)this.setParent(h,r),this.addSelfToProject(r);else throw r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${f}' that isn't found in the project`)}if(i.declaration){const f=oe(i.declaration),h=this.project.get(f);if(h)this.setDeclaration(h);else throw new Error(`${this.type} with id '${this.id}' has a 'declaration' reference '${f}' that isn't found in the project`)}return(a=i.calledByEntry)==null||a.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addEntryCaller(m,r),m.addCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByEntry' reference '${h}' that isn't found in the project`)}),i.calledByEntry&&[...this.calledByEntry].forEach(f=>{var m;((m=i.calledByEntry)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addSuccessCaller(m,r),m.addSuccessCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledBySuccess' reference '${h}' that isn't found in the project`)}),i.calledBySuccess&&[...this.calledBySuccess].forEach(f=>{var m;((m=i.calledBySuccess)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(e=i.calledByError)==null||e.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addErrorCaller(m,r),m.addErrorCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByError' reference '${h}' that isn't found in the project`)}),i.calledByError&&[...this.calledByError].forEach(f=>{var m;((m=i.calledByError)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],r=[],a=[],c=[];if(this.initialData.parent){const e=oe(this.initialData.parent),f=this.project.get(e);if(f)this.setParent(f,null),i.push(f);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.declaration){const e=oe(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addErrorCaller(h,null)}),{updated:P(i),added:P(r),removed:P(a),affected:P(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];if(this.initialized=!0,this.checkIsSynced())return i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this};const{updated:f,added:h,removed:m}=this.syncChildren(i);return r.push(...f),a.push(...h),c.push(...m),this.inputs.sort((v,b)=>{var A,w;return(v.index??((A=v.declaration)==null?void 0:A.index))-(b.index??((w=b.declaration)==null?void 0:w.index))}),this.outputs.sort((v,b)=>{var A,w;return(v.index??((A=v.declaration)==null?void 0:A.index))-(b.index??((w=b.declaration)==null?void 0:w.index))}),this.errorCalls.length&&!this.catchesError&&this.metaSync({catchesError:!0},i),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){const r=[this],a=[],c=[],e=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(f=>{f.addSuccessCaller(this,i),r.push(f)}),this.errorCalls.forEach(f=>{f.addErrorCaller(this,i),r.push(f)}),this.calledByEntry.forEach(f=>{f.addCall(this,i),r.push(f)}),this.calledBySuccess.forEach(f=>{f.addSuccessCall(this,i),r.push(f)}),this.calledByError.forEach(f=>{f.addErrorCall(this,i),r.push(f)}),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveInput))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[removeInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this;const a=this.inputs.findIndex(c=>c.id===i.id);return a>-1&&(this.inputs.splice(a,1),r&&(r==null||r.add(this,z.Affected))),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this}addInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddInput))){return this.checkCanEdit(this,r)?this.inputs.includes(i)?(r==null||r.attemptAutoclose(_.AddInput,this.id),this):(this.inputs.push(i),r==null||r.add(this,z.Affected),r==null||r.attemptAutoclose(_.AddInput,this.id),this):(X.Logger.warn(`[addInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddInput,this.id),this)}addOutput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"add-output"))){return this.checkCanEdit(this,r)?this.outputs.includes(i)?(r==null||r.attemptAutoclose("add-output",this.id),this):(this.outputs.push(i),r==null||r.add(this,z.Affected),r==null||r.attemptAutoclose("add-output",this.id),this):(X.Logger.warn(`[addOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose("add-output",this.id),this)}removeOutput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"remove-output"))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[removeOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose("remove-output",this.id),this;const a=this.outputs.findIndex(c=>c.id===i.id);return a>-1&&(this.outputs.splice(a,1),r&&(r==null||r.add(this,z.Affected))),r==null||r.attemptAutoclose("remove-output",this.id),this}setBody(i){return this.body=i,this}detachBody(){return this.body=null,this}addSuccessCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddSuccessCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddSuccessCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddSuccessCaller}-${this.id}--${Fe.CannotSuccessCallItself}`,action:_.AddSuccessCaller,owner:this,errorReason:Fe.CannotSuccessCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddSuccessCaller})),this.calledBySuccess.find(e=>e.id===i.id)||(this.calledBySuccess.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddSuccessCaller,this.id),this):this}addErrorCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddErrorCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddErrorCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddErrorCaller}-${this.id}--${Fe.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Fe.CannotErrorCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddErrorCaller})),this.calledByError.find(e=>e.id===i.id)||(this.calledByError.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddErrorCaller,this.id),this):this}addEntryCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddEntryCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddEntryCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddEntryCaller}-${this.id}--${Fe.CannotEntryCallItself}`,action:_.AddEntryCaller,owner:this,errorReason:Fe.CannotEntryCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddEntryCaller})),this.calledByEntry.find(e=>e.id===i.id)||(this.calledByEntry.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddEntryCaller,this.id),this):this}addErrorCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddErrorCall)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddErrorCall,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddErrorCaller}-${this.id}--${Fe.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Fe.CannotErrorCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddErrorCaller})),this.errorCalls.find(e=>e.id===i.id)||(this.errorCalls.push(i),this.catchesError||this.metaSync({catchesError:!0},r),a&&Zt(this,r),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.AddErrorCall,this.id),this):this}addSuccessCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddSuccessCall)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddSuccessCall,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddSuccessCaller}-${this.id}`,action:_.AddSuccessCaller,owner:this,errorReason:Fe.CannotSuccessCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddSuccessCaller})),this.successCalls.find(e=>e.id===i.id)||(this.successCalls.push(i),a&&Zt(this,r),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.AddSuccessCall,this.id),this):this}removeCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveCall)),a=!1){if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,_.RemoveCall,r))return this;const c=this.successCalls.findIndex(f=>f.id===i.id);c>-1&&(this.successCalls.splice(c,1),r==null||r.add(this,z.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),r==null||r.add(this,z.Affected)),a&&Zt(this,r),r==null||r.attemptAutoclose(_.RemoveCall,this.id),this}removeCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"remove-caller")),a=!1){return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.RemoveCaller,r)?(this.calledBySuccess=this.calledBySuccess.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),a&&Zt(this,r),r==null||r.attemptAutoclose(_.RemoveCaller,this.id),this):this}replaceDetachedChild(i,r){const a=this.detachedChildren.indexOf(i);return a!==-1&&(this.detachedChildren[a]=r),this}subscribeDetachedChild(i){return this.detachedChildren.includes(i)||this.detachedChildren.push(i),this}unsubscribeDetachedChild(i){const r=this.detachedChildren.indexOf(i);return r!==-1&&this.detachedChildren.splice(r,1),this}setError(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetErrorEntity))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[setError] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetErrorEntity,this.id),this;const a=this.error;return(a==null?void 0:a.id)!==(i==null?void 0:i.id)&&(a==null||a.remove({ignoreUpstream:!0},r),this.error=i,this.subscribeToDependencies(),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.SetErrorEntity,this.id),this}setParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetParent))){var a;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetParent,r)?(((a=this.parent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent=i,r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}setDeclaration(i){return this.declaration=i,this}initChildren(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.declaration=we(this.initialData.declaration,this.project),this.initialData.dataType){const r=we(this.initialData.dataType,this.project);this.setDataType(r,null),this.dataType.setParent(this,null),this.dataType.initChildren(i)}return this.successCalls=this.initialData.successCalls.map(r=>{const a=we(r,this.project);if(a.addSuccessCaller(this,null),[d.BreakStatement,d.ContinueStatement].includes(a.type))a.setParent(this.parent.parent,null),a.initChildren(i);else if(a.type===d.ReturnStatement){const c=Xn(this,this.project);a.setParent(c,null),a.initChildren(i)}else a.type!==d.InternalCall&&(a.setParent(this.parent,null),a.initChildren(i));return a}),this.errorCalls=this.initialData.errorCalls.map(r=>{const a=we(r,this.project);if(a.addErrorCaller(this,null),[d.BreakStatement,d.ContinueStatement].includes(a.type))a.setParent(this.parent.parent,null),a.initChildren(i);else if(a.type===d.ReturnStatement){const c=Xn(this,this.project);a.setParent(c,null),a.initChildren(i)}else a.type!==d.InternalCall&&(a.setParent(this.parent,null),a.initChildren(i));return a}),this.inputs=this.initialData.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(i),a}),this.outputs=this.initialData.outputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(i),a}),this.initialData.body&&(this.body=we(this.initialData.body,this.project),this.body.setParent(this,null),this.body.initChildren(i)),this.initialData.error&&(this.error=we(this.initialData.error,this.project),this.error.setParent(this,null),this.error.initChildren(i)),this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(r=>{r.version!==this.version&&(r.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r),c=Nn(this,a),e=this.toMeta();return this.x=a.x||e.x,this.y=a.y||e.y,this.catchesError=a.catchesError!==void 0?a.catchesError:this.catchesError,super.baseMetaSync(a,this,r),a.deleted===!0&&!e.deleted?r==null||r.add(this,z.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,z.Added):c&&(r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=Je,...r){return await Pi.repository.APILoad(this.id,...r),this}async APICreate(i=Je,...r){return await Pi.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=Je,...r){return await Pi.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=Je,...r){return await Pi.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=Je,...r){return await Pi.repository.APIClone(this.id,...r),this}async APILoadVersion(i=Je,r,...a){return await Pi.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.parent.type===d.Project?(this.parent.removeLoop(this),e.push(this.parent)):this.parent.detachedChildren.includes(this)&&this.parent.unsubscribeDetachedChild(this),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:P(c),updated:P(r),removed:P(a),affected:P(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return X.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),r==null||r.event({id:`${_.RemoveEntity}-${this.id}--${Fe.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Fe.ActionOwnerEntityNonDeletable,rootAction:((h=r==null?void 0:r.self)==null?void 0:h.id)===this.id&&(r==null?void 0:r.actionName)===_.RemoveEntity}),r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const a=[],c=[],e=[],f=[];if(r!=null&&r.hasRemoved(this.id))return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},r),Object.values(this.detachedDependents).forEach(m=>{const{updated:v,removed:b,added:A}=m.entity.onDetachedDependencyRemoved(this,m.field,r);a.push(...v),c.push(...b),e.push(...A)}),this.inputs.forEach(m=>{const{updated:v,removed:b}=m.remove({ignoreUpstream:!0},r);a.push(...v),c.push(...b)}),this.outputs.forEach(m=>{const{updated:v,removed:b}=m.remove({ignoreUpstream:!0},r);a.push(...v),c.push(...b)}),this.body.remove({ignoreUpstream:!0},r),this.error){const{updated:m,removed:v}=this.error.remove({ignoreUpstream:!0},r);a.push(...m),c.push(...v)}if(this.dataType){const{updated:m,removed:v}=this.dataType.remove({ignoreUpstream:!0},r);a.push(...m),c.push(...v)}if(this.successCalls.forEach(m=>{a.push(m),m.removeCaller(this,r)}),this.errorCalls.forEach(m=>{a.push(m),m.removeCaller(this,r)}),!i){const m=this.removeFromParent(r);e.push(...m.added),a.push(...m.updated),c.push(...m.removed),f.push(...m.affected),this.calledBy.forEach(v=>{a.push(v),v.removeCall(this,r)})}return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:P(e),updated:P(a),removed:P(c),affected:P(f),self:this}}restore({}={},i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];if(i!=null&&i.hasAdded(this.id))return i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),this.inputs.forEach(f=>{const{updated:h}=f.restore({},i);a.push(...h)}),this.outputs.forEach(f=>{const{updated:h}=f.restore({},i);a.push(...h)}),this.body.restore({},i),this.successCalls.forEach(f=>{a.push(f),f.addSuccessCaller(this,i)}),this.errorCalls.forEach(f=>{a.push(f),f.addErrorCaller(this,i)}),this.error){const{updated:f}=this.error.restore({},i);a.push(...f)}if(this.dataType){const{updated:f}=this.dataType.restore({},i);a.push(...f)}return this.calledBySuccess.forEach(f=>{a.push(f),f.addSuccessCall(this,i)}),this.calledByError.forEach(f=>{a.push(f),f.addErrorCall(this,i)}),this.calledByEntry.forEach(f=>{a.push(f),f.addCall(this,i)}),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:P(r),updated:P(a),removed:P(c),affected:P(e),self:this}}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.inputs.flatMap(a=>a.toFlat(i)),...this.outputs.flatMap(a=>a.toFlat(i)),...this.successCalls.flatMap(a=>a.toFlat(i)),...this.errorCalls.flatMap(a=>a.toFlat(i)),...this.error?this.error.toFlat(i):[],...this.body?this.body.toFlat(i):[],...this.dataType?this.dataType.toFlat(i):[],...this.continueStatements.flatMap(a=>a.toFlat(i)),...this.breakStatements.flatMap(a=>a.toFlat(i))])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.inputs.flatMap(a=>a.toFlatIds(i)),...this.outputs.flatMap(a=>a.toFlatIds(i)),...this.successCalls.flatMap(a=>a.toFlatIds(i)),...this.errorCalls.flatMap(a=>a.toFlatIds(i)),...this.error?this.error.toFlatIds(i):[],...this.body?this.body.toFlatIds(i):[],...this.dataType?this.dataType.toFlatIds(i):[],...this.continueStatements.flatMap(a=>a.toFlatIds(i)),...this.breakStatements.flatMap(a=>a.toFlatIds(i))])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,x:this.x,y:this.y,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError}}toJSON(i=new Set){var r,a;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError,x:this.x,y:this.y,dataType:((r=this.dataType)==null?void 0:r.toJSON(i))||null,calledBySuccess:this.calledBySuccess.map(c=>c.toReference()),calledByError:this.calledByError.map(c=>c.toReference()),calledByEntry:this.calledByEntry.map(c=>c.toReference()),writesValues:this.writesValues.map(c=>c.toJSON(i)),declaration:this.declaration.toJSON(i),inputs:this.inputs.map(c=>c.toJSON(i)),outputs:this.outputs.map(c=>c.toJSON(i)),successCalls:this.successCalls.map(c=>c.toJSON(i)),errorCalls:this.errorCalls.map(c=>c.toJSON(i)),error:((a=this.error)==null?void 0:a.toJSON(i))||null,body:this.body.toJSON(i),parent:this.parent.toReference()})}toJSONClone(i=Et){var a,c,e,f,h,m,v;let r;return(a=i.seenEntityMaps)!=null&&a.has(this.id)?r=i.seenEntityMaps.get(this.id):(r=i.newId||Gn(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,r)),(c=i.seenEntities)!=null&&c.has(r)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(r),(h=i.seenEntities)==null||h.add(this.id),{id:r,version:L.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,x:this.x,y:this.y,catchesError:this.catchesError,dataType:((m=this.dataType)==null?void 0:m.toJSONClone({...i,newId:null}))||null,calledBySuccess:this.calledBySuccess.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),calledByError:this.calledByError.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),calledByEntry:this.calledByEntry.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),declaration:this.declaration.toJSON(),inputs:this.inputs.map(b=>b.toJSONClone({...i,newId:null})),outputs:this.outputs.map(b=>b.toJSONClone({...i,newId:null})),writesValues:this.writesValues.map(b=>b.toJSONClone({...i,newId:null})),successCalls:this.successCalls.map(b=>b.toJSONClone({...i,newId:null})),errorCalls:this.errorCalls.map(b=>b.toJSONClone({...i,newId:null})),error:((v=this.error)==null?void 0:v.toJSONClone({...i,newId:null}))||null,body:this.body.toJSONClone({...i,newId:null}),parent:this.parent.toReference({seenEntityMaps:i.seenEntityMaps})})}toReference(i=Et){var a;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:r,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var a,c,e,f,h;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError,x:this.x,y:this.y,dataType:((c=this.dataType)==null?void 0:c.toReference(i))||null,declaration:((e=this.declaration)==null?void 0:e.toReference(i))||null,body:((f=this.body)==null?void 0:f.toReference(i))||null,inputs:this.inputs.map(m=>m.toReference(i)),outputs:this.outputs.map(m=>m.toReference(i)),writesValues:this.writesValues.map(m=>m.toReference(i)),successCalls:this.successCalls.map(m=>m.toReference(i)),errorCalls:this.errorCalls.map(m=>m.toReference(i)),calledBySuccess:this.calledBySuccess.map(m=>m.toReference(i)),calledByError:this.calledByError.map(m=>m.toReference(i)),calledByEntry:this.calledByEntry.map(m=>m.toReference(i)),error:((h=this.error)==null?void 0:h.toReference(i))||null,parent:this.parent.toReference(i)}}toFlatJSON(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...((a=this.body)==null?void 0:a.toFlatJSON(i))||[],...this.successCalls.flatMap(c=>c.toFlatJSON(i)),...this.errorCalls.flatMap(c=>c.toFlatJSON(i)),...this.inputs.flatMap(c=>c.toFlatJSON(i)),...this.outputs.flatMap(c=>c.toFlatJSON(i)),...this.continueStatements.flatMap(c=>c.toFlatJSON(i)),...this.breakStatements.flatMap(c=>c.toFlatJSON(i)),...this.error?this.error.toFlatJSON(i):[],...this.dataType?this.dataType.toFlatJSON(i):[]])}toGenerationTarget(i=Et){var c,e;const r=this.parent.type===d.Project?void 0:(c=i.seenEntityMaps)!=null&&c.has(this.parent.id)?i.seenEntityMaps.get(this.parent.id):this.parent.id;let a=this.id;return(e=i.seenEntityMaps)!=null&&e.has(this.id)&&(a=i.seenEntityMaps.get(this.id)),{id:a,type:this.type,calledByEntry:this.calledByEntry.map(f=>f.id),calledBySuccess:this.calledBySuccess.map(f=>f.id),calledByError:this.calledByError.map(f=>f.id),declaration:this.declaration.id,parent:r}}toFlatGenerationTarget(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...((a=this.body)==null?void 0:a.toFlatGenerationTarget(i))||[],...this.successCalls.flatMap(c=>c.toFlatGenerationTarget(i)),...this.errorCalls.flatMap(c=>c.toFlatGenerationTarget(i)),...this.inputs.flatMap(c=>c.toFlatGenerationTarget(i)),...this.outputs.flatMap(c=>c.toFlatGenerationTarget(i)),...this.continueStatements.flatMap(c=>c.toFlatGenerationTarget(i)),...this.breakStatements.flatMap(c=>c.toFlatGenerationTarget(i)),...this.error?this.error.toFlatGenerationTarget(i):[],...this.dataType?this.dataType.toFlatGenerationTarget(i):[]])}clearErrors(){var i,r;return this.errors=[],this.inputs.forEach(a=>a.clearErrors()),this.outputs.forEach(a=>a.clearErrors()),this.successCalls.forEach(a=>a.clearErrors()),this.errorCalls.forEach(a=>a.clearErrors()),this.continueStatements.forEach(a=>a.clearErrors()),this.breakStatements.forEach(a=>a.clearErrors()),(i=this.error)==null||i.clearErrors(),(r=this.dataType)==null||r.clearErrors(),this}validate(){return this.errors=q$(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await LNe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...this.outputs.flatMap(r=>r.getErrors()),...this.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.dataType?this.dataType.getErrors():[]]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];await r.tick();for(const c of this.inputs)a.push(...await c.getErrorsAsync({tracker:r}));for(const c of this.outputs)a.push(...await c.getErrorsAsync({tracker:r}));return this.body&&a.push(...await this.body.getErrorsAsync({tracker:r})),this.error&&a.push(...await this.error.getErrorsAsync({tracker:r})),this.dataType&&a.push(...await this.dataType.getErrorsAsync({tracker:r})),a}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){var R,O;const e=En(r,this),f=this.toJSON(),h=a||L.UUID.uuid();f.inputs=[];const m=h.split("-id"),v=m[m.length-1||0]||h;f.id=h,f.version=L.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const b=Lr(f,e);r?b.setParent(r,i):b.setParent(this.parent,null),c&&b.subscribe(),b.initChildren(i),i==null||i.add(b,z.Added);const A=(R=this.inputs)==null?void 0:R.map(($,G)=>$.clone(i,b,v+"-input-map-"+G+"-id",c));b.inputs=A;const w=(O=this.outputs)==null?void 0:O.map(($,G)=>$.clone(i,b,v+"-output-map-"+G+"-id",c));return b.outputs=w,this.body&&(b.body=this.body.clone(i,b,v+"-body-id",c,!0)),this.error&&(b.error=this.error.clone(i,b,v+"-error-map-id",c)),this.dataType&&(b.dataType=this.dataType.clone(i,b,v+"-data-type-id",c)),i||b.captureVersion(),i==null||i.attemptAutoclose(_.CloneEntity,this.id),b}getVariableInstances(){return this.body?Fr(this.body).filter(a=>a.type===d.VariableInstance):[]}addReturnStatement(i){return Ti.includes(this.parent.type)&&this.parent.addReturnStatement(i),this}removeReturnStatement(i){return Ti.includes(this.parent.type)&&this.parent.removeReturnStatement(i),this}addBreakStatement(i){return this.breakStatements.includes(i)||this.breakStatements.push(i),this}removeBreakStatement(i){const r=this.breakStatements.indexOf(i);return r!==-1&&this.breakStatements.splice(r,1),this}addContinueStatement(i){return this.continueStatements.includes(i)||this.continueStatements.push(i),this}removeContinueStatement(i){const r=this.continueStatements.indexOf(i);return r!==-1&&this.continueStatements.splice(r,1),this}getUniqueInputMaps(){const i=[];return[...this.breakStatements,...this.continueStatements].forEach(a=>{a.outputs.filter(e=>{var f;return!e.deleted&&!((f=e.declaration)!=null&&f.deleted)}).forEach(e=>{i.find(h=>h===e||ye(h,this.project)===ye(e,this.project)&&Ri(h.dataType,e.dataType))||i.push(e)})}),P(i)}syncTerminationStatements(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-termination-statements"))){const r=[],a=[],c=[],e=[],f=this.getUniqueInputMaps();return[...this.breakStatements,...this.continueStatements].forEach(m=>{const v=m.outputs.filter(A=>{var w;return!A.deleted&&!((w=A.declaration)!=null&&w.deleted)}),b=f.filter(A=>!v.find(w=>ye(A,this.project)===ye(w,this.project)&&Ri(A.dataType,w.dataType)));b.length&&(r.push(m),i==null||i.add(m,z.Updated)),b.forEach(A=>{const w=A.clone(i,m);i==null||i.add(w,z.Added),w.addSelfToProject(i),a.push(w)})}),i==null||i.attemptAutoclose("sync-termination-statements",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncBodyInputIndexes(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-body-input-indexes"))){const r=[],a=[],c=[],e=[];return this.body.inputs.sort((f,h)=>f.index-h.index),i==null||i.attemptAutoclose("sync-body-input-indexes",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncBodyArgumentsDeclarations(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-body-arguments-declarations"))){var $;const r=[],a=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncFixedBodyArgumentDeclarations(i);r.push(...f),a.push(...h),c.push(...m);const v=this.getUniqueInputMaps(),b=this.body.inputs;v.sort((G,x)=>G.index-x.index);const A=this.getDataType();if((($=A==null?void 0:A.entity)==null?void 0:$.id)!==j["primitive-entity"].void.id&&(A!=null&&A.entity||A!=null&&A.isGroup||A!=null&&A.foreignKeyRef)&&!b.find(x=>{var k,W,te,ee,Q;return x.id!==((k=this.currentIterationNumberArgumentDeclaration)==null?void 0:k.id)&&x.id!==((W=this.currentValueArgumentDeclaration)==null?void 0:W.id)&&((ee=(te=x.dataType)==null?void 0:te.entity)==null?void 0:ee.id)===((Q=A==null?void 0:A.entity)==null?void 0:Q.id)})){let x=0;this.currentIterationNumberArgumentDeclaration&&x++,this.currentValueArgumentDeclaration&&x++;const k=xs.new(i);k.name="Aggregate result",k.description="Aggretated list of all previously outputted values from each iteration",k.constant=!0,k.index=x,k.required=!1,k.parent=this.body.toReference();const W=we(k,this.project);if(W.hydrateAncestors(),W.addSelfToProject(i),i==null||i.add(W,z.Added),a.push(W),W.setParent(this.body,i),W.initChildren(i),!W.dataType&&A){const te=qr.new(i);te.parent=W.toReference();const ee=we(te,this.project);ee.hydrateAncestors(),ee.addSelfToProject(i),a.push(ee),ee.setParent(W,i),ee.initChildren(i),ee.merge(A,i),ee.setEntity(A.entity,i),i==null||i.add(ee,z.Added),W.dataType=ee,i||ee.captureVersion()}i||W.captureVersion()}const{updated:w,added:R,removed:O}=this.removeExtraBodyArgumentDeclarations(i);return r.push(...w),a.push(...R),c.push(...O),i==null||i.attemptAutoclose("sync-body-arguments-declarations",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}reAttachAllTerminationInputMapsToDeclarations(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"reattach-termination-input-maps-to-declarations"))){var h,m,v;const r=[],a=[],c=[],e=[];return!((h=this.body)!=null&&h.dataType)||!((m=this.body)!=null&&m.dataType.entity)||((v=this.body)==null?void 0:v.dataType.entity.type)!==d.DefinitionEntity?(i==null||i.attemptAutoclose("reattach-termination-input-maps-to-declarations",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}):([...this.breakStatements,...this.continueStatements].forEach(b=>{var $,G,x;const A=b.outputs.filter(k=>{var W;return!k.deleted&&!((W=k.declaration)!=null&&W.deleted)}),w=A.filter(k=>!k.declaration&&!!k.readsValue),R=A.filter(k=>!k.declaration&&!k.readsValue);let O=(((x=(G=($=this.body)==null?void 0:$.dataType)==null?void 0:G.entity)==null?void 0:x.properties)||[]).filter(k=>!A.find(W=>{var te,ee;return!W.deleted&&!((te=W.declaration)!=null&&te.deleted)&&((ee=W.declaration)==null?void 0:ee.id)===k.id}));w.forEach(k=>{const W=k.getDataType(i);if(k.readsValue){const te=ye(k.readsValue,this.project),ee=O.find(Q=>ye(Q,this.project)===te&&Ri(Q.dataType,W));if(ee){k.setDeclaration(ee,i),r.push(k),O=O.filter(Q=>Q!==ee);return}}}),R.forEach(k=>{const W=k.getDataType(i),te=O.find(ee=>Ri(ee.dataType,W));if(te){k.setDeclaration(te,i),r.push(k),O=O.filter(ee=>ee!==te);return}}),A.forEach(k=>{const W=O.find(te=>ye(te,this.project)===ye(k,this.project));k.declaration&&!O.includes(k.declaration)&&W&&(k.setDeclaration(W,i),r.push(k),O=O.filter(te=>te!==W))})}),i==null||i.attemptAutoclose("reattach-termination-input-maps-to-declarations",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this})}syncOutputDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-outputs-properties"))){var O,$,G,x,k,W,te,ee,Q,ne,de,J,ie,se,fe,ue,me,ve,Ae,De,Ce,Le,Ge;const r=[],a=[],c=[],e=[],f=[...this.breakStatements,...this.continueStatements];if(!f.every(Ie=>Ie.initialized))return i==null||i.attemptAutoclose("sync-outputs-properties",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this};let h=!1;if(!((O=this.body)!=null&&O.dataType)){const Ie=qr.new(i);Ie.parent=this.body.toReference(),Ie.inferred=!0;const Ue=we(Ie,this.project);Ue.hydrateAncestors(),Ue.addSelfToProject(i),i==null||i.add(Ue,z.Added),Ue.initChildren(i),a.push(Ue),h=!0}const m=f.find(Ie=>!!Ie.readsValue);if(m){const Ie=($=m.readsValue)==null?void 0:$.getDataType(i);Ie&&((x=(G=this.body)==null?void 0:G.dataType)==null||x.merge(Ie,i))}h&&(i||(W=(k=this.body)==null?void 0:k.dataType)==null||W.captureVersion());const v=this.getUniqueInputMaps();let b=(ee=(te=this.body)==null?void 0:te.dataType)==null?void 0:ee.entity;if(v.length&&(!b||b.id===j["primitive-entity"].void.id)){const Ie=Kn.new(i);Ie.parent=((Q=this.body)==null?void 0:Q.dataType).toReference(),Ie.name=`${ye(this,this.project)} output definition`,Ie.description=`The definition of the output data type of the loop '${ye(this,this.project)}'`;const Ue=we(Ie,this.project);Ue.setParent((ne=this.body)==null?void 0:ne.dataType,i),Ue.hydrateAncestors(),i==null||i.add(Ue,z.Added),Ue.addSelfToProject(i),Ue.initChildren(i),a.push(Ue),b=Ue,(J=(de=this.body)==null?void 0:de.dataType)==null||J.metaSync({inferred:!0},i),i||Ue.captureVersion()}const A=(b==null?void 0:b.properties)||[];(se=(ie=this.body)==null?void 0:ie.dataType)!=null&&se.inferred&&((ue=(fe=this.body)==null?void 0:fe.dataType.entity)==null?void 0:ue.type)===d.DefinitionEntity&&(v.forEach(Ie=>{var dt,at,ut,Vi,ji;const Ue=Ie.getDataType(i);let Se=A.find(Rt=>ye(Rt,this.project)===ye(Ie,this.project)&&Ri(Rt.dataType,Ie.dataType));if(!Se){const Rt=Ps.new(i);Rt.name=ye(Ie,this.project),Rt.description=`Aggretated list of all previously outputted values from each iteration by the output '${ye(Ie,this.project)}'`,Rt.index=Ie.index,Rt.required=((dt=Ie.declaration)==null?void 0:dt.required)||!1,Rt.parent=((ut=(at=this.body)==null?void 0:at.dataType)==null?void 0:ut.entity).toReference();const pt=we(Rt,this.project);pt.hydrateAncestors(),pt.setParent((ji=(Vi=this.body)==null?void 0:Vi.dataType)==null?void 0:ji.entity,i),pt.addSelfToProject(i),i==null||i.add(pt,z.Added),pt.initChildren(i),a.push(pt),Se=pt,i||pt.captureVersion()}Se.index!==Ie.index&&(Se.metaSync({index:Ie.index},i),r.push(Se));let At=Se.getDataType(i);if(Ue&&(!At||!Ri(At,Ue))){if(!At){const Rt=Ue.clone(i,Se);i==null||i.add(Rt,z.Added),Rt.addSelfToProject(i),At=Rt,a.push(Rt),r.push(Se)}At.merge(Ue,i)}if(!Ue&&!At){const Rt={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,parentRelationType:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:Se.toReference()},pt=we(Rt,this.project);pt.hydrateAncestors(),pt.setParent(Se,i),pt.addSelfToProject(i),i==null||i.add(pt,z.Added),pt.initChildren(i),a.push(pt),i||pt.captureVersion()}}),this.reAttachAllTerminationInputMapsToDeclarations(i)),(ve=(me=this.body)==null?void 0:me.dataType)!=null&&ve.inferred&&((De=(Ae=this.body)==null?void 0:Ae.dataType.entity)==null?void 0:De.type)===d.DefinitionEntity&&A.filter(Ue=>!v.find(Se=>ye(Ue,this.project)===ye(Se,this.project))).forEach(Ue=>{if(!(i!=null&&i.hasRemoved(Ue.id))&&!Ue.deleted){const{updated:We,removed:Se}=Ue.remove({ignoreUpstream:!1},i);r.push(...We),c.push(...Se)}}),f.forEach(Ie=>{Ie.outputs.filter(We=>{var Se;return!We.deleted&&!((Se=We.declaration)!=null&&Se.deleted)}).forEach(We=>{var ot,At,dt;if(!(((dt=(At=(ot=this.body)==null?void 0:ot.dataType)==null?void 0:At.entity)==null?void 0:dt.properties)||[]).find(at=>{var ut;return((ut=We.declaration)==null?void 0:ut.id)===at.id})&&!(i!=null&&i.hasRemoved(We.id))&&!We.deleted){const{updated:at,removed:ut}=We.remove({ignoreUpstream:!1},i);r.push(...at),c.push(...ut)}})});const w=this.getUniqueInputMaps();if(f.every(Ie=>!Ie.readsValue)&&!w.length){const Ie=this.project.getBuiltIn(j["primitive-entity"].void.id);(Le=(Ce=this.body)==null?void 0:Ce.dataType)==null||Le.setEntity(Ie,i),r.push((Ge=this.body)==null?void 0:Ge.dataType)}return i==null||i.attemptAutoclose("sync-outputs-properties",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncOutputMaps(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SyncOutputs))){var v,b,A;const r=[],a=[],c=[],e=[],f=((A=(b=(v=this.body)==null?void 0:v.dataType)==null?void 0:b.entity)==null?void 0:A.properties)||[],h=this.outputs;return f.forEach(w=>{var $;let O=h.find(G=>{var x,k;return((x=G.declaration)==null?void 0:x.id)===w.id&&Ri((k=G.declaration)==null?void 0:k.dataType,w.dataType)});if(O)(($=O.declaration)==null?void 0:$.id)!==w.id&&(O.setDeclaration(w,i),r.push(O));else{const G={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.OutputMap,index:w.index,declaration:w.toJSON(),writesValues:[],parent:this.toReference()},x=we(G,this.project);x.hydrateAncestors(),x.setParent(this,i),x.addSelfToProject(i),i==null||i.add(x,z.Added),x.initChildren(i),a.push(x),i||x.captureVersion(),O=x}O.index!==w.index&&(O.metaSync({index:w.index},i),r.push(O))}),h.filter(w=>!f.find(O=>{var $;return(($=w.declaration)==null?void 0:$.id)===O.id})).forEach(w=>{const{updated:R,removed:O}=w.remove({ignoreUpstream:!1},i);r.push(...R),c.push(...O)}),this.outputs.forEach(w=>{const{updated:R,added:O,removed:$}=w.afterAllChildrenInitialized(i);r.push(...R),a.push(...O),c.push(...$)}),this.outputs.sort((w,R)=>w.index-R.index),i==null||i.attemptAutoclose(_.SyncOutputs,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}createCurrentIterationNumberArgumentDeclaration(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"create-current-iteration-number-argument-declaration"))){const r=[],a=[],c=[],e=[];let h=this.body.inputs.find(A=>{var w;return A.name===Pi.CURRENT_ITERATION_NUMBER_ARG_NAME||A.id===((w=this.currentIterationNumberArgumentDeclaration)==null?void 0:w.id)});const m=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!h){const A={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:Pi.CURRENT_ITERATION_NUMBER_ARG_NAME,codeName:null,description:"The number of the current iteration",defaultValue:null,constant:!0,dataType:null,implements:[m==null?void 0:m.toJSON()],index:this.body.inputs.length,required:!0,parent:this.body.toReference(),writesValues:[]},w=we(A,this.project);w.hydrateAncestors(),w.setParent(this.body,i),w.addSelfToProject(i),i==null||i.add(w,z.Added),w.initChildren(i),a.push(w),i||w.captureVersion(),h=w}!h.index&&h.index!==0&&(h.metaSync({index:0},i),r.push(h)),(!h.implements||!h.implements.find(A=>A.id===m.id))&&(h.addImplementation(m,i),r.push(h));let b=h.getDataType(i);if(!b){const A={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,parentRelationType:null,isList:!1,index:null,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:h.toReference()},w=we(A,this.project);w.hydrateAncestors(),w.setParent(h,i),w.addSelfToProject(i),i==null||i.add(w,z.Added),w.initChildren(i),a.push(w),i||w.captureVersion(),b=w}if(!b.entity||b.entity.type!==d.PrimitiveEntity||b.entity.name!==he.Number||b.entity.id!==j["primitive-entity"].number.id){const A=this.project.getBuiltIn(j["primitive-entity"].number.id);b.setEntity(A,i),r.push(b)}return i==null||i.attemptAutoclose("create-current-iteration-number-argument-declaration",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}removeExtraBodyArgumentDeclarations(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"remove-extra-body-argument-declarations"))){const r=[],a=[],c=[],e=[],f=this.body.inputs,h=this.getDataType();return f.filter(v=>{var b,A,w,R,O;return v===this.currentIterationNumberArgumentDeclaration||v===this.currentValueArgumentDeclaration?!1:((b=h==null?void 0:h.entity)==null?void 0:b.id)===j["primitive-entity"].void.id||((A=h==null?void 0:h.entity)==null?void 0:A.id)===void 0?!0:((R=(w=v.dataType)==null?void 0:w.entity)==null?void 0:R.id)!==((O=h==null?void 0:h.entity)==null?void 0:O.id)}).forEach(v=>{const{updated:b,removed:A}=v.remove({ignoreUpstream:!1},i);r.push(...b),c.push(...A)}),i==null||i.attemptAutoclose("remove-extra-body-argument-declarations",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}createCurrentValueInputBasedOnInputMap(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"create-current-value-input-based-on-input-map"))){var v,b,A,w,R,O,$,G,x;const r=[],a=[],c=[],e=[];switch(this.declaration.id){case _t.List:{const k=this.body.inputs.find(ee=>!!ee.implements.find(Q=>Q.id===j[d.Loop][_t.List].body.inputs.currentValue.id)),W=this.inputs.find(ee=>{var Q;return((Q=ee.declaration)==null?void 0:Q.id)===j[d.Loop][_t.List].inputs.list.id});if(!W)break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(de=>de.id===te.id)&&(k.addImplementation(te,i),r.push(k));let Q=k.getDataType(i);if(!Q){const de={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(v=this.currentValueArgumentDeclaration)==null?void 0:v.toReference()},J=we(de,this.project);J.hydrateAncestors(),J.setParent(this.currentValueArgumentDeclaration,i),J.addSelfToProject(i),i==null||i.add(J,z.Added),J.initChildren(i),a.push(J),i||J.captureVersion(),Q=J}const ne=W.getDataType(i);Q.merge(ne,i),Q.metaSync({isList:!1},i)}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:Pi.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:[te],writesValues:[],dataType:null,parent:this.body.toReference()},Q=we(ee,this.project);Q.hydrateAncestors(),Q.setParent(this.body,i),Q.addSelfToProject(i),i==null||i.add(Q,z.Added),Q.initChildren(i),te&&!Q.implements.find(ne=>ne.id===te.id)&&(Q.addImplementation(te,i),r.push(Q)),a.push(Q),i||Q.captureVersion()}break}case _t.ManualFlow:break;case _t.Counted:break;case _t.ObjectKeys:{const k=this.body.inputs.find(ee=>!!ee.implements.find(Q=>Q.id===j[d.Loop][_t.ObjectKeys].body.inputs.currentValue.id));if(!this.inputs.find(ee=>{var Q;return((Q=ee.declaration)==null?void 0:Q.id)===j[d.Loop][_t.ObjectKeys].inputs.object.id}))break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ne=>ne.id===te.id)&&(k.addImplementation(te),r.push(k));let Q=k.getDataType(i);if(Q){const ne=this.project.getBuiltIn(j["primitive-entity"].string.id);((A=Q.entity)==null?void 0:A.id)!==ne.id&&(Q.setEntity(ne,i),r.push(Q))}else{const ne={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(b=this.currentValueArgumentDeclaration)==null?void 0:b.toReference()},de=we(ne,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,z.Added),de.initChildren(i),i||de.captureVersion(),Q=de}}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:Pi.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:[te],writesValues:[],dataType:null,parent:this.body.toReference()},Q=we(ee,this.project);Q.hydrateAncestors(),Q.setParent(this.body,i),Q.addSelfToProject(i),i==null||i.add(Q,z.Added),Q.initChildren(i),te&&!Q.implements.find(ne=>ne.id===te.id)&&(Q.addImplementation(te,i),r.push(Q)),a.push(Q),i||Q.captureVersion()}break}case _t.ObjectValues:{const k=this.body.inputs.find(ee=>!!ee.implements.find(Q=>Q.id===j[d.Loop][_t.ObjectValues].body.inputs.currentValue.id)),W=this.inputs.find(ee=>{var Q;return((Q=ee.declaration)==null?void 0:Q.id)===j[d.Loop][_t.ObjectValues].inputs.object.id});if(!W)break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ne=>ne.id===te.id)&&(k.addImplementation(te,i),r.push(k));let Q=k.getDataType(i);if(Q){const ne=W.getDataType(i),de=((O=ne==null?void 0:ne.entity)==null?void 0:O.properties)||[];($=Q.orChildrenGroup)==null||$.forEach(J=>{const{updated:ie,removed:se}=J.remove({ignoreUpstream:!1},i);r.push(...ie),c.push(...se)}),de.forEach(J=>{if(!J.getDataType(i)){const se={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,index:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:rt.OrDataTypeGroup,parent:Q.toReference()},fe=we(se,this.project);fe.hydrateAncestors(),fe.setParent(Q,i),fe.addSelfToProject(i),i==null||i.add(fe,z.Added),fe.initChildren(i),i||fe.captureVersion(),a.push(fe)}})}else{const ne={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(w=this.currentValueArgumentDeclaration)==null?void 0:w.toReference()},de=we(ne,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,z.Added),de.initChildren(i),i||de.captureVersion(),Q=de;const J=W.getDataType(i);(((R=J==null?void 0:J.entity)==null?void 0:R.properties)||[]).forEach(se=>{if(!se.getDataType(i)){const ue={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,index:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:rt.OrDataTypeGroup,parent:de.toReference()},me=we(ue,this.project);me.hydrateAncestors(),me.setParent(de,i),me.addSelfToProject(i),i==null||i.add(me,z.Added),me.initChildren(i),i||me.captureVersion(),a.push(me)}})}}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:Pi.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,constant:!0,defaultValue:null,index:this.body.inputs.length,required:!0,implements:[te],writesValues:[],dataType:null,parent:this.body.toReference()},Q=we(ee,this.project);Q.hydrateAncestors(),Q.setParent(this.body,i),Q.addSelfToProject(i),i==null||i.add(Q,z.Added),Q.initChildren(i),te&&!Q.implements.find(ne=>ne.id===te.id)&&(Q.addImplementation(te,i),r.push(Q)),a.push(Q),i||Q.captureVersion()}break}case _t.String:{const k=this.body.inputs.find(ee=>!!ee.implements.find(Q=>Q.id===j[d.Loop][_t.String].body.inputs.currentValue.id));if(!this.inputs.find(ee=>{var Q;return((Q=ee.declaration)==null?void 0:Q.id)===j[d.Loop][_t.String].inputs.string.id}))break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ne=>ne.id===te.id)&&(k.addImplementation(te,i),r.push(k));let Q=k.getDataType(i);if(Q){const ne=this.project.getBuiltIn(j["primitive-entity"].string.id);((x=Q.entity)==null?void 0:x.id)!==ne.id&&(Q.setEntity(ne,i),r.push(Q))}else{const ne={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(G=this.currentValueArgumentDeclaration)==null?void 0:G.toReference()},de=we(ne,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,z.Added),de.initChildren(i),i||de.captureVersion(),a.push(de),Q=de}}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.ArgumentDeclaration,name:Pi.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,index:this.body.inputs.length,required:!0,constant:!0,defaultValue:null,implements:[te],writesValues:[],dataType:null,parent:this.body.toReference()},Q=we(ee,this.project);Q.hydrateAncestors(),Q.setParent(this.body,i),Q.addSelfToProject(i),i==null||i.add(Q,z.Added),Q.initChildren(i),te&&!Q.implements.find(ne=>ne.id===te.id)&&(Q.addImplementation(te,i),r.push(Q)),a.push(Q),i||Q.captureVersion()}break}}const{updated:f,added:h,removed:m}=this.removeExtraBodyArgumentDeclarations(i);return r.push(...f),a.push(...h),c.push(...m),i==null||i.attemptAutoclose("create-current-value-input-based-on-input-map",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncFixedBodyArgumentDeclarations(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-fixed-body-argument-declarations"))){const r=[],a=[],c=[],e=[],{updated:f,added:h,removed:m}=this.createCurrentIterationNumberArgumentDeclaration(i);r.push(...f),a.push(...h),c.push(...m);const{updated:v,added:b,removed:A}=this.createCurrentValueInputBasedOnInputMap(i);return r.push(...v),a.push(...b),c.push(...A),i==null||i.attemptAutoclose("sync-fixed-body-argument-declarations",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncInputMaps(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-input-maps"))){const r=[],a=[],c=[],e=[];switch(this.declaration.id){case _t.List:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===j[d.Loop]["list-loop"].inputs.list.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==j[d.Loop]["list-loop"].inputs.list.id){const m=this.project.get(j[d.Loop]["list-loop"].inputs.list.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(j[d.Loop]["list-loop"].inputs.list.id),v={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==j[d.Loop]["list-loop"].inputs.list.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>U(m.createdAt).isBefore(U(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case _t.ManualFlow:{this.inputs.forEach(f=>{f.remove({ignoreUpstream:!1},i),c.push(f)});break}case _t.Counted:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===j[d.Loop]["counted-loop"].inputs.number.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==j[d.Loop]["counted-loop"].inputs.number.id){const m=this.project.get(j[d.Loop]["counted-loop"].inputs.number.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(j[d.Loop]["counted-loop"].inputs.number.id),v={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==j[d.Loop]["counted-loop"].inputs.number.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>U(m.createdAt).isBefore(U(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case _t.ObjectKeys:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===j[d.Loop]["object-keys-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==j[d.Loop]["object-keys-loop"].inputs.object.id){const m=this.project.get(j[d.Loop]["object-keys-loop"].inputs.object.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(j[d.Loop]["object-keys-loop"].inputs.object.id),v={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==j[d.Loop]["object-keys-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>U(m.createdAt).isBefore(U(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case _t.ObjectValues:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===j[d.Loop]["object-values-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==j[d.Loop]["object-values-loop"].inputs.object.id){const m=this.project.get(j[d.Loop]["object-values-loop"].inputs.object.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(j[d.Loop]["object-values-loop"].inputs.object.id),v={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==j[d.Loop]["object-values-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>U(m.createdAt).isBefore(U(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case _t.String:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===j[d.Loop]["string-loop"].inputs.string.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==j[d.Loop]["string-loop"].inputs.string.id){const m=this.project.get(j[d.Loop]["string-loop"].inputs.string.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(j[d.Loop]["string-loop"].inputs.string.id),v={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==j[d.Loop]["string-loop"].inputs.string.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>U(m.createdAt).isBefore(U(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}}return this.inputs.forEach(f=>{const{updated:h,added:m,removed:v}=f.afterAllChildrenInitialized(i);r.push(...h),a.push(...m),c.push(...v)}),this.inputs.sort((f,h)=>f.index-h.index),i==null||i.attemptAutoclose("sync-input-maps",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}getValueInputMapDeclarationId(){switch(this.declaration.id){case _t.List:return j[d.Loop]["list-loop"].inputs.list.id;case _t.ObjectKeys:return j[d.Loop]["object-keys-loop"].inputs.object.id;case _t.ObjectValues:return j[d.Loop]["object-values-loop"].inputs.object.id;case _t.String:return j[d.Loop]["string-loop"].inputs.string.id;case _t.Counted:return j[d.Loop]["counted-loop"].inputs.number.id;default:return null}}getCurrentValueBuiltInValueDescriptor(){var r;if(this.declaration.id===_t.ManualFlow||this.declaration.id===_t.Counted)return null;const i=(r=j[d.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:r.id;return i?this.project.get(i):null}getCurrentIterationNumberBuiltInValueDescriptor(){const i=j[d.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(i)}syncBody(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-body"))){var m;const r=[],a=[],c=[],e=[],f=j[d.Loop][this.declaration.id].body.id,h=this.project.getBuiltIn(f);if(this.body)((m=this.body.implements)==null?void 0:m.id)!==h.id&&(this.body.setImplements(h,i),this.body.setParent(this,i),r.push(this.body));else{const v=su.new(i);v.implements=h.toJSON(),v.name=h.name,v.parent=this.toReference();const b=we(v,this.project);b.hydrateAncestors(),b.setParent(this,i),b.addSelfToProject(i),i==null||i.add(b,z.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}return i==null||i.attemptAutoclose("sync-body",this.id),{self:this,updated:P(r),added:P(a),removed:P(c),affected:P(e)}}checkIsSynced(){var A,w,R,O,$,G,x,k,W,te,ee,Q,ne,de,J,ie,se,fe,ue;if((!this.body||!((A=this.body)!=null&&A.dataType)||!((w=this.body)!=null&&w.dataType.entity))&&this.id)return!1;const i=[_t.List,_t.ObjectKeys,_t.ObjectValues,_t.String],r=this.body.inputs.find(me=>me.implements.find(ve=>ve.id===j[d.Loop][this.declaration.id].body.inputs.iterationNumber.id))||null,a=this.body.inputs.find(me=>me.implements.find(ve=>{var Ae;return ve.id===((Ae=j[d.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:Ae.id)}))||null;if(!r||i.includes(this.declaration.id)&&!a)return!1;if(this.declaration.id===_t.List){const me=this.inputs.find(ve=>{var Ae;return((Ae=ve.declaration)==null?void 0:Ae.id)===j[d.Loop]["list-loop"].inputs.list.id});if(me&&a){const ve=me.getDataType(null),Ae=a.getDataType(null),De=Ri(ve,Ae,{ignoreTopListDif:!0});if(!De.compatible||!De.exact||(Ae==null?void 0:Ae.isList)!==!1)return!1}}const c=[...this.breakStatements,...this.continueStatements],e=this.getDataType();if(((R=e==null?void 0:e.entity)==null?void 0:R.id)!==j["primitive-entity"].void.id&&(e!=null&&e.entity||e!=null&&e.isGroup||e!=null&&e.foreignKeyRef)){if(!this.body.inputs.find(ve=>{var Ae,De,Ce;return((De=(Ae=ve.dataType)==null?void 0:Ae.entity)==null?void 0:De.id)===((Ce=e==null?void 0:e.entity)==null?void 0:Ce.id)})||((O=e==null?void 0:e.entity)==null?void 0:O.type)===d.DefinitionEntity&&(!(e==null?void 0:e.entity).properties.every(De=>this.outputs.find(Ce=>{var Le;return((Le=Ce.declaration)==null?void 0:Le.id)===De.id}))||!c.every(De=>{const Ce=De.outputs.filter(Ie=>!Ie.deleted),Le=(e==null?void 0:e.entity).properties.every(Ie=>Ce.find(Ue=>{var We;return((We=Ue.declaration)==null?void 0:We.id)===Ie.id})),Ge=Ce.every(Ie=>(e==null?void 0:e.entity).properties.find(Ue=>{var We;return Ue.id===((We=Ie.declaration)==null?void 0:We.id)}));return Le&&Ge})))return!1}else if(this.body.inputs.find(Ae=>{var De,Ce,Le;return((Ce=(De=Ae.dataType)==null?void 0:De.entity)==null?void 0:Ce.id)===((Le=e==null?void 0:e.entity)==null?void 0:Le.id)})||this.outputs.length>0||![...this.breakStatements,...this.continueStatements].every(Ae=>Ae.outputs.filter(De=>!De.deleted).length===0))return!1;if([_t.List,_t.Counted,_t.ObjectKeys,_t.ObjectValues,_t.String].includes(this.declaration.id)){if(this.inputs.length!==1)return!1;const me=this.inputs[0],ve=this.getValueInputMapDeclarationId();if((($=me.declaration)==null?void 0:$.id)!==ve)return!1}else if(this.inputs.length>0)return!1;if((x=(G=this.body)==null?void 0:G.dataType)!=null&&x.inferred){const me=this.getUniqueInputMaps();if(c.every(Ce=>!Ce.readsValue)&&!me.length&&((te=(W=(k=this.body)==null?void 0:k.dataType)==null?void 0:W.entity)==null?void 0:te.id)!==j["primitive-entity"].void.id)return!1;const Ae=c.find(Ce=>Ce.readsValue),De=(ne=(Q=(ee=Ae==null?void 0:Ae.readsValue)==null?void 0:ee.getDataType(null))==null?void 0:Q.entity)==null?void 0:ne.id;if(De&&De!==((ie=(J=(de=this.body)==null?void 0:de.dataType)==null?void 0:J.entity)==null?void 0:ie.id))return!1}const h=((ue=(fe=(se=this.body)==null?void 0:se.dataType)==null?void 0:fe.entity)==null?void 0:ue.properties)||[],m=this.outputs,v=h.every(me=>m.find(ve=>{var Ae;return((Ae=ve.declaration)==null?void 0:Ae.id)===me.id})),b=m.every(me=>h.find(ve=>{var Ae;return ve.id===((Ae=me.declaration)==null?void 0:Ae.id)}));return!(!v||!b)}syncFromDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-from-data-type"))){const r=[],a=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncOutputDataType(i);r.push(...f),a.push(...h),c.push(...m);const{updated:v,added:b,removed:A}=this.syncBodyArgumentsDeclarations(i);r.push(...v),a.push(...b),c.push(...A);const{updated:w,added:R,removed:O}=this.syncBodyInputIndexes(i);r.push(...w),a.push(...R),c.push(...O);const{updated:$,added:G,removed:x}=this.syncOutputMaps(i);return r.push(...$),a.push(...G),c.push(...x),i==null||i.attemptAutoclose("sync-from-data-type",this.id),{self:this,updated:P(r),added:P(a),removed:P(c),affected:P(e)}}syncChildren(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-children"))){const r=[],a=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncBody(i);r.push(...f),a.push(...h),c.push(...m);const{updated:v,added:b,removed:A}=this.syncInputMaps(i);r.push(...v),a.push(...b),c.push(...A);const{updated:w,added:R,removed:O}=this.syncTerminationStatements(i);r.push(...w),a.push(...R),c.push(...O);const{updated:$,added:G,removed:x}=this.syncFromDataType(i);return r.push(...$),a.push(...G),c.push(...x),i==null||i.attemptAutoclose("sync-children",this.id),{self:this,updated:P(r),added:P(a),removed:P(c),affected:P(e)}}getUnusedInputs(){return this.inputs.filter(i=>i.suggestion||!i.readsValue&&!i.defaultValue)}getUnusedOutputs(){return this.outputs.filter(i=>i.suggestion||!i.writesValues.length)}getUsedInputs(){return this.inputs.filter(i=>!i.suggestion&&(i.readsValue||i.defaultValue))}getUsedOutputs(){return this.outputs.filter(i=>!i.suggestion&&i.writesValues.length)}addValueReader(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddValueReader))){var e,f,h,m;if(!this.checkCanEditFromScopeOwnerWithSideEffects(this,_.AddValueReader,r))return this;(i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.SetValueWriter}-${this.id}`,action:_.SetValueWriter,owner:this,errorReason:Fe.CannotValueWriteItself,rootAction:((e=r==null?void 0:r.self)==null?void 0:e.id)===this.id&&(r==null?void 0:r.actionName)===_.SetValueWriter}));const a=i.type===d.InputMap&&i.parent.type===d.VariableInstance&&((f=i.declaration)==null?void 0:f.type)===d.Property&&((h=i.declaration)==null?void 0:h.constant),c=i.type===d.VariableInstance&&((m=i.declaration)==null?void 0:m.constant);return(a||c)&&i?(r==null||r.event({id:`${_.SetValueWriter}-${this.id}--${i.id}`,action:_.SetValueWriter,owner:i,counterpart:this,errorReason:Fe.ValueReadingOverridesConstantVariable,rootAction:!1}),r==null||r.attemptAutoclose(_.AddValueReader,this.id),this):this.writesValues.includes(i)?(r==null||r.attemptAutoclose(_.AddValueReader,this.id),this):(this.writesValues.push(i),r==null||r.add(this,z.Affected),this)}setDataType(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetDataType))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetDataType,this.id),this;const a=this.dataType;return(a==null?void 0:a.id)!==(i==null?void 0:i.id)&&(a==null||a.remove({ignoreUpstream:!0},r),this.dataType=i,this.subscribeToDependencies(),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.SetDataType,this.id),this}removeValueReader(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveValueReader))){return this.checkCanEditFromScopeOwnerWithSideEffects(this,_.RemoveValueReader,r)?this.writesValues.includes(i)?(this.writesValues=this.writesValues.filter(a=>a.id!==i.id),r==null||r.add(this,z.Affected),this):(r==null||r.attemptAutoclose(_.RemoveValueReader,this.id),this):this}removeDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveDataType))){return this.checkCanEdit(this,i)?(this.dataType&&(this.dataType.remove({ignoreUpstream:!0},i),i==null||i.add(this,z.Affected),this.dataType=null),i==null||i.attemptAutoclose(_.RemoveDataType,this.id),this):(X.Logger.warn(`[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveDataType,this.id),this)}getDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"get-data-type"))){var r;return i==null||i.attemptAutoclose("get-data-type",this.id),this.dataType||((r=this.body)==null?void 0:r.dataType)||null}};D(Pi,"repository",{APICreate:async(i,...r)=>i,APIUpdate:async(i,...r)=>i,APIDelete:async(i,...r)=>i,APIClone:async(i,...r)=>{},APILoad:async(i,...r)=>null,APILoadVersion:async(i,r,...a)=>null}),D(Pi,"type",d.Loop),D(Pi,"USER_MANAGED_PARENT_TYPES",[...tn,d.Project]),D(Pi,"PARENT_TYPES",[...wr.USER_MANAGED_PARENT_TYPES]),D(Pi,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),D(Pi,"CURRENT_VALUE_ARG_NAME","Current value"),D(Pi,"MUTABLE_BASE_PROPERTIES",["catchesError"]),D(Pi,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),D(Pi,"BASE_PROPERTIES",[...Pi.MUTABLE_BASE_PROPERTIES,...Pi.INMUTABLE_BASE_PROPERTIES]),D(Pi,"MUTABLE_META_PROPERTIES",[...Pi.MUTABLE_BASE_PROPERTIES,"x","y"]),D(Pi,"INMUTABLE_META_PROPERTIES",[...Pi.INMUTABLE_BASE_PROPERTIES]),D(Pi,"META_PROPERTIES",[...Pi.MUTABLE_META_PROPERTIES,...Pi.INMUTABLE_META_PROPERTIES]),D(Pi,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),D(Pi,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration","dataType"]),D(Pi,"UPSTREAM_PROPERTIES",[...Pi.MUTABLE_UPSTREAM_PROPERTIES,...Pi.INMUTABLE_UPSTREAM_PROPERTIES]),D(Pi,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),D(Pi,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),D(Pi,"DOWNSTREAM_PROPERTIES",[...Pi.MUTABLE_DOWNSTREAM_PROPERTIES,...Pi.INMUTABLE_DOWNSTREAM_PROPERTIES]),D(Pi,"PROPERTIES",[...Pi.META_PROPERTIES,...Pi.UPSTREAM_PROPERTIES,...Pi.DOWNSTREAM_PROPERTIES]);let Rc=Pi;async function kNe(s,u={}){const i=X.YieldTracker.from(u),r=ts(s),a=is(s),c=rs(s),e=jNe(s),f=[...r,...a,...c,...e],h=vi(s.errors,f);await i.tick();for(const m of s.inputs)await m.validateAsync({tracker:i});for(const m of s.andChildrenGroup||[])await m.validateAsync({tracker:i});for(const m of s.orChildrenGroup||[])await m.validateAsync({tracker:i});return h}function UNe(s){s.inputs.forEach(e=>e.validate());const u=ts(s),i=is(s),r=rs(s),a=jNe(s),c=[...u,...i,...r,...a];return(s.andChildrenGroup||[]).forEach(e=>e.validate()),(s.orChildrenGroup||[]).forEach(e=>e.validate()),vi(s.errors,c)}function jNe(s){var i,r;const u=[];if(((i=s.declaration)==null?void 0:i.id)!==j.condition["condition-group-and"].id&&((r=s.declaration)==null?void 0:r.id)!==j.condition["condition-group-or"].id)return u;if(!s.andChildrenGroup&&!s.orChildrenGroup){const a=Kt({id:`${s.id}--${ge.EmptyGroupCondition}`,message:`Condition "${ye(s,s.project)}" with id "${s.id}" does not have any nested conditions. So it doesn't do anything.`,severity:Ee.Error,code:ge.EmptyGroupCondition,entity:s});u.push(a.error)}return vi(s.errors,u)}const WRi=Object.freeze(Object.defineProperty({__proto__:null,validate:UNe,validateAsync:kNe},Symbol.toStringTag,{value:"Module"}));var FNe=(s=>(s.Parent="parent",s))(FNe||{});const cr=class cr extends kn{constructor(i,r){super(i);D(this,"initialData");D(this,"id");D(this,"x");D(this,"y");D(this,"type",d.Condition);D(this,"index",null);D(this,"successCalls",[]);D(this,"errorCalls",[]);D(this,"declaration");D(this,"inputs",[]);D(this,"calledBySuccess",[]);D(this,"calledByError",[]);D(this,"calledByEntry",[]);D(this,"andChildrenGroup",null);D(this,"orChildrenGroup",null);D(this,"project");D(this,"errors",[]);D(this,"parent");D(this,"detachedDependents",{});D(this,"knownVersions",null);D(this,"activeVersion",!1);D(this,"initialized",!1);D(this,"startedInitialization",!1);this.initialData=i,this.project=r,this.id=i.id,this.x=i.x,this.y=i.y,this.index=i.index??null}static new(i=null){return{id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:(i==null?void 0:i.author)||L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.Condition,declaration:null,index:null,inputs:[],parent:null,andChildrenGroup:null,orChildrenGroup:null,calledByEntry:[],calledBySuccess:[],calledByError:[],errorCalls:[],successCalls:[],x:0,y:0}}static fromGenerationTarget(i,r,a){var R,O;const c=a===void 0?r.addChangeSet(new Z(r,L.sessionAuthor,U().toISOString(),r,!0,_.CreateFromGenerationTarget)):a;let e=r;if(i.parent){const $=oe(i.parent);e=r.get($)}const f=(i.calledByEntry||[]).map($=>{const G=oe($);return r.get(G)}),h=(i.calledBySuccess||[]).map($=>{const G=oe($);return r.get(G)}),m=(i.calledByError||[]).map($=>{const G=oe($);return r.get(G)});let v;if(i.declaration){const $=oe(i.declaration);v=r.get($)}let b=null;e&&e.type===d.Condition&&(((R=e.declaration)==null?void 0:R.id)===ln.Or?b=(e.orChildrenGroup||[]).length:((O=e.declaration)==null?void 0:O.id)===ln.And&&(b=(e.andChildrenGroup||[]).length));const A={id:i.id,version:L.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||U().toISOString(),author:(c==null?void 0:c.author)||L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.Condition,index:b,declaration:v.toJSON(),andChildrenGroup:[],orChildrenGroup:[],calledByEntry:f.map($=>$.toReference()),calledBySuccess:h.map($=>$.toReference()),calledByError:m.map($=>$.toReference()),errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:e.toReference()},w=we(A,r);return w.hydrateAncestors(),w.setParent(e,c),w.addSelfToProject(c),c==null||c.add(w,z.Added),w.initChildren(c),c||w.captureVersion(),w}static validateGenerationTarget(i,r){let a=JSON.parse(JSON.stringify(i));const c=[],e=[],f=ya(a,{parent:{list:!1,types:[...tn,d.Project],optional:!0}},r);c.push(...f.explanations),a=f.modifiedData;const h=Pn(a);if(e.push(...f.errors,...h.errors),c.push(...h.explanations),!i.declaration)e.push(new Ne({id:`${i.id}--${Pe.InvalidObjectStructure}`,code:Pe.InvalidObjectStructure,severity:Ee.Error,message:`Entity of type '${i.type}' with id '${i.id}' is missing the 'declaration' property. This property is required for a '${i.type}' entity and must point to one of the built-in action descriptors reserved for '${d.Condition}' entities.`})),c.push({id:Rr.AllConditionActionDescriptors,message:QI(r)});else if(!r.get(i.declaration))e.push(new Ne({id:`${i.id}--${Te.ReferencedEntityNotFound}`,code:Te.ReferencedEntityNotFound,severity:Ee.Error,message:`Entity of type '${i.type}' with id '${i.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 '${d.Condition}' entities.`})),c.push({id:Rr.AllConditionActionDescriptors,message:QI(r)});else{const v=_Fe(i.declaration,r);e.push(...v.errors),c.push(...v.explanations)}return{errors:e,explanations:c,modifiedData:a}}validateGeneratedUpdate(i){const r=[],a=[];return i.parent&&r.push(new Ne({id:`${this.id}--${Te.InvalidParentUpdate}`,code:Te.InvalidParentUpdate,severity:Ee.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.
|
|
48
48
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.`})),{errors:r,explanations:a,modifiedData:i}}subscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]||(this.detachedDependents[r.entity.id]=r)}),this}unsubscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]&&delete this.detachedDependents[r.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const r=[],a=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);r.push(...h.updated),a.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}onDetachedDependencyRemoved(i,r,a){const c=[],e=[],f=[],h=[];if(r==="parent"){const{updated:m,added:v,removed:b}=this.remove({ignoreUpstream:!1},a);c.push(...m),e.push(...v),f.push(...b)}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}onDetachedDependencyRestored(i,r,a){const c=[],e=[],f=[],h=[];if(r==="parent"){const{updated:m,added:v,removed:b}=this.restore({},a);c.push(...m),e.push(...v),f.push(...b)}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}unsubscribeFromDependencies(){return this.parent.unsubscribeDependents([{entity:this,field:"parent"}]),this}subscribeToDependencies(){var i;return(i=this.parent)==null||i.subscribeDependents([{entity:this,field:"parent"}]),this}increaseVersion(i){var r;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((r=this.knownVersions)!=null&&r.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=L.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new cr(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new cr(this,this.project);return this.apply(i)}apply(i){const r=this.toMeta();return i.metaSync(r,null),i.inputs=[...this.inputs],i.declaration=this.declaration,i.andChildrenGroup=this.andChildrenGroup?[...this.andChildrenGroup]:this.andChildrenGroup,i.orChildrenGroup=this.orChildrenGroup?[...this.orChildrenGroup]:this.orChildrenGroup,i.successCalls=[...this.successCalls],i.errorCalls=[...this.errorCalls],i.calledBySuccess=[...this.calledBySuccess],i.calledByError=[...this.calledByError],i.calledByEntry=[...this.calledByEntry],i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const r=[],a=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);r.push(this.parent,...f.updated),a.push(...f.added),c.push(...f.removed)}return{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}async restoreVersion(i,r){var m;const a=[],c=[],e=[],f=[];if(this.version===i&&(r!=null&&r.skipIfSameVersion))return{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this};if(!this.knownVersions){const v=new Map;for(const[b,A]of this.knownVersions||new Map){if(v.set(b,A),A.activeVersion=!1,A.knownVersions)for(const[w,R]of A.knownVersions)v.set(w,R);A.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const v=await this.APILoadVersion({},i);if(!v)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new cr(v,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.inputs=[...h.inputs],this.declaration=h.declaration,this.andChildrenGroup=h.andChildrenGroup?[...h.andChildrenGroup]:null,this.orChildrenGroup=h.orChildrenGroup?[...h.orChildrenGroup]:null,this.successCalls=[...h.successCalls],this.errorCalls=[...h.errorCalls],this.calledBySuccess=[...h.calledBySuccess],this.calledByError=[...h.calledByError],this.calledByEntry=[...h.calledByEntry],this.parent=h.parent,{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}updateWithShallowTransfer(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithShallowTransfer))){var a,c;if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,r),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,i.parent){const e=oe(i.parent),f=this.project.get(e),h=this.parent;if(h&&h.id!==(f==null?void 0:f.id)&&this.removeFromParent(r),f)this.setParent(f,r),this.addSelfToProject(r);else throw r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.declaration){const e=oe(i.declaration),f=this.project.get(e);f&&this.setDeclaration(f)}return(a=i.andChildrenGroup)==null||a.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&(this.addToAndGroup(h,r),h.setParent(this,r))}),[...this.andChildrenGroup||[]].forEach(e=>{var h;((h=i.andChildrenGroup)==null?void 0:h.find(m=>oe(m)===e.id))||(this.removeChildGroup(e,r),e.removeFromParent(r))}),(c=i.orChildrenGroup)==null||c.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&(this.addToOrGroup(h,r),h.setParent(this,r))}),[...this.orChildrenGroup||[]].forEach(e=>{var h;((h=i.orChildrenGroup)==null?void 0:h.find(m=>oe(m)===e.id))||(this.removeChildGroup(e,r),e.removeFromParent(r))}),i.calledByEntry.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&(this.addEntryCaller(h,r),h.addCall(this,r))}),[...this.calledByEntry].forEach(e=>{i.calledByEntry.find(h=>oe(h)===e.id)||(this.removeCaller(e,r),e.removeCall(this,r))}),i.calledBySuccess.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&(this.addSuccessCaller(h,r),h.addSuccessCall(this,r))}),[...this.calledBySuccess].forEach(e=>{i.calledBySuccess.find(h=>oe(h)===e.id)||(this.removeCaller(e,r),e.removeCall(this,r))}),i.calledByError.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&(this.addErrorCaller(h,r),h.addErrorCall(this,r))}),[...this.calledByError].forEach(e=>{i.calledByError.find(h=>oe(h)===e.id)||(this.removeCaller(e,r),e.removeCall(this,r))}),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithGenerationTarget))){var a,c,e;if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,r),i.parent){const f=oe(i.parent),h=this.project.get(f),m=this.parent;if(m&&m.id!==(h==null?void 0:h.id)&&this.removeFromParent(r),h)this.setParent(h,r),this.addSelfToProject(r);else throw r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${f}' that isn't found in the project`)}if(i.declaration){const f=oe(i.declaration),h=this.project.get(f);if(h)this.setDeclaration(h);else throw new Error(`${this.type} with id '${this.id}' has a 'declaration' reference '${f}' that isn't found in the project`)}return(a=i.calledByEntry)==null||a.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addEntryCaller(m,r),m.addCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByEntry' reference '${h}' that isn't found in the project`)}),i.calledByEntry&&[...this.calledByEntry].forEach(f=>{var m;((m=i.calledByEntry)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addSuccessCaller(m,r),m.addSuccessCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledBySuccess' reference '${h}' that isn't found in the project`)}),i.calledBySuccess&&[...this.calledBySuccess].forEach(f=>{var m;((m=i.calledBySuccess)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(e=i.calledByError)==null||e.forEach(f=>{const h=oe(f),m=this.project.get(h);if(m)this.addErrorCaller(m,r),m.addErrorCall(this,r);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByError' reference '${h}' that isn't found in the project`)}),i.calledByError&&[...this.calledByError].forEach(f=>{var m;((m=i.calledByError)==null?void 0:m.find(v=>oe(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],r=[],a=[],c=[];if(this.initialData.parent){const e=oe(this.initialData.parent),f=this.project.get(e);if(f)this.setParent(f,null);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.declaration){const e=oe(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.addErrorCaller(h,null)}),{updated:P(i),added:P(r),removed:P(a),affected:P(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AfterAllChildrenInitialized))){var v,b;if(!this.checkCanEdit(this,i))return X.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];if(this.initialized=!0,this.parent.type===d.Condition){let A=this.index||0;const w=(this.parent.declaration.id===ln.And?this.parent.andChildrenGroup||[]:this.parent.orChildrenGroup||[]).filter(O=>!O.deleted&&O.id!==this.id);w.length&&(A>w.length+1?A=w.length:A<0&&(A=0)),w.find(O=>(O.index||0)===A&&!O.deleted)&&w.filter(O=>(O.index||0)>=A&&!O.deleted).forEach(O=>{O.metaSync({index:(O.index||0)+1},i),i==null||i.add(O,z.Updated),r.push(O)}),this.metaSync({index:A},i)}(v=this.andChildrenGroup)!=null&&v.length&&this.andChildrenGroup.sort((A,w)=>(A.index||0)-(w.index||0)),(b=this.orChildrenGroup)!=null&&b.length&&this.orChildrenGroup.sort((A,w)=>(A.index||0)-(w.index||0)),this.inputs.sort((A,w)=>{var R,O;return(A.index??((R=A.declaration)==null?void 0:R.index))-(w.index??((O=w.declaration)==null?void 0:O.index))});const{updated:f,added:h,removed:m}=this.syncInputs(i);return r.push(...f),a.push(...h),c.push(...m),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){const r=[this],a=[],c=[],e=[];return this.parent===this.project?this.project.addCondition(this):this.parent.type===d.Condition&&(this.parent.declaration.id===ln.And?this.parent.addToAndGroup(this,i):this.parent.declaration.id===ln.Or&&this.parent.addToOrGroup(this,i)),this.successCalls.forEach(f=>{f.addSuccessCaller(this,i),r.push(f)}),this.errorCalls.forEach(f=>{f.addErrorCaller(this,i),r.push(f)}),this.calledByEntry.forEach(f=>{f.addCall(this,i),r.push(f)}),this.calledBySuccess.forEach(f=>{f.addSuccessCall(this,i),r.push(f)}),this.calledByError.forEach(f=>{f.addErrorCall(this,i),r.push(f)}),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveInput))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[removeInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this;const a=this.inputs.findIndex(c=>c.id===i.id);return a>-1&&(this.inputs.splice(a,1),r&&(r==null||r.add(this,z.Affected))),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this}addInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddInput))){return this.checkCanEdit(this,r)?this.inputs.includes(i)?(r==null||r.attemptAutoclose(_.AddInput,this.id),this):(this.inputs.push(i),r==null||r.add(this,z.Affected),r==null||r.attemptAutoclose(_.AddInput,this.id),this):(X.Logger.warn(`[addInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddInput,this.id),this)}addOutput(i){return this}removeOutput(i){return this}addSuccessCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddSuccessCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddSuccessCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddSuccessCaller}-${this.id}--${Fe.CannotSuccessCallItself}`,action:_.AddSuccessCaller,owner:this,errorReason:Fe.CannotSuccessCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddSuccessCaller})),this.calledBySuccess.find(e=>e.id===i.id)||(this.calledBySuccess.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddSuccessCaller,this.id),this):this}addErrorCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddErrorCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddErrorCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddErrorCaller}-${this.id}--${Fe.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Fe.CannotErrorCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddErrorCaller})),this.calledByError.find(e=>e.id===i.id)||(this.calledByError.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddErrorCaller,this.id),this):this}addEntryCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddEntryCaller)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddEntryCaller,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddEntryCaller}-${this.id}--${Fe.CannotEntryCallItself}`,action:_.AddEntryCaller,owner:this,errorReason:Fe.CannotEntryCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddEntryCaller})),this.calledByEntry.find(e=>e.id===i.id)||(this.calledByEntry.push(i),r==null||r.add(this,z.Updated),a&&Zt(this,r)),r==null||r.attemptAutoclose(_.AddEntryCaller,this.id),this):this}addErrorCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddErrorCall)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddErrorCall,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddErrorCaller}-${this.id}--${Fe.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Fe.CannotErrorCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddErrorCaller})),this.errorCalls.find(e=>e.id===i.id)||(this.errorCalls.push(i),a&&Zt(this,r),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.AddErrorCall,this.id),this):this}addSuccessCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddSuccessCall)),a=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.AddSuccessCall,r)?((i==null?void 0:i.id)===this.id&&(r==null||r.event({id:`${_.AddSuccessCaller}-${this.id}`,action:_.AddSuccessCaller,owner:this,errorReason:Fe.CannotSuccessCallItself,rootAction:((c=r==null?void 0:r.self)==null?void 0:c.id)===this.id&&(r==null?void 0:r.actionName)===_.AddSuccessCaller})),this.successCalls.find(e=>e.id===i.id)||(this.successCalls.push(i),a&&Zt(this,r),r==null||r.add(this,z.Affected)),r==null||r.attemptAutoclose(_.AddSuccessCall,this.id),this):this}removeCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveCall)),a=!1){if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,_.RemoveCall,r))return this;const c=this.successCalls.findIndex(f=>f.id===i.id);c>-1&&(this.successCalls.splice(c,1),r==null||r.add(this,z.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),r==null||r.add(this,z.Affected)),a&&Zt(this,r),r==null||r.attemptAutoclose(_.RemoveCall,this.id),this}removeCaller(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveCaller)),a=!1){return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.RemoveCaller,r)?(this.calledBySuccess=this.calledBySuccess.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,z.Updated),r==null||r.add(c,z.Affected),!1)),a&&Zt(this,r),r==null||r.attemptAutoclose(_.RemoveCaller,this.id),this):this}setParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetParent))){var a;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetParent,r)?(((a=this.parent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent=i,r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}removeChildGroup(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveChildGroup))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[removeChildGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.RemoveChildGroup,this.id),this;if(this.andChildrenGroup){const a=this.andChildrenGroup.findIndex(c=>c.id===i.id);a!==-1&&(this.andChildrenGroup.splice(a,1),r==null||r.add(this,z.Updated))}if(this.orChildrenGroup){const a=this.orChildrenGroup.findIndex(c=>c.id===i.id);a!==-1&&(this.orChildrenGroup.splice(a,1),r==null||r.add(this,z.Updated))}return r==null||r.attemptAutoclose(_.RemoveChildGroup,this.id),this}setDeclaration(i){return this.declaration=i,this}initChildren(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.declaration=we(this.initialData.declaration,this.project),this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(i),a})),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(i),a})),this.successCalls=this.initialData.successCalls.map(r=>{const a=we(r,this.project);if(a.addSuccessCaller(this,null),[d.BreakStatement,d.ContinueStatement].includes(a.type))a.setParent(this.parent.parent,null),a.initChildren(i);else if(a.type===d.ReturnStatement){const c=Xn(this,this.project);a.setParent(c,null),a.initChildren(i)}else a.type!==d.InternalCall&&(a.setParent(this.parent,null),a.initChildren(i));return a}),this.errorCalls=this.initialData.errorCalls.map(r=>{const a=we(r,this.project);if(a.addErrorCaller(this,null),[d.BreakStatement,d.ContinueStatement].includes(a.type))a.setParent(this.parent.parent,null),a.initChildren(i);else if(a.type===d.ReturnStatement){const c=Xn(this,this.project);a.setParent(c,null),a.initChildren(i)}else a.type!==d.InternalCall&&(a.setParent(this.parent,null),a.initChildren(i));return a}),this.inputs=this.initialData.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(i),a}),this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this)}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(r=>{r.version!==this.version&&(r.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r),c=Nn(this,a),e=this.toMeta();return this.x=a.x!==void 0?a.x:e.x,this.y=a.y!==void 0?a.y:e.y,this.index=a.index!==void 0?a.index:e.index,super.baseMetaSync(a,this,r),a.deleted===!0&&!e.deleted?r==null||r.add(this,z.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,z.Added):c&&(r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=Je,...r){return await cr.repository.APILoad(this.id,...r),this}async APICreate(i=Je,...r){return await cr.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=Je,...r){return await cr.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=Je,...r){return await cr.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=Je,...r){return await cr.repository.APIClone(this.id,...r),this}async APILoadVersion(i=Je,r,...a){return await cr.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveFromParent))){var f;if(!this.checkCanEdit(this,i))return X.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.parent.type===d.Project?(this.parent.removeCondition(this),e.push(this.parent)):((f=this.parent)==null?void 0:f.type)===d.Condition?this.parent.removeChildGroup(this,i):this.parent.detachedChildren.includes(this)&&this.parent.unsubscribeDetachedChild(this),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:P(c),updated:P(r),removed:P(a),affected:P(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return X.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),r==null||r.event({id:`${_.RemoveEntity}-${this.id}--${Fe.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Fe.ActionOwnerEntityNonDeletable,rootAction:((h=r==null?void 0:r.self)==null?void 0:h.id)===this.id&&(r==null?void 0:r.actionName)===_.RemoveEntity}),r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const a=[],c=[],e=[],f=[];if(r!=null&&r.hasRemoved(this.id))return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},r),Object.values(this.detachedDependents).forEach(m=>{const{updated:v,removed:b,added:A}=m.entity.onDetachedDependencyRemoved(this,m.field,r);a.push(...v),c.push(...b),e.push(...A)}),this.andChildrenGroup&&this.andChildrenGroup.forEach(m=>{const{removed:v,updated:b}=m.remove({ignoreUpstream:!0},r);c.push(...v),a.push(...b)}),this.orChildrenGroup&&this.orChildrenGroup.forEach(m=>{const{removed:v,updated:b}=m.remove({ignoreUpstream:!0},r);c.push(...v),a.push(...b)}),this.inputs.forEach(m=>{const{updated:v,removed:b}=m.remove({ignoreUpstream:!0},r);a.push(...v),c.push(...b)}),this.successCalls.forEach(m=>{a.push(m),m.removeCaller(this,r)}),this.errorCalls.forEach(m=>{a.push(m),m.removeCaller(this,r)}),!i){const m=this.removeFromParent(r);e.push(...m.added),a.push(...m.updated),c.push(...m.removed),f.push(...m.affected),this.calledBy.forEach(v=>{a.push(v),v.removeCall(this,r)})}return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:P(e),updated:P(a),removed:P(c),affected:P(f),self:this}}restore({}={},i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:v}=f.entity.onDetachedDependencyRestored(this,f.field,i);a.push(...h),c.push(...m),r.push(...v)}),this.andChildrenGroup&&this.andChildrenGroup.forEach(f=>{const{updated:h,added:m}=f.restore({},i);a.push(...h),r.push(...m)}),this.orChildrenGroup&&this.orChildrenGroup.forEach(f=>{const{updated:h,added:m}=f.restore({},i);a.push(...h),r.push(...m)}),this.inputs.forEach(f=>{const{updated:h}=f.restore({},i);a.push(...h)}),this.successCalls.forEach(f=>{a.push(f),f.addSuccessCaller(this,i)}),this.errorCalls.forEach(f=>{a.push(f),f.addErrorCaller(this,i)}),this.calledBySuccess.forEach(f=>{a.push(f),f.addSuccessCall(this,i)}),this.calledByError.forEach(f=>{a.push(f),f.addErrorCall(this,i)}),this.calledByEntry.forEach(f=>{a.push(f),f.addCall(this,i)}),this.parent.type===d.Project&&this.project.addCondition(this),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:P(r),updated:P(a),removed:P(c),affected:P(e),self:this})}toFlat(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this,...((a=this.andChildrenGroup)==null?void 0:a.flatMap(e=>e.toFlat(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlat(i)))||[],...this.inputs.flatMap(e=>e.toFlat(i)),...this.successCalls.flatMap(e=>e.toFlat(i)),...this.errorCalls.flatMap(e=>e.toFlat(i)),...this.calledBy.flatMap(e=>e.toFlat(i))])}toFlatIds(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.id,...((a=this.andChildrenGroup)==null?void 0:a.flatMap(e=>e.toFlatIds(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatIds(i)))||[],...this.inputs.flatMap(e=>e.toFlatIds(i)),...this.successCalls.flatMap(e=>e.toFlatIds(i)),...this.errorCalls.flatMap(e=>e.toFlatIds(i)),...this.calledBy.flatMap(e=>e.toFlatIds(i))])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,index:this.index,x:this.x,y:this.y,type:this.type,editable:this.editable,deletable:this.deletable}}toJSON(i=new Set){var r,a;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toJSON(i),andChildrenGroup:((r=this.andChildrenGroup)==null?void 0:r.map(c=>c.toJSON(i)))||null,orChildrenGroup:((a=this.orChildrenGroup)==null?void 0:a.map(c=>c.toJSON(i)))||null,successCalls:this.successCalls.map(c=>c.toJSON(i)),errorCalls:this.errorCalls.map(c=>c.toJSON(i)),calledBySuccess:this.calledBySuccess.map(c=>c.toReference()),calledByError:this.calledByError.map(c=>c.toReference()),calledByEntry:this.calledByEntry.map(c=>c.toReference()),inputs:this.inputs.map(c=>c.toJSON(i)),parent:this.parent.toReference()})}toJSONClone(i=Et){var a,c,e,f,h,m,v;let r;return(a=i.seenEntityMaps)!=null&&a.has(this.id)?r=i.seenEntityMaps.get(this.id):(r=i.newId||Gn(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,r)),(c=i.seenEntities)!=null&&c.has(r)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(r),(h=i.seenEntities)==null||h.add(this.id),{id:r,version:L.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toJSON(),andChildrenGroup:((m=this.andChildrenGroup)==null?void 0:m.map(b=>b.toJSONClone({...i,newId:null})))||null,orChildrenGroup:((v=this.orChildrenGroup)==null?void 0:v.map(b=>b.toJSONClone({...i,newId:null})))||null,successCalls:this.successCalls.map(b=>b.toJSONClone({...i,newId:null})),errorCalls:this.errorCalls.map(b=>b.toJSONClone({...i,newId:null})),calledBySuccess:this.calledBySuccess.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),calledByError:this.calledByError.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),calledByEntry:this.calledByEntry.map(b=>b.toReference({seenEntityMaps:i.seenEntityMaps})),inputs:this.inputs.map(b=>b.toJSONClone({...i,newId:null})),parent:this.parent.toReference({seenEntityMaps:i.seenEntityMaps})})}toReference(i=Et){var a;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:r,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var a,c,e;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toReference(i),andChildrenGroup:((c=this.andChildrenGroup)==null?void 0:c.map(f=>f.toReference(i)))||null,orChildrenGroup:((e=this.orChildrenGroup)==null?void 0:e.map(f=>f.toReference(i)))||null,inputs:this.inputs.map(f=>f.toReference(i)),successCalls:this.successCalls.map(f=>f.toReference(i)),errorCalls:this.errorCalls.map(f=>f.toReference(i)),calledBySuccess:this.calledBySuccess.map(f=>f.toReference(i)),calledByError:this.calledByError.map(f=>f.toReference(i)),calledByEntry:this.calledByEntry.map(f=>f.toReference(i)),parent:this.parent.toReference(i)}}toFlatJSON(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...((a=this.andChildrenGroup)==null?void 0:a.flatMap(e=>e.toFlatJSON(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatJSON(i)))||[],...this.inputs.flatMap(e=>e.toFlatJSON(i)),...this.successCalls.flatMap(e=>e.toFlatJSON(i)),...this.errorCalls.flatMap(e=>e.toFlatJSON(i)),...this.calledBy.flatMap(e=>e.toFlatJSON(i))])}toGenerationTarget(i=Et){var c,e;const r=this.parent.type===d.Project?void 0:(c=i.seenEntityMaps)!=null&&c.has(this.parent.id)?i.seenEntityMaps.get(this.parent.id):this.parent.id;let a=this.id;return(e=i.seenEntityMaps)!=null&&e.has(this.id)&&(a=i.seenEntityMaps.get(this.id)),{id:a,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(f=>f.id),calledBySuccess:this.calledBySuccess.map(f=>f.id),calledByError:this.calledByError.map(f=>f.id),parent:r}}toFlatGenerationTarget(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...((a=this.andChildrenGroup)==null?void 0:a.flatMap(e=>e.toFlatGenerationTarget(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatGenerationTarget(i)))||[],...this.inputs.flatMap(e=>e.toFlatGenerationTarget(i)),...this.successCalls.flatMap(e=>e.toFlatGenerationTarget(i)),...this.errorCalls.flatMap(e=>e.toFlatGenerationTarget(i))])}clearErrors(){var i,r;return this.errors=[],(i=this.andChildrenGroup)==null||i.forEach(a=>a.clearErrors()),(r=this.orChildrenGroup)==null||r.forEach(a=>a.clearErrors()),this.inputs.forEach(a=>a.clearErrors()),this.successCalls.forEach(a=>a.clearErrors()),this.errorCalls.forEach(a=>a.clearErrors()),this}validate(){return this.errors=UNe(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await kNe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...this.andChildrenGroup?this.andChildrenGroup.flatMap(r=>r.getErrors()):[],...this.orChildrenGroup?this.orChildrenGroup.flatMap(r=>r.getErrors()):[]]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];await r.tick();for(const c of this.inputs){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}if(await r.tick(),this.andChildrenGroup)for(const c of this.andChildrenGroup){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}if(this.orChildrenGroup)for(const c of this.orChildrenGroup){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}return a}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){var O,$,G;const e=En(r,this),f=this.toJSON(),h=a||L.UUID.uuid();f.inputs=[];const m=h.split("-id"),v=m[m.length-1||0]||h;f.id=h,f.version=L.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const b=Lr(f,e);r?b.setParent(r,i):b.setParent(this.parent,null),c&&b.subscribe(),b.initChildren(i),i==null||i.add(b,z.Added);const A=(O=this.andChildrenGroup)==null?void 0:O.map(x=>x.clone(i,b,L.UUID.uuid(),c)),w=($=this.orChildrenGroup)==null?void 0:$.map(x=>x.clone(i,b,L.UUID.uuid(),c));b.andChildrenGroup=A||null,b.orChildrenGroup=w||null;const R=(G=this.inputs)==null?void 0:G.map((x,k)=>x.clone(i,b,v+"-input-map-"+k+"-id",c));return b.inputs=R,i||b.captureVersion(),i==null||i.attemptAutoclose(_.CloneEntity,this.id),b}addToAndGroup(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddToAndGroup))){return this.checkCanEdit(this,r)?(this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(i)||(this.andChildrenGroup.push(i),r==null||r.add(i,z.Affected)),r==null||r.attemptAutoclose(_.AddToAndGroup,this.id),this):(X.Logger.warn(`[addToAndGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddToAndGroup,this.id),this)}addToOrGroup(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddToOrGroup))){return this.checkCanEdit(this,r)?(this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(i)||(this.orChildrenGroup.push(i),r==null||r.add(i,z.Affected)),r==null||r.attemptAutoclose(_.AddToOrGroup,this.id),this):(X.Logger.warn(`[addToOrGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddToOrGroup,this.id),this)}removeUnrecognizedInputs(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveUnrecognizedInputs))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[removeUnrecognizedInputs] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveUnrecognizedInputs,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.inputs.forEach(h=>{if(!this.declaration.inputs.find(v=>{var b;return v.id===((b=h.declaration)==null?void 0:b.id)})){const v=h.remove({ignoreUpstream:!1},i);c.push(...v.removed),r.push(...v.updated)}}),this.inputs.filter((h,m)=>{const v=this.inputs.findIndex(A=>A.declaration===h.declaration&&A!==h);if(v===-1)return!1;const b=this.inputs[v];return U(b==null?void 0:b.createdAt).isSame(U(h.createdAt))?m>v:!!U(b==null?void 0:b.createdAt).isAfter(h.createdAt)}).forEach(h=>{const m=h.remove({ignoreUpstream:!1},i);c.push(...m.removed),r.push(...m.updated)}),i==null||i.attemptAutoclose(_.RemoveUnrecognizedInputs,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}syncInputs(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SyncInputs))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[syncInputs] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.SyncInputs,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[],f=this.declaration.inputs.filter(b=>b.parentRelationType===K.FixedArguments&&!this.inputs.find(A=>A.declaration.id===b.id));this.inputs.sort((b,A)=>b.index-A.index),f.forEach(b=>{this.inputs.forEach(R=>{R.index>=b.index&&R.metaSync({index:R.index+1},i)});const A={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.InputMap,dataType:null,parentRelationType:null,declaration:b.toJSON(),readsValue:null,defaultValue:null,index:b.index,name:null,codeName:null,description:null,parent:this.toReference()},w=we(A,this.project);w.setParent(this,i),w.addSelfToProject(i),i==null||i.add(w,z.Added),w.initChildren(i),i||w.captureVersion()}),this.inputs.sort((b,A)=>b.index-A.index);const{updated:h,added:m,removed:v}=this.removeUnrecognizedInputs(i);return r.push(...h),a.push(...m),c.push(...v),this.inputs.forEach(b=>{const{updated:A,added:w,removed:R}=b.afterAllChildrenInitialized(i);r.push(...A),a.push(...w),c.push(...R)}),this.inputs.sort((b,A)=>b.index-A.index),i==null||i.attemptAutoclose(_.SyncInputs,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}getUnusedInputs(){return this.inputs.filter(i=>i.suggestion||!i.readsValue&&!i.defaultValue)}getUnusedOutputs(){return[]}getUsedInputs(){return this.inputs.filter(i=>!i.suggestion&&(i.readsValue||i.defaultValue))}getUsedOutputs(){return[]}getDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"get-data-type"))){var a;const r=((a=this.declaration)==null?void 0:a.getDataType(i))||null;return i==null||i.attemptAutoclose("get-data-type",this.id),r}};D(cr,"repository",{APICreate:async(i,...r)=>i,APIUpdate:async(i,...r)=>i,APIDelete:async(i,...r)=>i,APIClone:async(i,...r)=>{},APILoad:async(i,...r)=>null,APILoadVersion:async(i,r,...a)=>null}),D(cr,"type",d.Condition),D(cr,"USER_MANAGED_PARENT_TYPES",[...tn,d.Project,d.Condition]),D(cr,"PARENT_TYPES",[...cr.USER_MANAGED_PARENT_TYPES]),D(cr,"MUTABLE_BASE_PROPERTIES",["operator"]),D(cr,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion","index"]),D(cr,"BASE_PROPERTIES",[...cr.MUTABLE_BASE_PROPERTIES,...cr.INMUTABLE_BASE_PROPERTIES]),D(cr,"MUTABLE_META_PROPERTIES",["x","y"]),D(cr,"INMUTABLE_META_PROPERTIES",[...cr.INMUTABLE_BASE_PROPERTIES]),D(cr,"META_PROPERTIES",[...cr.MUTABLE_META_PROPERTIES,...cr.INMUTABLE_META_PROPERTIES]),D(cr,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),D(cr,"INMUTABLE_UPSTREAM_PROPERTIES",[]),D(cr,"UPSTREAM_PROPERTIES",[...cr.MUTABLE_UPSTREAM_PROPERTIES,...cr.INMUTABLE_UPSTREAM_PROPERTIES]),D(cr,"MUTABLE_DOWNSTREAM_PROPERTIES",["andChildrenGroup","orChildrenGroup","successCalls","errorCalls","inputsDeclarations","inputs"]),D(cr,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),D(cr,"DOWNSTREAM_PROPERTIES",[...cr.MUTABLE_DOWNSTREAM_PROPERTIES,...cr.INMUTABLE_DOWNSTREAM_PROPERTIES]),D(cr,"PROPERTIES",[...cr.META_PROPERTIES,...cr.UPSTREAM_PROPERTIES,...cr.DOWNSTREAM_PROPERTIES]);let Dc=cr;async function zRi(s,u={}){const i=X.YieldTracker.from(u),r=[],a=vi(s.errors,r);return await i.tick(),a}function YRi(s){const u=[];return vi(s.errors,u)}async function KNe(s,u={}){const i=X.YieldTracker.from(u),r=[],a=vi(s.errors,r);return await i.tick(),a}function SNe(s){const u=[];return vi(s.errors,u)}const JRi=Object.freeze(Object.defineProperty({__proto__:null,validate:SNe,validateAsync:KNe},Symbol.toStringTag,{value:"Module"}));function QRi(s,u){const i=[],r=[];if(s.parent)if(s.parent){const a=u.get(s.parent);a?Xr.USER_MANAGED_PARENT_TYPES.includes(a.type)||r.push(new Ne({id:`${s.id}--${s.parent}--${Te.InvalidParentReference}`,code:Te.InvalidParentReference,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}", has a parent reference which is of type ${a.type}, and therefore that isn't pointing to the following valid types for this reference: '${qt(Xr.USER_MANAGED_PARENT_TYPES,"', '","' or '")}'.`})):r.push(new Ne({id:`${s.id}--${s.parent}--${Te.ReferencedEntityNotFound}`,code:Te.ReferencedEntityNotFound,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}", is referencing an entity with id "${s.parent}" at 'parent' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`}))}else r.push(new Ne({id:`${s.id}--${Pe.InvalidObjectStructure}`,code:Pe.InvalidObjectStructure,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}" is missing a 'parent' reference. The 'parent' of a literal value entity must be a reference to an entity of type '${qt(Xr.USER_MANAGED_PARENT_TYPES,"', '","', or '")}'.`}));else return r.push(new Ne({id:`${s.id}--${Pe.InvalidObjectStructure}`,code:Pe.InvalidObjectStructure,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}" is missing a 'parent' reference. The 'parent' of a literal value entity must be a reference to an entity of type '${qt(Xr.USER_MANAGED_PARENT_TYPES,"', '","', or '")}'.`})),{errors:r,explanations:i};if(s.valueAsTypeSingle){const a=[],c=[],e=s.valueAsTypeSingle;Array.isArray(e)?e.forEach(f=>{typeof f=="string"?c.push(f):a.push(f)}):typeof e=="string"?c.push(e):a.push(e),a.forEach(f=>{const h=nw(f);r.push(...h),h.length===0&&c.push(f.entityId)}),c.forEach(f=>{const h=u.get(f);h?[d.DefinitionEntity,d.BuiltInBaseEntity].includes(h.type)||r.push(new Ne({id:`${s.id}--${f}--${Te.InvalidImplementsReference}`,code:Te.InvalidImplementsReference,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}", has an 'valueAsTypeSingle' reference which is of type ${h.type}, and therefore that isn't pointing to the following valid types for this reference: 'definition-entity', 'function-declaration' or 'operation'.`})):r.push(new Ne({id:`${s.id}--${f}--${Te.ReferencedEntityNotFound}`,code:Te.ReferencedEntityNotFound,severity:Ee.Error,message:`Entity of type "${s.type}" with id "${s.id}", is referencing an entity with id "${f}" at 'valueAsTypeSingle' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`}))})}return{errors:r,explanations:i}}var qNe=(s=>(s.ValueAsTypeSingle="value-as-type-single",s.ValueAsTypeList="value-as-type-list",s))(qNe||{});const Si=class Si extends kn{constructor(i,r){super(i);D(this,"initialData");D(this,"type",d.LiteralValue);D(this,"id");D(this,"name");D(this,"autogeneration",null);D(this,"value",null);D(this,"rawString",null);D(this,"valueAsTypeSingle",null);D(this,"valueAsTypeList",null);D(this,"errors",[]);D(this,"parent",null);D(this,"standaloneParent",null);D(this,"project");D(this,"detachedDependents",{});D(this,"knownVersions",null);D(this,"activeVersion",!1);D(this,"initialized",!1);D(this,"startedInitialization",!1);D(this,"standalone",!1);if(this.initialData=i,this.project=r,this.id=i.id,this.name=i.name,this.autogeneration=i.autogeneration,this.value=i.value,this.rawString=i.rawString!==void 0?i.rawString:typeof i.value=="string"?i.value:null,!this.name)throw new Error("[LiteralValueState.constructor] Must have a name in the initial data passed to the constructor")}static new(i=null){return{id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:(i==null?void 0:i.author)||L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:"",autogeneration:null,value:null,rawString:null,valueAsTypeSingle:null,valueAsTypeList:null,parent:null}}static fromGenerationTarget(i,r,a){const c=a===void 0?r.addChangeSet(new Z(r,L.sessionAuthor,U().toISOString(),r,!0,_.CreateFromGenerationTarget)):a,e=oe(i.parent),f=r.get(e);let h=null,m=null;i.valueAsTypeList?Array.isArray(i.valueAsTypeList)&&(m=i.valueAsTypeList.map(A=>r.get(A)||r.getBuiltIn(A))):i.valueAsTypeSingle&&(h=r.get(i.valueAsTypeSingle)||r.getBuiltIn(i.valueAsTypeSingle));const v={id:i.id,version:L.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||U().toISOString(),author:(c==null?void 0:c.author)||L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:i.name,autogeneration:i.autogeneration,valueAsTypeSingle:h,valueAsTypeList:m,value:i.value||null,rawString:i.rawString!==void 0?i.rawString:typeof i.value=="string"?i.value:null,parent:f.toReference()},b=we(v,r);return b.hydrateAncestors(),b.setParent(f,c),b.addSelfToProject(c),c==null||c.add(b,z.Added),b.initChildren(c),c||b.captureVersion(),b}static validateGenerationTarget(i,r){let a=JSON.parse(JSON.stringify(i));(a.valueAsTypeList||a.valueAsTypeSingle)&&(a.name=he.EntityTemplate);const c=[],e=[],f=QRi(a,r),h=Pn(a);return e.push(...f.errors,...h.errors),c.push(...f.explanations,...h.explanations),{errors:e,explanations:c,modifiedData:a}}get valueAsType(){return this.valueAsTypeSingle?this.valueAsTypeSingle:this.valueAsTypeList?this.valueAsTypeList:null}get isFinal(){var i,r;return!!(((i=this.parent)==null?void 0:i.type)===d.Property&&(this.parent.constant||this.parent.implements.some(a=>a.constant))||((r=this.parent)==null?void 0:r.type)===d.Property&&this.parent.parent.type===d.DefinitionEntity&&!lo(this.parent.parent))}validateGeneratedUpdate(i){const r=[],a=[];return i.parent&&r.push(new Ne({id:`${this.id}--${Te.InvalidParentUpdate}`,code:Te.InvalidParentUpdate,severity:Ee.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.
|
|
49
|
-
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.`})),{errors:r,explanations:a,modifiedData:i}}subscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]||(this.detachedDependents[r.entity.id]=r)}),this}unsubscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]&&delete this.detachedDependents[r.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const r=[],a=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);r.push(...h.updated),a.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}onDetachedDependencyRemoved(i,r,a){const c=[],e=[],f=[],h=[];return r==="value-as-type-single"&&(this.valueAsTypeSingle=null,a==null||a.add(this,z.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),a==null||a.add(this,z.Updated)),{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}onDetachedDependencyRestored(i,r,a){const c=[],e=[],f=[],h=[];return r==="value-as-type-single"&&(this.valueAsTypeSingle=i,a==null||a.add(this,z.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],a==null||a.add(this,z.Updated)),{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}unsubscribeFromDependencies(){return this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==d.BuiltInBaseEntity&&this.valueAsTypeSingle.unsubscribeDependents([{entity:this,field:"value-as-type-single"}]),this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&this.valueAsTypeList.forEach(i=>{i.type!==d.BuiltInBaseEntity&&i.unsubscribeDependents([{entity:this,field:"value-as-type-list"}])}),this}subscribeToDependencies(){return!this.valueAsTypeSingle&&!this.valueAsTypeList?this:(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.forEach(i=>{i.type!==d.BuiltInBaseEntity&&i.subscribeDependents([{entity:this,field:"value-as-type-list"}])}):this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==d.BuiltInBaseEntity&&this.valueAsTypeSingle.subscribeDependents([{entity:this,field:"value-as-type-single"}]),this)}increaseVersion(i){var r;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((r=this.knownVersions)!=null&&r.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=L.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new Si(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Si(this,this.project);return this.apply(i)}apply(i){const r=this.toMeta();return i.metaSync(r,null),i.valueAsTypeSingle=this.valueAsTypeSingle,i.valueAsTypeList=this.valueAsTypeList?[...this.valueAsTypeList]:this.valueAsTypeList,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const r=[],a=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);r.push(this.parent,...f.updated),a.push(...f.added),c.push(...f.removed)}return{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}async restoreVersion(i,r){var m;const a=[],c=[],e=[],f=[];if(this.version===i&&(r!=null&&r.skipIfSameVersion))return{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this};if(!this.knownVersions){const v=new Map;for(const[b,A]of this.knownVersions||new Map){if(v.set(b,A),A.activeVersion=!1,A.knownVersions)for(const[w,R]of A.knownVersions)v.set(w,R);A.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const v=await this.APILoadVersion({},i);if(!v)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Si(v,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.valueAsTypeSingle=h.valueAsTypeSingle,this.parent=h.parent,{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}updateWithShallowTransfer(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,r),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const a=oe(i.parent),c=this.project.get(a),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(r),c)this.setParent(c,r),this.addSelfToProject(r);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${a}' that isn't found in the project`)}else if(i.standaloneParent){const a=oe(i.standaloneParent),c=this.project.get(a);if(c)this.setStandaloneParent(c,r);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${a}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>oe(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=oe(i.valueAsTypeSingle),c=this.project.get(a);c&&(this.setValueAsTypeSingle(c,r),this.setValueAsTypeList(null,r),this.metaSync({value:null},r))}else this.setValueAsTypeSingle(null,r),this.setValueAsTypeList(null,r);return this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,r),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const a=oe(i.parent),c=this.project.get(a),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(r),c)this.setParent(c,r),this.addSelfToProject(r);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${a}' that isn't found in the project`)}else if(i.standaloneParent){const a=oe(i.standaloneParent),c=this.project.get(a);if(c)this.setStandaloneParent(c,r);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${a}' that isn't found in the project`)}if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>oe(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=oe(i.valueAsTypeSingle),c=this.project.get(a);c&&(this.setValueAsTypeSingle(c,r),this.setValueAsTypeList(null,r),this.metaSync({value:null},r))}return(i.valueAsTypeSingle===null||i.valueAsTypeList||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeSingle(null,r),(i.valueAsTypeList===null||i.valueAsTypeSingle||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeList(null,r),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],r=[],a=[],c=[];if(this.initialData.parent&&this.initialData.standaloneParent){const e=oe(this.initialData.parent),f=this.project.get(e),h=oe(this.initialData.standaloneParent),m=this.project.get(h);let v="";throw f?v+=` Parent -> ${f.type}: '${f.id}' "${fi(f,this.project)}".`:v+=" Parent -> not-found.",m?v+=` Standalone Parent -> ${m.type}: '${m.id}' "${fi(m,this.project)}".`:v+=" Standalone Parent -> not-found.",new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.${v}`)}if(this.initialData.parent){const e=oe(this.initialData.parent),f=this.project.get(e);if(X.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)X.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else if(this.initialData.standaloneParent){const e=oe(this.initialData.standaloneParent),f=this.project.get(e);if(X.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)X.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Standalone parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${e}' that isn't found in the project`)}else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Entity with id '${this.id}' must have a 'parent'`),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],this.initialData.valueAsTypeList.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=oe(this.initialData.valueAsTypeSingle),f=this.project.get(e);f&&(this.valueAsTypeSingle=f)}return{updated:P(i),added:P(r),removed:P(a),affected:P(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.initialized=!0,i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){var f,h;const r=[this],a=[],c=[],e=[];return((f=this.parent)==null?void 0:f.type)===d.DataType?this.parent.setEntity(this,i):(h=this.parent)==null||h.setDefaultValue(this,i),e.push(this.parent),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}setParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetParent))){var a;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetParent,r)?(((a=this.parent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent=i,this.standaloneParent&&(this.standaloneParent=null,this.standalone=!1),r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}setStandaloneParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetStandaloneParent))){var a;if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetStandaloneParent,r))return this;if(this.project.get(this.id)&&this.parent)throw new Error("[LiteralValueState.setStandaloneParent] This literal-value belongs to the project AST and setting a standalone parent is not possible. Clone the instance, or create a separate one to be standalone.");return((a=this.standaloneParent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent&&(this.removeFromParent(r),this.parent=null),this.standaloneParent=i,this.standalone=!0,r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddValueAsTypeToList))){return this.checkCanEdit(this,r)?((this.valueAsTypeList||[]).includes(i)||(this.valueAsTypeList=this.valueAsTypeList||[],this.valueAsTypeList.push(i),this.value!==null&&this.metaSync({value:null},r),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,r==null||r.add(this,z.Updated)),r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this):(X.Logger.warn(`[addValueAsTypeToList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this)}removeValueAsTypeFromList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveValueAsTypeFromList))){return this.checkCanEdit(this,r)?(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&(this.valueAsTypeList||[]).includes(i)&&(this.valueAsTypeList=this.valueAsTypeList.filter(a=>a.id!==i.id),this.valueAsTypeList.length===0?this.valueAsTypeList=null:(this.value!==null&&this.metaSync({value:null},r),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,r==null||r.add(this,z.Updated))),r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this):(X.Logger.warn(`[removeValueAsTypeFromList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this)}setValueAsTypeSingle(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsTypeSingle))){return this.checkCanEdit(this,r)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this):(X.Logger.warn(`[setValueAsTypeSingle] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this)}setValueAsTypeList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsTypeList))){var a,c;return this.checkCanEdit(this,r)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,r==null||r.add(this,z.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)):i&&this.valueAsTypeList&&((a=this.valueAsTypeList)==null?void 0:a.length)!==i.length?(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this):(X.Logger.warn(`[setValueAsTypeList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this)}setValueAsType(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsType))){return this.checkCanEdit(this,r)?i?(Array.isArray(i)?this.setValueAsTypeList(i,r):this.setValueAsTypeSingle(i,r),r==null||r.attemptAutoclose(_.SetValueAsType,this.id),this):(this.setValueAsTypeSingle(null,r),this.setValueAsTypeList(null,r),this):(X.Logger.warn(`[setValueAsType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsType,this.id),this)}initChildren(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.standalone){if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(r=>{if(r.type===d.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(r);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.entityType}' with id '${r.entityId}' that is not part of the project state.`);return c}const a=this.project.get(r.id);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.type}' with id '${r.id}' that is not part of the project state.`);return a});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===d.GenericReference){const a=this.project.findSubscribedBuiltInInstanceFromReference(this.initialData.valueAsTypeSingle);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=a,this}const r=this.project.get(this.initialData.valueAsTypeSingle.id);if(!r)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=r}return this}if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(r=>{if(r.type===d.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(r);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.entityType}' with id '${r.entityId}' that is not part of the project state.`);return c}const a=this.project.get(r.id);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.type}' with id '${r.id}' that is not part of the project state.`);return a});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===d.GenericReference){const a=oe(this.initialData.valueAsTypeSingle),c=a?this.project.get(a):null;if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=c,this}const r=this.project.get(this.initialData.valueAsTypeSingle.id);if(!r)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=r}return this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(r=>{r.version!==this.version&&(r.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r);this.id==="3a497c83-1410-4ab0-8478-1e9c4f0c1935"&&i.value===!1&&console.trace("[LiteralValueState.metaSync] Test error");const c=Nn(this,a),e=this.toMeta();this.name=a.name!==void 0?a.name:e.name,this.autogeneration=a.autogeneration!==void 0?a.autogeneration:e.autogeneration,this.value=a.value!==void 0?a.value:e.value,a.rawString!==void 0?this.rawString=a.rawString:a.value!==void 0&&typeof a.value=="string"?this.rawString=a.value:this.rawString=e.rawString;const f=i.valueAsTypeSingle!==void 0?i.valueAsTypeSingle:this.valueAsTypeSingle??null,h=i.valueAsTypeList!==void 0?i.valueAsTypeList:this.valueAsTypeList??null;return(this.name!==he.String||f!==null||h!==null&&h.length>0)&&(this.rawString=null,a.rawString=null),super.baseMetaSync(a,this,r),a.deleted===!0&&!e.deleted?r==null||r.add(this,z.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,z.Added):c&&(r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=Je,...r){return await Si.repository.APILoad(this.id,...r),this}async APICreate(i=Je,...r){return await Si.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=Je,...r){return await Si.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=Je,...r){return await Si.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=Je,...r){return await Si.repository.APIClone(this.id,...r),this}async APILoadVersion(i=Je,r,...a){return await Si.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.parent&&(this.parent.type===d.DataType?this.parent.setEntity(null,i):yR.includes(this.parent.type)&&this.parent.setDefaultValue(null,i),e.push(this.parent)),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:P(c),updated:P(r),removed:P(a),affected:P(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return X.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),r==null||r.event({id:`${_.RemoveEntity}-${this.id}--${Fe.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Fe.ActionOwnerEntityNonDeletable,rootAction:((h=r==null?void 0:r.self)==null?void 0:h.id)===this.id&&(r==null?void 0:r.actionName)===_.RemoveEntity}),r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const a=[],c=[],e=[],f=[];if(r!=null&&r.hasRemoved(this.id))return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},r),Object.values(this.detachedDependents).forEach(m=>{const{updated:v,removed:b,added:A}=m.entity.onDetachedDependencyRemoved(this,m.field,r);a.push(...v),c.push(...b),e.push(...A)}),!i){const m=this.removeFromParent(r);e.push(...m.added),a.push(...m.updated),c.push(...m.removed),f.push(...m.affected)}return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:P(e),updated:P(a),removed:P(c),affected:P(f),self:this}}restore({}={},i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:v}=f.entity.onDetachedDependencyRestored(this,f.field,i);a.push(...h),c.push(...m),r.push(...v)}),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:P(r),updated:P(a),removed:P(c),affected:P(e),self:this})}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlat(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlat(i)):[]])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatIds(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatIds(i)):[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name}}toJSON(i=new Set){var r,a,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:((r=this.valueAsTypeSingle)==null?void 0:r.toJSON(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(e=>e.toJSON(i)):null,parent:((a=this.parent)==null?void 0:a.toReference())||null,standaloneParent:((c=this.standaloneParent)==null?void 0:c.toReference())||null})}toJSONClone(i=Et){var a,c,e,f,h,m,v;let r;return(a=i.seenEntityMaps)!=null&&a.has(this.id)?r=i.seenEntityMaps.get(this.id):(r=i.newId||Gn(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,r)),(c=i.seenEntities)!=null&&c.has(r)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(r),(h=i.seenEntities)==null||h.add(this.id),{id:r,version:L.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:this.valueAsTypeSingle?this.project.getBuiltIn(this.valueAsTypeSingle.id)?this.valueAsTypeSingle.toJSON():this.valueAsTypeSingle.toJSONClone({...i,newId:null}):null,valueAsTypeList:this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(b=>{var A;return this.project.getBuiltIn(b.id)?b.toJSON(i.seenEntities):(A=b.toJSONClone)==null?void 0:A.call(b,{...i,newId:null})}):null,parent:((m=this.parent)==null?void 0:m.toReference({seenEntityMaps:i.seenEntityMaps}))||null,standaloneParent:((v=this.standaloneParent)==null?void 0:v.toReference({seenEntityMaps:i.seenEntityMaps}))||null})}toReference(i=Et){var a;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:r,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var a,c,e,f;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.toReference(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.toReference(i)):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:((e=this.parent)==null?void 0:e.toReference(i))||null,standaloneParent:(f=this.standaloneParent)==null?void 0:f.toReference(i)}}toFlatJSON(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatJSON(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatJSON(i)):[]])}toGenerationTarget(i=Et){var a,c,e,f;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,type:this.type,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.id)||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.id):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:(e=this.parent)==null?void 0:e.id,standaloneParent:(f=this.standaloneParent)==null?void 0:f.id}}toFlatGenerationTarget(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatGenerationTarget(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatGenerationTarget(i)):[]])}clearErrors(){return this.errors=[],this}validate(){return this.errors=SNe(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await KNe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];return await r.tick(),a}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){const e=En(r,this),f=this.toJSON();r?(f.parent=r.toReference(),f.standaloneParent=null):(f.parent=null,this.standaloneParent?f.standaloneParent=this.standaloneParent.toReference():this.parent?f.standaloneParent=this.parent.toReference():f.standaloneParent=null);const h=a||L.UUID.uuid();f.id=h,f.version=L.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=Lr(f,e);return m.hydrateAncestors(),r&&m.setParent(r,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,z.Added),m.initChildren(i),!i&&c&&m.captureVersion(),i==null||i.attemptAutoclose(_.CloneEntity,this.id),m}merge(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"merge-literal-value"))){const a=[],c=[],e=[],f=[];return this.valueAsTypeSingle!==(i==null?void 0:i.valueAsTypeSingle)&&(this.setValueAsType(i.valueAsTypeSingle,r),a.push(this)),this.valueAsTypeList!==i.valueAsTypeList&&(this.setValueAsTypeList(i.valueAsTypeList,r),a.push(this)),this.value!==i.value&&(this.metaSync({value:i.value},r),a.push(this)),this.autogeneration!==i.autogeneration&&(this.metaSync({autogeneration:i.autogeneration},r),a.push(this)),this.name!==i.name&&(this.metaSync({name:i.name},r),a.push(this)),r==null||r.attemptAutoclose("merge-literal-value",this.id),{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}};D(Si,"repository",{APICreate:async(i,...r)=>i,APIUpdate:async(i,...r)=>i,APIDelete:async(i,...r)=>i,APIClone:async(i,...r)=>{},APILoad:async(i,...r)=>null,APILoadVersion:async(i,r,...a)=>null}),D(Si,"type",d.LiteralValue),D(Si,"USER_MANAGED_PARENT_TYPES",[d.DataType,d.InputMap,d.Property,d.ArgumentDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement,d.VariableDeclaration,d.VariableInstance,d.ValueDescriptor]),D(Si,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...fR]),D(Si,"PARENT_TYPES",[...Si.USER_MANAGED_PARENT_TYPES]),D(Si,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),D(Si,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),D(Si,"BASE_PROPERTIES",[...Si.MUTABLE_BASE_PROPERTIES,...Si.INMUTABLE_BASE_PROPERTIES]),D(Si,"MUTABLE_META_PROPERTIES",[...Si.MUTABLE_BASE_PROPERTIES]),D(Si,"INMUTABLE_META_PROPERTIES",[...Si.INMUTABLE_BASE_PROPERTIES]),D(Si,"META_PROPERTIES",[...Si.MUTABLE_META_PROPERTIES,...Si.INMUTABLE_META_PROPERTIES]),D(Si,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),D(Si,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),D(Si,"UPSTREAM_PROPERTIES",[...Si.MUTABLE_UPSTREAM_PROPERTIES,...Si.INMUTABLE_UPSTREAM_PROPERTIES]),D(Si,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),D(Si,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),D(Si,"DOWNSTREAM_PROPERTIES",[...Si.MUTABLE_DOWNSTREAM_PROPERTIES,...Si.INMUTABLE_DOWNSTREAM_PROPERTIES]),D(Si,"PROPERTIES",[...Si.META_PROPERTIES,...Si.UPSTREAM_PROPERTIES,...Si.DOWNSTREAM_PROPERTIES]);let Xr=Si;function Jy(s){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const i=new Uint8Array(s);return crypto.getRandomValues(i),i}const{randomBytes:u}=require("crypto");return u(s)}function ZNe(s,u){const i=u-s+1,a=vD()*i;return Math.floor(a)+s}function HNe(){const s=Jy(4);return(s[0]<<24|s[1]<<16|s[2]<<8|s[3])>>>0}function vD(){return HNe()/2**32}function Z$(s){const u=Jy(s);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const xP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function H$(s){let u="";const i=Jy(s);for(let r=0;r<s;r++)u+=xP[i[r]%xP.length];return u}function WNe(s){const u=Jy(s);let i;if(typeof Buffer<"u")i=Buffer.from(u).toString("base64");else{const r=String.fromCharCode(...u);i=btoa(r)}return i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function W$(s){return H$(s)}function z$(s,u=xP){let i="";const r=Jy(s);for(let a=0;a<s;a++)i+=u[r[a]%u.length];return i}function hc(){const s=Jy(16);s[6]=s[6]&15|64,s[8]=s[8]&63|128;const u=Array.from(s).map(i=>i.toString(16).padStart(2,"0")).join("");return[u.slice(0,8),u.slice(8,12),u.slice(12,16),u.slice(16,20),u.slice(20,32)].join("-")}function zNe(){return z$(6)}function YNe(){return Z$(32)}const XRi=63,e1i=/^[a-z][a-z0-9-]*[a-z0-9]$/;function t1i(s){return s.length>=1&&s.length<=XRi&&e1i.test(s)&&!s.includes("--")}function*i1i(){yield"";const s="abcdefghijklmnopqrstuvwxyz";for(let u=1;;u++){const i=new Array(u).fill(0);let r=!1;for(;!r;){yield i.map(a=>s[a]).join("");for(let a=u-1;a>=0&&(i[a]++,!(i[a]<s.length));a--)i[a]=0,a===0&&(r=!0)}}}function r1i(s,u){const i=new Set(s.map(a=>a.toLowerCase())),r=u>0?"secondarydb":"main";for(const a of i1i()){const c=a?`${r}${a}`:r;if(t1i(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function JNe(s,u){switch(s.id){case j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=s.project.entities.filter(h=>!!h.implements.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),r=i.find(h=>{const m=h.properties.find(A=>A.implements.find(w=>w.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),v=m==null?void 0:m.getDefaultValue();return(v==null?void 0:v.value)===!0});if(!r&&i.length){const m=i[0].properties.find(b=>b.implements.find(A=>A.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),v=m==null?void 0:m.defaultValue;if(v)v.metaSync({value:!0},u);else if(m!=null&&m.dataType){const b={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:m==null?void 0:m.toReference()},A=we(b,s.project);return A.hydrateAncestors(),A.setParent(m,u),A.addSelfToProject(u),u==null||u.add(A,z.Added),A.initChildren(u),u||A.captureVersion(),{newEntities:[A]}}return{newEntities:[]}}else if(r)return{newEntities:[]};const a=s.project.get(j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=ED(a,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),f=e==null?void 0:e.defaultValue;if(f)f.metaSync({value:!0},u);else if(e!=null&&e.dataType){const h={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:e==null?void 0:e.toReference()},m=we(h,s.project);m.hydrateAncestors(),m.setParent(e,u),m.addSelfToProject(u),u==null||u.add(m,z.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function QNe(s,u){const i=[],r=[],a=[],c=[];return K0(s).filter(f=>f.type===d.BuiltInBaseEntity).forEach(f=>{var h,m,v,b,A,w,R,O,$;switch(f.id){case j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const G=s.project.entities.filter(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=G.find(Q=>!!Q.properties.find(ne=>{var de;return ne.implements.find(J=>J.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((de=ne.getDefaultValue())==null?void 0:de.value)===!0}));if(!x&&G.length)x=G[0];else if(!x&&!G.length){x=s.project.getBuiltIn(j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const ne=x.properties.find(de=>de.implements.find(J=>J.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=ne==null?void 0:ne.defaultValue)==null||h.metaSync({value:!0},u),r.push(x)}const k=s.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(k&&!(k!=null&&k.defaultValue)){const Q={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:k==null?void 0:k.toReference()},ne=we(Q,s.project);ne.hydrateAncestors(),ne.setParent(k,u),ne.addSelfToProject(u),u==null||u.add(ne,z.Added),ne.initChildren(u),(k==null?void 0:k.defaultValue).setValueAsTypeSingle(x||null,u),r.push(ne),u||ne.captureVersion();return}else k!=null&&k.defaultValue&&!(k!=null&&k.defaultValue.valueAsTypeSingle)&&(k==null||k.defaultValue.setValueAsTypeSingle(x||null,u));const W=s.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!W)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${j["built-in-base-entity"]}`);let te=!1;if(!W.dataType){const Q=qr.new(u);Q.parent=W.toReference();const ne=we(Q,s.project);ne.hydrateAncestors(),ne.setParent(W,u),ne.addSelfToProject(u),u==null||u.add(ne,z.Added),ne.initChildren(u),te=!0}const ee=s.project.getBuiltIn(j["primitive-entity"].number.id);(m=W.dataType)==null||m.setEntity(ee,u),te&&(u||(v=W.dataType)==null||v.captureVersion());return}case j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const G=s.project.entities.filter(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&J.id!==s.id),x=G.map(J=>{var fe;const ie=J.properties.find(ue=>ue.implements.find(me=>me.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(fe=ie==null?void 0:ie.getDefaultValue())==null?void 0:fe.value}).filter(J=>!!J),k=s.properties.find(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!G.find(J=>!!J.properties.find(ie=>{var se;return ie.implements.find(fe=>fe.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((se=ie.getDefaultValue())==null?void 0:se.value)===!0}))){const J=s.properties.find(se=>se.implements.find(fe=>fe.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!J)throw new Error("Default boolean property not found for relational database entity with id: "+s.id);let ie=!1;if(!(J!=null&&J.defaultValue)){const se=Xr.new(u);se.parent=J.toReference();const fe=we(se,s.project);fe.hydrateAncestors(),fe.setParent(J,u),fe.addSelfToProject(u),u==null||u.add(fe,z.Added),fe.initChildren(u),ie=!0}(b=J==null?void 0:J.defaultValue)==null||b.metaSync({value:!0},u),ie&&(u||(A=J==null?void 0:J.defaultValue)==null||A.captureVersion())}if(!k)throw new Error("Identifier property not found for relational database entity with id: "+s.id);let te=!1;if(!(k!=null&&k.defaultValue)){const J=Xr.new(u);J.parent=k.toReference();const ie=we(J,s.project);ie.hydrateAncestors(),ie.setParent(k,u),ie.addSelfToProject(u),u==null||u.add(ie,z.Added),ie.initChildren(u),te=!0}const ee=r1i(x,G.length);(w=k.defaultValue)==null||w.metaSync({value:ee},u),te&&(u||(R=k.defaultValue)==null||R.captureVersion());const Q=s.properties.find(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!Q)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${s.id}`);let ne=!1;if(!Q.defaultValue){const J=Xr.new(u);J.parent=Q.toReference();const ie=we(J,s.project);ie.hydrateAncestors(),ie.setParent(Q,u),ie.addSelfToProject(u),u==null||u.add(ie,z.Added),ie.initChildren(u),r.push(ie),ne=!0}const de=W$(24);(O=Q.defaultValue)==null||O.metaSync({value:de},u),ne&&(u||($=Q.defaultValue)==null||$.captureVersion());return}case j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const G=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.time.id));if(!G)throw new Error(`[handleAfterEntityImplementationSideEffects] Time property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let x=G.defaultValue||null;if(!x){const te=Xr.new(u);te.parent=G.toReference(),te.name=he.Date,te.id=L.UUID.uuid(),x=we(te,s.project),x.hydrateAncestors(),x.setParent(G,u),x.addSelfToProject(u),x.initChildren(u),u==null||u.add(x,z.Added)}x.metaSync({value:new Date().toISOString()},u),x.metaSync({editable:!1,deletable:!1},u),G.metaSync({editable:!1,deletable:!1},u);const k=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id));if(!k)throw new Error(`[handleAfterEntityImplementationSideEffects] Definition property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let W=k.defaultValue||null;if(!W){const te=Xr.new(u);te.name=he.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),W=we(te,s.project),W.hydrateAncestors(),W.setParent(k,u),W.addSelfToProject(u),W.initChildren(u),u==null||u.add(W,z.Added)}break}case j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id:{const G=s.project.entities.filter(x=>Ni(x,be.SHARED_DRIVE_ENTITY)&&x.id!==s.id);if(G.length===1){const x=G[0],k=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.properties.sharedDrive.id));if(!k)throw new Error(`[handleAfterEntityImplementationSideEffects] Shared Drive property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id} with id ${s.id}`);let W=k.defaultValue||null;if(!W){const te=Xr.new(u);te.name=he.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),W=we(te,s.project),W.hydrateAncestors(),W.setParent(k,u),W.addSelfToProject(u),W.initChildren(u),u==null||u.add(W,z.Added)}W.setValueAsTypeSingle(x,u)}break}case j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id:{const G=s.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id));if(!G)throw new Error(`[handleAfterEntityImplementationSideEffects] Compute name property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id} with id ${s.id}`);const x=s.project.entities.filter(ee=>Ni(ee,be.COMPUTE_ENTITY)&&ee.id!==s.id);let k=G.defaultValue||null;if(!k){const ee=Xr.new(u);ee.name=he.EntityTemplate,ee.parent=G.toReference(),ee.id=L.UUID.uuid(),k=we(ee,s.project),k.hydrateAncestors(),k.setParent(G,u),k.addSelfToProject(u),k.initChildren(u),u==null||u.add(k,z.Added)}const W=x.map(ee=>{var Q,ne;return((ne=(Q=ee.properties.find(de=>de.implements.some(J=>J.id===j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id)))==null?void 0:Q.defaultValue)==null?void 0:ne.value)||""}),te=k$(k.value||"compute-instance",W);k.metaSync({value:te},u);break}}}),{self:s,updated:P(i),added:P(r),removed:P(a),affected:P(c)}}function ED(s,u,i,r){const a=r||L.UUID.uuid(),c=Kn.new(i);c.id=a,c.name=u,c.static=s.static,c.implements=[s.toJSON()],c.parent=s.project.toReference(),c.static=s.static,JNe(s,i);const e=we(c,s.project);return e.hydrateAncestors(),i==null||i.add(e,z.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),QNe(e,i),e.afterAllChildrenInitialized(i),e}function Y$(s,u){return u.entities.find(a=>{const c=a.properties,e=c.map(b=>b.name),f=s.every(b=>e.includes(b)),h=e.filter(b=>!s.includes(b)),m=c.every(b=>!h.includes(b.name)||!b.required);return f&&m})||null}function XNe(s,u,i,r=rt.OrDataTypeGroup){const a=[],c=[],e=[],f=[],h=L.UUID.uuid(),m=qr.new(i);m.id=h,m.parent=u.toReference(),m.like=!0,m.parentRelationType=r;const v=we(m,s.project);return c.push(v),v.setParent(u,i),v.addSelfToProject(i),i==null||i.add(v,z.Added),v.setEntity(s,i),v.initChildren(i),i||v.captureVersion(),{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:v}}function J$(s,u,i,r,a){var m,v,b,A,w,R,O,$;const c=[],e=[],f=[],h=[];switch(typeof s){case"string":let G=!1;const x=new Date(s);if(x instanceof Date&&!isNaN(x.valueOf())&&(G=!0),G){const k=u.project.getBuiltIn(j[d.PrimitiveEntity][he.Date].id);u.setEntity(k,r);break}else{const k=u.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id);u.setEntity(k,r);break}case"number":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":if(s===null){u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}else if(Array.isArray(s))if(u.metaSync({isList:!0},r),s.length>0){const k=s.slice(0,5).filter(te=>te!==void 0);if(k.every(te=>typeof te==typeof k[0])&&(typeof k[0]!="object"||k[0]===null))switch(typeof k[0]){case"string":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id),r);break;case"number":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}else{const te=[];let ee=!1;k.forEach(ne=>{var de,J,ie,se;if(Array.isArray(ne)&&(ee=!0),typeof ne=="object"&&!Array.isArray(ne)&&ne!==null){const fe=yI(ne,u.project,{...i,id:L.UUID.uuid()},r,a);fe.hasCreated&&te.push((de=fe.changeSet)==null?void 0:de.self),c.push(...(J=fe.changeSet)==null?void 0:J.updated),e.push(...(ie=fe.changeSet)==null?void 0:ie.added),f.push(...(se=fe.changeSet)==null?void 0:se.removed)}});const Q=P(te);if(!Q.length&&!ee){k.forEach(ne=>{const de=qr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const J=we(de,u.project);switch(J.hydrateAncestors(),J.setParent(u,r),J.addSelfToProject(r),r==null||r.add(J,z.Added),J.initChildren(r),typeof ne){case"string":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id),r);break;case"number":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}r||J.captureVersion()});break}else Q.length===1&&!ee?u.setEntity(Q[0],r):k.forEach(ne=>{if(typeof ne=="object"&&!Array.isArray(ne)&&ne!==null){const de=Y$(Object.keys(ne),u.project);if(de){const J=XNe(de||Q[0],u,r,rt.OrDataTypeGroup);c.push(...J.updated),e.push(...J.added),f.push(...J.removed)}}else{const de=qr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const J=we(de,u.project);J.hydrateAncestors(),J.setParent(u,r),J.addSelfToProject(r),r==null||r.add(J,z.Added),J.initChildren(r);const ie=J$(ne,J,{...i,id:L.UUID.uuid()},r,a);c.push(...ie.updated),e.push(...ie.added),f.push(...ie.removed),r||J.captureVersion()}})}}else{const k=yI(s[0],u.project,{...i},r,a);u.setEntity((m=k.changeSet)==null?void 0:m.self,r),c.push(...(v=k.changeSet)==null?void 0:v.updated),e.push(...(b=k.changeSet)==null?void 0:b.added),f.push(...(A=k.changeSet)==null?void 0:A.removed);break}else{const k=yI(s,u.project,{...i},r,a);u.setEntity((w=k.changeSet)==null?void 0:w.self,r),c.push(...(R=k.changeSet)==null?void 0:R.updated),e.push(...(O=k.changeSet)==null?void 0:O.added),f.push(...($=k.changeSet)==null?void 0:$.removed);break}}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:u}}function yI(s,u,i,r,a){const c=[],e=[],f=[],h=[],m=Object.keys(s),v=Y$(m,u);if(v)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:v}};const b=a?i.name+" of "+a.name:i.name,w={id:i.id||L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(r==null?void 0:r.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,name:b,codeName:null,deletable:!0,editable:!0,type:d.DefinitionEntity,additionalProperties:!1,additionalPropertiesDataType:null,allPropertiesImplement:null,description:i.description||null,static:i.static||!1,abstract:i.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:null,implements:[],x:0,y:0,parent:u.toReference()},R=we(w,u);return R.hydrateAncestors(),R.setParent(u,r),R.addSelfToProject(r),r==null||r.add(R,z.Added),R.initChildren(r),e.push(R),m.forEach((O,$)=>{const G=L.UUID.uuid(),x=Ps.new(r);x.id=G,x.name=O,x.codeName=O,x.parent=R.toReference(),x.index=$,x.required=!0,x.interactive=!0;const k=we(x,u);k.hydrateAncestors(),k.setParent(R,r),k.addSelfToProject(r),r==null||r.add(k,z.Added),k.initChildren(r),e.push(k);const W=s[O],te=L.UUID.uuid(),ee=qr.new(r);ee.id=te,ee.parent=k.toReference(),ee.like=!0,ee.isList=!1;const Q=we(ee,u);Q.hydrateAncestors(),Q.setParent(k,r),Q.addSelfToProject(r),r==null||r.add(Q,z.Added),Q.initChildren(r),e.push(Q);const ne=J$(W,Q,{...i,name:O,id:L.UUID.uuid()},r,a||R);c.push(...ne.updated),e.push(...ne.added),f.push(...ne.removed),r||(k.captureVersion(),Q.captureVersion())}),r||R.captureVersion(),{hasCreated:!0,changeSet:{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:R}}}function Hu(s,u,i,r,a){const c={ignoreImplementationMatch:!1,...a},e=[];return!s.length||!u.length?{errors:e,overlap:!1}:(s.length>u.length?s.forEach(f=>{const h=u.find(v=>v.name===f.name),m=u.find(v=>{var b,A;return Array.isArray(v.implements)?v.implements.some(w=>!!f.implements.find(R=>R.id===w.id)):((b=v.implements)==null?void 0:b.id)===((A=f.implements)==null?void 0:A.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const v=new pi({id:f.id+"--"+h.id+"--"+r,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${h.type} ${h.name} with id "${h.id}" that has the same name`,severity:Ee.Error,code:r,entity:f,firstRelationship:h});e.push(v)}if(m&&!c.ignoreImplementationMatch){const v=new pi({id:f.id+"--"+m.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${m.type} ${m.name} with id "${m.id}" that implements the same base descriptor`,severity:Ee.Error,code:i,entity:f,firstRelationship:m});e.push(v)}}):u.forEach(f=>{var v;const h=s.find(b=>b.name===f.name),m=s.find(b=>{var A,w;return b.implements&&Array.isArray(b.implements)?b.implements.some(R=>!!f.implements.find(O=>O.id===R.id)):((A=b.implements)==null?void 0:A.id)===((w=f.implements)==null?void 0:w.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const b=new pi({id:h.id+"--"+f.id+"--"+r,message:`Entity of type ${h.type} named "${h.name}" with id "${h.id}" overrides a base entity ${f.name} with id "${f.id}" that has the same name`,severity:Ee.Error,code:r,entity:h,firstRelationship:f});e.push(b)}if(m&&!c.ignoreImplementationMatch){const b=new pi({id:m.id+"--"+f.id+"--"+i,message:`Entity of type ${m.type} named "${m.name}" with id "${m.id}" overrides a base entity ${f.name} with id "${f.id}" that implements the same base ${Array.isArray(m==null?void 0:m.implements)?qt(m==null?void 0:m.implements.map(A=>A.type),"', '","' and '"):(v=m.implements)==null?void 0:v.id}`,severity:Ee.Error,code:i,entity:m,firstRelationship:f});e.push(b)}}),{errors:e,overlap:!!e.length})}function n1i(s,u){return s.abstract||(s.properties.forEach(r=>{r.abstract||r.metaSync({abstract:!0},u)}),Object.values(s.detachedDependents).forEach(r=>{r.field===gB.EntityField&&r.entity.remove({ignoreUpstream:!1},u)}),s.metaSync({abstract:!0},u)),s}function a1i(s,u){return s.abstract&&(s.properties.forEach(r=>{r.abstract&&r.metaSync({abstract:!1},u)}),Object.values(s.detachedDependents).forEach(r=>{(r.field===XI.Implements||r.field===XI.Extends)&&r.entity.onDetachedDependencyRemoved(s,r.field,u)}),s.metaSync({abstract:!1},u)),s}function s1i(s,u){return s.static||(s.properties.forEach(r=>{r.static||r.metaSync({static:!0},u)}),s.metaSync({static:!0},u)),s}function l1i(s,u){return s.static&&s.metaSync({static:!1},u),s}const aE=class aE extends j${constructor(i,r){super(i);D(this,"initialData");D(this,"id");D(this,"version");D(this,"name");D(this,"description",null);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",!1);D(this,"static");D(this,"additionalProperties",!1);D(this,"properties",[]);D(this,"allPropertiesImplement",null);D(this,"additionalPropertiesDataType",null);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"interactive",!1);D(this,"errors",[]);D(this,"project");if(this.initialData=this.initialData||i,this.project=this.project||r,this.id=this.id||i.id,this.version=this.version||i.version,this.name=this.name||i.name,this.static=this.static||i.static,this.interactive=this.interactive||i.interactive,this.abstract=i.abstract,this.additionalProperties=i.additionalProperties,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.initialData.allPropertiesImplement){const a=we(this.initialData.allPropertiesImplement,this.project);a.setParent(this,null),a.initChildren(null),this.allPropertiesImplement=a}if(this.initialData.additionalPropertiesDataType){const a=we(this.initialData.additionalPropertiesDataType,this.project);a.setParent(this,null),a.initChildren(null),this.additionalPropertiesDataType=a}this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project))}get allMethods(){return P([...this.ownDeclaredMethods,...this.allBaseMethodsFromOriginalParents])}get allProperties(){return P([...this.ownDeclaredProperties,...this.allBasePropertiesFromOriginalParents])}get allBaseMethodsFromOriginalParents(){var a;const i=((a=this.extends)==null?void 0:a.allMethods)||[],r=[...i].filter(c=>!i.some(e=>e.id!==c.id));return P(r)}get allBasePropertiesFromOriginalParents(){var a;const i=((a=this.extends)==null?void 0:a.allProperties)||[],r=[...i].filter(c=>!i.some(e=>{var f;return e.id!==c.id&&(!!e.implements.find(h=>h.id===c.id)||((f=e.extends)==null?void 0:f.id)===c.id)}));return P(r)}get allBasePropertiesFromExtendedAndImplementedEntities(){var a,c;const i=[...((a=this.extends)==null?void 0:a.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.allBasePropertiesFromExtendedAndImplementedEntities)||[]].filter(e=>!e.abstract),r=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return P([...r])}get allBaseMethodsFromExtendedAndImplementedEntities(){return P([...(this.extends?[this.extends]:[]).reduce((i,r)=>r.type===d.PrimitiveEntity?i:[...[...r.ownDeclaredMethods,...r.allBaseMethodsFromExtendedAndImplementedEntities].filter(c=>c.type!==d.ActionDescriptor),...i],[])])}get extendedPropertiesFromOriginalParents(){var a,c;const i=[...((a=this.extends)==null?void 0:a.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.extendedPropertiesFromOriginalParents)||[]].filter(e=>!e.abstract),r=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return P(r)}get implementedPropertiesFromOriginalParents(){return P([...(this.extends?[this.extends]:[]).reduce((i,r)=>{const a=r.implementedPropertiesFromOriginalParents,c=[...r.ownDeclaredProperties].filter(h=>!!h.abstract),e=[...a,...c,...i];return[...e].filter(h=>!!!e.find(v=>{var b;return((b=v.extends)==null?void 0:b.id)===h.id||!!v.implements.find(A=>A.id===h.id)}))},[])].filter(i=>!!i.abstract))}get extendedProperties(){return this.properties.filter(i=>i.isExtendedProperty)}get ownDeclaredMethods(){return[...this.methods,...this.abstractMethods]}get ownDeclaredProperties(){return this.properties.filter(i=>!i.isExtendedProperty)}subscribe(){return this.project.subscribeBuiltInInstance(this),this}unsubscribe(){return this.project.unsubscribeBuiltInInstance(this),this}async APILoad(i=Je,...r){return await aE.repository.APILoad(this.id,...r),this}toFlat(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this,...this.properties.flatMap(c=>c.toFlat(i)),...this.methods.flatMap(c=>c.toFlat(i)),...this.abstractMethods.flatMap(c=>c.toFlat(i)),...((a=this.extends)==null?void 0:a.toFlat(i))||[]])}toFlatIds(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.properties.flatMap(c=>c.toFlatIds(i)),...this.methods.flatMap(c=>c.toFlatIds(i)),...this.abstractMethods.flatMap(c=>c.toFlatIds(i)),...((a=this.extends)==null?void 0:a.toFlatIds(i))||[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,description:this.description,interactive:this.interactive,additionalProperties:this.additionalProperties,abstract:this.abstract,static:this.static,type:this.type,name:this.name}}toJSON(i=new Set){var r,a,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,additionalProperties:this.additionalProperties,interactive:this.interactive,additionalPropertiesDataType:((r=this.additionalPropertiesDataType)==null?void 0:r.toJSON(i))||null,allPropertiesImplement:((a=this.allPropertiesImplement)==null?void 0:a.toJSON(i))||null,properties:this.properties.map(e=>e.toJSON(i)),methods:this.methods.map(e=>e.toJSON(i)),abstractMethods:this.abstractMethods.map(e=>e.toJSON(i)),extends:((c=this.extends)==null?void 0:c.toJSON(i))||null})}toReference(i=Et){return{id:this.id+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var r,a,c;return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,additionalProperties:this.additionalProperties,additionalPropertiesDataType:((r=this.additionalPropertiesDataType)==null?void 0:r.toReference())||null,allPropertiesImplement:((a=this.allPropertiesImplement)==null?void 0:a.toReference())||null,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:((c=this.extends)==null?void 0:c.toReference())||null}}toFlatJSON(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(e=>e.toFlatJSON(i)),...this.methods.flatMap(e=>e.toFlatJSON(i)),...this.abstractMethods.flatMap(e=>e.toFlatJSON(i)),...((a=this.additionalPropertiesDataType)==null?void 0:a.toFlatJSON(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatJSON(i))||[]])}toGenerationTarget(i=Et){var r;return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,additionalProperties:this.additionalProperties,extends:(r=this.extends)==null?void 0:r.id}}toFlatGenerationTarget(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(e=>e.toFlatGenerationTarget(i)),...this.methods.flatMap(e=>e.toFlatGenerationTarget(i)),...this.abstractMethods.flatMap(e=>e.toFlatGenerationTarget(i)),...((a=this.additionalPropertiesDataType)==null?void 0:a.toFlatGenerationTarget(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatGenerationTarget(i))||[]])}clearErrors(){var i,r;return this.errors=[],this.properties.forEach(a=>a.clearErrors()),this.methods.forEach(a=>a.clearErrors()),this.abstractMethods.forEach(a=>a.clearErrors()),(i=this.additionalPropertiesDataType)==null||i.clearErrors(),(r=this.allPropertiesImplement)==null||r.clearErrors(),this}validate(){return this.errors=YRi(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await zRi(this,{tracker:r}),{success:!0}}getErrors(){var r,a;return[...this.errors,...this.properties.flatMap(c=>c.getErrors()),...this.methods.flatMap(c=>c.getErrors()),...this.abstractMethods.flatMap(c=>c.getErrors()),...((r=this.additionalPropertiesDataType)==null?void 0:r.getErrors())||[],...((a=this.allPropertiesImplement)==null?void 0:a.getErrors())||[]]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];await r.tick();for(const c of this.properties){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}for(const c of this.methods){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}for(const c of this.abstractMethods){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}if(this.additionalPropertiesDataType){const c=await this.additionalPropertiesDataType.getErrorsAsync({tracker:r});a.push(...c)}if(this.allPropertiesImplement){const c=await this.allPropertiesImplement.getErrorsAsync({tracker:r});a.push(...c)}return a}getShallowErrors(){return this.errors}implement(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),null,!0,"implement-built-in-base-entity")),a){const c=ED(this,i,r,a);return r==null||r.attemptAutoclose("implement-built-in-base-entity",this.id),c}getAllPropertiesImplements(){var r;const i=[];return this.allPropertiesImplement&&i.push(this.allPropertiesImplement),((r=this.extends)==null?void 0:r.type)===d.BuiltInBaseEntity&&i.push(...this.extends.getAllPropertiesImplements()||[]),i}getAllInteractiveMethods(){const i=[];if(this.interactive){if(i.push(...this.methods,...this.abstractMethods),!this.extends||this.extends.type===d.BuiltInBaseEntity&&this.extends.interactive||this.extends.type===d.PrimitiveEntity)return i;this.extends instanceof aE&&i.push(...this.extends.getAllInteractiveMethods())}return P(i)}getRawDefaultValue(){const i={};return this.properties.forEach(r=>{var e;if(!OE(r)||!r.defaultValue)return;const a=ye(r,this.project),c=r.codeName||yc(r,this.project)||el($r(a));i[c]=((e=r.getDefaultValue())==null?void 0:e.value)||null}),i}};D(aE,"repository",{APILoad:async(i,...r)=>null});let Nl=aE;class eVe extends Nl{constructor(i){super(da,i);D(this,"initialData");D(this,"id",be.PERSISTED_ENTITY);D(this,"version","1");D(this,"name",be.PERSISTED_ENTITY);D(this,"description",da.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",da.abstract);D(this,"static",da.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=da,this.project=i,this.id=da.id,this.version=da.version,this.name=da.name,this.static=da.static,this.abstract=da.abstract,this.properties=this.initialData.properties.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=we(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=we(r,this.project);return a.parent=this,a}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project))}}var Ra=(s=>(s.ValueMustBeString="value-must-be-string",s.StringValueMustNotHaveSpaces="string-value-must-not-have-spaces",s.StringValueMustNotHaveDashes="string-value-must-not-have-dashes",s.MustBeUniqueAmongSameEntities="must-be-unique-among-same-entities",s))(Ra||{});function bD(s,u){const i=[],r=u;if(!r)return{errors:i,override:u};if(typeof r!="string")return{errors:[],override:u};if(r.includes(" ")){const a=new pi({id:s.id+"--string-value-must-not-have-spaces",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces.`,severity:Ee.Error,code:"string-value-must-not-have-spaces",entity:s});i.push(a)}return{errors:i,override:r.replace(/\s/g,"-")}}function tVe(s,u){const i=[],r=u;if(!r)return{errors:i,override:u};if(typeof r!="string")return{errors:[],override:u};if(r.includes(" ")){const a=new pi({id:s.id+"--string-value-must-not-have-spaces",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ee.Error,code:"string-value-must-not-have-spaces",entity:s});i.push(a)}if(r.includes("-")){const a=new pi({id:s.id+"--string-value-must-not-have-dashes",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ee.Error,code:"string-value-must-not-have-dashes",entity:s});i.push(a)}return{errors:i,override:r.replace(/\s|-/g,"_")}}var lu=(s=>(s.StatusCodeMustBeNumber="status-code-must-be-number",s.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",s))(lu||{}),iVe=(s=>(s.PathMustStartWithSlash="path-must-start-with-slash",s.PathContainsInvalidCharacters="path-contains-invalid-characters",s.PathUnclosedCurlyBracket="path-unclosed-curly-bracket",s.PathUnopenedCurlyBracket="path-unopened-curly-bracket",s.PathEmptyCurlyBrackets="path-empty-curly-brackets",s.PathConflictsWithExistingEndpoint="path-conflicts-with-existing-endpoint",s))(iVe||{});function $P(s,u){if(!s||!u)return!1;if(s===u)return!0;const i=s.split("/").filter(Boolean),r=u.split("/").filter(Boolean);if(i.length!==r.length)return!1;for(let a=0;a<i.length;a++){const c=i[a],e=r[a],f=c.startsWith("{")&&c.endsWith("}"),h=e.startsWith("{")&&e.endsWith("}");if(!(f&&h)&&c!==e)return!1}return!0}function rVe(s,u){const i=[];if(typeof u!="number"){const r=new pi({id:s.id+"--status-code-must-be-number",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a number.`,severity:Ee.Error,code:"status-code-must-be-number",entity:s});return i.push(r),{errors:i,override:u}}if(u<100||u>599){const r=new pi({id:s.id+"--status-code-must-be-between-100-and-599",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a number between 100 and 599.`,severity:Ee.Error,code:"status-code-must-be-between-100-and-599",entity:s});i.push(r)}return{errors:i,override:u}}class nVe extends Nl{constructor(i){var f,h;super(zs,i);D(this,"initialData");D(this,"id",be.HTTP_ENDPOINT);D(this,"version","1");D(this,"name",be.HTTP_ENDPOINT);D(this,"description",zs.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",zs.abstract);D(this,"static",zs.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=zs,this.project=i,this.id=zs.id,this.version=zs.version,this.name=zs.name,this.static=zs.static,this.abstract=zs.abstract,this.properties=this.initialData.properties.map(m=>{const v=we(m,this.project);return v.setParent(this,null),v.initChildren(null),v}),this.methods=this.initialData.methods.map(m=>{const v=we(m,this.project);return v.parent=this,v}),this.abstractMethods=this.initialData.abstractMethods.map(m=>{const v=we(m,this.project);return v.parent=this,v}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id);if(!r)throw new Error("Path property not found in endpoint entity");r._codeNativeValueValidation=(m,v)=>{var G;const b=bD(m,v);let A=typeof b.override=="string"?b.override:"";if(A&&!A.startsWith("/")&&(A="/"+A),typeof A=="string"){if(/[^a-zA-Z0-9\-_/{}]/g.test(A)){const te=new pi({id:m.id+"--path-contains-invalid-characters",message:`Path "${A}" contains invalid characters. Only alphanumeric, -, _, /, and {} are allowed.`,severity:Ee.Error,code:"path-contains-invalid-characters",entity:m});b.errors.push(te)}let k=!1,W="";for(let te=0;te<A.length;te++){const ee=A[te];if(ee==="{")k=!0,W+=ee;else if(ee==="}"){if(!k){const Q=new pi({id:m.id+"--path-unopened-curly-bracket",message:`Path "${A}" has a closed curly bracket '}' without an opening bracket '{'.`,severity:Ee.Error,code:"path-unopened-curly-bracket",entity:m});b.errors.push(Q)}k=!1,W+=ee}else W+=k?ee:ee.toLowerCase()}if(A=W,k){const te=new pi({id:m.id+"--path-unclosed-curly-bracket",message:`Path "${A}" has an unclosed curly bracket '{'.`,severity:Ee.Error,code:"path-unclosed-curly-bracket",entity:m});b.errors.push(te)}if(A.includes("{}")){const te=new pi({id:m.id+"--path-empty-curly-brackets",message:`Path "${A}" has empty curly brackets '{}'. Path parameters must have a name.`,severity:Ee.Error,code:"path-empty-curly-brackets",entity:m});b.errors.push(te)}}b.override=A;const w=m.parent,R=w.properties.find(x=>x.implements.find(k=>k.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),O=(G=R==null?void 0:R.getDefaultValue())==null?void 0:G.value;if(m.project.entities.filter(x=>Ni(x,be.HTTP_ENDPOINT)&&x.id!==w.id).some(x=>{var te,ee;const k=x.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));if(((te=k==null?void 0:k.getDefaultValue())==null?void 0:te.value)!==O)return!1;const W=x.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!W)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return $P((ee=W.getDefaultValue())==null?void 0:ee.value,A)})){const x=new pi({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${A}" conflicts with another endpoint using the ${O} method.`,severity:Ee.Error,code:"path-conflicts-with-existing-endpoint",entity:m});b.errors.push(x)}return b};const a=this.properties.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id);a&&(a._codeNativeValueValidation=(m,v)=>{var $;const b={errors:[],override:v},A=m.parent,w=A.properties.find(G=>G.implements.find(x=>x.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),R=($=w==null?void 0:w.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(G=>Ni(G,be.HTTP_ENDPOINT)&&G.id!==A.id).some(G=>{var W,te;const x=G.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!$P((W=x==null?void 0:x.getDefaultValue())==null?void 0:W.value,R))return!1;const k=G.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));return((te=k==null?void 0:k.getDefaultValue())==null?void 0:te.value)===v})){const G=new pi({id:m.id+"--"+Ra.MustBeUniqueAmongSameEntities,message:`Method "${v}" cannot be used because another endpoint is already using the ${v} method on path "${R}".`,severity:Ee.Error,code:Ra.MustBeUniqueAmongSameEntities,entity:m});b.errors.push(G)}return b});const c=this.abstractMethods.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.id);if(!c)throw new Error("Handler method not found in endpoint entity");const e=(((h=(f=c.dataType)==null?void 0:f.entity)==null?void 0:h.properties)||[]).find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.dataType.entity.properties.statusCode.id);if(!e)throw new Error("Status code output not found in handler method");e._codeNativeValueValidation=(m,v)=>rVe(m,v)}}var zv=(s=>(s.InvalidCharacters="cron-invalid-characters",s.MustHaveSixFields="cron-must-have-six-fields",s.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",s))(zv||{});function aVe(s,u){const i=[];let r=u;if(typeof u!="string"){const e=new pi({id:s.id+"--"+Ra.ValueMustBeString,message:`Entity of type ${s.type} with id "${s.id}" has an invalid value. The cron expression must be a string.`,severity:Ee.Error,code:Ra.ValueMustBeString,entity:s});return i.push(e),{errors:i,override:""}}r=u.trimStart().replace(/\s{2,}/g," ");const a=/[^0-9A-Z *?\-/,LW#]/g;if(a.test(r)){const e=Array.from(new Set(r.match(a)));i.push(new pi({id:s.id+"--cron-invalid-characters",message:`Cron expression contains invalid characters: "${e.join(", ")}". Only alphanumeric characters and (* ? - / , L W #) are allowed.`,severity:Ee.Error,code:"cron-invalid-characters",entity:s})),r=r.replace(a,"")}const c=r.split(" ").filter(Boolean);if(c.length!==6)i.push(new pi({id:s.id+"--cron-must-have-six-fields",message:`Elyx Cron expressions must have exactly 6 fields separated by spaces (Minutes, Hours, Day-of-month, Month, Day-of-week, Year). Currently has ${c.length}.`,severity:Ee.Error,code:"cron-must-have-six-fields",entity:s}));else{const e=c[2],f=c[4];e!=="?"&&f!=="?"&&(i.push(new pi({id:s.id+"--cron-day-of-month-and-week-conflict",message:"Elyx restricts defining both Day-of-month and Day-of-week simultaneously. If you specify one, the other must be '?'",severity:Ee.Error,code:"cron-day-of-month-and-week-conflict",entity:s})),e==="*"&&f==="*"&&(c[4]="?",r=c.join(" ")))}return{errors:i,override:r}}class sVe extends Nl{constructor(i){super(Rl,i);D(this,"initialData");D(this,"id",be.CRON_JOB);D(this,"version","1");D(this,"name",be.CRON_JOB);D(this,"description",Rl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Rl.abstract);D(this,"static",Rl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Rl,this.project=i,this.id=Rl.id,this.version=Rl.version,this.name=Rl.name,this.static=Rl.static,this.abstract=Rl.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"].BUILT_IN_CRON_JOB_ENTITY.properties.expression.id);if(!r)throw new Error("Expression property not found in cron job entity");r._codeNativeValueValidation=(a,c)=>aVe(a,c)}}class lVe extends Nl{constructor(i){super(Ia,i);D(this,"initialData");D(this,"id",be.RELATIONAL_DATABASE);D(this,"version","1");D(this,"name",be.RELATIONAL_DATABASE);D(this,"description",Ia.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Ia.abstract);D(this,"static",Ia.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Ia,this.project=i,this.id=Ia.id,this.version=Ia.version,this.name=Ia.name,this.static=Ia.static,this.abstract=Ia.abstract,this.properties=this.initialData.properties.map(c=>{const e=we(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=we(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=we(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(c=>c.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id);if(!r)throw new Error("Path property not found in endpoint entity");r._codeNativeValueValidation=(c,e)=>tVe(c,e);const a=this.properties.find(c=>c.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.minSize.id);a&&(a._codeNativeValueValidation=(c,e)=>{const f={errors:[],override:e};if(typeof e=="number"){if(e<6){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeTooSmall,message:"Minimum GB size cannot be less than 6.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeTooSmall,entity:c});f.errors.push(h)}else if(e>65536){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeTooLarge,message:"Minimum GB size cannot be greater than 65536.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeTooLarge,entity:c});f.errors.push(h)}}else if(e!==void 0){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeMustBeNumber,message:"Minimum GB size must be a number.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeMustBeNumber,entity:c});f.errors.push(h)}return f})}}var oVe=(s=>(s.InvalidCharacters="compute-name-invalid-characters",s.TooLong="compute-name-too-long",s.Empty="compute-name-empty",s))(oVe||{});class dVe extends Nl{constructor(i){super(Dl,i);D(this,"initialData");D(this,"id",be.COMPUTE_ENTITY);D(this,"version","1");D(this,"name",be.COMPUTE_ENTITY);D(this,"description",Dl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Dl.abstract);D(this,"static",Dl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Dl,this.project=i,this.id=Dl.id,this.version=Dl.version,this.name=Dl.name,this.static=Dl.static,this.abstract=Dl.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"][be.COMPUTE_ENTITY].properties.computeName.id);r&&(r._codeNativeValueValidation=(a,c)=>{const e={errors:[],override:c};if(typeof c!="string"||!c){const h=new pi({id:a.id+"--compute-name-empty",message:"Compute name cannot be empty.",severity:Ee.Error,code:"compute-name-empty",entity:a});return e.errors.push(h),e}if(c.length>255){const h=new pi({id:a.id+"--compute-name-too-long",message:"Compute name must be 255 characters or fewer.",severity:Ee.Error,code:"compute-name-too-long",entity:a});e.errors.push(h)}if(/[^a-zA-Z0-9\-_]/g.test(c)){const h=new pi({id:a.id+"--compute-name-invalid-characters",message:`Compute name "${c}" contains invalid characters. Only alphanumeric characters, hyphens (-), and underscores (_) are allowed.`,severity:Ee.Error,code:"compute-name-invalid-characters",entity:a});e.errors.push(h)}return e.errors.length||this.project.entities.filter(m=>Ni(m,be.COMPUTE_ENTITY)&&m.id!==this.id).forEach(m=>{var b;const v=m.properties.find(A=>A.implements.some(w=>w.id===j[d.BuiltInBaseEntity][be.COMPUTE_ENTITY].properties.computeName.id));if(v&&(v==null?void 0:v.id)!==a.id&&((b=v.defaultValue)==null?void 0:b.value)===c){const A=new pi({id:a.id+"--"+ge.ComputeNameNotUnique,message:`Compute name "${c}" is duplicated.`,severity:Ee.Error,code:ge.ComputeNameNotUnique,entity:a});e.errors.push(A)}}),e})}}var uVe=(s=>(s.InvalidImageUri="container-compute-invalid-image-uri",s.InvalidMinTasks="container-compute-invalid-min-tasks",s.InvalidMaxTasks="container-compute-invalid-max-tasks",s.MaxTasksLessThanMinTasks="container-compute-max-less-than-min",s.InvalidEphemeralStorage="container-compute-invalid-ephemeral-storage",s))(uVe||{});class pVe extends Nl{constructor(i){super(wl,i);D(this,"initialData");D(this,"id",be.CONTAINER_COMPUTE_ENTITY);D(this,"version","1");D(this,"name",be.CONTAINER_COMPUTE_ENTITY);D(this,"description",wl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",wl.abstract);D(this,"static",wl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=wl,this.project=i,this.id=wl.id,this.version=wl.version,this.name=wl.name,this.static=wl.static,this.abstract=wl.abstract,this.properties=this.initialData.properties.map(f=>{const h=we(f,this.project);return h.setParent(this,null),h.initChildren(null),h}),this.methods=this.initialData.methods.map(f=>{const h=we(f,this.project);return h.parent=this,h}),this.abstractMethods=this.initialData.abstractMethods.map(f=>{const h=we(f,this.project);return h.parent=this,h}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.imageUri.id);r&&(r._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="string"||!h)return m;if(/\s/.test(h)){const v=new pi({id:f.id+"--container-compute-invalid-image-uri",message:`Image URI "${h}" contains spaces, which is invalid.`,severity:Ee.Error,code:"container-compute-invalid-image-uri",entity:f});m.errors.push(v)}return m});const a=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id);a&&(a._codeNativeValueValidation=(f,h)=>{var w;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<0){const R=new pi({id:f.id+"--container-compute-invalid-min-tasks",message:"Minimum Tasks must be 0 or greater.",severity:Ee.Error,code:"container-compute-invalid-min-tasks",entity:f});m.errors.push(R)}const b=f.parent.properties.find(R=>R.implements.find(O=>O.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id)),A=(w=b==null?void 0:b.getDefaultValue())==null?void 0:w.value;if(typeof A=="number"&&h>A){const R=new pi({id:f.id+"--container-compute-max-less-than-min",message:`Minimum Tasks (${h}) cannot be greater than Maximum Tasks (${A}).`,severity:Ee.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(R)}return m});const c=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id);c&&(c._codeNativeValueValidation=(f,h)=>{var w;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<1){const R=new pi({id:f.id+"--container-compute-invalid-max-tasks",message:"Maximum Tasks must be 1 or greater.",severity:Ee.Error,code:"container-compute-invalid-max-tasks",entity:f});m.errors.push(R)}const b=f.parent.properties.find(R=>R.implements.find(O=>O.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id)),A=(w=b==null?void 0:b.getDefaultValue())==null?void 0:w.value;if(typeof A=="number"&&h<A){const R=new pi({id:f.id+"--container-compute-max-less-than-min",message:`Maximum Tasks (${h}) cannot be less than Minimum Tasks (${A}).`,severity:Ee.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(R)}return m});const e=this.properties.find(f=>{var h;return f.id===((h=j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.ephemeralStorage)==null?void 0:h.id)});e&&(e._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="number")return m;if(h<20||h>200){const v=new pi({id:f.id+"--container-compute-invalid-ephemeral-storage",message:"Ephemeral Storage must be between 20 and 200 GB.",severity:Ee.Error,code:"container-compute-invalid-ephemeral-storage",entity:f});m.errors.push(v)}return m})}}var cVe=(s=>(s.PathContainsInvalidCharacters="shared-drive-mount-path-invalid-characters",s.PathIsSystemFolder="shared-drive-mount-path-is-system-folder",s.PathInvalidFormat="shared-drive-mount-path-invalid-format",s))(cVe||{});class fVe extends Nl{constructor(i){super(Ys,i);D(this,"initialData");D(this,"id",be.SHARED_DRIVE_MOUNT_ENTITY);D(this,"version","1");D(this,"name",be.SHARED_DRIVE_MOUNT_ENTITY);D(this,"description",Ys.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Ys.abstract);D(this,"static",Ys.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Ys,this.project=i,this.id=Ys.id,this.version=Ys.version,this.name=Ys.name,this.static=Ys.static,this.abstract=Ys.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"][be.SHARED_DRIVE_MOUNT_ENTITY].properties.path.id);if(!r)throw new Error("Path property not found in shared drive mount entity");r._codeNativeValueValidation=(a,c)=>{const e=bD(a,c);let f=typeof e.override=="string"?e.override:"";if(f&&!f.startsWith("/")&&(f="/"+f),typeof f=="string"){if(/[^a-zA-Z0-9\-_/]/g.test(f)){const v=new pi({id:a.id+"--shared-drive-mount-path-invalid-characters",message:`Mount path "${f}" contains invalid characters. Only alphanumeric, -, _, and / are allowed.`,severity:Ee.Error,code:"shared-drive-mount-path-invalid-characters",entity:a});e.errors.push(v)}const m=["/bin","/boot","/dev","/etc","/lib","/lib64","/proc","/sys","/usr","/sbin","/run","/var/run"];for(const v of m)if(f===v||f.startsWith(v+"/")){const b=new pi({id:a.id+"--shared-drive-mount-path-is-system-folder",message:`Mounting to or within critical system folder "${v}" is not allowed.`,severity:Ee.Error,code:"shared-drive-mount-path-is-system-folder",entity:a});e.errors.push(b);break}}return e.override=f,e}}}class yVe extends wr{constructor(i){super(Wa,i);D(this,"id",Wa.id);D(this,"name",Wa.name);D(this,"description",Wa.description);D(this,"version",Wa.version);D(this,"autoexecutable",!1);D(this,"type",d.ActionDescriptor);D(this,"inputs",[]);D(this,"dataType",null);D(this,"error",null);D(this,"project");this.project=i,this.inputs=Wa.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.dataType=we(Wa.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=Wa.error?we(Wa.error,this.project):null}}var tl=(s=>(s.UUIDMustBeString="uuid-must-be-string",s.UUIDMustBeValidFormat="uuid-must-be-valid-format",s.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",s))(tl||{});function o1i(s,u){const i=[];if(typeof u!="string"){const a=new pi({id:s.id+"--uuid-must-be-string",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be text.`,severity:Ee.Error,code:"uuid-must-be-string",entity:s});return i.push(a),{errors:i,override:u}}const r=bD(s,u);if(r.errors.length>0)return i.push(...r.errors),{errors:i,override:u};if(!U$(u)){const a=new pi({id:s.id+"--uuid-must-be-valid-format",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a valid UUID format. Eg: "123e4567-e89b-12d3-a456-426614174000".`,severity:Ee.Error,code:"uuid-must-be-valid-format",entity:s});i.push(a)}return{errors:i,override:u}}var Ke=(s=>(s.Inherited="inherited",s.DefaultValue="default-value",s.Missing="missing",s.Undefined="undefined",s.Empty="empty",s.AutoCalculated="auto-calculated",s.QueuedAutocalculation="queued-autocalculation",s.External="external",s.Testing="testing",s.ExecutionResult="execution-result",s))(Ke||{});const hVe={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function Bv(s,u){return{...hVe,id:s,project:u}}class Mv{constructor(u,i){D(this,"initialized",!1);D(this,"id");D(this,"project");D(this,"values",{});D(this,"onWriteCallback",()=>{});D(this,"onRemoveCallback",()=>{});this.id=u,this.project=i,this.init()}onWrite(u){this.onWriteCallback=u}onRemove(u){this.onRemoveCallback=u}init(){var r;if(!((r=this.project)!=null&&r.id)||this.initialized)return;const u={},i={};Object.keys(u).forEach(a=>{const c=u[a],e=new Xr(c,this.project);try{if(c.parent){const m=this.project.findSubscribedInstanceFromReference(c.parent);if(!m)return;e.setParent(m,null),e.hydrateAncestors(),e.initChildren(null)}else if(c.standaloneParent){const m=this.project.findSubscribedInstanceFromReference(c.standaloneParent);if(!m)return;e.standalone=!0,e.setStandaloneParent(m,null),e.hydrateAncestors(),e.initChildren(null)}i[a]=e;const f=e.parent||e.standaloneParent,h=VVe(e,f,this.project);h?i[a]=h:delete u[a]}catch(f){X.Logger.error("Error hydrating ancestors: ",f),delete u[a]}}),this.values={...this.values,...i},this.initialized=!0}toJSON(){const u={};return Object.keys(this.values).forEach(i=>{u[i]=this.values[i].toJSON()}),u}writeValue(u,i){if(!u)throw new Error("The value owner entity is required when writing a value to a value store");let a=this.values[u.id];if(!a)if(i instanceof Xr)a=i;else if(i)a=Lr(i,this.project);else{const c={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:new Date().toISOString(),author:L.sessionAuthor,deleted:!1,previousVersion:null,value:null,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:u.toReference(),parent:null,valueAsTypeSingle:null,valueAsTypeList:null,autogeneration:null,name:Wu(u.getDataType(null))};a=Lr(c,this.project)}a.standalone=!0,a.initialData.standaloneParent||X.Logger.warn("instance.initialData: ",a.initialData),a.setStandaloneParent(u,null),a.hydrateAncestors(),a.initChildren(null),i&&(a.metaSync({...i},null),a.setValueAsType(i.valueAsType,null)),this.values[u.id]=a,this.onWriteCallback(u,a)}readValue(u){return this.values[u]||null}removeValue(u){if(!this.values[u])return;delete this.values[u];const i=this.project.get(u);i&&this.onRemoveCallback(i)}clear(){this.values={}}}function sn(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Q$(s){if(Array.isArray(s))return s.map(h=>typeof h=="number"?h:e(h)?Number(h):String(h));const u=[];let i=0,r="",a=!1,c=null;for(;i<s.length;){const h=s[i];if(h==="."&&!a){r.length&&(u.push(f(r)),r=""),i++;continue}if(h==="["&&!a){r.length&&(u.push(f(r)),r=""),a=!0,i++;continue}if(a){if(!c&&(h==='"'||h==="'")){c=h,i++;continue}if(c){if(h==="\\"&&i+1<s.length){r+=s[i+1],i+=2;continue}if(h===c){c=null,i++;continue}r+=h,i++;continue}if(h==="]"){u.push(f(r)),r="",a=!1,i++;continue}if(/\s/.test(h)&&!c){i++;continue}r+=h,i++;continue}r+=h,i++}return r.length&&u.push(f(r)),u;function e(h){return/^[0-9]+$/.test(h)}function f(h){const m=h.trim();return e(m)?Number(m):m}}function AD(s,u,i){if(s==null)return i;const r=Q$(u);let a=s;for(let c=0;c<r.length;c++){const e=r[c];if(a==null)return i;if(Array.isArray(a)&&typeof e=="number"){if(!(e in a))return i;a=a[e]}else{if(!Object.prototype.hasOwnProperty.call(a,e))return i;a=a[e]}}return a}const d1i=new Set(["__proto__","prototype","constructor"]);function mVe(s){return typeof s=="string"&&d1i.has(s)}function u1i(s,u,i,r){const{createMissing:a=!0,coerce:c=!0}=r??{};if(s==null||typeof s!="object")throw new TypeError("set(...) expects a non-null object as target.");const e=Q$(u);if(e.length===0)throw new Error("set(...) path must not be empty.");let f=s;for(let h=0;h<e.length;h++){const m=e[h];if(mVe(m))throw new Error(`Refusing to set unsafe key "${String(m)}" on object.`);const v=h===e.length-1,A=typeof e[h+1]=="number",w=Array.isArray(f)&&typeof m=="number";if(v){if(w&&f[m]==null&&!a)throw new Error(`set(...) missing array index "${String(m)}" (createMissing=false).`);return f[m]=i,s}else{if(!Object.prototype.hasOwnProperty.call(f,m)||f[m]==null){if(!a)throw new Error(`set(...) missing parent at segment "${String(m)}" (createMissing=false).`);f[m]=A?[]:{}}else{const R=f[m],O=R!==null&&typeof R=="object",$=Array.isArray(R);if(A){if(!$){if(!c)throw new Error(`set(...) expected an array at "${String(m)}" but found non-array (coerce=false).`);f[m]=[]}}else if(!O||$){if(!c)throw new Error(`set(...) expected an object at "${String(m)}" but found non-object (coerce=false).`);f[m]={}}}f=f[m]}}return s}function X$(s,u,i,r){const a=Q$(u);if(a.length===0)return s;function c(e,f){const h=a[f],m=f===a.length-1;if(r==="strict-set"||r==="strict-delete"){if(mVe(h))throw new Error(`Unsafe key "${String(h)}"`);if(e==null||typeof e!="object"&&!Array.isArray(e))throw new Error(`Missing parent or invalid container at segment "${String(h)}".`);if(r==="strict-delete"&&m&&!(h in e))return e}let v;if(Array.isArray(e))v=[...e];else if(e&&typeof e=="object")v={...e};else if(r==="safe-set")v=typeof h=="number"?[]:{};else throw new Error(`Cannot traverse path at "${String(h)}"`);if(m)return r==="strict-delete"?delete v[h]:v[h]=i,v;const b=e?e[h]:void 0;if(r==="safe-set"&&b==null){const A=typeof a[f+1]=="number",w=c(A?[]:{},f+1);return v[h]=w,v}return v[h]=c(b,f+1),v}if(s==null&&r==="safe-set"){const e=typeof a[0]=="number";return c(e?[]:{},0)}return c(s,0)}const Oj=Symbol("missing"),p1i=s=>s!=null&&typeof s=="object";function gD(s,u){if(typeof s!="string")throw new TypeError(`${u} expects the key to be a string.`);return s}function _0(s,u){if(typeof s!="string"&&!Array.isArray(s))throw new TypeError(`${u} expects the path to be string or array.`);return s}function Qy(s,u){if(!sn(s))throw new TypeError(`${u} expects the first argument to be an object.`);return s??{}}function TVe(s,u){const i=gD(u,"ReadKey");return(s??{})[i]}function vVe(s,u,i){const r=gD(u,"WriteKey");if(s&&typeof s=="object"){const a=Array.isArray(s)?[...s]:{...s};return a[r]=i,a}return{[r]:i}}function EVe(s,u){if(!s||typeof s!="object")return{};const i=String(u),{[i]:r,...a}=s;return a}function bVe(s,u,i){const r=Qy(s,"ReadNestedKey"),a=_0(u,"ReadNestedKey");return AD(r,a,i)}function AVe(s,u,i){const r=Qy(s,"WriteNestedKey"),a=_0(u,"WriteNestedKey");return X$(r,a,i,"strict-set")}function gVe(s,u,i){const r=Qy(s,"WriteSafeNestedKeyRecursively"),a=_0(u,"WriteSafeNestedKeyRecursively");return X$(r,a,i,"safe-set")}function IVe(s,u){const i=Qy(s,"DeleteNestedKey"),r=_0(u,"DeleteNestedKey");return X$(i,r,null,"strict-delete")}function RVe(s,u){const i=gD(u,"HasKey"),r=s;return r!=null&&p1i(r)&&Object.prototype.hasOwnProperty.call(r,i)}function DVe(s,u,i){const r=gD(u,"KeyValueEquals");return s==null||typeof s!="object"?!1:s[r]===i}function wVe(s,u){const i=s,r=_0(u,"HasNestedKey");return AD(i,r,Oj)!==Oj}function CVe(s,u,i){const r=_0(u,"NestedKeyValueEquals");return AD(s,r)===i}function OVe(...s){const u={};for(let i=0;i<s.length;i++){const r=s[i];if(r!=null){if(!sn(r))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,r)}}return u}function _Ve(s){const u=Qy(s,"ObjectKeys");return Object.keys(u)}function PVe(s){const u=Qy(s,"ObjectValues");return Object.values(u)}function NVe(s){const u=Qy(s,"ObjectEntries");return Object.entries(u)}const om=new Set;function c1i(s){return{execution:null,project:s,localTestValues:Bv("local-test-values",s),resolvedValues:Bv("resolved-values",s),persistedExecutionResults:Bv("persisted-execution-results",s),lastExecutionResults:Bv("last-execution-results",s),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function P0(s,u,i,r){var f;let a;if(((f=s==null?void 0:s.entity)==null?void 0:f.type)===d.PrimitiveEntity)switch(s.entity.name){case he.EntityTemplate:a=he.EntityTemplate;break;case he.String:a=he.String;break;case he.Number:a=he.Number;break;case he.Boolean:a=he.Boolean;break;case he.Null:a=he.Null;break;case he.Enum:a=he.Enum;break;case he.KeyValue:a=he.KeyValue;break;case he.Untyped:a=he.Untyped;break;case he.KeyValue:a=he.KeyValue;break;case he.Date:a=he.Date;break;case he.UUID:a=he.UUID;break;case he.File:a=he.File;break;case he.Void:a=he.Void;break;case he.ActionDescriptor:a=he.ActionDescriptor;break;case he.Bytes:a=he.Bytes;break;case he.SqlProgram:a=he.SqlProgram;break;default:throw new Error(`Primitive type ${fi(s.entity,i)} is not supported`)}else a=he.Untyped;const c=Xr.new(r);c.name=a,c.parent=u.toReference();const e=we(c,i);return e.hydrateAncestors(),r==null||r.add(e,z.Added),e.addSelfToProject(r),e.initChildren(r),e}function Xd(s,u,i=new Set){var r,a,c,e;if(i.has(s.id))return[];if(i.add(s.id),mi.includes(s.type)){const f=zr(s);return P([f,...[f].flatMap(h=>Xd(h,u,i))])}else if(s.type===d.OutputMap){if(mi.includes(s.parent.type)&&((r=s.declaration)==null?void 0:r.type)===d.Property&&s.declaration.static)return P([s,s.declaration,...[s,s.declaration].flatMap(f=>Xd(f,u,i))])}else if(s.type===d.InputMap){if(mi.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&((c=s.declaration)!=null&&c.static))return P([s.declaration,...[s.declaration].flatMap(f=>Xd(f,u,i))])}else if(s.type===d.ValueDescriptor&&((e=s.parent)==null?void 0:e.type)===d.Search){const f=s.parent.inputs.find(h=>{var m;return((m=h.declaration)==null?void 0:m.id)===s.id});if(f)return[f]}return[s]}function VVe(s,u,i){return s}function N0(s,u,i=!1){const r=s.readsValue;let a=null;const c=Xu(r,u,i);if(c){const e={sources:[c],target:s};a={value:c.value,valueOwner:s,type:Ke.Inherited,inheritanceLink:e}}else a={value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null};return a}function Bi(s,u,i){var f;if(!u)return null;let r;if(((f=s==null?void 0:s.entity)==null?void 0:f.type)===d.PrimitiveEntity)switch(s.entity.name){case he.EntityTemplate:r=he.EntityTemplate;break;case he.String:r=he.String;break;case he.Number:r=he.Number;break;case he.Boolean:r=he.Boolean;break;case he.Null:r=he.Null;break;case he.Enum:r=he.Enum;break;case he.KeyValue:r=he.KeyValue;break;case he.Untyped:r=he.Untyped;break;case he.KeyValue:r=he.KeyValue;break;case he.Date:r=he.Date;break;case he.UUID:r=he.UUID;break;case he.File:r=he.File;break;case he.Void:r=he.Void;break;case he.ActionDescriptor:r=he.ActionDescriptor;break;case he.Bytes:r=he.Bytes;break;case he.SqlProgram:r=he.SqlProgram;break;default:throw new Error(`Primitive type ${fi(s.entity,i)} is not supported`)}else r=he.Untyped;if(!i.get(u.id))return null;const c=Xr.new(null);c.name=r,c.standaloneParent=u.toReference();let e=new Xr(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function xVe(s,u,i=!1){var c,e;if(u.execution&&u.execution.hasEntity(s)&&!i){const f=(c=u.lastExecutionResults)==null?void 0:c.readValue(s.id);if(f)return{value:f,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=(e=u.localTestValues)==null?void 0:e.readValue(s.id),a=u.getValueTypePreference(s.id);return r&&!i&&(a===null||a!==Ke.DefaultValue)?{value:r,valueOwner:s,type:Ke.Testing,inheritanceLink:null}:{value:null,valueOwner:s,type:Ke.QueuedAutocalculation,inheritanceLink:null}}function hI(s,u,i,r=!1){var e,f;const a={...s},c=u.type===d.VariableDeclaration?u.inputs:Jt.includes(u.type)?u.outputs:[];if(!c||c.length===0)return a;for(const h of c){if(!Dy(h))continue;const m=dE(h,i,r);if(m&&m.value)try{const v=ye(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||$r(v);a[b]=ua((m==null?void 0:m.value)||null)?a[b]:(f=m==null?void 0:m.value)==null?void 0:f.value}catch{}}return a}function Gv(s,u,i,r=!1){var e,f;const a={...s},c=u.inputs;if(!c)return a;for(const h of c){if(!Dy(h))continue;const m=Pb(h,i,r);if(m&&m.value&&m.type!==Ke.Undefined){const v=fi(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||$r(v);a[b]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return a}function $Ve(s,u,i=!1){var v,b,A,w,R,O,$,G;let r={};if(((b=(v=s.getDataType(null))==null?void 0:v.entity)==null?void 0:b.type)===d.DefinitionEntity&&(r={...r,...((A=s.getDataType(null))==null?void 0:A.entity).getActiveRawDefaultValue()}),u.execution&&u.execution.hasEntity(s)&&!i){const x=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(x){if(sn(x.value)){const W={...r,...x.value},te={...Gv(W,s,u,i)};x.metaSync({value:te},null)}return{value:x,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}}const a=!!((R=u.execution)!=null&&R.entities.length),c=(O=u.execution)==null?void 0:O.hasEntity(s),e=s.readsValue;let f=null;if(e){const x=($=u.execution)==null?void 0:$.hasEntity(e);if((!a||a&&x&&c||a&&!x&&!c)&&(f=N0(s,u,i),f&&f.value&&sn(f.value.value))){const W={...r,...f.value.value},te={...Gv(W,s,u,i)};f.value.metaSync({value:te},null)}}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const x=h;if(x&&x.value===null&&x.autogeneration){const k=Aw(x);if(x.metaSync({value:k},null),sn(k)){const W={...Gv(k,s,u,i)};x.metaSync({value:W},null)}}(i||m===null||m!==Ke.Testing)&&(f={value:x,valueOwner:s,type:ua(x)?s.readsValue?Ke.Inherited:Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const x=(G=u.localTestValues)==null?void 0:G.readValue(s.id);if(x){if(sn(x.value)){const k={...r,...x.value},W={...Gv(k,s,u,i)};x.metaSync({value:W},null)}return{value:x,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}}return ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function eL(s,u,i=!1){var f,h,m,v,b,A,w,R,O,$,G,x,k,W,te,ee,Q;let r={};if(((h=(f=s.getDataType(null))==null?void 0:f.entity)==null?void 0:h.type)===d.DefinitionEntity?r={...r,...((m=s.getDataType(null))==null?void 0:m.entity).getActiveRawDefaultValue()}:((b=(v=s.getDataType(null))==null?void 0:v.entity)==null?void 0:b.type)===d.BuiltInBaseEntity&&(r={...r,...((A=s.getDataType(null))==null?void 0:A.entity).getRawDefaultValue()}),u.execution&&u.execution.hasEntity(s)&&!i){const ne=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(ne){if(sn(ne.value)){const J={...r,...ne.value},ie=hI(J,s,u,i);ne==null||ne.metaSync({value:ie},null)}return{value:ne,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}}const a=(R=u.localTestValues)==null?void 0:R.readValue(s.id);let c=!1;if(s.type===d.VariableDeclaration){const ne=s,de=!!((O=u.execution)!=null&&O.entities.length),J=($=u.execution)==null?void 0:$.hasEntity(s),ie=ne.readsValue;if(ie){const se=(G=u.execution)==null?void 0:G.hasEntity(ie);c=!de||de&&se&&J||de&&!se&&!J}}const e=u.getValueTypePreference(s.id);if(a&&!i&&(!c||e===Ke.Testing)){if(sn(a.value)){const de={...r,...a.value},J=hI(de,s,u,i);a.metaSync({value:J},null)}return{value:a,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}if((x=s.getDataType(null))!=null&&x.entity&&(((W=(k=s.getDataType(null))==null?void 0:k.entity)==null?void 0:W.type)===d.DefinitionEntity||((ee=(te=s.getDataType(null))==null?void 0:te.entity)==null?void 0:ee.type)===d.BuiltInBaseEntity)&&((Q=s.getDataType(null))!=null&&Q.isObject())){const ne=Bi(s.dataType,s,u.project),de=hI(r,s,u,i);return ne==null||ne.metaSync({value:de},null),{value:ne,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null}}return null}function ID(s,u,i=!1){var v,b,A,w,R;if((v=s.dataType)!=null&&v.isObject())return $Ve(s,u,i);const r=Mt(s),a=!!((b=u.execution)!=null&&b.entities.length),c=(A=u.execution)==null?void 0:A.hasEntity(r),e=s.readsValue;let f=null;if(e){const O=(w=u.execution)==null?void 0:w.hasEntity(e);(!a||a&&O&&c||a&&!O&&!c)&&(f=N0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const O=h;if(O&&O.value===null&&O.autogeneration){const $=Aw(O);O.metaSync({value:$},null)}(i||m===null||m!==Ke.Testing)&&(f={value:O,valueOwner:s,type:ua(O)?s.readsValue?Ke.Inherited:Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const O=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(O)return{value:O,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}return ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function tL(s,u,i=!1){var a,c;if(u.execution&&u.execution.hasEntity(s)&&!i){const e=(a=u.lastExecutionResults)==null?void 0:a.readValue(s.id);if(e)return{value:e,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return(c=s.dataType)!=null&&c.isObject()||s.outputs.length?eL(s,u,i):ID(s,u,i)}function LVe(s,u,i=!1){var A,w,R,O;const r=!!((A=u.execution)!=null&&A.entities.length),a=(w=u.execution)==null?void 0:w.hasEntity(s);let c=null;const e=s.readsValue;if(e){const $=(R=u.execution)==null?void 0:R.hasEntity(e);(!r||r&&$&&a||r&&!$&&!a)&&(c=N0(s,u,i))}const f=s.declaration;if(!c&&f){const $=ID(f,u,i);$&&$.value&&(c=$)}const h=u.getValueTypePreference(s.id);if(!c||(c.type===Ke.DefaultValue||c.type===Ke.External)&&!i||h===Ke.Testing){const $=(O=u.localTestValues)==null?void 0:O.readValue(s.id);if($)return{value:$,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const m=pp(s),v=s.getDataType(null);return m&&a&&(!(c!=null&&c.value)||!_s(v)&&eu(c==null?void 0:c.value))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:a&&!m&&ua((c==null?void 0:c.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:c||{value:null,valueOwner:s,type:Ke.External,inheritanceLink:null}}function BVe(s,u,i=!1){return tL(s.declaration,u,i)}function MVe(s,u,i=!1){var w,R,O,$;if(!i&&u.execution&&u.execution.hasEntity(s)){const G=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(G)return{value:G,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const G=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(G&&!i&&(a===null||a!==Ke.DefaultValue))return{value:G,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=Mt(s),e=s.parent.type===d.FunctionDeclaration&&s.parent.parent.type===d.Loop?s.parent:null,f=!!((O=u.execution)!=null&&O.hasEntity(c))||!!e&&!!(($=u.execution)!=null&&$.hasEntity(e));let h=null;const m=s.defaultValue;if(m){const G=m||null;if(G&&G.value===null&&G.autogeneration){const x=Aw(G);G.metaSync({value:x},null)}(i||a===null||a!==Ke.Testing)&&(h={value:G,valueOwner:s,type:ua(G)?Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}!h||(h.type===Ke.DefaultValue||h.type===Ke.External)&&!i||Ke.Testing;const v=pp(s),b=s.getDataType(null);let A=v&&f&&(!(h!=null&&h.value)||!_s(b)&&eu(h==null?void 0:h.value));return c.type===d.Loop&&f&&(A=!1),A?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:f&&!v&&ua((h==null?void 0:h.value)||null)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:h||{value:null,valueOwner:s,type:Ke.External,inheritanceLink:null}}function iL(s,u,i=!1){var w,R,O,$,G,x;if((w=s.getDataType(null))!=null&&w.isObject()||s.outputs.length)return eL(s,u);if(u.execution&&u.execution.hasEntity(s)&&!i){const k=(R=u.lastExecutionResults)==null?void 0:R.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=Mt(s),a=!!((O=u.execution)!=null&&O.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null;if(e){const k=(G=u.execution)==null?void 0:G.hasEntity(e);(!a||a&&k&&c||a&&!k&&!c)&&(f=N0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const k=h;(i||m===null||m!==Ke.Testing)&&(f={value:k,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const k=(x=u.localTestValues)==null?void 0:x.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const v=pp(s),b=s.getDataType(null);return v&&(!(f!=null&&f.value)||!_s(b)&&eu(f==null?void 0:f.value))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:!s.defaultValue&&!s.readsValue?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}:!v&&ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function GVe(s,u,i=!1){var e,f,h,m,v,b,A,w;if(u.execution&&u.execution.hasEntity(s)&&!i){const R=(e=u.lastExecutionResults)==null?void 0:e.readValue(s.id);if(R)return{value:R,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=$c(s);if(ip.includes(r.type)){const R=Xu(r,u,i),O=s.codeName||((f=s.declaration)==null?void 0:f.codeName)||$r(fi(s,u.project));if(R!=null&&R.value&&s.parentRelationType!==Cl.Error){const $=(R.value.value||{})[O];if($===void 0)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};const G=Bi(s.getDataType(null),s,u.project);return G==null||G.metaSync({value:$,rawString:typeof $=="string"&&typeof((h=R==null?void 0:R.value)==null?void 0:h.rawString)=="string"?(m=R==null?void 0:R.value)==null?void 0:m.rawString:void 0},null),{value:G,valueOwner:s,type:!mi.includes(r.type)&&R.type===Ke.Empty?Ke.QueuedAutocalculation:R.type,inheritanceLink:{sources:[R],target:s}}}return{value:null,valueOwner:s,type:mi.includes(r.type)?Ke.Empty:Ke.QueuedAutocalculation,inheritanceLink:null}}const a=(v=u.execution)==null?void 0:v.hasEntity(r),c=((b=u.execution)==null?void 0:b.state)===EL.Running;if((A=u.persistedExecutionResults)!=null&&A.values[s.id]&&!a&&!c&&!i){const R=(w=u.persistedExecutionResults)==null?void 0:w.readValue(s.id);if((R==null?void 0:R.value)!==null||(R==null?void 0:R.valueAsType)!==null)return{value:R,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return null}function LP(s,u,i=!1){var b,A,w,R,O;if(![...Jt,...mi].includes(s.parent.type)||!Dy(s))return null;if(((b=s.declaration)==null?void 0:b.type)===d.Property&&s.declaration.static)return Xu(s.declaration,u);const r=Pb(s,u,i);if(r&&r.type!==Ke.Empty&&r.type!==Ke.Missing&&r.type!==Ke.Undefined)return r;const a=zr(s.parent),c=Fo(a,u,i),e=s.codeName||((A=s.declaration)==null?void 0:A.codeName)||$r(fi(s,u.project)),f=Bi(s.getDataType(null),s,u.project),h=pp(s),m=(w=c==null?void 0:c.value)==null?void 0:w.value;if(m){let $=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:c?[c]:[],target:s}};f==null||f.metaSync({value:$,rawString:typeof $=="string"&&typeof((R=c==null?void 0:c.value)==null?void 0:R.rawString)=="string"?(O=c==null?void 0:c.value)==null?void 0:O.rawString:void 0},null);const G=pp(s),x=s.getDataType(null);return G&&(!f||!_s(x)&&eu(f))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:{value:f,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}}return c!=null&&c.type&&c.type!==Ke.Missing&&c.type!==Ke.Empty&&c.type!==Ke.Undefined?{value:null,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}:h?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}}function BP(s,u,i=!1){var m,v,b,A,w,R,O,$,G,x,k;if(![...Jt,...mi].includes(s.parent.type)||!Dy(s))return null;if(((m=s.declaration)==null?void 0:m.type)===d.Property&&s.declaration.static)return Xu(s.declaration,u,i);const r=Jt.includes(s.parent.type)?s.parent:zr(s.parent),a=Xu(r,u,i);let c=dE(s,u,i);if((c==null?void 0:c.type)===Ke.Undefined||(c==null?void 0:c.type)===Ke.Missing){const W=zr(s.parent);let te=s;W.type===d.VariableDeclaration&&(te=(s.parent===W?s:W.inputs.find(Q=>{var ne,de;return((ne=Q.declaration)==null?void 0:ne.id)===((de=s.declaration)==null?void 0:de.id)}))||s,c=dE(te,u,i))}const e=s.codeName||((v=s.declaration)==null?void 0:v.codeName)||$r(fi(s,u.project));let f=s.defaultValue||Bi(s.getDataType(null),s,u.project);const h=(b=a==null?void 0:a.value)==null?void 0:b.value;if(((a==null?void 0:a.type)===Ke.ExecutionResult||(a==null?void 0:a.type)===Ke.Testing)&&!i&&h){let W=(h||{})[e];if(h[e]===void 0&&!s.readsValue&&!s.defaultValue)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}};f!=null&&f.parent&&!f.standaloneParent&&(f=f.clone(null,null,null,!1),f.setStandaloneParent(s,null));let te=W;return s.defaultValue&&(te=s.defaultValue.value),f==null||f.metaSync({value:te,rawString:typeof W=="string"&&typeof((A=a==null?void 0:a.value)==null?void 0:A.rawString)=="string"?(w=a==null?void 0:a.value)==null?void 0:w.rawString:void 0},null),{value:f,valueOwner:s,type:a.type,inheritanceLink:{sources:a?[a]:[],target:s}}}if(c&&c.type!==Ke.Empty&&c.type!==Ke.Missing&&c.type!==Ke.Undefined)return c;if(h){let W=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:W,rawString:typeof W=="string"&&typeof((R=a==null?void 0:a.value)==null?void 0:R.rawString)=="string"?(O=a==null?void 0:a.value)==null?void 0:O.rawString:void 0},null));const te=pp(s),ee=s.getDataType(null),Q=te&&(!f||!_s(ee)&&eu(f)),ne=!!(($=u.execution)!=null&&$.entities.length),de=(G=u.execution)==null?void 0:G.hasEntity(r),J=r.readsValue;if(J){const ie=(x=u.execution)==null?void 0:x.hasEntity(J);if(Q&&(!ne||ne&&ie&&de||ne&&!ie&&!de))return{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}}if(s.readsValue){const ie=(k=u.execution)==null?void 0:k.hasEntity(s.readsValue);if(Q&&(!ne||ne&&ie&&de||ne&&!ie&&!de))return{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}}return Q?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:h[e]===void 0&&!s.readsValue&&!s.defaultValue?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}}:{value:f,valueOwner:s,type:ua(f)&&!s.readsValue?Ke.Empty:Ke.Inherited,inheritanceLink:null}}return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}}function Pb(s,u,i=!1){var O,$,G,x,k;const r=Mt(s),a=!!((O=u.execution)!=null&&O.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null,h=!1;if(e){const W=(G=u.execution)==null?void 0:G.hasEntity(e);h=!a||a&&W&&c||a&&!W&&!c,h&&(f=N0(s,u,i))}const m=!!e&&h,v=s.defaultValue,b=u.getValueTypePreference(s.id);if(!f&&v&&(i||b===null||b!==Ke.Testing)&&(f={value:v,valueOwner:s,type:eu(v)?Ke.Empty:Ke.DefaultValue,inheritanceLink:null}),(!f||f.type===Ke.DefaultValue||(f==null?void 0:f.type)===Ke.Empty||b===Ke.Testing)&&!m){const W=(x=u.persistedExecutionResults)==null?void 0:x.readValue(s.id);if(W&&!i)return{value:W,valueOwner:s,type:Ke.Testing,inheritanceLink:null};const te=(k=u.localTestValues)==null?void 0:k.readValue(s.id);if(te&&!i&&(b===null||b===Ke.Testing))return{value:te,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}if(v&&!eu(v))return{value:v,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null};const A=pp(s),w=s.getDataType(null),R=A&&(!(f!=null&&f.value)||!_s(w)&&eu(f==null?void 0:f.value));return m&&R?{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}:R?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!s.defaultValue&&!m?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}:!A&&(!f||f.type===Ke.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:s,type:m?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function dE(s,u,i=!1){var a;if(u.execution&&u.execution.hasEntity(s)&&!i){const c=(a=u.lastExecutionResults)==null?void 0:a.readValue(s.id);if(c)return{value:c,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return Pb(s,u,i)}function kVe(s,u,i=!1){var r,a;return mi.includes(s.parent.type)&&(r=zr(s.parent).dataType)!=null&&r.isObject()||Jt.includes(s.parent.type)&&(a=s.parent.getDataType(null))!=null&&a.isObject()?LP(s,u,i):Pb(s,u,i)}function rL(s,u,i=!1){var r,a;if(mi.includes(s.parent.type)){const c=zr(s.parent);if((r=c.dataType)!=null&&r.isObject()||c.inputs.length)return BP(s,u,i)}return Jt.includes(s.parent.type)&&((a=s.parent.getDataType(null))!=null&&a.isObject()||s.parent.outputs.length)?BP(s,u,i):dE(s,u,i)}function UVe(s,u,i=!1){var v,b;if(u.execution){const A=(v=u.lastExecutionResults)==null?void 0:v.readValue(s.id);if(A&&!i)return{value:A,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const A=(b=u.localTestValues)==null?void 0:b.readValue(s.id);if(A&&!i&&(a===null||a!==Ke.DefaultValue))return{value:A,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;c&&(i||a===null||a!==Ke.Testing)&&(e={value:c,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null});const f=pp(s),h=s.getDataType(null);return f&&(!(e!=null&&e.value)||!_s(h)&&eu(e==null?void 0:e.value))&&s.static?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:ua(e==null?void 0:e.value)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:e}function jVe(s,u,i=!1){var f,h,m;if(u.execution&&u.execution.hasEntity(s)&&!i){const v=(f=u.lastExecutionResults)==null?void 0:f.readValue(s.id);if(v)return{value:v,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const v=(h=u.localTestValues)==null?void 0:h.readValue(s.id);if(v&&!i&&(a===null||a!==Ke.DefaultValue))return{value:v,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;if(c&&(i||a===null||a!==Ke.Testing)&&(e={value:c,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null}),((m=s.parent)==null?void 0:m.type)===d.Search){const v=s.parent.inputs.find(b=>{var A;return((A=b.declaration)==null?void 0:A.id)===s.id});if(v)return rL(v,u,i)}return ua((e==null?void 0:e.value)||null)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:e}function Xu(s,u,i=!1){if(om.has(s.id))return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};om.add(s.id);try{switch(s.type){case d.ArgumentDeclaration:return MVe(s,u,i);case d.InputMap:return rL(s,u,i);case d.VariableDeclaration:return tL(s,u,i);case d.VariableInstance:return BVe(s,u,i);case d.OutputMap:return GVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return iL(s,u,i);case d.Property:return UVe(s,u,i);case d.ValueDescriptor:return jVe(s,u,i);case d.Operation:case d.Loop:case d.FunctionCall:case d.InternalCall:case d.Search:return xVe(s,u,i);default:return null}}finally{om.delete(s.id)}}function Fo(s,u,i=!1){if(om.has(s.id))return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};om.add(s.id);try{switch(s.type){case d.InputMap:return kVe(s,u,i);case d.VariableDeclaration:return ID(s,u,i);case d.VariableInstance:return LVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return iL(s,u,i);default:return null}}finally{om.delete(s.id)}}function f1i(s){var u,i,r,a,c;if(s&&s.type===Ke.DefaultValue&&s.value&&s.valueOwner&&(!yR.includes(s.valueOwner.type)||((u=s.valueOwner.defaultValue)==null?void 0:u.id)===s.value.id)){const e=Bi(s.valueOwner.getDataType(null),s.valueOwner,s.valueOwner.project);return e==null||e.metaSync({value:(i=s.value)==null?void 0:i.value,rawString:typeof((r=s.value)==null?void 0:r.value)=="string"&&typeof((a=s.value)==null?void 0:a.rawString)=="string"?(c=s.value)==null?void 0:c.rawString:void 0},null),{type:Ke.DefaultValue,value:e,valueOwner:s.valueOwner,inheritanceLink:null}}return s}function y1i(s,u,i,r){var w,R,O,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=zr(s.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=a?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!a&&m&&m.id===((w=f.defaultValue)==null?void 0:w.id)&&(m=Bi(f.getDataType(null),f,u)):a?m=P0(f.getDataType(null),f,u,c):m=Bi(f.getDataType(null),f,u);const v=fi(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||$r(v);let A={};if((($=(O=f.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),sn(m==null?void 0:m.value)&&(A={...A,...m.value}),A[b]=i,m==null||m.metaSync({value:A},c),a||e==null||e.writeValue(f,m),(i===""||i===null||i===void 0)&&s.type===d.OutputMap){const G=f.inputs.find(x=>{var k,W;return((k=x.declaration)==null?void 0:k.id)===((W=s.declaration)==null?void 0:W.id)||fi(x,u)===v});if(G){let x=a?G.defaultValue:e==null?void 0:e.readValue(G.id);x&&x.metaSync({value:null},c),a||e==null||e.removeValue(G.id)}}return c}function h1i(s,u,i){const r=Xd(s,u);let a=!1,c=null,e=null;return i instanceof Z?(a=!0,c=i,e=null):(c=null,e=i),r.forEach(f=>{var m;let h=a?((m=f.getDefaultValue)==null?void 0:m.call(f))||null:e==null?void 0:e.readValue(f.id);a?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id)}),c}function m1i(s,u,i,r,a,c){const e=Xd(u,i);let f=!1,h=null,m=null;return r instanceof Z?(f=!0,h=r,m=null):(h=null,m=r),i.diggestedBuiltInBaseEntitiesIds.has(u.id)||e.forEach(v=>{var w,R,O,$;if(i.diggestedBuiltInBaseEntitiesIds.has(v.id))return;let b=null;if(f){const G=((w=v.getDefaultValue)==null?void 0:w.call(v))||null;G&&(i.diggestedBuiltInBaseEntitiesIds.has(G.id)||((R=G.parent)==null?void 0:R.id)!==v.id?b=G.clone(h,v):b=G)}else b=m==null?void 0:m.readValue(v.id);b?!f&&b&&b.id===(($=(O=v.getDefaultValue)==null?void 0:O.call(v))==null?void 0:$.id)&&(b=Bi(v.getDataType(null),v,i)):f?(b=P0(v.getDataType(null),v,i,h),h==null||h.add(b,z.Added)):b=Bi(v.getDataType(null),v,i),b==null||b.setValueAsType(null,h);let A=a||(b==null?void 0:b.name);(!(b!=null&&b.name)||(b==null?void 0:b.name)===he.Untyped)&&!a&&(typeof s=="string"?A=he.String:s===null?A=he.Null:typeof s=="number"?A=he.Number:typeof s=="boolean"&&(A=he.Boolean)),b==null||b.metaSync({value:s,name:A,rawString:c!==void 0?c:null},h),f||m==null||m.writeValue(v,b)}),h}function Ty(s,u,i,r){let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=s.parent;return u.getVariableDeclarations().forEach(m=>{var b,A,w,R,O,$;const v=m.getDataType(null);if(((b=v==null?void 0:v.entity)==null?void 0:b.id)===f.id){let G=a?m.defaultValue:e==null?void 0:e.readValue(m.id);G?!a&&G&&G.id===((A=m.defaultValue)==null?void 0:A.id)&&(G=Bi(m.getDataType(null),m,u)):a?G=P0(m.getDataType(null),m,u,c):G=Bi(m.getDataType(null),m,u);const x=fi(s,u),k=s.codeName||((w=s.extends)==null?void 0:w.codeName)||((R=s.implements[0])==null?void 0:R.codeName)||$r(x);let W={};(($=(O=m.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(W={...W,...m.dataType.entity.getActiveRawDefaultValue()}),sn(G==null?void 0:G.value)&&(W={...W,...G.value}),Array.isArray(i)?W[k]=(i==null?void 0:i.map(te=>te.toShallowJSON()))||null:W[k]=(i==null?void 0:i.toShallowJSON())||null,G==null||G.metaSync({value:W},c),a||e==null||e.writeValue(m,G);return}}),c}function uE(s,u,i,r){var w,R,O,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=zr(s.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=a?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!a&&m&&m.id===((w=f.defaultValue)==null?void 0:w.id)&&(m=Bi(f.getDataType(null),f,u)):a?m=P0(f.getDataType(null),f,u,c):m=Bi(f.getDataType(null),f,u);const v=fi(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||$r(v);let A={};if((($=(O=f.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),sn(m==null?void 0:m.value)&&(A={...A,...m.value}),Array.isArray(i)?A[b]=(i==null?void 0:i.map(G=>G.toShallowJSON()))||null:A[b]=(i==null?void 0:i.toShallowJSON())||null,m==null||m.metaSync({value:A},c),a||e==null||e.writeValue(f,m),i==null&&s.type===d.OutputMap){const G=f.inputs.find(x=>{var k,W;return((k=x.declaration)==null?void 0:k.id)===((W=s.declaration)==null?void 0:W.id)||fi(x,u)===v});if(G){let x=a?G.defaultValue:e==null?void 0:e.readValue(G.id);x&&(Array.isArray(i)?x==null||x.setValueAsTypeList(i,c):x==null||x.setValueAsTypeSingle(i,c)),a||e==null||e.removeValue(G.id)}}return c}function FVe(s,u,i){var r,a,c,e;return s.type===d.InputMap?((r=s.declaration)==null?void 0:r.type)===d.Property&&s.declaration.static?Ty(s.declaration,u,null,i):mi.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&uE(s,u,null,i):s.type===d.OutputMap?((c=s.declaration)==null?void 0:c.type)===d.Property&&s.declaration.static?Ty(s.declaration,u,null,i):mi.includes(s.parent.type)&&((e=s.declaration)==null?void 0:e.type)===d.Property&&uE(s,u,null,i):s.type===d.Property&&s.static&&Ty(s,u,null,i),i}function KVe(s,u,i,r){var a,c,e,f;return u.type===d.InputMap?((a=u.declaration)==null?void 0:a.type)===d.Property&&u.declaration.static?Ty(u.declaration,i,s,r):mi.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===d.Property&&uE(u,i,s,r):u.type===d.OutputMap?((e=u.declaration)==null?void 0:e.type)===d.Property&&u.declaration.static?Ty(u.declaration,i,null,r):mi.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===d.Property&&uE(u,i,null,r):u.type===d.Property&&u.static&&Ty(u,i,s,r),r}function T1i(s,u,i){const r=Xd(s,u);let a=!1,c=null,e=null;return i instanceof Z?(a=!0,c=i,e=null):(c=null,e=i),r.forEach(f=>{var m;let h=a?(m=f.getDefaultValue)==null?void 0:m.call(f):e==null?void 0:e.readValue(f.id);a?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id),FVe(f,u,i)}),c}function v1i(s,u,i,r){const a=Xd(u,i);let c=!1,e=null,f=null;return r instanceof Z?(c=!0,e=r,f=null):(e=null,f=r),a.forEach(h=>{var v,b,A;let m=c?(v=h.getDefaultValue)==null?void 0:v.call(h):f==null?void 0:f.readValue(h.id);m?!c&&m&&m.id===((A=(b=h.getDefaultValue)==null?void 0:b.call(h))==null?void 0:A.id)&&(m=Bi(h.getDataType(null),h,h.project)):c?m=P0(h.getDataType(null),h,i,e):m=Bi(h.getDataType(null),h,i),Array.isArray(s)?m==null||m.setValueAsTypeList(s,e):m==null||m.setValueAsTypeSingle(s,e),m==null||m.metaSync({value:null},e),c||f==null||f.writeValue(h,m),KVe(s,h,i,r)}),e}function Ur(s,u){let i=s;return s&&s.parent&&s.project.get(s.id)&&(i=i.clone(null,null,null,!1),i.setStandaloneParent(u,null)),i}class RD{constructor(u,i){this.extensionsRegistry=u,this.contextType=i,this.off=this.extensionsRegistry.off.bind(this.extensionsRegistry),this.on=this.extensionsRegistry.on.bind(this.extensionsRegistry),this.emit=this.extensionsRegistry.emit.bind(this.extensionsRegistry),this.emitAsync=this.extensionsRegistry.emitAsync.bind(this.extensionsRegistry),this.emitAsyncAll=this.extensionsRegistry.emitAsyncAll.bind(this.extensionsRegistry),this.emitAsyncAllSettled=this.extensionsRegistry.emitAsyncAllSettled.bind(this.extensionsRegistry),this.emitAsyncSequentially=this.extensionsRegistry.emitAsyncSequentially.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAll=this.extensionsRegistry.emitAsyncSequentiallyAll.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAllSettled=this.extensionsRegistry.emitAsyncSequentiallyAllSettled.bind(this.extensionsRegistry)}on(u,i){this.extensionsRegistry.on(u,i)}emit(u,...i){this.extensionsRegistry.emit(u,...i)}off(u,i){this.extensionsRegistry.off(u,i)}emitAsync(u,...i){return this.extensionsRegistry.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.extensionsRegistry.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.extensionsRegistry.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.extensionsRegistry.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled(u,...i)}}var Ve=(s=>(s[s.High=1]="High",s[s.Normal=5]="Normal",s[s.Low=10]="Low",s))(Ve||{}),le=(s=>(s.Logic="logic",s.EditorGUI="editor-gui",s.GUI="gui",s.Editor="editor",s.Compile="compile",s.PublicationRun="publication-run",s))(le||{}),xe=(s=>(s.All="*",s.OnAll="on:*",s.EmitAll="emit:*",s.ReadAll="read:*",s.WriteAll="write:*",s.UpdateAll="update:*",s.DoAll="do:*",s.OnLogicAll="on:logic:*",s.EmitLogicAll="emit:logic:*",s.ReadLogicAll="read:logic:*",s.WriteLogicAll="write:logic:*",s.UpdateLogicAll="update:logic:*",s.DoLogicAll="do:logic:*",s.OnGUIAll="on:gui:*",s.EmitGUIAll="emit:gui:*",s.ReadGUIAll="read:gui:*",s.WriteGUIAll="write:gui:*",s.UpdateGUIAll="update:gui:*",s.DoGUIAll="do:gui:*",s.OnEditorAll="on:editor:*",s.EmitEditorAll="emit:editor:*",s.ReadEditorAll="read:editor:*",s.WriteEditorAll="write:editor:*",s.UpdateEditorAll="update:editor:*",s.DoEditorAll="do:editor:*",s.OnCompileBefore="on:compile:before:DefinitionEntity",s.OnCompileDefault="on:compile:default:DefinitionEntity",s.OnCompileAfter="on:compile:after:DefinitionEntity",s.EmitCompile="emit:compile:DefinitionEntity",s.DoEditorPublish="do:editor:publish",s.PostGUICanvasSlotNewToolbarButton="write:gui:canvas:slot:toolbar-button",s.ReadGUICanvasSlotToolbarButtons="read:gui:canvas:slot:toolbar-buttons",s.UpdateGUIGlobalTheme="update:gui:global:theme",s))(xe||{});class SVe{constructor(u){D(this,"state",new Map);u&&(this.state=new Map(Object.entries(u)))}get(u){return this.state.get(u)}set(u,i){this.state.set(u,i)}delete(u){this.state.delete(u)}}class qVe extends SVe{constructor(u,i){super(i),this.parentExtension=u}}class $e{constructor(u,i){D(this,"manifest");D(this,"module");D(this,"state");this.extensionsRegistry=u,this.state=new qVe(this,i)}}class MP extends RD{constructor(i,r){super(i,le.Logic);D(this,"id");this._project=r,this.id=r.id}get type(){return this._project.type}get name(){return this._project.name}get workspaceId(){return this._project.workspaceId}get description(){return this._project.description}get version(){return this._project.version}get createdAt(){return this._project.createdAt}get previousVersion(){return this._project.previousVersion}get author(){return this._project.author}get deleted(){return this._project.deleted}get editable(){return this._project.editable}get deletable(){return this._project.deletable}get entities(){return[...this._project.entities]}get projects(){return[...this._project.projects]}get functions(){return[...this._project.functions]}get events(){return[...this._project.events]}get variableDeclarations(){return[...this._project.variableDeclarations]}get variableInstances(){return[...this._project.variableInstances]}get conditions(){return[...this._project.conditions]}get operations(){return[...this._project.operations]}get functionCalls(){return[...this._project.functionCalls]}get loops(){return[...this._project.loops]}get searches(){return[...this._project.searches]}get primitives(){return[...this._project.primitives]}get builtInBaseEntities(){return[...this._project.builtInBaseEntities]}get operationDeclarations(){return[...this._project.operationDeclarations]}get globalEventActionDescriptors(){return[...this._project.globalEventActionDescriptors]}get loopDeclarations(){return[...this._project.loopDeclarations]}get loopDeclarationsBodies(){return[...this._project.loopDeclarationsBodies]}get conditionDeclarations(){return[...this._project.conditionDeclarations]}get valueDescriptors(){return[...this._project.valueDescriptors]}get dataTypes(){return[...this._project.dataTypes]}get errors(){return[...this._project.errors]}get history(){return[...this._project.history]}get undoableStackValueIndex(){return this._project.undoableStackValueIndex}get knownVersions(){return this._project.knownVersions}get activeVersion(){return this._project.activeVersion}get initialized(){return this._project.initialized}get startedInitialization(){return this._project.startedInitialization}closePersistChangeSetsSequentially(){return this._project.closePersistChangeSetsSequentially()}persistChangeSetSequentially(i){return this._project.persistChangeSetSequentially(i)}toLatestChangeSet(i,r,a,c=!1,e="here-this"){return this._project.toLatestChangeSet(i,r,a,c,e)}addChangeSet(i){return this._project.addChangeSet(i)}discardChangeSet(i){return this._project.discardChangeSet(i)}subscribeDependents(i){return this._project.subscribeDependents(i)}unsubscribeDependents(i){return this._project.unsubscribeDependents(i)}syncDependents(i){return this._project.syncDependents(i)}onDetachedDependencyRemoved(i,r,a){return this._project.onDetachedDependencyRemoved(i,r,a)}onDetachedDependencyRestored(i,r,a){return this._project.onDetachedDependencyRestored(i,r,a)}increaseVersion(i){return this._project.increaseVersion(i)}captureVersion(){return this._project.captureVersion()}restoreVersion(i){return this._project.restoreVersion(i)}updateWithShallowTransfer(i,r){return this._project.updateWithShallowTransfer(i,r)}hydrateAncestors(){return this._project.hydrateAncestors()}afterAllChildrenInitialized(i=null){return this._project.afterAllChildrenInitialized(i)}addSelfToProject(i){return this._project.addSelfToProject(i)}get instancesList(){return[...this._project.instancesList]}isOperationDeclaration(i){return this._project.isOperationDeclaration(i)}isGlobalEventActionDescriptor(i){return this._project.isGlobalEventActionDescriptor(i)}isLoopDeclaration(i){return this._project.isLoopDeclaration(i)}isConditionDeclaration(i){return this._project.isConditionDeclaration(i)}findSubscribedBuiltInInstance(i){return this._project.findSubscribedBuiltInInstance(i)}get(i){return this._project.get(i)}getDeleted(i){return this._project.getDeleted(i)}getManaged(i){return this._project.getManaged(i)}getBuiltIn(i){return this._project.getBuiltIn(i)}findSubscribedInstanceFromReference(i){return this._project.findSubscribedInstanceFromReference(i)}findSubscribedBuiltInInstanceFromReference(i){return this._project.findSubscribedBuiltInInstanceFromReference(i)}metaSync(i,r){return this._project.metaSync(i,r)}getAllBuiltInIds(){return this._project.getAllBuiltInIds()}getAllBuiltIn(){return this._project.getAllBuiltIn()}toFlat(i){return this._project.toFlat(i)}toFlatIds(i){return this._project.toFlatIds(i)}toMeta(){return this._project.toMeta()}toJSON(i){return this._project.toJSON(i)}toJSONClone(i){return this._project.toJSONClone(i)}toReference(i){return this._project.toReference(i)}toShallowJSON(i){return this._project.toShallowJSON(i)}toFlatJSON(i){return this._project.toFlatJSON(i)}toGenerationTarget(i){return this._project.toGenerationTarget(i)}toFlatGenerationTarget(i){return this._project.toFlatGenerationTarget(i)}clearErrors(){return this._project.clearErrors()}validate(){return this._project.validate()}validateChildren(){return this._project.validateChildren()}getErrors(){return this._project.getErrors()}getShallowErrors(){return this._project.getShallowErrors()}addDefinitionEntity(i){return this._project.addDefinitionEntity(i)}addFunctionDeclaration(i){return this._project.addFunctionDeclaration(i)}addFunctionCall(i){return this._project.addFunctionCall(i)}addVariableDeclaration(i){return this._project.addVariableDeclaration(i)}addVariableInstance(i){return this._project.addVariableInstance(i)}addInstalledProject(i){return this._project.addInstalledProject(i)}addGlobalEvent(i){return this._project.addGlobalEvent(i)}addCondition(i){return this._project.addCondition(i)}addOperation(i){return this._project.addOperation(i)}addLoop(i){return this._project.addLoop(i)}addSearch(i){return this._project.addSearch(i)}removeDefinitionEntity(i){return this._project.removeDefinitionEntity(i)}removeCondition(i){return this._project.removeCondition(i)}removeOperation(i){return this._project.removeOperation(i)}removeLoop(i){return this._project.removeLoop(i)}removeSearch(i){return this._project.removeSearch(i)}removeFunctionCall(i){return this._project.removeFunctionCall(i)}removeVariableInstance(i){return this._project.removeVariableInstance(i)}removeVariableDeclaration(i){return this._project.removeVariableDeclaration(i)}removeFunctionDeclaration(i){return this._project.removeFunctionDeclaration(i)}removeInstalledProject(i){return this._project.removeInstalledProject(i)}removeGlobalEvent(i){return this._project.removeGlobalEvent(i)}removeTopLevelVariableDeclaration(i){return this._project.removeTopLevelVariableDeclaration(i)}getEntryPoints(){return this._project.getEntryPoints()}getTerminationStatements(){return this._project.getTerminationStatements()}getFunctionDeclaration(i){return this._project.getFunctionDeclaration(i)}getConditions(){return this._project.getConditions()}getOperations(){return this._project.getOperations()}getVariables(){return this._project.getVariables()}getVariableInstances(){return this._project.getVariableInstances()}getVariableDeclarations(){return this._project.getVariableDeclarations()}getLoops(){return this._project.getLoops()}getSearches(){return this._project.getSearches()}getBuiltInPersistedEntity(){return this._project.getBuiltInPersistedEntity()}requestActiveDynamicValue(i,r=!1){return this._project.requestActiveDynamicValue(i,r)}undo(){return this._project.undo()}redo(){return this._project.redo()}applyExternalChangeSet(i){return this._project.applyExternalChangeSet(i)}toFullProjectTransfer(){return this._project.toFullProjectTransfer()}}function E1i(s,u){return u instanceof MP?u:new MP(s,u)}const ds="built-in-function-implementations__",ke="operations-implementations__",Ws="conditions-implementations__",Be={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:ds+yn.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:ds+yn.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:ds+yn.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:ds+yn.DeletePersistedEntity,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY:ke+ui.Empty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY:ke+ui.NotEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL:ke+ui.PrimitiveEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL:ke+ui.PrimitiveNotEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST:ke+Wn.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Wo.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+_e.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+Ns.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+pe.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+pe.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+pe.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+pe.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+pe.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+pe.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+pe.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+pe.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+pe.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+pe.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+pe.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+pe.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+pe.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+pe.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+pe.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+pe.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+pe.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+pe.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+pe.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+pe.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+pe.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+pe.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+pe.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+pe.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+pe.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+pe.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+pe.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+pe.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+pe.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+pe.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+pe.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+Y.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+Y.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+Y.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+Y.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+pe.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+pe.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+pe.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+Y.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+Y.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+Y.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+Y.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+Y.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+Y.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+Y.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+Y.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+Y.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+Y.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+Y.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+Y.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+Y.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+Y.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+Y.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+Y.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+Y.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+Y.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+Y.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+Y.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+Y.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+Y.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+Y.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+Y.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+Y.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+Y.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+Y.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+Y.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+Y.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+Y.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+Y.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+Y.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+Y.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+Y.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+Y.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+Y.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+Y.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+Y.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+Y.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+Y.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+Y.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+ce.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+ce.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+ce.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+ce.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+ce.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+ce.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+ce.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+ce.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+ce.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+ce.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+ce.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+ce.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+ce.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+ce.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+ce.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+ce.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+ce.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+ce.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+ce.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+ce.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+ce.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+ce.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+ce.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+ce.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+ce.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+ce.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+ce.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+ce.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+ce.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+ce.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+ce.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+ce.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+ce.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+ce.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+ce.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+ce.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+ce.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+ce.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+ce.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+ce.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+ce.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+ce.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+st.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+st.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+st.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+st.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+st.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+st.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+st.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+st.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+st.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+st.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+Y.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+Y.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+Y.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+Y.MatchesRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP:ke+S.GetCurrentTimestamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE:ke+S.FormatDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE:ke+S.ParseDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE:ke+S.AddToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE:ke+S.SubtractFromDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES:ke+S.DifferenceBetweenDates,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE:ke+S.ToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX:ke+S.ToUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX:ke+S.FromUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING:ke+S.ToISOString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR:ke+S.GetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH:ke+S.GetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE:ke+S.GetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR:ke+S.GetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE:ke+S.GetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND:ke+S.GetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND:ke+S.GetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY:ke+S.GetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR:ke+S.GetWeekOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER:ke+S.GetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR:ke+S.GetDayOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH:ke+S.GetDaysInMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE:ke+S.GetCurrentIanaTimeZone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR:ke+S.SetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH:ke+S.SetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE:ke+S.SetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR:ke+S.SetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE:ke+S.SetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND:ke+S.SetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND:ke+S.SetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY:ke+S.SetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER:ke+S.SetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF:ke+S.StartOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF:ke+S.EndOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO:ke+S.RoundTo,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE:Ws+S.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Ws+S.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Ws+S.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Ws+S.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Ws+S.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Ws+S.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Ws+S.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Ws+S.IsLeapYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE:ke+S.ClampToRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF:ke+S.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF:ke+S.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW:ke+S.FromNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW:ke+S.ToNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF:ke+S.HumanizeDiff,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS:ke+S.AddBusinessDays,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY:ke+S.NextWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY:ke+S.PreviousWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC:ke+S.ToUTC,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE:ke+S.ConvertTimezone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET:ke+S.GetTimezoneOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET:ke+S.SetUTCOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY:ke+_e.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+_e.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+_e.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+_e.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+_e.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+_e.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+_e.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Ws+_e.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Ws+_e.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Ws+_e.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Ws+_e.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Ws+_e.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+_e.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+_e.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+_e.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+_e.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+et.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+oi.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+oi.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+st.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+oi.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+oi.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+Qr.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+Qr.VerifyPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC:ke+gi.BuildJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC:ke+gi.VerifyJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE:ke+gi.DecodeJwt,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING:ke+et.FromBytesToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES:ke+et.ToBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER:ke+et.ToNumber,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING:ke+et.ToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64:ke+et.EncodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64:ke+et.DecodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL:ke+et.EncodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL:ke+et.DecodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX:ke+et.EncodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX:ke+et.DecodeHex,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE:ke+Yn.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+Yn.Stringify};class ZVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION,version:"1.0.0",description:'Implementation for the built-in function "Abort Execution". It terminates the execution of the current entity being run.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class HVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Delete SQL database table". It deletes the current entity as an entry in the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class WVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Create SQL database table". It saves the current entity state to the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class zVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Update SQL database table". It saves the current entity state to the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class YVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({error:"Search module not implemented",data:null})})}}class JVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:Ve.High,permissions:[xe.All],contexts:[]});D(this,"module",RN)}}class QVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.Empty);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[ui.Empty].inputs.leftHand.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f==null;return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class XVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.NotEmpty);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[ui.NotEmpty].inputs.leftHand.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f!=null;return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}const lR=class lR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.PrimitiveEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=(c=(a=r[0])==null?void 0:a.value)==null?void 0:c.name,b=(f=(e=r[0])==null?void 0:e.value)==null?void 0:f.value,A=(m=(h=r[1])==null?void 0:h.value)==null?void 0:m.value;let w=!1;return v&&lR.primitiveSet.has(v)?w=b===A:v===he.Untyped||v===he.KeyValue?w=JSON.stringify(b)===JSON.stringify(A):w=!1,{value:F.Success,error:null,result:w}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};D(lR,"primitiveSet",new Set([he.String,he.Number,he.Boolean,he.Null,he.Enum,he.Date,he.UUID]));let MI=lR;const oR=class oR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.PrimitiveNotEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=(c=(a=r[0])==null?void 0:a.value)==null?void 0:c.name,b=(f=(e=r[0])==null?void 0:e.value)==null?void 0:f.value,A=(m=(h=r[1])==null?void 0:h.value)==null?void 0:m.value;let w=!1;return v&&oR.primitiveSet.has(v)?w=b!==A:v===he.Untyped||v===he.KeyValue?w=JSON.stringify(b)!==JSON.stringify(A):w=!1,{value:F.Success,error:null,result:w}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};D(oR,"primitiveSet",new Set([he.String,he.Number,he.Boolean,he.Null,he.Enum,he.Date,he.UUID]));let GI=oR;var exe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="minute",r=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(c,e,f){var h=e.prototype;f.utc=function(O){var $={date:O,utc:!0,args:arguments};return new e($)},h.utc=function(O){var $=f(this.toDate(),{locale:this.$L,utc:!0});return O?$.add(this.utcOffset(),i):$},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(O){O.utc&&(this.$u=!0),this.$utils().u(O.$offset)||(this.$offset=O.$offset),m.call(this,O)};var v=h.init;h.init=function(){if(this.$u){var O=this.$d;this.$y=O.getUTCFullYear(),this.$M=O.getUTCMonth(),this.$D=O.getUTCDate(),this.$W=O.getUTCDay(),this.$H=O.getUTCHours(),this.$m=O.getUTCMinutes(),this.$s=O.getUTCSeconds(),this.$ms=O.getUTCMilliseconds()}else v.call(this)};var b=h.utcOffset;h.utcOffset=function(O,$){var G=this.$utils().u;if(G(O))return this.$u?0:G(this.$offset)?b.call(this):this.$offset;if(typeof O=="string"&&(O=function(te){te===void 0&&(te="");var ee=te.match(r);if(!ee)return null;var Q=(""+ee[0]).match(a)||["-",0,0],ne=Q[0],de=60*+Q[1]+ +Q[2];return de===0?0:ne==="+"?de:-de}(O),O===null))return this;var x=Math.abs(O)<=16?60*O:O;if(x===0)return this.utc($);var k=this.clone();if($)return k.$offset=x,k.$u=!1,k;var W=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(k=this.local().add(x+W,i)).$offset=x,k.$x.$localOffset=W,k};var A=h.format;h.format=function(O){var $=O||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return A.call(this,$)},h.valueOf=function(){var O=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*O},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var w=h.toDate;h.toDate=function(O){return O==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var R=h.diff;h.diff=function(O,$,G){if(O&&this.$u===O.$u)return R.call(this,O,$,G);var x=this.local(),k=f(O).local();return R.call(x,k,$,G)}}})})(exe);var b1i=exe.exports;const A1i=fl(b1i);var txe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(a,c,e){var f,h=function(A,w,R){R===void 0&&(R={});var O=new Date(A),$=function(G,x){x===void 0&&(x={});var k=x.timeZoneName||"short",W=G+"|"+k,te=r[W];return te||(te=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:G,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:k}),r[W]=te),te}(w,R);return $.formatToParts(O)},m=function(A,w){for(var R=h(A,w),O=[],$=0;$<R.length;$+=1){var G=R[$],x=G.type,k=G.value,W=i[x];W>=0&&(O[W]=parseInt(k,10))}var te=O[3],ee=te===24?0:te,Q=O[0]+"-"+O[1]+"-"+O[2]+" "+ee+":"+O[4]+":"+O[5]+":000",ne=+A;return(e.utc(Q).valueOf()-(ne-=ne%1e3))/6e4},v=c.prototype;v.tz=function(A,w){A===void 0&&(A=f);var R,O=this.utcOffset(),$=this.toDate(),G=$.toLocaleString("en-US",{timeZone:A}),x=Math.round(($-new Date(G))/1e3/60),k=15*-Math.round($.getTimezoneOffset()/15)-x;if(!Number(k))R=this.utcOffset(0,w);else if(R=e(G,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),w){var W=R.utcOffset();R=R.add(O-W,"minute")}return R.$x.$timezone=A,R},v.offsetName=function(A){var w=this.$x.$timezone||e.tz.guess(),R=h(this.valueOf(),w,{timeZoneName:A}).find(function(O){return O.type.toLowerCase()==="timezonename"});return R&&R.value};var b=v.startOf;v.startOf=function(A,w){if(!this.$x||!this.$x.$timezone)return b.call(this,A,w);var R=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(R,A,w).tz(this.$x.$timezone,!0)},e.tz=function(A,w,R){var O=R&&w,$=R||w||f,G=m(+e(),$);if(typeof A!="string")return e(A).tz($);var x=function(ee,Q,ne){var de=ee-60*Q*1e3,J=m(de,ne);if(Q===J)return[de,Q];var ie=m(de-=60*(J-Q)*1e3,ne);return J===ie?[de,J]:[ee-60*Math.min(J,ie)*1e3,Math.max(J,ie)]}(e.utc(A,O).valueOf(),G,$),k=x[0],W=x[1],te=e(k).utcOffset(W);return te.$x.$timezone=$,te},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(A){f=A}}})})(txe);var g1i=txe.exports;const I1i=fl(g1i);var ixe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){r.prototype.isBetween=function(c,e,f,h){var m=a(c),v=a(e),b=(h=h||"()")[0]==="(",A=h[1]===")";return(b?this.isAfter(m,f):!this.isBefore(m,f))&&(A?this.isBefore(v,f):!this.isAfter(v,f))||(b?this.isBefore(m,f):!this.isAfter(m,f))&&(A?this.isAfter(v,f):!this.isBefore(v,f))}}})})(ixe);var R1i=ixe.exports;const D1i=fl(R1i);var rxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isSameOrAfter=function(a,c){return this.isSame(a,c)||this.isAfter(a,c)}}})})(rxe);var w1i=rxe.exports;const C1i=fl(w1i);var nxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isSameOrBefore=function(a,c){return this.isSame(a,c)||this.isBefore(a,c)}}})})(nxe);var O1i=nxe.exports;const _1i=fl(O1i);var axe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="week",r="year";return function(a,c,e){var f=c.prototype;f.week=function(h){if(h===void 0&&(h=null),h!==null)return this.add(7*(h-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var v=e(this).startOf(r).add(1,r).date(m),b=e(this).endOf(i);if(v.isBefore(b))return 1}var A=e(this).startOf(r).date(m).startOf(i).subtract(1,"millisecond"),w=this.diff(A,i,!0);return w<0?e(this).startOf("week").week():Math.ceil(w)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(axe);var P1i=axe.exports;const N1i=fl(P1i);var sxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="day";return function(r,a,c){var e=function(m){return m.add(4-m.isoWeekday(),i)},f=a.prototype;f.isoWeekYear=function(){return e(this).year()},f.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),i);var v,b,A,w,R=e(this),O=(v=this.isoWeekYear(),b=this.$u,A=(b?c.utc:c)().year(v).startOf("year"),w=4-A.isoWeekday(),A.isoWeekday()>4&&(w+=7),A.add(w,i));return R.diff(O,"week")+1},f.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var h=f.startOf;f.startOf=function(m,v){var b=this.$utils(),A=!!b.u(v)||v;return b.p(m)==="isoweek"?A?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):h.bind(this)(m,v)}}})})(sxe);var V1i=sxe.exports;const x1i=fl(V1i);var lxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="month",r="quarter";return function(a,c){var e=c.prototype;e.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var f=e.add;e.add=function(m,v){return m=Number(m),this.$utils().p(v)===r?this.add(3*m,i):f.bind(this)(m,v)};var h=e.startOf;e.startOf=function(m,v){var b=this.$utils(),A=!!b.u(v)||v;if(b.p(m)===r){var w=this.quarter()-1;return A?this.month(3*w).startOf(i).startOf("day"):this.month(3*w+2).endOf(i).endOf("day")}return h.bind(this)(m,v)}}})})(lxe);var $1i=lxe.exports;const L1i=fl($1i);var oxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){r.prototype.dayOfYear=function(c){var e=Math.round((a(this).startOf("day")-a(this).startOf("year"))/864e5)+1;return c==null?e:this.add(c-e,"day")}}})})(oxe);var B1i=oxe.exports;const M1i=fl(B1i);var dxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){i=i||{};var c=r.prototype,e={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f(m,v,b,A){return c.fromToBase(m,v,b,A)}a.en.relativeTime=e,c.fromToBase=function(m,v,b,A,w){for(var R,O,$,G=b.$locale().relativeTime||e,x=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],k=x.length,W=0;W<k;W+=1){var te=x[W];te.d&&(R=A?a(m).diff(b,te.d,!0):b.diff(m,te.d,!0));var ee=(i.rounding||Math.round)(Math.abs(R));if($=R>0,ee<=te.r||!te.r){ee<=1&&W>0&&(te=x[W-1]);var Q=G[te.l];w&&(ee=w(""+ee)),O=typeof Q=="string"?Q.replace("%d",ee):Q(ee,v,te.l,$);break}}if(v)return O;var ne=$?G.future:G.past;return typeof ne=="function"?ne(O):ne.replace("%s",O)},c.to=function(m,v){return f(m,v,this,!0)},c.from=function(m,v){return f(m,v,this)};var h=function(m){return m.$u?a.utc():a()};c.toNow=function(m){return this.to(h(this),m)},c.fromNow=function(m){return this.from(h(this),m)}}})})(dxe);var G1i=dxe.exports;const k1i=fl(G1i);var uxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i,r,a=1e3,c=6e4,e=36e5,f=864e5,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=31536e6,v=2628e6,b=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,A={years:m,months:v,days:f,hours:e,minutes:c,seconds:a,milliseconds:1,weeks:6048e5},w=function(ee){return ee instanceof W},R=function(ee,Q,ne){return new W(ee,ne,Q.$l)},O=function(ee){return r.p(ee)+"s"},$=function(ee){return ee<0},G=function(ee){return $(ee)?Math.ceil(ee):Math.floor(ee)},x=function(ee){return Math.abs(ee)},k=function(ee,Q){return ee?$(ee)?{negative:!0,format:""+x(ee)+Q}:{negative:!1,format:""+ee+Q}:{negative:!1,format:""}},W=function(){function ee(ne,de,J){var ie=this;if(this.$d={},this.$l=J,ne===void 0&&(this.$ms=0,this.parseFromMilliseconds()),de)return R(ne*A[O(de)],this);if(typeof ne=="number")return this.$ms=ne,this.parseFromMilliseconds(),this;if(typeof ne=="object")return Object.keys(ne).forEach(function(ue){ie.$d[O(ue)]=ne[ue]}),this.calMilliseconds(),this;if(typeof ne=="string"){var se=ne.match(b);if(se){var fe=se.slice(2).map(function(ue){return ue!=null?Number(ue):0});return this.$d.years=fe[0],this.$d.months=fe[1],this.$d.weeks=fe[2],this.$d.days=fe[3],this.$d.hours=fe[4],this.$d.minutes=fe[5],this.$d.seconds=fe[6],this.calMilliseconds(),this}}return this}var Q=ee.prototype;return Q.calMilliseconds=function(){var ne=this;this.$ms=Object.keys(this.$d).reduce(function(de,J){return de+(ne.$d[J]||0)*A[J]},0)},Q.parseFromMilliseconds=function(){var ne=this.$ms;this.$d.years=G(ne/m),ne%=m,this.$d.months=G(ne/v),ne%=v,this.$d.days=G(ne/f),ne%=f,this.$d.hours=G(ne/e),ne%=e,this.$d.minutes=G(ne/c),ne%=c,this.$d.seconds=G(ne/a),ne%=a,this.$d.milliseconds=ne},Q.toISOString=function(){var ne=k(this.$d.years,"Y"),de=k(this.$d.months,"M"),J=+this.$d.days||0;this.$d.weeks&&(J+=7*this.$d.weeks);var ie=k(J,"D"),se=k(this.$d.hours,"H"),fe=k(this.$d.minutes,"M"),ue=this.$d.seconds||0;this.$d.milliseconds&&(ue+=this.$d.milliseconds/1e3,ue=Math.round(1e3*ue)/1e3);var me=k(ue,"S"),ve=ne.negative||de.negative||ie.negative||se.negative||fe.negative||me.negative,Ae=se.format||fe.format||me.format?"T":"",De=(ve?"-":"")+"P"+ne.format+de.format+ie.format+Ae+se.format+fe.format+me.format;return De==="P"||De==="-P"?"P0D":De},Q.toJSON=function(){return this.toISOString()},Q.format=function(ne){var de=ne||"YYYY-MM-DDTHH:mm:ss",J={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return de.replace(h,function(ie,se){return se||String(J[ie])})},Q.as=function(ne){return this.$ms/A[O(ne)]},Q.get=function(ne){var de=this.$ms,J=O(ne);return J==="milliseconds"?de%=1e3:de=J==="weeks"?G(de/A[J]):this.$d[J],de||0},Q.add=function(ne,de,J){var ie;return ie=de?ne*A[O(de)]:w(ne)?ne.$ms:R(ne,this).$ms,R(this.$ms+ie*(J?-1:1),this)},Q.subtract=function(ne,de){return this.add(ne,de,!0)},Q.locale=function(ne){var de=this.clone();return de.$l=ne,de},Q.clone=function(){return R(this.$ms,this)},Q.humanize=function(ne){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!ne)},Q.valueOf=function(){return this.asMilliseconds()},Q.milliseconds=function(){return this.get("milliseconds")},Q.asMilliseconds=function(){return this.as("milliseconds")},Q.seconds=function(){return this.get("seconds")},Q.asSeconds=function(){return this.as("seconds")},Q.minutes=function(){return this.get("minutes")},Q.asMinutes=function(){return this.as("minutes")},Q.hours=function(){return this.get("hours")},Q.asHours=function(){return this.as("hours")},Q.days=function(){return this.get("days")},Q.asDays=function(){return this.as("days")},Q.weeks=function(){return this.get("weeks")},Q.asWeeks=function(){return this.as("weeks")},Q.months=function(){return this.get("months")},Q.asMonths=function(){return this.as("months")},Q.years=function(){return this.get("years")},Q.asYears=function(){return this.as("years")},ee}(),te=function(ee,Q,ne){return ee.add(Q.years()*ne,"y").add(Q.months()*ne,"M").add(Q.days()*ne,"d").add(Q.hours()*ne,"h").add(Q.minutes()*ne,"m").add(Q.seconds()*ne,"s").add(Q.milliseconds()*ne,"ms")};return function(ee,Q,ne){i=ne,r=ne().$utils(),ne.duration=function(ie,se){var fe=ne.locale();return R(ie,{$l:fe},se)},ne.isDuration=w;var de=Q.prototype.add,J=Q.prototype.subtract;Q.prototype.add=function(ie,se){return w(ie)?te(this,ie,1):de.bind(this)(ie,se)},Q.prototype.subtract=function(ie,se){return w(ie)?te(this,ie,-1):J.bind(this)(ie,se)}}})})(uxe);var U1i=uxe.exports;const j1i=fl(U1i);var pxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(pxe);var F1i=pxe.exports;const K1i=fl(F1i);U.extend(A1i);U.extend(I1i);U.extend(D1i);U.extend(C1i);U.extend(_1i);U.extend(N1i);U.extend(x1i);U.extend(L1i);U.extend(M1i);U.extend(k1i);U.extend(j1i);U.extend(K1i);const di=s=>U(s),Hr=s=>s.toISOString();function cxe(){return Hr(U())}function fxe(s,u){return di(s).format(u)}function yxe(s){return Hr(U(s))}function hxe(s){if(s==null)throw new TypeError("ToDate expects a non-null value.");if(typeof s=="string"){const u=U(s);if(!u.isValid())throw new TypeError("Invalid date string.");return u.toISOString()}if(typeof s=="number"&&Number.isFinite(s)){const u=Math.abs(s)<1e12?U.unix(s):U(s);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(s instanceof Date){const u=U(s);if(!u.isValid())throw new TypeError("Invalid Date object.");return u.toISOString()}throw new TypeError("Unsupported value type for ToDate. Provide a string, number, or Date.")}function mxe(s,u,i){return Hr(di(s).add(u,i))}function Txe(s,u,i){return Hr(di(s).subtract(u,i))}function vxe(s,u,i,r=!1){return di(s).diff(di(u),i,r)}function Exe(s){return di(s).unix()}function bxe(s){return Hr(U.unix(s))}function Axe(s){return Hr(di(s))}function gxe(s){return di(s).year()}function Ixe(s){return di(s).month()}function Rxe(s){return di(s).date()}function Dxe(s){return di(s).hour()}function wxe(s){return di(s).minute()}function Cxe(s){return di(s).second()}function Oxe(s){return di(s).millisecond()}function _xe(s){return di(s).isoWeekday()}function Pxe(s){return di(s).week()}function Nxe(s){return di(s).quarter()}function Vxe(s){return di(s).dayOfYear()}function xxe(s){return di(s).daysInMonth()}function $xe(s,u){return Hr(di(s).year(u))}function Lxe(s,u){return Hr(di(s).month(u))}function Bxe(s,u){return Hr(di(s).date(u))}function Mxe(s,u){return Hr(di(s).hour(u))}function Gxe(s,u){return Hr(di(s).minute(u))}function kxe(s,u){return Hr(di(s).second(u))}function Uxe(s,u){return Hr(di(s).millisecond(u))}function jxe(s,u){return Hr(di(s).isoWeekday(u))}function Fxe(s,u){return Hr(di(s).quarter(u))}function Kxe(s,u){return Hr(di(s).startOf(u))}function Sxe(s,u){return Hr(di(s).endOf(u))}function qxe(s,u){const i=di(s),r=i.startOf(u),a=i.endOf(u),c=r.valueOf()+(a.valueOf()-r.valueOf())/2;return Hr(i.valueOf()<c?r:a)}function Zxe(s,u,i){return di(s).isBefore(di(u),i)}function Hxe(s,u,i){return di(s).isAfter(di(u),i)}function Wxe(s,u,i){return di(s).isSame(di(u),i)}function zxe(s,u,i){return di(s).isSameOrBefore(di(u),i)}function Yxe(s,u,i){return di(s).isSameOrAfter(di(u),i)}function Jxe(s,u,i,r,a="()"){return di(s).isBetween(di(u),di(i),r,a)}function Qxe(s){return U(s).isValid()}function Xxe(s){return di(s).isLeapYear()}function e$e(s,u,i){const r=di(s);return r.isBefore(u)?Hr(di(u)):r.isAfter(i)?Hr(di(i)):Hr(r)}function t$e(s){if(s.length===0)throw new Error("minOf requires at least one date");let u=di(s[0]);for(let i=1;i<s.length;i++){const r=di(s[i]);r.isBefore(u)&&(u=r)}return Hr(u)}function i$e(s){if(s.length===0)throw new Error("maxOf requires at least one date");let u=di(s[0]);for(let i=1;i<s.length;i++){const r=di(s[i]);r.isAfter(u)&&(u=r)}return Hr(u)}function r$e(s,u=!1){return di(s).fromNow(u)}function n$e(s,u=!1){return di(s).toNow(u)}function a$e(s,u,i=!0){const r=di(s).diff(di(u),"millisecond",!0),a=Math.abs(r),e=U.duration(a,"milliseconds").humanize();return i?r>=0?`in ${e}`:`${e} ago`:e}function s$e(s,u,i=["6","7"],r=[]){const a=m=>r.some(v=>di(v).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=di(s);const f=u>=0?1:-1;let h=Math.abs(u);for(;h>0;){e=e.add(f,"day");const m=c(e);!i.includes(m)&&!a(e)&&h--}return Hr(e)}function l$e(s,u){let i=di(s);const r=u;for(let a=0;a<7;a++)if(i=i.add(1,"day"),i.isoWeekday()===r)return Hr(i);return Hr(i)}function o$e(s,u){let i=di(s);const r=u;for(let a=0;a<7;a++)if(i=i.subtract(1,"day"),i.isoWeekday()===r)return Hr(i);return Hr(i)}const d$e="Local";function nL(){try{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;if(s&&typeof s=="string")return s}catch{}try{if(typeof process<"u"&&process.env&&process.env.TZ)return process.env.TZ}catch{}return null}function aL(){const s=nL();if(s)return s;throw new Error("Unable to detect current IANA timezone from host environment.")}function u$e(s,u,i=!1){let r=u;if(r===d$e){const e=nL();if(!e)throw new Error("Unable to detect current timezone from host environment.");r=e}const a=r?U.tz(s,r):di(s),c=i?a.utc(!0):a.utc();return Hr(c)}function p$e(s,u,i=!1){const r=di(s);return Hr(i?r.tz(u,!0):r.tz(u))}function c$e(s,u){const i=s===d$e?aL():s;return di(u).tz(i).utcOffset()}function f$e(s,u,i=!1){return Hr(di(s).utcOffset(u,i))}class y$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetCurrentTimestamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=cxe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class h$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FormatDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.FormatDate].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.FormatDate].inputs.format.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=fxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class m$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ParseDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ParseDate].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=yxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class T$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.AddToDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.amount.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=mxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class v$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SubtractFromDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.amount.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Txe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class E$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.DifferenceBetweenDates);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,v,b;try{const A=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.firstDate.id}),w=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),R=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.secondDate.id}),O=((e=R==null?void 0:R.value)==null?void 0:e.valueAsType)??((f=R==null?void 0:R.value)==null?void 0:f.value),$=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.unit.id}),G=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),x=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.asFloat.id}),k=((v=x==null?void 0:x.value)==null?void 0:v.valueAsType)??((b=x==null?void 0:x.value)==null?void 0:b.value)??!1,W=vxe(w,O,G,k);return{value:F.Success,error:null,result:W}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class S1i extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE,version:"1.0.0",description:"Date to-date operation implementation module (coerce to ISO 8601 string)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToDate].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=hxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class b$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToUnix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToUnix].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Exe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class A$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FromUnix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.FromUnix].inputs.seconds.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=bxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class g$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToISOString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToISOString].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Axe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class I$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=gxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class R$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMonth].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Ixe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class D$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE,version:"1.0.0",description:"Date get-date (day of month) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDate].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Rxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class w$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetHour);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetHour].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Dxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class C$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMinute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMinute].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=wxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class O$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetSecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetSecond].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Cxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class _$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMillisecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMillisecond].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Oxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class P$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetIsoWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetIsoWeekday].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_xe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class N$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR,version:"1.0.0",description:"Date get-week-of-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetWeekOfYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetWeekOfYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Pxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class V$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetQuarter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetQuarter].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Nxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class x$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR,version:"1.0.0",description:"Date get-day-of-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDayOfYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDayOfYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Vxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class $$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH,version:"1.0.0",description:"Date get-days-in-month operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDaysInMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDaysInMonth].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=xxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class L$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE,version:"1.0.0",description:"Date get-current-iana-timezone operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetCurrentIanaTimeZone);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=aL();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class B$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetYear].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetYear].inputs.year.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=$xe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class M$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH,version:"1.0.0",description:"Date set-month operation implementation module (0-based month)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMonth].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMonth].inputs.month.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Lxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class G$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE,version:"1.0.0",description:"Date set-date (day of month) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetDate].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetDate].inputs.date.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Bxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class k$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetHour);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetHour].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetHour].inputs.hour.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Mxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class U$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMinute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMinute].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMinute].inputs.minute.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Gxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class j$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetSecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetSecond].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetSecond].inputs.second.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=kxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class F$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMillisecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMillisecond].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMillisecond].inputs.millisecond.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Uxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class K$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetIsoWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetIsoWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetIsoWeekday].inputs.isoWeekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=jxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class S$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetQuarter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetQuarter].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetQuarter].inputs.quarter.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Fxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class q$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.StartOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.StartOf].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.StartOf].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Kxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Z$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.EndOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.EndOf].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.EndOf].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Sxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class H$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.RoundTo);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.RoundTo].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.RoundTo].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=qxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class W$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsBefore);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Zxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class z$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsAfter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Hxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class Y$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSame);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Wxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class J$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE,version:"1.0.0",description:"Date is-same-or-before operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSameOrBefore);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=zxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class Q$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER,version:"1.0.0",description:"Date is-same-or-after operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSameOrAfter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Yxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class X$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsBetween);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,v,b,A,w;try{const R=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.target.id}),O=((a=R==null?void 0:R.value)==null?void 0:a.valueAsType)??((c=R==null?void 0:R.value)==null?void 0:c.value),$=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.start.id}),G=((e=$==null?void 0:$.value)==null?void 0:e.valueAsType)??((f=$==null?void 0:$.value)==null?void 0:f.value),x=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.end.id}),k=((h=x==null?void 0:x.value)==null?void 0:h.valueAsType)??((m=x==null?void 0:x.value)==null?void 0:m.value),W=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.unit.id}),te=((v=W==null?void 0:W.value)==null?void 0:v.valueAsType)??((b=W==null?void 0:W.value)==null?void 0:b.value),ee=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.inclusivity.id}),Q=((A=ee==null?void 0:ee.value)==null?void 0:A.valueAsType)??((w=ee==null?void 0:ee.value)==null?void 0:w.value),ne=Jxe(O,G,k,te,Q??void 0);return{value:F.Success,error:null,result:ne}}catch(R){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:R,result:null}}}})}}class eLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsValid);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.IsValid].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class tLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsLeapYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.IsLeapYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class iLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ClampToRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.min.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.max.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=e$e(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class rLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.MinOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[S.MinOf].inputs.dates.id}).map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=t$e(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class nLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.MaxOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[S.MaxOf].inputs.dates.id}).map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=i$e(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class aLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FromNow);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.FromNow].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.FromNow].inputs.withoutSuffix.id}),A=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value)??!1,w=r$e(m,A);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class sLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToNow);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.ToNow].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.ToNow].inputs.withoutSuffix.id}),A=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value)??!1,w=n$e(m,A);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class lLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.HumanizeDiff);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.firstDate.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.secondDate.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.withoutSuffix.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!0,G=a$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class oLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS,version:"1.1.0",description:"Date add-business-days operation implementation module (ISO-weekend strings)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.AddBusinessDays);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(b=>{var A,w;return((w=(A=b.valueOwner)==null?void 0:A.declaration)==null?void 0:w.id)===j.operation[S.AddBusinessDays].inputs.dateValue.id}).map(b=>{var A,w;return((A=b.value)==null?void 0:A.valueAsType)??((w=b.value)==null?void 0:w.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],v=s$e(e,f,h,m);return{value:F.Success,error:null,result:v}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class dLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.NextWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.NextWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.NextWeekday].inputs.weekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=l$e(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class uLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.PreviousWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.PreviousWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.PreviousWeekday].inputs.weekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=o$e(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class pLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToUTC);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(v=>{var b,A;return((A=(b=v.valueOwner)==null?void 0:b.declaration)==null?void 0:A.id)===j.operation[S.ToUTC].inputs.dateValue.id}).map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)??((A=v.value)==null?void 0:A.value)}),e=c[0],f=c[1]||void 0,h=c[2]??!1,m=u$e(e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class cLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ConvertTimezone);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.targetTimezone.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.keepLocalTime.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!1,G=p$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class fLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetTimezoneOffset);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[S.GetTimezoneOffset].inputs.timezone.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[S.GetTimezoneOffset].inputs.atDate.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),R=c$e(m,b);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class yLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetUTCOffset);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.offsetMinutes.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.keepLocalTime.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!1,G=f$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class hLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Ns.Wait);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[Ns.Wait].inputs.duration.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return typeof f!="number"||f<0?{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid wait time provided",result:null}:(await new Promise(h=>setTimeout(h,f)),{value:F.Success,error:null,result:null})}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}const q1i=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,sL=s=>s===null||["string","number","boolean"].includes(typeof s);function Oa(s,u="Input must be an array"){if(!Array.isArray(s))throw new TypeError(u);return s}function wd(s){const u=Oa(s,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function lL(s){return Array.isArray(s)?s:[]}function Vl(s){return Number(s)}function mLe(s){if(!s||s.length===0)throw new TypeError("No input lists provided");if(!s.every(r=>Array.isArray(r)))throw new TypeError("All inputs must be arrays");const[u,...i]=s;return i.reduce((r,a)=>r.concat(a),u)}function TLe(s,...u){if(!Array.isArray(s))throw new TypeError("First input must be an array");if(!u.every(i=>Array.isArray(i)))throw new TypeError("All subsequent inputs must be arrays");return s.concat(...u)}function vLe(s,u){const i=wd(s),r=Vl(u);return[i.slice(0,r),i.slice(r)]}function ELe(s){return wd(s).slice().reverse()}function bLe(s){return wd(s).slice(0,-1)}function ALe(s){return wd(s).slice(1)}function gLe(s,u,i){const r=Oa(s),a=Vl(u);if(a<0||a>r.length)throw new TypeError("Index out of bounds");return[...r.slice(0,a),i,...r.slice(a)]}function ILe(s,u,i){const r=wd(s),a=Vl(u);if(a<0||a>=r.length)throw new TypeError("Index out of bounds");const c=[...r];return c[a]=i,c}function RLe(s,u,i){const r=wd(s),a=r.indexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function DLe(s,u,i){const r=wd(s),a=r.lastIndexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function wLe(s,u,i){return wd(s).map(a=>a===u?i:a)}function CLe(s,u){const i=wd(s),r=Vl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i[r]}function OLe(s){return wd(s)[0]}function _Le(s){const u=wd(s);return u[u.length-1]}function PLe(s,u,...i){return[...Oa(s),u,...i]}function NLe(s,u){const i=Oa(s);return[u,...i]}function VLe(s){return Oa(s).length}function xLe(s,u){const i=Oa(s),r=Vl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i.slice(0,r).concat(i.slice(r+1))}function $Le(s,u){const i=Oa(s),r=Math.max(0,Vl(u)??0);return i.slice(0,r)}function LLe(s,u){const i=Oa(s),r=Math.max(0,Vl(u)??0);return r===0?[]:i.slice(-r)}function BLe(s,u,i){const r=Oa(s),a=u==null?void 0:Vl(u),c=i==null?void 0:Vl(i);return r.slice(a,c)}function MLe(s,u){return Oa(s).indexOf(u)}function GLe(s,u){return Oa(s).lastIndexOf(u)}function kLe(s){const u=Oa(s),i=[],r=new Set;for(const a of u)r.has(a)||(r.add(a),i.push(a));return i}function ULe(s){return Oa(s).reduce((i,r)=>i.concat(r),[])}function jLe(s){const u=Oa(s);if(u.length<=1)return[...u];const i=u[0],r=typeof i=="number"&&u.every(e=>typeof e=="number"&&Number.isFinite(e)),a=typeof i=="string"&&u.every(e=>typeof e=="string");let c=null;if(r?c="number":a&&(c=u.every(f=>q1i.test(f)&&U(f).isValid())?"date":"string"),!c)throw new TypeError("All items must be of the same supported type: number, string, or ISO date string.");return c==="number"?[...u].sort((e,f)=>e-f):c==="string"?[...u].sort((e,f)=>e.localeCompare(f)):[...u].sort((e,f)=>U(e).valueOf()-U(f).valueOf())}function FLe(s){const i=[...Oa(s)];for(let r=i.length-1;r>0;r--){const a=Math.floor(vD()*(r+1));[i[r],i[a]]=[i[a],i[r]]}return i}function KLe(s,u){const i=Oa(s),r=Math.max(1,Vl(u)||1),a=[];for(let c=0;c<i.length;c+=r)a.push(i.slice(c,c+r));return a}function SLe(s,u,i){const r=Oa(s),a=Math.max(0,Vl(u)||0);if(r.length>=a)return[...r];const c=a-r.length;return Array(c).fill(i).concat(r)}function qLe(s,u,i){const r=Oa(s),a=Math.max(0,Vl(u)||0);if(r.length>=a)return[...r];const c=a-r.length,e=Array(c).fill(i);return r.concat(e)}function ZLe(s,u){const i=Oa(s),r=Math.max(0,Vl(u)||0),a=[];for(let c=0;c<r;c++)a.push(...i);return a}function HLe(s,u){if(!sL(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return lL(s).some(r=>r===u)}function WLe(s,u){const i=lL(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(sL))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return r.every(a=>i.includes(a))}function zLe(s,u){const i=lL(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(sL))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return r.some(a=>i.includes(a))}class YLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.firstList.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.separator.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.secondList.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)}),R=mLe([m,b,...w]);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class JLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Split);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[pe.Split].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[pe.Split].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),[A,w]=vLe(m,b);return{value:F.Success,error:null,result:[A,w]}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class QLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Reverse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Reverse].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ELe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class XLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.DeleteLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.DeleteLastNItems].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=bLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class eBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.DeleteFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.DeleteFirstNItems].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ALe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class tBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.AddAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.index.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.value.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=gLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class iBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.index.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.value.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=ILe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class rBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=RLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class nBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=DLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class aBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=wLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class sBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexItem].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexItem].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=CLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class lBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetFirst);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.GetFirst].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=OLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class oBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetLast);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.GetLast].inputs.list.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_Le(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class dBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.elementToAppend.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.dynamicArgument.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)}),R=PLe(m,b,...w);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class uBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Prepend].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Prepend].inputs.listPrependOperationValueArg.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=NLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class pBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLength);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[pe.GetLength].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:VLe(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class cBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX,version:"1.0.0",description:"List delete one item at index (non-mutating)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.DeleteAtIndex].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.DeleteAtIndex].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=xLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class fBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetFirstNItems].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetFirstNItems].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=$Le(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class yBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastNItems].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastNItems].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=LLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class hBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Slice);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.startIndex.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.endIndex.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=BLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class mBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Concat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),[c,...e]=a,f=TLe(c,...e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class TBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexOf].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexOf].inputs.searchValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=MLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class vBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastIndexOf].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastIndexOf].inputs.searchValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=GLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class EBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Unique);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Unique].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=kLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class bBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Flatten);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Flatten].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ULe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class ABe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT,version:"1.0.0",description:"List sort (non-mutating). Supports lists of strings (alphabetic), numbers (numeric), or ISO date strings (chronological).",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Sort);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Sort].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class gBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Shuffle);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Shuffle].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=FLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class IBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Chunk);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Chunk].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Chunk].inputs.size.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=KLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class RBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.PadStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.targetLength.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.padValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=SLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class DBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.PadEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.targetLength.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.padValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=qLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class wBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Repeat].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Repeat].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=ZLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class CBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Contains].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Contains].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=HLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class OBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.ContainsAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAll].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAll].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=WLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class _Be extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.ContainsAny);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAny].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAny].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=zLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Z1i extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.GetLength);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.length;return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class PBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.separator.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.first.id}),v=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.second.id}),A=((e=b==null?void 0:b.value)==null?void 0:e.value)||"",R=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.dynamicString.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)||((x=$.value)==null?void 0:x.value)||""}),O=[v,A,...R].join(h);return{value:F.Success,error:null,result:O}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class NBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1],f={firstPart:c.slice(0,e),secondPart:c.slice(e)};return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class VBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS,version:"1.0.0",description:"String split at all the occurrences of separators operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtAllSeparators);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1],f=c.split(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class xBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR,version:"1.0.0",description:"String split at the first occurrence of a separator operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtFirstSeparator);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=c.indexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class $Be extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR,version:"1.0.0",description:"String split at the last occurrence of a separator operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtLastSeparator);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=c.lastIndexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class LBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS,version:"1.0.0",description:"String delete last number of characters operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,-e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class BBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS,version:"1.0.0",description:"String delete first number of characters operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class MBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Reverse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.split("").reverse().join("");return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class GBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ToLowerCase);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.toLowerCase();return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class kBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ToUpperCase);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.toUpperCase();return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class UBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=Math.min(f,c.length-e),m=c.slice(0,e)+c.slice(e+h);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class jBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.AddAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,e)+f+c.slice(e);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class FBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1]??1,f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=f+c.slice(e);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class KBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1]??1,f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,-e)+f;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class SBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2]??1,h=a[3];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const m=(c.slice(0,e)||"")+h+(c.slice(e+f)||"");return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class qBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceFirstMatch);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.replace(e,f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class ZBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceLastMatch);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.lastIndexOf(e),m=h===-1?c:c.substring(0,h)+f+c.substring(h+e.length);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class HBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceAllMatches);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.split(e).join(f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class WBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.charAt(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class zBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS,version:"1.0.0",description:"String get last N chars operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(-e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class YBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS,version:"1.0.0",description:"String get first N chars operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class JBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};if(typeof e!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No search value provided",result:null};const f=c.indexOf(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class QBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.stringValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.valueToAppend.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.dynamicArgument.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)});if(typeof m!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};if(typeof b!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No value to append provided",result:null};if(!w.every(O=>typeof O=="string"))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"All values to append must be strings",result:null};const R=[m,b,...w].join("");return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class XBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=e+c;return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class eMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Trim);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trim();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class tMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.TrimStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trimStart();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class iMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.TrimEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trimEnd();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class rMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Substring);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.substring(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class nMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Slice);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.slice(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class aMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.lastIndexOf(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class sMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.PadStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.padStart(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class lMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.PadEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.padEnd(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class oMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=a.repeat(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class dMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),f=new RegExp(String(c??""),e?String(e):void 0),h=String(a??"").match(f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class uMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchAllRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(b=>{var A,w;return((A=b.value)==null?void 0:A.valueAsType)??((w=b.value)==null?void 0:w.value)}),f=e?String(e):"",h=f.includes("g")?f:f+"g",m=new RegExp(String(c??""),h),v=Array.from(String(a??"").matchAll(m),b=>Array.from(b));return{value:F.Success,error:null,result:v}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class pMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.SearchRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)});let f=-1;try{const h=new RegExp(String(c??""),e?String(e):void 0);f=String(a??"").search(h)}catch{f=-1}return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class cMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.ReplaceRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)??((A=v.value)==null?void 0:A.value)});let h=String(a??"");const m=new RegExp(String(c??""),f?String(f):void 0);return h=h.replace(m,String(e??"")),{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class fMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.NormalizeUnicode);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=a.normalize(c||"NFC");return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}const dR=class dR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemoveDiacritics);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a??"").normalize("NFD").replace(dR.COMBINING_MARKS,"");return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}};D(dR,"COMBINING_MARKS",/[\u0300-\u036f]/g);let kI=dR;class yMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.CountOccurrences);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=f===""?0:e.split(f).length-1;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class hMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX,version:"1.0.0",description:"Ensure string starts with given prefix (add if missing)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EnsurePrefix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.startsWith(f)?e:f+e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class mMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX,version:"1.0.0",description:"Ensure string ends with given suffix (add if missing)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EnsureSuffix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.endsWith(f)?e:e+f;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class TMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemovePrefix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.startsWith(f)?e.slice(f.length):e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class vMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemoveSuffix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.endsWith(f)?e.slice(0,-f.length):e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class EMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.StartsWith);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("StartsWith expects two strings.");const e=a.startsWith(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class bMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EndsWith);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("EndsWith expects two strings.");const e=a.endsWith(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class AMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("Contains expects two strings.");const e=a.includes(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class gMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX,version:"1.0.0",description:"Regex test: new RegExp(pattern, flags?).test(src) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchesRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("MatchesRegex expects source and pattern to be strings.");if(!(e===void 0||typeof e=="string"))throw new TypeError("MatchesRegex flags must be a string if provided.");let f=!1;return f=new RegExp(c,e).test(a),{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}function IMe(s,u){const i=Number(s),a=10**Math.max(0,Number(u)||0);return Math.round(i*a)/a}function RMe(s,u){const i=Number(s),r=Math.abs(Number(u)||0);return r===0?i:Math.round(i/r)*r}function DMe(s,u,i){const r=Number(s),a=Number(u),c=Number(i);return Math.min(Math.max(r,a),c)}function wMe(s,u,i,r,a){const c=Number(s),e=Number(u),f=Number(i),h=Number(r),m=Number(a);if(e===f)throw new Error("Input range cannot be zero");const v=(c-e)/(f-e);return h+v*(m-h)}function CMe(...s){const u=s.map(r=>Number(r));return u.length===0?0:u.reduce((r,a)=>r+a,0)/u.length}function OMe(...s){const u=s.map(r=>Number(r)).sort((r,a)=>r-a);if(u.length===0)return 0;const i=Math.floor(u.length/2);return u.length%2?u[i]:(u[i-1]+u[i])/2}function _Me(s,u){const i=Number(s),r=Number(u);return r===0?NaN:i<0&&r%2===1?-Math.pow(-i,1/r):Math.pow(i,1/r)}function PMe(s,u){const i=Number(s),r=Number(u);return i===0?1/0:(r-i)/i*100}const Cr=s=>s.map(u=>{var i,r;return((i=u.value)==null?void 0:i.valueAsType)??((r=u.value)==null?void 0:r.value)});class NMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Addition);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=Cr(r).reduce((e,f)=>e+f,0);return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class VMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Subtraction);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=Cr(r).reduce((e,f)=>e-f,0);return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class xMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Multiplication);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.firstFactor.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.secondFactor.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.dynamicFactor.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),O=[m,b,...w].reduce(($,G)=>$*G,1);return{value:F.Success,error:null,result:O}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class $Me extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Division);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r);if(c===0)throw new Error("Division by zero is not allowed");const e=a/c;return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class LMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Remainder);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r);if(c===0)throw new Error("Division by zero is not allowed");const e=a%c;return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class BMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Exponentiation);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r),e=Math.pow(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class MMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Negate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:-a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class GMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Absolute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.abs(Number(a))}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class kMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Sign);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sign(Number(a))}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class UMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Round);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.round(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class jMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Floor);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.floor(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class FMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Ceil);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.ceil(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class KMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Trunc);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.trunc(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class SMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.RoundToDecimals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=IMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class qMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP,version:"1.0.0",description:"Snap a number to the nearest multiple of step (>=0 step)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.SnapToStep);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=RMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class ZMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Clamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Cr(r),f=DMe(a,c,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class HMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MapRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h]=Cr(r),m=wMe(a,c,e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class WMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Average);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w],O=CMe(...R);return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class zMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Median);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w],O=OMe(...R);return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class YMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MinOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w].filter($=>typeof $=="number"&&!Number.isNaN($)),O=R.length?Math.min(...R):1/0;return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class JMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MaxOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w].filter($=>typeof $=="number"&&!Number.isNaN($)),O=R.length?Math.max(...R):-1/0;return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class QMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.SquareRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sqrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class XMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.CubeRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.cbrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class e2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.NthRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=_Me(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class t2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Exp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.exp(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class i2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LogNatural);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.log(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class r2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Log10);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r),c=Number(a),e=Math.log10?Math.log10(c):Math.log(c)/Math.LN10;return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class n2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Sin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class a2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Cos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.cos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class s2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Tan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.tan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class l2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Asin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.asin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class o2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Acos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.acos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class d2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Atan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.atan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class u2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Atan2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:Math.atan2(Number(a),Number(c))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class p2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.ToRadians);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Number(a)*Math.PI/180}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class c2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.ToDegrees);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Number(a)*180/Math.PI}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class f2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.PercentOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=Number(a)/100*Number(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class GP extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.PercentageChange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=PMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class y2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LessThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a<c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class h2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MoreThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a>c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class m2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LessThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a<=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class T2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MoreThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a>=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}function v2e(s,u){return function(){return s.apply(u,arguments)}}const{toString:H1i}=Object.prototype,{getPrototypeOf:oL}=Object,{iterator:DD,toStringTag:E2e}=Symbol,wD=(s=>u=>{const i=H1i.call(u);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Cd=s=>(s=s.toLowerCase(),u=>wD(u)===s),CD=s=>u=>typeof u===s,{isArray:V0}=Array,Em=CD("undefined");function Nb(s){return s!==null&&!Em(s)&&s.constructor!==null&&!Em(s.constructor)&&il(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const b2e=Cd("ArrayBuffer");function W1i(s){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(s):u=s&&s.buffer&&b2e(s.buffer),u}const z1i=CD("string"),il=CD("function"),A2e=CD("number"),Vb=s=>s!==null&&typeof s=="object",Y1i=s=>s===!0||s===!1,mI=s=>{if(wD(s)!=="object")return!1;const u=oL(s);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(E2e in s)&&!(DD in s)},J1i=s=>{if(!Vb(s)||Nb(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},Q1i=Cd("Date"),X1i=Cd("File"),eDi=s=>!!(s&&typeof s.uri<"u"),tDi=s=>s&&typeof s.getParts<"u",iDi=Cd("Blob"),rDi=Cd("FileList"),nDi=s=>Vb(s)&&il(s.pipe);function aDi(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const _j=aDi(),Pj=typeof _j.FormData<"u"?_j.FormData:void 0,sDi=s=>{let u;return s&&(Pj&&s instanceof Pj||il(s.append)&&((u=wD(s))==="formdata"||u==="object"&&il(s.toString)&&s.toString()==="[object FormData]"))},lDi=Cd("URLSearchParams"),[oDi,dDi,uDi,pDi]=["ReadableStream","Request","Response","Headers"].map(Cd),cDi=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xb(s,u,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let r,a;if(typeof s!="object"&&(s=[s]),V0(s))for(r=0,a=s.length;r<a;r++)u.call(null,s[r],r,s);else{if(Nb(s))return;const c=i?Object.getOwnPropertyNames(s):Object.keys(s),e=c.length;let f;for(r=0;r<e;r++)f=c[r],u.call(null,s[f],f,s)}}function g2e(s,u){if(Nb(s))return null;u=u.toLowerCase();const i=Object.keys(s);let r=i.length,a;for(;r-- >0;)if(a=i[r],u===a.toLowerCase())return a;return null}const fy=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),I2e=s=>!Em(s)&&s!==fy;function kP(){const{caseless:s,skipUndefined:u}=I2e(this)&&this||{},i={},r=(a,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=s&&g2e(i,c)||c;mI(i[e])&&mI(a)?i[e]=kP(i[e],a):mI(a)?i[e]=kP({},a):V0(a)?i[e]=a.slice():(!u||!Em(a))&&(i[e]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&xb(arguments[a],r);return i}const fDi=(s,u,i,{allOwnKeys:r}={})=>(xb(u,(a,c)=>{i&&il(a)?Object.defineProperty(s,c,{value:v2e(a,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,c,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),s),yDi=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),hDi=(s,u,i,r)=>{s.prototype=Object.create(u.prototype,r),Object.defineProperty(s.prototype,"constructor",{value:s,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(s,"super",{value:u.prototype}),i&&Object.assign(s.prototype,i)},mDi=(s,u,i,r)=>{let a,c,e;const f={};if(u=u||{},s==null)return u;do{for(a=Object.getOwnPropertyNames(s),c=a.length;c-- >0;)e=a[c],(!r||r(e,s,u))&&!f[e]&&(u[e]=s[e],f[e]=!0);s=i!==!1&&oL(s)}while(s&&(!i||i(s,u))&&s!==Object.prototype);return u},TDi=(s,u,i)=>{s=String(s),(i===void 0||i>s.length)&&(i=s.length),i-=u.length;const r=s.indexOf(u,i);return r!==-1&&r===i},vDi=s=>{if(!s)return null;if(V0(s))return s;let u=s.length;if(!A2e(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=s[u];return i},EDi=(s=>u=>s&&u instanceof s)(typeof Uint8Array<"u"&&oL(Uint8Array)),bDi=(s,u)=>{const r=(s&&s[DD]).call(s);let a;for(;(a=r.next())&&!a.done;){const c=a.value;u.call(s,c[0],c[1])}},ADi=(s,u)=>{let i;const r=[];for(;(i=s.exec(u))!==null;)r.push(i);return r},gDi=Cd("HTMLFormElement"),IDi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,r,a){return r.toUpperCase()+a}),Nj=(({hasOwnProperty:s})=>(u,i)=>s.call(u,i))(Object.prototype),RDi=Cd("RegExp"),R2e=(s,u)=>{const i=Object.getOwnPropertyDescriptors(s),r={};xb(i,(a,c)=>{let e;(e=u(a,c,s))!==!1&&(r[c]=e||a)}),Object.defineProperties(s,r)},DDi=s=>{R2e(s,(u,i)=>{if(il(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const r=s[i];if(il(r)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},wDi=(s,u)=>{const i={},r=a=>{a.forEach(c=>{i[c]=!0})};return V0(s)?r(s):r(String(s).split(u)),i},CDi=()=>{},ODi=(s,u)=>s!=null&&Number.isFinite(s=+s)?s:u;function _Di(s){return!!(s&&il(s.append)&&s[E2e]==="FormData"&&s[DD])}const PDi=s=>{const u=new Array(10),i=(r,a)=>{if(Vb(r)){if(u.indexOf(r)>=0)return;if(Nb(r))return r;if(!("toJSON"in r)){u[a]=r;const c=V0(r)?[]:{};return xb(r,(e,f)=>{const h=i(e,a+1);!Em(h)&&(c[f]=h)}),u[a]=void 0,c}}return r};return i(s,0)},NDi=Cd("AsyncFunction"),VDi=s=>s&&(Vb(s)||il(s))&&il(s.then)&&il(s.catch),D2e=((s,u)=>s?setImmediate:u?((i,r)=>(fy.addEventListener("message",({source:a,data:c})=>{a===fy&&c===i&&r.length&&r.shift()()},!1),a=>{r.push(a),fy.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",il(fy.postMessage)),xDi=typeof queueMicrotask<"u"?queueMicrotask.bind(fy):typeof process<"u"&&process.nextTick||D2e,$Di=s=>s!=null&&il(s[DD]),Qe={isArray:V0,isArrayBuffer:b2e,isBuffer:Nb,isFormData:sDi,isArrayBufferView:W1i,isString:z1i,isNumber:A2e,isBoolean:Y1i,isObject:Vb,isPlainObject:mI,isEmptyObject:J1i,isReadableStream:oDi,isRequest:dDi,isResponse:uDi,isHeaders:pDi,isUndefined:Em,isDate:Q1i,isFile:X1i,isReactNativeBlob:eDi,isReactNative:tDi,isBlob:iDi,isRegExp:RDi,isFunction:il,isStream:nDi,isURLSearchParams:lDi,isTypedArray:EDi,isFileList:rDi,forEach:xb,merge:kP,extend:fDi,trim:cDi,stripBOM:yDi,inherits:hDi,toFlatObject:mDi,kindOf:wD,kindOfTest:Cd,endsWith:TDi,toArray:vDi,forEachEntry:bDi,matchAll:ADi,isHTMLForm:gDi,hasOwnProperty:Nj,hasOwnProp:Nj,reduceDescriptors:R2e,freezeMethods:DDi,toObjectSet:wDi,toCamelCase:IDi,noop:CDi,toFiniteNumber:ODi,findKey:g2e,global:fy,isContextDefined:I2e,isSpecCompliantForm:_Di,toJSONObject:PDi,isAsyncFn:NDi,isThenable:VDi,setImmediate:D2e,asap:xDi,isIterable:$Di};class Gs extends Error{static from(u,i,r,a,c,e){const f=new Gs(u.message,i||u.code,r,a,c);return f.cause=u,f.name=u.name,u.status!=null&&f.status==null&&(f.status=u.status),e&&Object.assign(f,e),f}constructor(u,i,r,a,c){super(u),Object.defineProperty(this,"message",{value:u,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),r&&(this.config=r),a&&(this.request=a),c&&(this.response=c,this.status=c.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qe.toJSONObject(this.config),code:this.code,status:this.status}}}Gs.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Gs.ERR_BAD_OPTION="ERR_BAD_OPTION";Gs.ECONNABORTED="ECONNABORTED";Gs.ETIMEDOUT="ETIMEDOUT";Gs.ERR_NETWORK="ERR_NETWORK";Gs.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Gs.ERR_DEPRECATED="ERR_DEPRECATED";Gs.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Gs.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Gs.ERR_CANCELED="ERR_CANCELED";Gs.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Gs.ERR_INVALID_URL="ERR_INVALID_URL";const Nr=Gs,LDi=null;function UP(s){return Qe.isPlainObject(s)||Qe.isArray(s)}function w2e(s){return Qe.endsWith(s,"[]")?s.slice(0,-2):s}function Y_(s,u,i){return s?s.concat(u).map(function(a,c){return a=w2e(a),!i&&c?"["+a+"]":a}).join(i?".":""):u}function BDi(s){return Qe.isArray(s)&&!s.some(UP)}const MDi=Qe.toFlatObject(Qe,{},null,function(u){return/^is[A-Z]/.test(u)});function OD(s,u,i){if(!Qe.isObject(s))throw new TypeError("target must be an object");u=u||new FormData,i=Qe.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,$){return!Qe.isUndefined($[O])});const r=i.metaTokens,a=i.visitor||v,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Qe.isSpecCompliantForm(u);if(!Qe.isFunction(a))throw new TypeError("visitor must be a function");function m(R){if(R===null)return"";if(Qe.isDate(R))return R.toISOString();if(Qe.isBoolean(R))return R.toString();if(!h&&Qe.isBlob(R))throw new Nr("Blob is not supported. Use a Buffer instead.");return Qe.isArrayBuffer(R)||Qe.isTypedArray(R)?h&&typeof Blob=="function"?new Blob([R]):Buffer.from(R):R}function v(R,O,$){let G=R;if(Qe.isReactNative(u)&&Qe.isReactNativeBlob(R))return u.append(Y_($,O,c),m(R)),!1;if(R&&!$&&typeof R=="object"){if(Qe.endsWith(O,"{}"))O=r?O:O.slice(0,-2),R=JSON.stringify(R);else if(Qe.isArray(R)&&BDi(R)||(Qe.isFileList(R)||Qe.endsWith(O,"[]"))&&(G=Qe.toArray(R)))return O=w2e(O),G.forEach(function(k,W){!(Qe.isUndefined(k)||k===null)&&u.append(e===!0?Y_([O],W,c):e===null?O:O+"[]",m(k))}),!1}return UP(R)?!0:(u.append(Y_($,O,c),m(R)),!1)}const b=[],A=Object.assign(MDi,{defaultVisitor:v,convertValue:m,isVisitable:UP});function w(R,O){if(!Qe.isUndefined(R)){if(b.indexOf(R)!==-1)throw Error("Circular reference detected in "+O.join("."));b.push(R),Qe.forEach(R,function(G,x){(!(Qe.isUndefined(G)||G===null)&&a.call(u,G,Qe.isString(x)?x.trim():x,O,A))===!0&&w(G,O?O.concat(x):[x])}),b.pop()}}if(!Qe.isObject(s))throw new TypeError("data must be an object");return w(s),u}function Vj(s){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return u[r]})}function dL(s,u){this._pairs=[],s&&OD(s,this,u)}const C2e=dL.prototype;C2e.append=function(u,i){this._pairs.push([u,i])};C2e.toString=function(u){const i=u?function(r){return u.call(this,r,Vj)}:Vj;return this._pairs.map(function(a){return i(a[0])+"="+i(a[1])},"").join("&")};function GDi(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function O2e(s,u,i){if(!u)return s;const r=i&&i.encode||GDi,a=Qe.isFunction(i)?{serialize:i}:i,c=a&&a.serialize;let e;if(c?e=c(u,a):e=Qe.isURLSearchParams(u)?u.toString():new dL(u,a).toString(r),e){const f=s.indexOf("#");f!==-1&&(s=s.slice(0,f)),s+=(s.indexOf("?")===-1?"?":"&")+e}return s}class kDi{constructor(){this.handlers=[]}use(u,i,r){return this.handlers.push({fulfilled:u,rejected:i,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){Qe.forEach(this.handlers,function(r){r!==null&&u(r)})}}const xj=kDi,uL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},UDi=typeof URLSearchParams<"u"?URLSearchParams:dL,jDi=typeof FormData<"u"?FormData:null,FDi=typeof Blob<"u"?Blob:null,KDi={isBrowser:!0,classes:{URLSearchParams:UDi,FormData:jDi,Blob:FDi},protocols:["http","https","file","blob","url","data"]},pL=typeof window<"u"&&typeof document<"u",jP=typeof navigator=="object"&&navigator||void 0,SDi=pL&&(!jP||["ReactNative","NativeScript","NS"].indexOf(jP.product)<0),qDi=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ZDi=pL&&window.location.href||"http://localhost",HDi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pL,hasStandardBrowserEnv:SDi,hasStandardBrowserWebWorkerEnv:qDi,navigator:jP,origin:ZDi},Symbol.toStringTag,{value:"Module"})),ls={...HDi,...KDi};function WDi(s,u){return OD(s,new ls.classes.URLSearchParams,{visitor:function(i,r,a,c){return ls.isNode&&Qe.isBuffer(i)?(this.append(r,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function zDi(s){return Qe.matchAll(/\w+|\[(\w*)]/g,s).map(u=>u[0]==="[]"?"":u[1]||u[0])}function YDi(s){const u={},i=Object.keys(s);let r;const a=i.length;let c;for(r=0;r<a;r++)c=i[r],u[c]=s[c];return u}function _2e(s){function u(i,r,a,c){let e=i[c++];if(e==="__proto__")return!0;const f=Number.isFinite(+e),h=c>=i.length;return e=!e&&Qe.isArray(a)?a.length:e,h?(Qe.hasOwnProp(a,e)?a[e]=[a[e],r]:a[e]=r,!f):((!a[e]||!Qe.isObject(a[e]))&&(a[e]=[]),u(i,r,a[e],c)&&Qe.isArray(a[e])&&(a[e]=YDi(a[e])),!f)}if(Qe.isFormData(s)&&Qe.isFunction(s.entries)){const i={};return Qe.forEachEntry(s,(r,a)=>{u(zDi(r),a,i,0)}),i}return null}function JDi(s,u,i){if(Qe.isString(s))try{return(u||JSON.parse)(s),Qe.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(i||JSON.stringify)(s)}const cL={transitional:uL,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const r=i.getContentType()||"",a=r.indexOf("application/json")>-1,c=Qe.isObject(u);if(c&&Qe.isHTMLForm(u)&&(u=new FormData(u)),Qe.isFormData(u))return a?JSON.stringify(_2e(u)):u;if(Qe.isArrayBuffer(u)||Qe.isBuffer(u)||Qe.isStream(u)||Qe.isFile(u)||Qe.isBlob(u)||Qe.isReadableStream(u))return u;if(Qe.isArrayBufferView(u))return u.buffer;if(Qe.isURLSearchParams(u))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let f;if(c){if(r.indexOf("application/x-www-form-urlencoded")>-1)return WDi(u,this.formSerializer).toString();if((f=Qe.isFileList(u))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return OD(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||a?(i.setContentType("application/json",!1),JDi(u)):u}],transformResponse:[function(u){const i=this.transitional||cL.transitional,r=i&&i.forcedJSONParsing,a=this.responseType==="json";if(Qe.isResponse(u)||Qe.isReadableStream(u))return u;if(u&&Qe.isString(u)&&(r&&!this.responseType||a)){const e=!(i&&i.silentJSONParsing)&&a;try{return JSON.parse(u,this.parseReviver)}catch(f){if(e)throw f.name==="SyntaxError"?Nr.from(f,Nr.ERR_BAD_RESPONSE,this,null,this.response):f}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ls.classes.FormData,Blob:ls.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qe.forEach(["delete","get","head","post","put","patch"],s=>{cL.headers[s]={}});const fL=cL,QDi=Qe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),XDi=s=>{const u={};let i,r,a;return s&&s.split(`
|
|
49
|
+
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.`})),{errors:r,explanations:a,modifiedData:i}}subscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]||(this.detachedDependents[r.entity.id]=r)}),this}unsubscribeDependents(i){return i.forEach(r=>{this.detachedDependents[r.entity.id]&&delete this.detachedDependents[r.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const r=[],a=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);r.push(...h.updated),a.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}onDetachedDependencyRemoved(i,r,a){const c=[],e=[],f=[],h=[];return r==="value-as-type-single"&&(this.valueAsTypeSingle=null,a==null||a.add(this,z.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),a==null||a.add(this,z.Updated)),{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}onDetachedDependencyRestored(i,r,a){const c=[],e=[],f=[],h=[];return r==="value-as-type-single"&&(this.valueAsTypeSingle=i,a==null||a.add(this,z.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],a==null||a.add(this,z.Updated)),{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:this}}unsubscribeFromDependencies(){return this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==d.BuiltInBaseEntity&&this.valueAsTypeSingle.unsubscribeDependents([{entity:this,field:"value-as-type-single"}]),this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&this.valueAsTypeList.forEach(i=>{i.type!==d.BuiltInBaseEntity&&i.unsubscribeDependents([{entity:this,field:"value-as-type-list"}])}),this}subscribeToDependencies(){return!this.valueAsTypeSingle&&!this.valueAsTypeList?this:(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.forEach(i=>{i.type!==d.BuiltInBaseEntity&&i.subscribeDependents([{entity:this,field:"value-as-type-list"}])}):this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==d.BuiltInBaseEntity&&this.valueAsTypeSingle.subscribeDependents([{entity:this,field:"value-as-type-single"}]),this)}increaseVersion(i){var r;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((r=this.knownVersions)!=null&&r.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=L.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new Si(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Si(this,this.project);return this.apply(i)}apply(i){const r=this.toMeta();return i.metaSync(r,null),i.valueAsTypeSingle=this.valueAsTypeSingle,i.valueAsTypeList=this.valueAsTypeList?[...this.valueAsTypeList]:this.valueAsTypeList,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const r=[],a=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);r.push(this.parent,...f.updated),a.push(...f.added),c.push(...f.removed)}return{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}async restoreVersion(i,r){var m;const a=[],c=[],e=[],f=[];if(this.version===i&&(r!=null&&r.skipIfSameVersion))return{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this};if(!this.knownVersions){const v=new Map;for(const[b,A]of this.knownVersions||new Map){if(v.set(b,A),A.activeVersion=!1,A.knownVersions)for(const[w,R]of A.knownVersions)v.set(w,R);A.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const v=await this.APILoadVersion({},i);if(!v)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Si(v,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.valueAsTypeSingle=h.valueAsTypeSingle,this.parent=h.parent,{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}updateWithShallowTransfer(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,r),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const a=oe(i.parent),c=this.project.get(a),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(r),c)this.setParent(c,r),this.addSelfToProject(r);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${a}' that isn't found in the project`)}else if(i.standaloneParent){const a=oe(i.standaloneParent),c=this.project.get(a);if(c)this.setStandaloneParent(c,r);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${a}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>oe(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=oe(i.valueAsTypeSingle),c=this.project.get(a);c&&(this.setValueAsTypeSingle(c,r),this.setValueAsTypeList(null,r),this.metaSync({value:null},r))}else this.setValueAsTypeSingle(null,r),this.setValueAsTypeList(null,r);return this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,r))return X.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,r),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const a=oe(i.parent),c=this.project.get(a),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(r),c)this.setParent(c,r),this.addSelfToProject(r);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${a}' that isn't found in the project`)}else if(i.standaloneParent){const a=oe(i.standaloneParent),c=this.project.get(a);if(c)this.setStandaloneParent(c,r);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${a}' that isn't found in the project`)}if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(a=>{const c=oe(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>oe(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=oe(i.valueAsTypeSingle),c=this.project.get(a);c&&(this.setValueAsTypeSingle(c,r),this.setValueAsTypeList(null,r),this.metaSync({value:null},r))}return(i.valueAsTypeSingle===null||i.valueAsTypeList||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeSingle(null,r),(i.valueAsTypeList===null||i.valueAsTypeSingle||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeList(null,r),this.captureVersion(),this.subscribeToDependencies(),r==null||r.attemptAutoclose(_.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],r=[],a=[],c=[];if(this.initialData.parent&&this.initialData.standaloneParent){const e=oe(this.initialData.parent),f=this.project.get(e),h=oe(this.initialData.standaloneParent),m=this.project.get(h);let v="";throw f?v+=` Parent -> ${f.type}: '${f.id}' "${fi(f,this.project)}".`:v+=" Parent -> not-found.",m?v+=` Standalone Parent -> ${m.type}: '${m.id}' "${fi(m,this.project)}".`:v+=" Standalone Parent -> not-found.",new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.${v}`)}if(this.initialData.parent){const e=oe(this.initialData.parent),f=this.project.get(e);if(X.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)X.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else if(this.initialData.standaloneParent){const e=oe(this.initialData.standaloneParent),f=this.project.get(e);if(X.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)X.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Standalone parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${e}' that isn't found in the project`)}else throw X.Logger.error(`[LiteralValueState.hydrateAncestors] Entity with id '${this.id}' must have a 'parent'`),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],this.initialData.valueAsTypeList.forEach(e=>{const f=oe(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=oe(this.initialData.valueAsTypeSingle),f=this.project.get(e);f&&(this.valueAsTypeSingle=f)}return{updated:P(i),added:P(r),removed:P(a),affected:P(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.initialized=!0,i==null||i.attemptAutoclose(_.AfterAllChildrenInitialized,this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){var f,h;const r=[this],a=[],c=[],e=[];return((f=this.parent)==null?void 0:f.type)===d.DataType?this.parent.setEntity(this,i):(h=this.parent)==null||h.setDefaultValue(this,i),e.push(this.parent),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:P(r),added:P(a),removed:P(c),affected:P(e),self:this}}setParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetParent))){var a;return this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetParent,r)?(((a=this.parent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent=i,this.standaloneParent&&(this.standaloneParent=null,this.standalone=!1),r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}setStandaloneParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetStandaloneParent))){var a;if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,_.SetStandaloneParent,r))return this;if(this.project.get(this.id)&&this.parent)throw new Error("[LiteralValueState.setStandaloneParent] This literal-value belongs to the project AST and setting a standalone parent is not possible. Clone the instance, or create a separate one to be standalone.");return((a=this.standaloneParent)==null?void 0:a.id)!==(i==null?void 0:i.id)&&(this.parent&&(this.removeFromParent(r),this.parent=null),this.standaloneParent=i,this.standalone=!0,r&&(r==null||r.add(this,z.Updated))),r==null||r.attemptAutoclose(_.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.AddValueAsTypeToList))){return this.checkCanEdit(this,r)?((this.valueAsTypeList||[]).includes(i)||(this.valueAsTypeList=this.valueAsTypeList||[],this.valueAsTypeList.push(i),this.value!==null&&this.metaSync({value:null},r),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,r==null||r.add(this,z.Updated)),r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this):(X.Logger.warn(`[addValueAsTypeToList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this)}removeValueAsTypeFromList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveValueAsTypeFromList))){return this.checkCanEdit(this,r)?(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&(this.valueAsTypeList||[]).includes(i)&&(this.valueAsTypeList=this.valueAsTypeList.filter(a=>a.id!==i.id),this.valueAsTypeList.length===0?this.valueAsTypeList=null:(this.value!==null&&this.metaSync({value:null},r),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,r==null||r.add(this,z.Updated))),r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this):(X.Logger.warn(`[removeValueAsTypeFromList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this)}setValueAsTypeSingle(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsTypeSingle))){return this.checkCanEdit(this,r)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this):(X.Logger.warn(`[setValueAsTypeSingle] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this)}setValueAsTypeList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsTypeList))){var a,c;return this.checkCanEdit(this,r)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,r==null||r.add(this,z.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)):i&&this.valueAsTypeList&&((a=this.valueAsTypeList)==null?void 0:a.length)!==i.length?(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this):(X.Logger.warn(`[setValueAsTypeList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this)}setValueAsType(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.SetValueAsType))){return this.checkCanEdit(this,r)?i?(Array.isArray(i)?this.setValueAsTypeList(i,r):this.setValueAsTypeSingle(i,r),r==null||r.attemptAutoclose(_.SetValueAsType,this.id),this):(this.setValueAsTypeSingle(null,r),this.setValueAsTypeList(null,r),this):(X.Logger.warn(`[setValueAsType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),r==null||r.attemptAutoclose(_.SetValueAsType,this.id),this)}initChildren(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.standalone){if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(r=>{if(r.type===d.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(r);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.entityType}' with id '${r.entityId}' that is not part of the project state.`);return c}const a=this.project.get(r.id);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.type}' with id '${r.id}' that is not part of the project state.`);return a});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===d.GenericReference){const a=this.project.findSubscribedBuiltInInstanceFromReference(this.initialData.valueAsTypeSingle);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=a,this}const r=this.project.get(this.initialData.valueAsTypeSingle.id);if(!r)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=r}return this}if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(r=>{if(r.type===d.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(r);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.entityType}' with id '${r.entityId}' that is not part of the project state.`);return c}const a=this.project.get(r.id);if(!a)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${r.type}' with id '${r.id}' that is not part of the project state.`);return a});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===d.GenericReference){const a=oe(this.initialData.valueAsTypeSingle),c=a?this.project.get(a):null;if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=c,this}const r=this.project.get(this.initialData.valueAsTypeSingle.id);if(!r)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=r}return this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(r=>{r.version!==this.version&&(r.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r);this.id==="3a497c83-1410-4ab0-8478-1e9c4f0c1935"&&i.value===!1&&console.trace("[LiteralValueState.metaSync] Test error");const c=Nn(this,a),e=this.toMeta();this.name=a.name!==void 0?a.name:e.name,this.autogeneration=a.autogeneration!==void 0?a.autogeneration:e.autogeneration,this.value=a.value!==void 0?a.value:e.value,a.rawString!==void 0?this.rawString=a.rawString:a.value!==void 0&&typeof a.value=="string"?this.rawString=a.value:this.rawString=e.rawString;const f=i.valueAsTypeSingle!==void 0?i.valueAsTypeSingle:this.valueAsTypeSingle??null,h=i.valueAsTypeList!==void 0?i.valueAsTypeList:this.valueAsTypeList??null;return(this.name!==he.String||f!==null||h!==null&&h.length>0)&&(this.rawString=null,a.rawString=null),super.baseMetaSync(a,this,r),a.deleted===!0&&!e.deleted?r==null||r.add(this,z.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,z.Added):c&&(r==null||r.add(this,z.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=Je,...r){return await Si.repository.APILoad(this.id,...r),this}async APICreate(i=Je,...r){return await Si.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=Je,...r){return await Si.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=Je,...r){return await Si.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=Je,...r){return await Si.repository.APIClone(this.id,...r),this}async APILoadVersion(i=Je,r,...a){return await Si.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return this.parent&&(this.parent.type===d.DataType?this.parent.setEntity(null,i):yR.includes(this.parent.type)&&this.parent.setDefaultValue(null,i),e.push(this.parent)),i==null||i.attemptAutoclose(_.RemoveFromParent,this.id),{added:P(c),updated:P(r),removed:P(a),affected:P(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return X.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),r==null||r.event({id:`${_.RemoveEntity}-${this.id}--${Fe.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Fe.ActionOwnerEntityNonDeletable,rootAction:((h=r==null?void 0:r.self)==null?void 0:h.id)===this.id&&(r==null?void 0:r.actionName)===_.RemoveEntity}),r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const a=[],c=[],e=[],f=[];if(r!=null&&r.hasRemoved(this.id))return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},r),Object.values(this.detachedDependents).forEach(m=>{const{updated:v,removed:b,added:A}=m.entity.onDetachedDependencyRemoved(this,m.field,r);a.push(...v),c.push(...b),e.push(...A)}),!i){const m=this.removeFromParent(r);e.push(...m.added),a.push(...m.updated),c.push(...m.removed),f.push(...m.affected)}return r==null||r.attemptAutoclose(_.RemoveEntity,this.id),{added:P(e),updated:P(a),removed:P(c),affected:P(f),self:this}}restore({}={},i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return X.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const r=[],a=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:v}=f.entity.onDetachedDependencyRestored(this,f.field,i);a.push(...h),c.push(...m),r.push(...v)}),i==null||i.attemptAutoclose(_.RestoreEntity,this.id),{added:P(r),updated:P(a),removed:P(c),affected:P(e),self:this})}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlat(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlat(i)):[]])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatIds(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatIds(i)):[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name}}toJSON(i=new Set){var r,a,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:((r=this.valueAsTypeSingle)==null?void 0:r.toJSON(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(e=>e.toJSON(i)):null,parent:((a=this.parent)==null?void 0:a.toReference())||null,standaloneParent:((c=this.standaloneParent)==null?void 0:c.toReference())||null})}toJSONClone(i=Et){var a,c,e,f,h,m,v;let r;return(a=i.seenEntityMaps)!=null&&a.has(this.id)?r=i.seenEntityMaps.get(this.id):(r=i.newId||Gn(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,r)),(c=i.seenEntities)!=null&&c.has(r)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(r),(h=i.seenEntities)==null||h.add(this.id),{id:r,version:L.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:this.valueAsTypeSingle?this.project.getBuiltIn(this.valueAsTypeSingle.id)?this.valueAsTypeSingle.toJSON():this.valueAsTypeSingle.toJSONClone({...i,newId:null}):null,valueAsTypeList:this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(b=>{var A;return this.project.getBuiltIn(b.id)?b.toJSON(i.seenEntities):(A=b.toJSONClone)==null?void 0:A.call(b,{...i,newId:null})}):null,parent:((m=this.parent)==null?void 0:m.toReference({seenEntityMaps:i.seenEntityMaps}))||null,standaloneParent:((v=this.standaloneParent)==null?void 0:v.toReference({seenEntityMaps:i.seenEntityMaps}))||null})}toReference(i=Et){var a;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:r,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var a,c,e,f;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.toReference(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.toReference(i)):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:((e=this.parent)==null?void 0:e.toReference(i))||null,standaloneParent:(f=this.standaloneParent)==null?void 0:f.toReference(i)}}toFlatJSON(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatJSON(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatJSON(i)):[]])}toGenerationTarget(i=Et){var a,c,e,f;let r=this.id;return(a=i.seenEntityMaps)!=null&&a.has(this.id)&&(r=i.seenEntityMaps.get(this.id)),{id:r,type:this.type,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.id)||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.id):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:(e=this.parent)==null?void 0:e.id,standaloneParent:(f=this.standaloneParent)==null?void 0:f.id}}toFlatGenerationTarget(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatGenerationTarget(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(a=>a.toFlatGenerationTarget(i)):[]])}clearErrors(){return this.errors=[],this}validate(){return this.errors=SNe(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await KNe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];return await r.tick(),a}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){const e=En(r,this),f=this.toJSON();r?(f.parent=r.toReference(),f.standaloneParent=null):(f.parent=null,this.standaloneParent?f.standaloneParent=this.standaloneParent.toReference():this.parent?f.standaloneParent=this.parent.toReference():f.standaloneParent=null);const h=a||L.UUID.uuid();f.id=h,f.version=L.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=Lr(f,e);return m.hydrateAncestors(),r&&m.setParent(r,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,z.Added),m.initChildren(i),!i&&c&&m.captureVersion(),i==null||i.attemptAutoclose(_.CloneEntity,this.id),m}merge(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),this,!0,"merge-literal-value"))){const a=[],c=[],e=[],f=[];return this.valueAsTypeSingle!==(i==null?void 0:i.valueAsTypeSingle)&&(this.setValueAsType(i.valueAsTypeSingle,r),a.push(this)),this.valueAsTypeList!==i.valueAsTypeList&&(this.setValueAsTypeList(i.valueAsTypeList,r),a.push(this)),this.value!==i.value&&(this.metaSync({value:i.value},r),a.push(this)),this.autogeneration!==i.autogeneration&&(this.metaSync({autogeneration:i.autogeneration},r),a.push(this)),this.name!==i.name&&(this.metaSync({name:i.name},r),a.push(this)),r==null||r.attemptAutoclose("merge-literal-value",this.id),{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:this}}};D(Si,"repository",{APICreate:async(i,...r)=>i,APIUpdate:async(i,...r)=>i,APIDelete:async(i,...r)=>i,APIClone:async(i,...r)=>{},APILoad:async(i,...r)=>null,APILoadVersion:async(i,r,...a)=>null}),D(Si,"type",d.LiteralValue),D(Si,"USER_MANAGED_PARENT_TYPES",[d.DataType,d.InputMap,d.Property,d.ArgumentDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement,d.VariableDeclaration,d.VariableInstance,d.ValueDescriptor]),D(Si,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...fR]),D(Si,"PARENT_TYPES",[...Si.USER_MANAGED_PARENT_TYPES]),D(Si,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),D(Si,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),D(Si,"BASE_PROPERTIES",[...Si.MUTABLE_BASE_PROPERTIES,...Si.INMUTABLE_BASE_PROPERTIES]),D(Si,"MUTABLE_META_PROPERTIES",[...Si.MUTABLE_BASE_PROPERTIES]),D(Si,"INMUTABLE_META_PROPERTIES",[...Si.INMUTABLE_BASE_PROPERTIES]),D(Si,"META_PROPERTIES",[...Si.MUTABLE_META_PROPERTIES,...Si.INMUTABLE_META_PROPERTIES]),D(Si,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),D(Si,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),D(Si,"UPSTREAM_PROPERTIES",[...Si.MUTABLE_UPSTREAM_PROPERTIES,...Si.INMUTABLE_UPSTREAM_PROPERTIES]),D(Si,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),D(Si,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),D(Si,"DOWNSTREAM_PROPERTIES",[...Si.MUTABLE_DOWNSTREAM_PROPERTIES,...Si.INMUTABLE_DOWNSTREAM_PROPERTIES]),D(Si,"PROPERTIES",[...Si.META_PROPERTIES,...Si.UPSTREAM_PROPERTIES,...Si.DOWNSTREAM_PROPERTIES]);let Xr=Si;function Jy(s){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const i=new Uint8Array(s);return crypto.getRandomValues(i),i}const{randomBytes:u}=require("crypto");return u(s)}function ZNe(s,u){const i=u-s+1,a=vD()*i;return Math.floor(a)+s}function HNe(){const s=Jy(4);return(s[0]<<24|s[1]<<16|s[2]<<8|s[3])>>>0}function vD(){return HNe()/2**32}function Z$(s){const u=Jy(s);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const xP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function H$(s){let u="";const i=Jy(s);for(let r=0;r<s;r++)u+=xP[i[r]%xP.length];return u}function WNe(s){const u=Jy(s);let i;if(typeof Buffer<"u")i=Buffer.from(u).toString("base64");else{const r=String.fromCharCode(...u);i=btoa(r)}return i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function W$(s){return H$(s)}function z$(s,u=xP){let i="";const r=Jy(s);for(let a=0;a<s;a++)i+=u[r[a]%u.length];return i}function hc(){const s=Jy(16);s[6]=s[6]&15|64,s[8]=s[8]&63|128;const u=Array.from(s).map(i=>i.toString(16).padStart(2,"0")).join("");return[u.slice(0,8),u.slice(8,12),u.slice(12,16),u.slice(16,20),u.slice(20,32)].join("-")}function zNe(){return z$(6)}function YNe(){return Z$(32)}const XRi=63,e1i=/^[a-z][a-z0-9-]*[a-z0-9]$/;function t1i(s){return s.length>=1&&s.length<=XRi&&e1i.test(s)&&!s.includes("--")}function*i1i(){yield"";const s="abcdefghijklmnopqrstuvwxyz";for(let u=1;;u++){const i=new Array(u).fill(0);let r=!1;for(;!r;){yield i.map(a=>s[a]).join("");for(let a=u-1;a>=0&&(i[a]++,!(i[a]<s.length));a--)i[a]=0,a===0&&(r=!0)}}}function r1i(s,u){const i=new Set(s.map(a=>a.toLowerCase())),r=u>0?"secondarydb":"main";for(const a of i1i()){const c=a?`${r}${a}`:r;if(t1i(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function JNe(s,u){switch(s.id){case j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=s.project.entities.filter(h=>!!h.implements.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),r=i.find(h=>{const m=h.properties.find(A=>A.implements.find(w=>w.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),v=m==null?void 0:m.getDefaultValue();return(v==null?void 0:v.value)===!0});if(!r&&i.length){const m=i[0].properties.find(b=>b.implements.find(A=>A.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),v=m==null?void 0:m.defaultValue;if(v)v.metaSync({value:!0},u);else if(m!=null&&m.dataType){const b={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:m==null?void 0:m.toReference()},A=we(b,s.project);return A.hydrateAncestors(),A.setParent(m,u),A.addSelfToProject(u),u==null||u.add(A,z.Added),A.initChildren(u),u||A.captureVersion(),{newEntities:[A]}}return{newEntities:[]}}else if(r)return{newEntities:[]};const a=s.project.get(j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=ED(a,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),f=e==null?void 0:e.defaultValue;if(f)f.metaSync({value:!0},u);else if(e!=null&&e.dataType){const h={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:e==null?void 0:e.toReference()},m=we(h,s.project);m.hydrateAncestors(),m.setParent(e,u),m.addSelfToProject(u),u==null||u.add(m,z.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function QNe(s,u){const i=[],r=[],a=[],c=[];return K0(s).filter(f=>f.type===d.BuiltInBaseEntity).forEach(f=>{var h,m,v,b,A,w,R,O,$;switch(f.id){case j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const G=s.project.entities.filter(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=G.find(Q=>!!Q.properties.find(ne=>{var de;return ne.implements.find(J=>J.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((de=ne.getDefaultValue())==null?void 0:de.value)===!0}));if(!x&&G.length)x=G[0];else if(!x&&!G.length){x=s.project.getBuiltIn(j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const ne=x.properties.find(de=>de.implements.find(J=>J.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=ne==null?void 0:ne.defaultValue)==null||h.metaSync({value:!0},u),r.push(x)}const k=s.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(k&&!(k!=null&&k.defaultValue)){const Q={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:null,name:he.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:k==null?void 0:k.toReference()},ne=we(Q,s.project);ne.hydrateAncestors(),ne.setParent(k,u),ne.addSelfToProject(u),u==null||u.add(ne,z.Added),ne.initChildren(u),(k==null?void 0:k.defaultValue).setValueAsTypeSingle(x||null,u),r.push(ne),u||ne.captureVersion();return}else k!=null&&k.defaultValue&&!(k!=null&&k.defaultValue.valueAsTypeSingle)&&(k==null||k.defaultValue.setValueAsTypeSingle(x||null,u));const W=s.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!W)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${j["built-in-base-entity"]}`);let te=!1;if(!W.dataType){const Q=qr.new(u);Q.parent=W.toReference();const ne=we(Q,s.project);ne.hydrateAncestors(),ne.setParent(W,u),ne.addSelfToProject(u),u==null||u.add(ne,z.Added),ne.initChildren(u),te=!0}const ee=s.project.getBuiltIn(j["primitive-entity"].number.id);(m=W.dataType)==null||m.setEntity(ee,u),te&&(u||(v=W.dataType)==null||v.captureVersion());return}case j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const G=s.project.entities.filter(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&J.id!==s.id),x=G.map(J=>{var fe;const ie=J.properties.find(ue=>ue.implements.find(me=>me.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(fe=ie==null?void 0:ie.getDefaultValue())==null?void 0:fe.value}).filter(J=>!!J),k=s.properties.find(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!G.find(J=>!!J.properties.find(ie=>{var se;return ie.implements.find(fe=>fe.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((se=ie.getDefaultValue())==null?void 0:se.value)===!0}))){const J=s.properties.find(se=>se.implements.find(fe=>fe.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!J)throw new Error("Default boolean property not found for relational database entity with id: "+s.id);let ie=!1;if(!(J!=null&&J.defaultValue)){const se=Xr.new(u);se.parent=J.toReference();const fe=we(se,s.project);fe.hydrateAncestors(),fe.setParent(J,u),fe.addSelfToProject(u),u==null||u.add(fe,z.Added),fe.initChildren(u),ie=!0}(b=J==null?void 0:J.defaultValue)==null||b.metaSync({value:!0},u),ie&&(u||(A=J==null?void 0:J.defaultValue)==null||A.captureVersion())}if(!k)throw new Error("Identifier property not found for relational database entity with id: "+s.id);let te=!1;if(!(k!=null&&k.defaultValue)){const J=Xr.new(u);J.parent=k.toReference();const ie=we(J,s.project);ie.hydrateAncestors(),ie.setParent(k,u),ie.addSelfToProject(u),u==null||u.add(ie,z.Added),ie.initChildren(u),te=!0}const ee=r1i(x,G.length);(w=k.defaultValue)==null||w.metaSync({value:ee},u),te&&(u||(R=k.defaultValue)==null||R.captureVersion());const Q=s.properties.find(J=>J.implements.find(ie=>ie.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!Q)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${s.id}`);let ne=!1;if(!Q.defaultValue){const J=Xr.new(u);J.parent=Q.toReference();const ie=we(J,s.project);ie.hydrateAncestors(),ie.setParent(Q,u),ie.addSelfToProject(u),u==null||u.add(ie,z.Added),ie.initChildren(u),r.push(ie),ne=!0}const de=W$(24);(O=Q.defaultValue)==null||O.metaSync({value:de},u),ne&&(u||($=Q.defaultValue)==null||$.captureVersion());return}case j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const G=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.time.id));if(!G)throw new Error(`[handleAfterEntityImplementationSideEffects] Time property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let x=G.defaultValue||null;if(!x){const te=Xr.new(u);te.parent=G.toReference(),te.name=he.Date,te.id=L.UUID.uuid(),x=we(te,s.project),x.hydrateAncestors(),x.setParent(G,u),x.addSelfToProject(u),x.initChildren(u),u==null||u.add(x,z.Added)}x.metaSync({value:new Date().toISOString()},u),x.metaSync({editable:!1,deletable:!1},u),G.metaSync({editable:!1,deletable:!1},u);const k=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id));if(!k)throw new Error(`[handleAfterEntityImplementationSideEffects] Definition property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let W=k.defaultValue||null;if(!W){const te=Xr.new(u);te.name=he.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),W=we(te,s.project),W.hydrateAncestors(),W.setParent(k,u),W.addSelfToProject(u),W.initChildren(u),u==null||u.add(W,z.Added)}break}case j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id:{const G=s.project.entities.filter(x=>Ni(x,be.SHARED_DRIVE_ENTITY)&&x.id!==s.id);if(G.length===1){const x=G[0],k=s.properties.find(te=>te.implements.find(ee=>ee.id===j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.properties.sharedDrive.id));if(!k)throw new Error(`[handleAfterEntityImplementationSideEffects] Shared Drive property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id} with id ${s.id}`);let W=k.defaultValue||null;if(!W){const te=Xr.new(u);te.name=he.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),W=we(te,s.project),W.hydrateAncestors(),W.setParent(k,u),W.addSelfToProject(u),W.initChildren(u),u==null||u.add(W,z.Added)}W.setValueAsTypeSingle(x,u)}break}case j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id:{const G=s.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id));if(!G)throw new Error(`[handleAfterEntityImplementationSideEffects] Compute name property not found for implemented base entity ${j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id} with id ${s.id}`);const x=s.project.entities.filter(ee=>Ni(ee,be.COMPUTE_ENTITY)&&ee.id!==s.id);let k=G.defaultValue||null;if(!k){const ee=Xr.new(u);ee.name=he.EntityTemplate,ee.parent=G.toReference(),ee.id=L.UUID.uuid(),k=we(ee,s.project),k.hydrateAncestors(),k.setParent(G,u),k.addSelfToProject(u),k.initChildren(u),u==null||u.add(k,z.Added)}const W=x.map(ee=>{var Q,ne;return((ne=(Q=ee.properties.find(de=>de.implements.some(J=>J.id===j["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id)))==null?void 0:Q.defaultValue)==null?void 0:ne.value)||""}),te=k$(k.value||"compute-instance",W,"-");k.metaSync({value:te},u);break}}}),{self:s,updated:P(i),added:P(r),removed:P(a),affected:P(c)}}function ED(s,u,i,r){const a=r||L.UUID.uuid(),c=Kn.new(i);c.id=a,c.name=u,c.static=s.static,c.implements=[s.toJSON()],c.parent=s.project.toReference(),c.static=s.static,JNe(s,i);const e=we(c,s.project);return e.hydrateAncestors(),i==null||i.add(e,z.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),QNe(e,i),e.afterAllChildrenInitialized(i),e}function Y$(s,u){return u.entities.find(a=>{const c=a.properties,e=c.map(b=>b.name),f=s.every(b=>e.includes(b)),h=e.filter(b=>!s.includes(b)),m=c.every(b=>!h.includes(b.name)||!b.required);return f&&m})||null}function XNe(s,u,i,r=rt.OrDataTypeGroup){const a=[],c=[],e=[],f=[],h=L.UUID.uuid(),m=qr.new(i);m.id=h,m.parent=u.toReference(),m.like=!0,m.parentRelationType=r;const v=we(m,s.project);return c.push(v),v.setParent(u,i),v.addSelfToProject(i),i==null||i.add(v,z.Added),v.setEntity(s,i),v.initChildren(i),i||v.captureVersion(),{updated:P(a),added:P(c),removed:P(e),affected:P(f),self:v}}function J$(s,u,i,r,a){var m,v,b,A,w,R,O,$;const c=[],e=[],f=[],h=[];switch(typeof s){case"string":let G=!1;const x=new Date(s);if(x instanceof Date&&!isNaN(x.valueOf())&&(G=!0),G){const k=u.project.getBuiltIn(j[d.PrimitiveEntity][he.Date].id);u.setEntity(k,r);break}else{const k=u.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id);u.setEntity(k,r);break}case"number":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":if(s===null){u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}else if(Array.isArray(s))if(u.metaSync({isList:!0},r),s.length>0){const k=s.slice(0,5).filter(te=>te!==void 0);if(k.every(te=>typeof te==typeof k[0])&&(typeof k[0]!="object"||k[0]===null))switch(typeof k[0]){case"string":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id),r);break;case"number":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":u.setEntity(u.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}else{const te=[];let ee=!1;k.forEach(ne=>{var de,J,ie,se;if(Array.isArray(ne)&&(ee=!0),typeof ne=="object"&&!Array.isArray(ne)&&ne!==null){const fe=yI(ne,u.project,{...i,id:L.UUID.uuid()},r,a);fe.hasCreated&&te.push((de=fe.changeSet)==null?void 0:de.self),c.push(...(J=fe.changeSet)==null?void 0:J.updated),e.push(...(ie=fe.changeSet)==null?void 0:ie.added),f.push(...(se=fe.changeSet)==null?void 0:se.removed)}});const Q=P(te);if(!Q.length&&!ee){k.forEach(ne=>{const de=qr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const J=we(de,u.project);switch(J.hydrateAncestors(),J.setParent(u,r),J.addSelfToProject(r),r==null||r.add(J,z.Added),J.initChildren(r),typeof ne){case"string":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.String].id),r);break;case"number":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Number].id),r);break;case"boolean":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Boolean].id),r);break;case"object":J.setEntity(J.project.getBuiltIn(j[d.PrimitiveEntity][he.Null].id),r);break}r||J.captureVersion()});break}else Q.length===1&&!ee?u.setEntity(Q[0],r):k.forEach(ne=>{if(typeof ne=="object"&&!Array.isArray(ne)&&ne!==null){const de=Y$(Object.keys(ne),u.project);if(de){const J=XNe(de||Q[0],u,r,rt.OrDataTypeGroup);c.push(...J.updated),e.push(...J.added),f.push(...J.removed)}}else{const de=qr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const J=we(de,u.project);J.hydrateAncestors(),J.setParent(u,r),J.addSelfToProject(r),r==null||r.add(J,z.Added),J.initChildren(r);const ie=J$(ne,J,{...i,id:L.UUID.uuid()},r,a);c.push(...ie.updated),e.push(...ie.added),f.push(...ie.removed),r||J.captureVersion()}})}}else{const k=yI(s[0],u.project,{...i},r,a);u.setEntity((m=k.changeSet)==null?void 0:m.self,r),c.push(...(v=k.changeSet)==null?void 0:v.updated),e.push(...(b=k.changeSet)==null?void 0:b.added),f.push(...(A=k.changeSet)==null?void 0:A.removed);break}else{const k=yI(s,u.project,{...i},r,a);u.setEntity((w=k.changeSet)==null?void 0:w.self,r),c.push(...(R=k.changeSet)==null?void 0:R.updated),e.push(...(O=k.changeSet)==null?void 0:O.added),f.push(...($=k.changeSet)==null?void 0:$.removed);break}}return{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:u}}function yI(s,u,i,r,a){const c=[],e=[],f=[],h=[],m=Object.keys(s),v=Y$(m,u);if(v)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:v}};const b=a?i.name+" of "+a.name:i.name,w={id:i.id||L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(r==null?void 0:r.timestamp)||new Date().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,name:b,codeName:null,deletable:!0,editable:!0,type:d.DefinitionEntity,additionalProperties:!1,additionalPropertiesDataType:null,allPropertiesImplement:null,description:i.description||null,static:i.static||!1,abstract:i.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:null,implements:[],x:0,y:0,parent:u.toReference()},R=we(w,u);return R.hydrateAncestors(),R.setParent(u,r),R.addSelfToProject(r),r==null||r.add(R,z.Added),R.initChildren(r),e.push(R),m.forEach((O,$)=>{const G=L.UUID.uuid(),x=Ps.new(r);x.id=G,x.name=O,x.codeName=O,x.parent=R.toReference(),x.index=$,x.required=!0,x.interactive=!0;const k=we(x,u);k.hydrateAncestors(),k.setParent(R,r),k.addSelfToProject(r),r==null||r.add(k,z.Added),k.initChildren(r),e.push(k);const W=s[O],te=L.UUID.uuid(),ee=qr.new(r);ee.id=te,ee.parent=k.toReference(),ee.like=!0,ee.isList=!1;const Q=we(ee,u);Q.hydrateAncestors(),Q.setParent(k,r),Q.addSelfToProject(r),r==null||r.add(Q,z.Added),Q.initChildren(r),e.push(Q);const ne=J$(W,Q,{...i,name:O,id:L.UUID.uuid()},r,a||R);c.push(...ne.updated),e.push(...ne.added),f.push(...ne.removed),r||(k.captureVersion(),Q.captureVersion())}),r||R.captureVersion(),{hasCreated:!0,changeSet:{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:R}}}function Hu(s,u,i,r,a){const c={ignoreImplementationMatch:!1,...a},e=[];return!s.length||!u.length?{errors:e,overlap:!1}:(s.length>u.length?s.forEach(f=>{const h=u.find(v=>v.name===f.name),m=u.find(v=>{var b,A;return Array.isArray(v.implements)?v.implements.some(w=>!!f.implements.find(R=>R.id===w.id)):((b=v.implements)==null?void 0:b.id)===((A=f.implements)==null?void 0:A.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const v=new pi({id:f.id+"--"+h.id+"--"+r,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${h.type} ${h.name} with id "${h.id}" that has the same name`,severity:Ee.Error,code:r,entity:f,firstRelationship:h});e.push(v)}if(m&&!c.ignoreImplementationMatch){const v=new pi({id:f.id+"--"+m.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${m.type} ${m.name} with id "${m.id}" that implements the same base descriptor`,severity:Ee.Error,code:i,entity:f,firstRelationship:m});e.push(v)}}):u.forEach(f=>{var v;const h=s.find(b=>b.name===f.name),m=s.find(b=>{var A,w;return b.implements&&Array.isArray(b.implements)?b.implements.some(R=>!!f.implements.find(O=>O.id===R.id)):((A=b.implements)==null?void 0:A.id)===((w=f.implements)==null?void 0:w.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const b=new pi({id:h.id+"--"+f.id+"--"+r,message:`Entity of type ${h.type} named "${h.name}" with id "${h.id}" overrides a base entity ${f.name} with id "${f.id}" that has the same name`,severity:Ee.Error,code:r,entity:h,firstRelationship:f});e.push(b)}if(m&&!c.ignoreImplementationMatch){const b=new pi({id:m.id+"--"+f.id+"--"+i,message:`Entity of type ${m.type} named "${m.name}" with id "${m.id}" overrides a base entity ${f.name} with id "${f.id}" that implements the same base ${Array.isArray(m==null?void 0:m.implements)?qt(m==null?void 0:m.implements.map(A=>A.type),"', '","' and '"):(v=m.implements)==null?void 0:v.id}`,severity:Ee.Error,code:i,entity:m,firstRelationship:f});e.push(b)}}),{errors:e,overlap:!!e.length})}function n1i(s,u){return s.abstract||(s.properties.forEach(r=>{r.abstract||r.metaSync({abstract:!0},u)}),Object.values(s.detachedDependents).forEach(r=>{r.field===gB.EntityField&&r.entity.remove({ignoreUpstream:!1},u)}),s.metaSync({abstract:!0},u)),s}function a1i(s,u){return s.abstract&&(s.properties.forEach(r=>{r.abstract&&r.metaSync({abstract:!1},u)}),Object.values(s.detachedDependents).forEach(r=>{(r.field===XI.Implements||r.field===XI.Extends)&&r.entity.onDetachedDependencyRemoved(s,r.field,u)}),s.metaSync({abstract:!1},u)),s}function s1i(s,u){return s.static||(s.properties.forEach(r=>{r.static||r.metaSync({static:!0},u)}),s.metaSync({static:!0},u)),s}function l1i(s,u){return s.static&&s.metaSync({static:!1},u),s}const aE=class aE extends j${constructor(i,r){super(i);D(this,"initialData");D(this,"id");D(this,"version");D(this,"name");D(this,"description",null);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",!1);D(this,"static");D(this,"additionalProperties",!1);D(this,"properties",[]);D(this,"allPropertiesImplement",null);D(this,"additionalPropertiesDataType",null);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"interactive",!1);D(this,"errors",[]);D(this,"project");if(this.initialData=this.initialData||i,this.project=this.project||r,this.id=this.id||i.id,this.version=this.version||i.version,this.name=this.name||i.name,this.static=this.static||i.static,this.interactive=this.interactive||i.interactive,this.abstract=i.abstract,this.additionalProperties=i.additionalProperties,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.initialData.allPropertiesImplement){const a=we(this.initialData.allPropertiesImplement,this.project);a.setParent(this,null),a.initChildren(null),this.allPropertiesImplement=a}if(this.initialData.additionalPropertiesDataType){const a=we(this.initialData.additionalPropertiesDataType,this.project);a.setParent(this,null),a.initChildren(null),this.additionalPropertiesDataType=a}this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project))}get allMethods(){return P([...this.ownDeclaredMethods,...this.allBaseMethodsFromOriginalParents])}get allProperties(){return P([...this.ownDeclaredProperties,...this.allBasePropertiesFromOriginalParents])}get allBaseMethodsFromOriginalParents(){var a;const i=((a=this.extends)==null?void 0:a.allMethods)||[],r=[...i].filter(c=>!i.some(e=>e.id!==c.id));return P(r)}get allBasePropertiesFromOriginalParents(){var a;const i=((a=this.extends)==null?void 0:a.allProperties)||[],r=[...i].filter(c=>!i.some(e=>{var f;return e.id!==c.id&&(!!e.implements.find(h=>h.id===c.id)||((f=e.extends)==null?void 0:f.id)===c.id)}));return P(r)}get allBasePropertiesFromExtendedAndImplementedEntities(){var a,c;const i=[...((a=this.extends)==null?void 0:a.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.allBasePropertiesFromExtendedAndImplementedEntities)||[]].filter(e=>!e.abstract),r=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return P([...r])}get allBaseMethodsFromExtendedAndImplementedEntities(){return P([...(this.extends?[this.extends]:[]).reduce((i,r)=>r.type===d.PrimitiveEntity?i:[...[...r.ownDeclaredMethods,...r.allBaseMethodsFromExtendedAndImplementedEntities].filter(c=>c.type!==d.ActionDescriptor),...i],[])])}get extendedPropertiesFromOriginalParents(){var a,c;const i=[...((a=this.extends)==null?void 0:a.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.extendedPropertiesFromOriginalParents)||[]].filter(e=>!e.abstract),r=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return P(r)}get implementedPropertiesFromOriginalParents(){return P([...(this.extends?[this.extends]:[]).reduce((i,r)=>{const a=r.implementedPropertiesFromOriginalParents,c=[...r.ownDeclaredProperties].filter(h=>!!h.abstract),e=[...a,...c,...i];return[...e].filter(h=>!!!e.find(v=>{var b;return((b=v.extends)==null?void 0:b.id)===h.id||!!v.implements.find(A=>A.id===h.id)}))},[])].filter(i=>!!i.abstract))}get extendedProperties(){return this.properties.filter(i=>i.isExtendedProperty)}get ownDeclaredMethods(){return[...this.methods,...this.abstractMethods]}get ownDeclaredProperties(){return this.properties.filter(i=>!i.isExtendedProperty)}subscribe(){return this.project.subscribeBuiltInInstance(this),this}unsubscribe(){return this.project.unsubscribeBuiltInInstance(this),this}async APILoad(i=Je,...r){return await aE.repository.APILoad(this.id,...r),this}toFlat(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this,...this.properties.flatMap(c=>c.toFlat(i)),...this.methods.flatMap(c=>c.toFlat(i)),...this.abstractMethods.flatMap(c=>c.toFlat(i)),...((a=this.extends)==null?void 0:a.toFlat(i))||[]])}toFlatIds(i=new Set){var a;return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.properties.flatMap(c=>c.toFlatIds(i)),...this.methods.flatMap(c=>c.toFlatIds(i)),...this.abstractMethods.flatMap(c=>c.toFlatIds(i)),...((a=this.extends)==null?void 0:a.toFlatIds(i))||[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,description:this.description,interactive:this.interactive,additionalProperties:this.additionalProperties,abstract:this.abstract,static:this.static,type:this.type,name:this.name}}toJSON(i=new Set){var r,a,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,additionalProperties:this.additionalProperties,interactive:this.interactive,additionalPropertiesDataType:((r=this.additionalPropertiesDataType)==null?void 0:r.toJSON(i))||null,allPropertiesImplement:((a=this.allPropertiesImplement)==null?void 0:a.toJSON(i))||null,properties:this.properties.map(e=>e.toJSON(i)),methods:this.methods.map(e=>e.toJSON(i)),abstractMethods:this.abstractMethods.map(e=>e.toJSON(i)),extends:((c=this.extends)==null?void 0:c.toJSON(i))||null})}toReference(i=Et){return{id:this.id+"--"+L.UUID.uuid()+"--ref",type:d.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(i=Et){var r,a,c;return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,additionalProperties:this.additionalProperties,additionalPropertiesDataType:((r=this.additionalPropertiesDataType)==null?void 0:r.toReference())||null,allPropertiesImplement:((a=this.allPropertiesImplement)==null?void 0:a.toReference())||null,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:((c=this.extends)==null?void 0:c.toReference())||null}}toFlatJSON(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(e=>e.toFlatJSON(i)),...this.methods.flatMap(e=>e.toFlatJSON(i)),...this.abstractMethods.flatMap(e=>e.toFlatJSON(i)),...((a=this.additionalPropertiesDataType)==null?void 0:a.toFlatJSON(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatJSON(i))||[]])}toGenerationTarget(i=Et){var r;return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,additionalProperties:this.additionalProperties,extends:(r=this.extends)==null?void 0:r.id}}toFlatGenerationTarget(i=new Set){var a,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(e=>e.toFlatGenerationTarget(i)),...this.methods.flatMap(e=>e.toFlatGenerationTarget(i)),...this.abstractMethods.flatMap(e=>e.toFlatGenerationTarget(i)),...((a=this.additionalPropertiesDataType)==null?void 0:a.toFlatGenerationTarget(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatGenerationTarget(i))||[]])}clearErrors(){var i,r;return this.errors=[],this.properties.forEach(a=>a.clearErrors()),this.methods.forEach(a=>a.clearErrors()),this.abstractMethods.forEach(a=>a.clearErrors()),(i=this.additionalPropertiesDataType)==null||i.clearErrors(),(r=this.allPropertiesImplement)==null||r.clearErrors(),this}validate(){return this.errors=YRi(this),{success:!0}}async validateAsync(i={}){const r=X.YieldTracker.from(i);return this.errors=await zRi(this,{tracker:r}),{success:!0}}getErrors(){var r,a;return[...this.errors,...this.properties.flatMap(c=>c.getErrors()),...this.methods.flatMap(c=>c.getErrors()),...this.abstractMethods.flatMap(c=>c.getErrors()),...((r=this.additionalPropertiesDataType)==null?void 0:r.getErrors())||[],...((a=this.allPropertiesImplement)==null?void 0:a.getErrors())||[]]}async getErrorsAsync(i={}){const r=X.YieldTracker.from(i),a=[...this.errors];await r.tick();for(const c of this.properties){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}for(const c of this.methods){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}for(const c of this.abstractMethods){const e=await c.getErrorsAsync({tracker:r});a.push(...e)}if(this.additionalPropertiesDataType){const c=await this.additionalPropertiesDataType.getErrorsAsync({tracker:r});a.push(...c)}if(this.allPropertiesImplement){const c=await this.allPropertiesImplement.getErrorsAsync({tracker:r});a.push(...c)}return a}getShallowErrors(){return this.errors}implement(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,U().toISOString(),null,!0,"implement-built-in-base-entity")),a){const c=ED(this,i,r,a);return r==null||r.attemptAutoclose("implement-built-in-base-entity",this.id),c}getAllPropertiesImplements(){var r;const i=[];return this.allPropertiesImplement&&i.push(this.allPropertiesImplement),((r=this.extends)==null?void 0:r.type)===d.BuiltInBaseEntity&&i.push(...this.extends.getAllPropertiesImplements()||[]),i}getAllInteractiveMethods(){const i=[];if(this.interactive){if(i.push(...this.methods,...this.abstractMethods),!this.extends||this.extends.type===d.BuiltInBaseEntity&&this.extends.interactive||this.extends.type===d.PrimitiveEntity)return i;this.extends instanceof aE&&i.push(...this.extends.getAllInteractiveMethods())}return P(i)}getRawDefaultValue(){const i={};return this.properties.forEach(r=>{var e;if(!OE(r)||!r.defaultValue)return;const a=ye(r,this.project),c=r.codeName||yc(r,this.project)||el($r(a));i[c]=((e=r.getDefaultValue())==null?void 0:e.value)||null}),i}};D(aE,"repository",{APILoad:async(i,...r)=>null});let Nl=aE;class eVe extends Nl{constructor(i){super(da,i);D(this,"initialData");D(this,"id",be.PERSISTED_ENTITY);D(this,"version","1");D(this,"name",be.PERSISTED_ENTITY);D(this,"description",da.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",da.abstract);D(this,"static",da.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=da,this.project=i,this.id=da.id,this.version=da.version,this.name=da.name,this.static=da.static,this.abstract=da.abstract,this.properties=this.initialData.properties.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.methods=this.initialData.methods.map(r=>{const a=we(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=we(r,this.project);return a.parent=this,a}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project))}}var Ra=(s=>(s.ValueMustBeString="value-must-be-string",s.StringValueMustNotHaveSpaces="string-value-must-not-have-spaces",s.StringValueMustNotHaveDashes="string-value-must-not-have-dashes",s.MustBeUniqueAmongSameEntities="must-be-unique-among-same-entities",s))(Ra||{});function bD(s,u){const i=[],r=u;if(!r)return{errors:i,override:u};if(typeof r!="string")return{errors:[],override:u};if(r.includes(" ")){const a=new pi({id:s.id+"--string-value-must-not-have-spaces",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces.`,severity:Ee.Error,code:"string-value-must-not-have-spaces",entity:s});i.push(a)}return{errors:i,override:r.replace(/\s/g,"-")}}function tVe(s,u){const i=[],r=u;if(!r)return{errors:i,override:u};if(typeof r!="string")return{errors:[],override:u};if(r.includes(" ")){const a=new pi({id:s.id+"--string-value-must-not-have-spaces",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ee.Error,code:"string-value-must-not-have-spaces",entity:s});i.push(a)}if(r.includes("-")){const a=new pi({id:s.id+"--string-value-must-not-have-dashes",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ee.Error,code:"string-value-must-not-have-dashes",entity:s});i.push(a)}return{errors:i,override:r.replace(/\s|-/g,"_")}}var lu=(s=>(s.StatusCodeMustBeNumber="status-code-must-be-number",s.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",s))(lu||{}),iVe=(s=>(s.PathMustStartWithSlash="path-must-start-with-slash",s.PathContainsInvalidCharacters="path-contains-invalid-characters",s.PathUnclosedCurlyBracket="path-unclosed-curly-bracket",s.PathUnopenedCurlyBracket="path-unopened-curly-bracket",s.PathEmptyCurlyBrackets="path-empty-curly-brackets",s.PathConflictsWithExistingEndpoint="path-conflicts-with-existing-endpoint",s))(iVe||{});function $P(s,u){if(!s||!u)return!1;if(s===u)return!0;const i=s.split("/").filter(Boolean),r=u.split("/").filter(Boolean);if(i.length!==r.length)return!1;for(let a=0;a<i.length;a++){const c=i[a],e=r[a],f=c.startsWith("{")&&c.endsWith("}"),h=e.startsWith("{")&&e.endsWith("}");if(!(f&&h)&&c!==e)return!1}return!0}function rVe(s,u){const i=[];if(typeof u!="number"){const r=new pi({id:s.id+"--status-code-must-be-number",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a number.`,severity:Ee.Error,code:"status-code-must-be-number",entity:s});return i.push(r),{errors:i,override:u}}if(u<100||u>599){const r=new pi({id:s.id+"--status-code-must-be-between-100-and-599",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a number between 100 and 599.`,severity:Ee.Error,code:"status-code-must-be-between-100-and-599",entity:s});i.push(r)}return{errors:i,override:u}}class nVe extends Nl{constructor(i){var f,h;super(zs,i);D(this,"initialData");D(this,"id",be.HTTP_ENDPOINT);D(this,"version","1");D(this,"name",be.HTTP_ENDPOINT);D(this,"description",zs.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",zs.abstract);D(this,"static",zs.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=zs,this.project=i,this.id=zs.id,this.version=zs.version,this.name=zs.name,this.static=zs.static,this.abstract=zs.abstract,this.properties=this.initialData.properties.map(m=>{const v=we(m,this.project);return v.setParent(this,null),v.initChildren(null),v}),this.methods=this.initialData.methods.map(m=>{const v=we(m,this.project);return v.parent=this,v}),this.abstractMethods=this.initialData.abstractMethods.map(m=>{const v=we(m,this.project);return v.parent=this,v}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id);if(!r)throw new Error("Path property not found in endpoint entity");r._codeNativeValueValidation=(m,v)=>{var G;const b=bD(m,v);let A=typeof b.override=="string"?b.override:"";if(A&&!A.startsWith("/")&&(A="/"+A),typeof A=="string"){if(/[^a-zA-Z0-9\-_/{}]/g.test(A)){const te=new pi({id:m.id+"--path-contains-invalid-characters",message:`Path "${A}" contains invalid characters. Only alphanumeric, -, _, /, and {} are allowed.`,severity:Ee.Error,code:"path-contains-invalid-characters",entity:m});b.errors.push(te)}let k=!1,W="";for(let te=0;te<A.length;te++){const ee=A[te];if(ee==="{")k=!0,W+=ee;else if(ee==="}"){if(!k){const Q=new pi({id:m.id+"--path-unopened-curly-bracket",message:`Path "${A}" has a closed curly bracket '}' without an opening bracket '{'.`,severity:Ee.Error,code:"path-unopened-curly-bracket",entity:m});b.errors.push(Q)}k=!1,W+=ee}else W+=k?ee:ee.toLowerCase()}if(A=W,k){const te=new pi({id:m.id+"--path-unclosed-curly-bracket",message:`Path "${A}" has an unclosed curly bracket '{'.`,severity:Ee.Error,code:"path-unclosed-curly-bracket",entity:m});b.errors.push(te)}if(A.includes("{}")){const te=new pi({id:m.id+"--path-empty-curly-brackets",message:`Path "${A}" has empty curly brackets '{}'. Path parameters must have a name.`,severity:Ee.Error,code:"path-empty-curly-brackets",entity:m});b.errors.push(te)}}b.override=A;const w=m.parent,R=w.properties.find(x=>x.implements.find(k=>k.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),O=(G=R==null?void 0:R.getDefaultValue())==null?void 0:G.value;if(m.project.entities.filter(x=>Ni(x,be.HTTP_ENDPOINT)&&x.id!==w.id).some(x=>{var te,ee;const k=x.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));if(((te=k==null?void 0:k.getDefaultValue())==null?void 0:te.value)!==O)return!1;const W=x.properties.find(Q=>Q.implements.find(ne=>ne.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!W)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return $P((ee=W.getDefaultValue())==null?void 0:ee.value,A)})){const x=new pi({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${A}" conflicts with another endpoint using the ${O} method.`,severity:Ee.Error,code:"path-conflicts-with-existing-endpoint",entity:m});b.errors.push(x)}return b};const a=this.properties.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id);a&&(a._codeNativeValueValidation=(m,v)=>{var $;const b={errors:[],override:v},A=m.parent,w=A.properties.find(G=>G.implements.find(x=>x.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),R=($=w==null?void 0:w.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(G=>Ni(G,be.HTTP_ENDPOINT)&&G.id!==A.id).some(G=>{var W,te;const x=G.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!$P((W=x==null?void 0:x.getDefaultValue())==null?void 0:W.value,R))return!1;const k=G.properties.find(ee=>ee.implements.find(Q=>Q.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));return((te=k==null?void 0:k.getDefaultValue())==null?void 0:te.value)===v})){const G=new pi({id:m.id+"--"+Ra.MustBeUniqueAmongSameEntities,message:`Method "${v}" cannot be used because another endpoint is already using the ${v} method on path "${R}".`,severity:Ee.Error,code:Ra.MustBeUniqueAmongSameEntities,entity:m});b.errors.push(G)}return b});const c=this.abstractMethods.find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.id);if(!c)throw new Error("Handler method not found in endpoint entity");const e=(((h=(f=c.dataType)==null?void 0:f.entity)==null?void 0:h.properties)||[]).find(m=>m.id===j["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.dataType.entity.properties.statusCode.id);if(!e)throw new Error("Status code output not found in handler method");e._codeNativeValueValidation=(m,v)=>rVe(m,v)}}var zv=(s=>(s.InvalidCharacters="cron-invalid-characters",s.MustHaveSixFields="cron-must-have-six-fields",s.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",s))(zv||{});function aVe(s,u){const i=[];let r=u;if(typeof u!="string"){const e=new pi({id:s.id+"--"+Ra.ValueMustBeString,message:`Entity of type ${s.type} with id "${s.id}" has an invalid value. The cron expression must be a string.`,severity:Ee.Error,code:Ra.ValueMustBeString,entity:s});return i.push(e),{errors:i,override:""}}r=u.trimStart().replace(/\s{2,}/g," ");const a=/[^0-9A-Z *?\-/,LW#]/g;if(a.test(r)){const e=Array.from(new Set(r.match(a)));i.push(new pi({id:s.id+"--cron-invalid-characters",message:`Cron expression contains invalid characters: "${e.join(", ")}". Only alphanumeric characters and (* ? - / , L W #) are allowed.`,severity:Ee.Error,code:"cron-invalid-characters",entity:s})),r=r.replace(a,"")}const c=r.split(" ").filter(Boolean);if(c.length!==6)i.push(new pi({id:s.id+"--cron-must-have-six-fields",message:`Elyx Cron expressions must have exactly 6 fields separated by spaces (Minutes, Hours, Day-of-month, Month, Day-of-week, Year). Currently has ${c.length}.`,severity:Ee.Error,code:"cron-must-have-six-fields",entity:s}));else{const e=c[2],f=c[4];e!=="?"&&f!=="?"&&(i.push(new pi({id:s.id+"--cron-day-of-month-and-week-conflict",message:"Elyx restricts defining both Day-of-month and Day-of-week simultaneously. If you specify one, the other must be '?'",severity:Ee.Error,code:"cron-day-of-month-and-week-conflict",entity:s})),e==="*"&&f==="*"&&(c[4]="?",r=c.join(" ")))}return{errors:i,override:r}}class sVe extends Nl{constructor(i){super(Rl,i);D(this,"initialData");D(this,"id",be.CRON_JOB);D(this,"version","1");D(this,"name",be.CRON_JOB);D(this,"description",Rl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Rl.abstract);D(this,"static",Rl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Rl,this.project=i,this.id=Rl.id,this.version=Rl.version,this.name=Rl.name,this.static=Rl.static,this.abstract=Rl.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"].BUILT_IN_CRON_JOB_ENTITY.properties.expression.id);if(!r)throw new Error("Expression property not found in cron job entity");r._codeNativeValueValidation=(a,c)=>aVe(a,c)}}class lVe extends Nl{constructor(i){super(Ia,i);D(this,"initialData");D(this,"id",be.RELATIONAL_DATABASE);D(this,"version","1");D(this,"name",be.RELATIONAL_DATABASE);D(this,"description",Ia.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Ia.abstract);D(this,"static",Ia.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Ia,this.project=i,this.id=Ia.id,this.version=Ia.version,this.name=Ia.name,this.static=Ia.static,this.abstract=Ia.abstract,this.properties=this.initialData.properties.map(c=>{const e=we(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=we(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=we(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(c=>c.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id);if(!r)throw new Error("Path property not found in endpoint entity");r._codeNativeValueValidation=(c,e)=>tVe(c,e);const a=this.properties.find(c=>c.id===j["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.minSize.id);a&&(a._codeNativeValueValidation=(c,e)=>{const f={errors:[],override:e};if(typeof e=="number"){if(e<6){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeTooSmall,message:"Minimum GB size cannot be less than 6.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeTooSmall,entity:c});f.errors.push(h)}else if(e>65536){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeTooLarge,message:"Minimum GB size cannot be greater than 65536.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeTooLarge,entity:c});f.errors.push(h)}}else if(e!==void 0){const h=new pi({id:c.id+"--"+ge.RelationalDatabaseMinSizeMustBeNumber,message:"Minimum GB size must be a number.",severity:Ee.Error,code:ge.RelationalDatabaseMinSizeMustBeNumber,entity:c});f.errors.push(h)}return f})}}var oVe=(s=>(s.InvalidCharacters="compute-name-invalid-characters",s.TooLong="compute-name-too-long",s.Empty="compute-name-empty",s))(oVe||{});class dVe extends Nl{constructor(i){super(Dl,i);D(this,"initialData");D(this,"id",be.COMPUTE_ENTITY);D(this,"version","1");D(this,"name",be.COMPUTE_ENTITY);D(this,"description",Dl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Dl.abstract);D(this,"static",Dl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Dl,this.project=i,this.id=Dl.id,this.version=Dl.version,this.name=Dl.name,this.static=Dl.static,this.abstract=Dl.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"][be.COMPUTE_ENTITY].properties.computeName.id);r&&(r._codeNativeValueValidation=(a,c)=>{const e={errors:[],override:c};if(typeof c!="string"||!c){const h=new pi({id:a.id+"--compute-name-empty",message:"Compute name cannot be empty.",severity:Ee.Error,code:"compute-name-empty",entity:a});return e.errors.push(h),e}if(c.length>255){const h=new pi({id:a.id+"--compute-name-too-long",message:"Compute name must be 255 characters or fewer.",severity:Ee.Error,code:"compute-name-too-long",entity:a});e.errors.push(h)}if(/[^a-zA-Z0-9\-_]/g.test(c)){const h=new pi({id:a.id+"--compute-name-invalid-characters",message:`Compute name "${c}" contains invalid characters. Only alphanumeric characters, hyphens (-), and underscores (_) are allowed.`,severity:Ee.Error,code:"compute-name-invalid-characters",entity:a});e.errors.push(h)}return e.errors.length||this.project.entities.filter(m=>Ni(m,be.COMPUTE_ENTITY)&&m.id!==this.id).forEach(m=>{var b;const v=m.properties.find(A=>A.implements.some(w=>w.id===j[d.BuiltInBaseEntity][be.COMPUTE_ENTITY].properties.computeName.id));if(v&&(v==null?void 0:v.id)!==a.id&&((b=v.defaultValue)==null?void 0:b.value)===c){const A=new pi({id:a.id+"--"+ge.ComputeNameNotUnique,message:`Compute name "${c}" is duplicated.`,severity:Ee.Error,code:ge.ComputeNameNotUnique,entity:a});e.errors.push(A)}}),e})}}var uVe=(s=>(s.InvalidImageUri="container-compute-invalid-image-uri",s.InvalidMinTasks="container-compute-invalid-min-tasks",s.InvalidMaxTasks="container-compute-invalid-max-tasks",s.MaxTasksLessThanMinTasks="container-compute-max-less-than-min",s.InvalidEphemeralStorage="container-compute-invalid-ephemeral-storage",s))(uVe||{});class pVe extends Nl{constructor(i){super(wl,i);D(this,"initialData");D(this,"id",be.CONTAINER_COMPUTE_ENTITY);D(this,"version","1");D(this,"name",be.CONTAINER_COMPUTE_ENTITY);D(this,"description",wl.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",wl.abstract);D(this,"static",wl.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=wl,this.project=i,this.id=wl.id,this.version=wl.version,this.name=wl.name,this.static=wl.static,this.abstract=wl.abstract,this.properties=this.initialData.properties.map(f=>{const h=we(f,this.project);return h.setParent(this,null),h.initChildren(null),h}),this.methods=this.initialData.methods.map(f=>{const h=we(f,this.project);return h.parent=this,h}),this.abstractMethods=this.initialData.abstractMethods.map(f=>{const h=we(f,this.project);return h.parent=this,h}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.imageUri.id);r&&(r._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="string"||!h)return m;if(/\s/.test(h)){const v=new pi({id:f.id+"--container-compute-invalid-image-uri",message:`Image URI "${h}" contains spaces, which is invalid.`,severity:Ee.Error,code:"container-compute-invalid-image-uri",entity:f});m.errors.push(v)}return m});const a=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id);a&&(a._codeNativeValueValidation=(f,h)=>{var w;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<0){const R=new pi({id:f.id+"--container-compute-invalid-min-tasks",message:"Minimum Tasks must be 0 or greater.",severity:Ee.Error,code:"container-compute-invalid-min-tasks",entity:f});m.errors.push(R)}const b=f.parent.properties.find(R=>R.implements.find(O=>O.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id)),A=(w=b==null?void 0:b.getDefaultValue())==null?void 0:w.value;if(typeof A=="number"&&h>A){const R=new pi({id:f.id+"--container-compute-max-less-than-min",message:`Minimum Tasks (${h}) cannot be greater than Maximum Tasks (${A}).`,severity:Ee.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(R)}return m});const c=this.properties.find(f=>f.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id);c&&(c._codeNativeValueValidation=(f,h)=>{var w;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<1){const R=new pi({id:f.id+"--container-compute-invalid-max-tasks",message:"Maximum Tasks must be 1 or greater.",severity:Ee.Error,code:"container-compute-invalid-max-tasks",entity:f});m.errors.push(R)}const b=f.parent.properties.find(R=>R.implements.find(O=>O.id===j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id)),A=(w=b==null?void 0:b.getDefaultValue())==null?void 0:w.value;if(typeof A=="number"&&h<A){const R=new pi({id:f.id+"--container-compute-max-less-than-min",message:`Maximum Tasks (${h}) cannot be less than Minimum Tasks (${A}).`,severity:Ee.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(R)}return m});const e=this.properties.find(f=>{var h;return f.id===((h=j["built-in-base-entity"][be.CONTAINER_COMPUTE_ENTITY].properties.ephemeralStorage)==null?void 0:h.id)});e&&(e._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="number")return m;if(h<20||h>200){const v=new pi({id:f.id+"--container-compute-invalid-ephemeral-storage",message:"Ephemeral Storage must be between 20 and 200 GB.",severity:Ee.Error,code:"container-compute-invalid-ephemeral-storage",entity:f});m.errors.push(v)}return m})}}var cVe=(s=>(s.PathContainsInvalidCharacters="shared-drive-mount-path-invalid-characters",s.PathIsSystemFolder="shared-drive-mount-path-is-system-folder",s.PathInvalidFormat="shared-drive-mount-path-invalid-format",s))(cVe||{});class fVe extends Nl{constructor(i){super(Ys,i);D(this,"initialData");D(this,"id",be.SHARED_DRIVE_MOUNT_ENTITY);D(this,"version","1");D(this,"name",be.SHARED_DRIVE_MOUNT_ENTITY);D(this,"description",Ys.description);D(this,"type",d.BuiltInBaseEntity);D(this,"abstract",Ys.abstract);D(this,"static",Ys.static);D(this,"properties",[]);D(this,"methods",[]);D(this,"abstractMethods",[]);D(this,"extends",null);D(this,"errors",[]);D(this,"project");this.initialData=Ys,this.project=i,this.id=Ys.id,this.version=Ys.version,this.name=Ys.name,this.static=Ys.static,this.abstract=Ys.abstract,this.properties=this.initialData.properties.map(a=>{const c=we(a,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(a=>{const c=we(a,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=we(this.initialData.extends,this.project));const r=this.properties.find(a=>a.id===j["built-in-base-entity"][be.SHARED_DRIVE_MOUNT_ENTITY].properties.path.id);if(!r)throw new Error("Path property not found in shared drive mount entity");r._codeNativeValueValidation=(a,c)=>{const e=bD(a,c);let f=typeof e.override=="string"?e.override:"";if(f&&!f.startsWith("/")&&(f="/"+f),typeof f=="string"){if(/[^a-zA-Z0-9\-_/]/g.test(f)){const v=new pi({id:a.id+"--shared-drive-mount-path-invalid-characters",message:`Mount path "${f}" contains invalid characters. Only alphanumeric, -, _, and / are allowed.`,severity:Ee.Error,code:"shared-drive-mount-path-invalid-characters",entity:a});e.errors.push(v)}const m=["/bin","/boot","/dev","/etc","/lib","/lib64","/proc","/sys","/usr","/sbin","/run","/var/run"];for(const v of m)if(f===v||f.startsWith(v+"/")){const b=new pi({id:a.id+"--shared-drive-mount-path-is-system-folder",message:`Mounting to or within critical system folder "${v}" is not allowed.`,severity:Ee.Error,code:"shared-drive-mount-path-is-system-folder",entity:a});e.errors.push(b);break}}return e.override=f,e}}}class yVe extends wr{constructor(i){super(Wa,i);D(this,"id",Wa.id);D(this,"name",Wa.name);D(this,"description",Wa.description);D(this,"version",Wa.version);D(this,"autoexecutable",!1);D(this,"type",d.ActionDescriptor);D(this,"inputs",[]);D(this,"dataType",null);D(this,"error",null);D(this,"project");this.project=i,this.inputs=Wa.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.dataType=we(Wa.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=Wa.error?we(Wa.error,this.project):null}}var tl=(s=>(s.UUIDMustBeString="uuid-must-be-string",s.UUIDMustBeValidFormat="uuid-must-be-valid-format",s.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",s))(tl||{});function o1i(s,u){const i=[];if(typeof u!="string"){const a=new pi({id:s.id+"--uuid-must-be-string",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be text.`,severity:Ee.Error,code:"uuid-must-be-string",entity:s});return i.push(a),{errors:i,override:u}}const r=bD(s,u);if(r.errors.length>0)return i.push(...r.errors),{errors:i,override:u};if(!U$(u)){const a=new pi({id:s.id+"--uuid-must-be-valid-format",message:`Entity of type ${s.type} with id "${s.id}" has an invalid value "${u}". The value must be a valid UUID format. Eg: "123e4567-e89b-12d3-a456-426614174000".`,severity:Ee.Error,code:"uuid-must-be-valid-format",entity:s});i.push(a)}return{errors:i,override:u}}var Ke=(s=>(s.Inherited="inherited",s.DefaultValue="default-value",s.Missing="missing",s.Undefined="undefined",s.Empty="empty",s.AutoCalculated="auto-calculated",s.QueuedAutocalculation="queued-autocalculation",s.External="external",s.Testing="testing",s.ExecutionResult="execution-result",s))(Ke||{});const hVe={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function Bv(s,u){return{...hVe,id:s,project:u}}class Mv{constructor(u,i){D(this,"initialized",!1);D(this,"id");D(this,"project");D(this,"values",{});D(this,"onWriteCallback",()=>{});D(this,"onRemoveCallback",()=>{});this.id=u,this.project=i,this.init()}onWrite(u){this.onWriteCallback=u}onRemove(u){this.onRemoveCallback=u}init(){var r;if(!((r=this.project)!=null&&r.id)||this.initialized)return;const u={},i={};Object.keys(u).forEach(a=>{const c=u[a],e=new Xr(c,this.project);try{if(c.parent){const m=this.project.findSubscribedInstanceFromReference(c.parent);if(!m)return;e.setParent(m,null),e.hydrateAncestors(),e.initChildren(null)}else if(c.standaloneParent){const m=this.project.findSubscribedInstanceFromReference(c.standaloneParent);if(!m)return;e.standalone=!0,e.setStandaloneParent(m,null),e.hydrateAncestors(),e.initChildren(null)}i[a]=e;const f=e.parent||e.standaloneParent,h=VVe(e,f,this.project);h?i[a]=h:delete u[a]}catch(f){X.Logger.error("Error hydrating ancestors: ",f),delete u[a]}}),this.values={...this.values,...i},this.initialized=!0}toJSON(){const u={};return Object.keys(this.values).forEach(i=>{u[i]=this.values[i].toJSON()}),u}writeValue(u,i){if(!u)throw new Error("The value owner entity is required when writing a value to a value store");let a=this.values[u.id];if(!a)if(i instanceof Xr)a=i;else if(i)a=Lr(i,this.project);else{const c={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:new Date().toISOString(),author:L.sessionAuthor,deleted:!1,previousVersion:null,value:null,deletable:!0,editable:!0,type:d.LiteralValue,standaloneParent:u.toReference(),parent:null,valueAsTypeSingle:null,valueAsTypeList:null,autogeneration:null,name:Wu(u.getDataType(null))};a=Lr(c,this.project)}a.standalone=!0,a.initialData.standaloneParent||X.Logger.warn("instance.initialData: ",a.initialData),a.setStandaloneParent(u,null),a.hydrateAncestors(),a.initChildren(null),i&&(a.metaSync({...i},null),a.setValueAsType(i.valueAsType,null)),this.values[u.id]=a,this.onWriteCallback(u,a)}readValue(u){return this.values[u]||null}removeValue(u){if(!this.values[u])return;delete this.values[u];const i=this.project.get(u);i&&this.onRemoveCallback(i)}clear(){this.values={}}}function sn(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Q$(s){if(Array.isArray(s))return s.map(h=>typeof h=="number"?h:e(h)?Number(h):String(h));const u=[];let i=0,r="",a=!1,c=null;for(;i<s.length;){const h=s[i];if(h==="."&&!a){r.length&&(u.push(f(r)),r=""),i++;continue}if(h==="["&&!a){r.length&&(u.push(f(r)),r=""),a=!0,i++;continue}if(a){if(!c&&(h==='"'||h==="'")){c=h,i++;continue}if(c){if(h==="\\"&&i+1<s.length){r+=s[i+1],i+=2;continue}if(h===c){c=null,i++;continue}r+=h,i++;continue}if(h==="]"){u.push(f(r)),r="",a=!1,i++;continue}if(/\s/.test(h)&&!c){i++;continue}r+=h,i++;continue}r+=h,i++}return r.length&&u.push(f(r)),u;function e(h){return/^[0-9]+$/.test(h)}function f(h){const m=h.trim();return e(m)?Number(m):m}}function AD(s,u,i){if(s==null)return i;const r=Q$(u);let a=s;for(let c=0;c<r.length;c++){const e=r[c];if(a==null)return i;if(Array.isArray(a)&&typeof e=="number"){if(!(e in a))return i;a=a[e]}else{if(!Object.prototype.hasOwnProperty.call(a,e))return i;a=a[e]}}return a}const d1i=new Set(["__proto__","prototype","constructor"]);function mVe(s){return typeof s=="string"&&d1i.has(s)}function u1i(s,u,i,r){const{createMissing:a=!0,coerce:c=!0}=r??{};if(s==null||typeof s!="object")throw new TypeError("set(...) expects a non-null object as target.");const e=Q$(u);if(e.length===0)throw new Error("set(...) path must not be empty.");let f=s;for(let h=0;h<e.length;h++){const m=e[h];if(mVe(m))throw new Error(`Refusing to set unsafe key "${String(m)}" on object.`);const v=h===e.length-1,A=typeof e[h+1]=="number",w=Array.isArray(f)&&typeof m=="number";if(v){if(w&&f[m]==null&&!a)throw new Error(`set(...) missing array index "${String(m)}" (createMissing=false).`);return f[m]=i,s}else{if(!Object.prototype.hasOwnProperty.call(f,m)||f[m]==null){if(!a)throw new Error(`set(...) missing parent at segment "${String(m)}" (createMissing=false).`);f[m]=A?[]:{}}else{const R=f[m],O=R!==null&&typeof R=="object",$=Array.isArray(R);if(A){if(!$){if(!c)throw new Error(`set(...) expected an array at "${String(m)}" but found non-array (coerce=false).`);f[m]=[]}}else if(!O||$){if(!c)throw new Error(`set(...) expected an object at "${String(m)}" but found non-object (coerce=false).`);f[m]={}}}f=f[m]}}return s}function X$(s,u,i,r){const a=Q$(u);if(a.length===0)return s;function c(e,f){const h=a[f],m=f===a.length-1;if(r==="strict-set"||r==="strict-delete"){if(mVe(h))throw new Error(`Unsafe key "${String(h)}"`);if(e==null||typeof e!="object"&&!Array.isArray(e))throw new Error(`Missing parent or invalid container at segment "${String(h)}".`);if(r==="strict-delete"&&m&&!(h in e))return e}let v;if(Array.isArray(e))v=[...e];else if(e&&typeof e=="object")v={...e};else if(r==="safe-set")v=typeof h=="number"?[]:{};else throw new Error(`Cannot traverse path at "${String(h)}"`);if(m)return r==="strict-delete"?delete v[h]:v[h]=i,v;const b=e?e[h]:void 0;if(r==="safe-set"&&b==null){const A=typeof a[f+1]=="number",w=c(A?[]:{},f+1);return v[h]=w,v}return v[h]=c(b,f+1),v}if(s==null&&r==="safe-set"){const e=typeof a[0]=="number";return c(e?[]:{},0)}return c(s,0)}const Oj=Symbol("missing"),p1i=s=>s!=null&&typeof s=="object";function gD(s,u){if(typeof s!="string")throw new TypeError(`${u} expects the key to be a string.`);return s}function _0(s,u){if(typeof s!="string"&&!Array.isArray(s))throw new TypeError(`${u} expects the path to be string or array.`);return s}function Qy(s,u){if(!sn(s))throw new TypeError(`${u} expects the first argument to be an object.`);return s??{}}function TVe(s,u){const i=gD(u,"ReadKey");return(s??{})[i]}function vVe(s,u,i){const r=gD(u,"WriteKey");if(s&&typeof s=="object"){const a=Array.isArray(s)?[...s]:{...s};return a[r]=i,a}return{[r]:i}}function EVe(s,u){if(!s||typeof s!="object")return{};const i=String(u),{[i]:r,...a}=s;return a}function bVe(s,u,i){const r=Qy(s,"ReadNestedKey"),a=_0(u,"ReadNestedKey");return AD(r,a,i)}function AVe(s,u,i){const r=Qy(s,"WriteNestedKey"),a=_0(u,"WriteNestedKey");return X$(r,a,i,"strict-set")}function gVe(s,u,i){const r=Qy(s,"WriteSafeNestedKeyRecursively"),a=_0(u,"WriteSafeNestedKeyRecursively");return X$(r,a,i,"safe-set")}function IVe(s,u){const i=Qy(s,"DeleteNestedKey"),r=_0(u,"DeleteNestedKey");return X$(i,r,null,"strict-delete")}function RVe(s,u){const i=gD(u,"HasKey"),r=s;return r!=null&&p1i(r)&&Object.prototype.hasOwnProperty.call(r,i)}function DVe(s,u,i){const r=gD(u,"KeyValueEquals");return s==null||typeof s!="object"?!1:s[r]===i}function wVe(s,u){const i=s,r=_0(u,"HasNestedKey");return AD(i,r,Oj)!==Oj}function CVe(s,u,i){const r=_0(u,"NestedKeyValueEquals");return AD(s,r)===i}function OVe(...s){const u={};for(let i=0;i<s.length;i++){const r=s[i];if(r!=null){if(!sn(r))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,r)}}return u}function _Ve(s){const u=Qy(s,"ObjectKeys");return Object.keys(u)}function PVe(s){const u=Qy(s,"ObjectValues");return Object.values(u)}function NVe(s){const u=Qy(s,"ObjectEntries");return Object.entries(u)}const om=new Set;function c1i(s){return{execution:null,project:s,localTestValues:Bv("local-test-values",s),resolvedValues:Bv("resolved-values",s),persistedExecutionResults:Bv("persisted-execution-results",s),lastExecutionResults:Bv("last-execution-results",s),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function P0(s,u,i,r){var f;let a;if(((f=s==null?void 0:s.entity)==null?void 0:f.type)===d.PrimitiveEntity)switch(s.entity.name){case he.EntityTemplate:a=he.EntityTemplate;break;case he.String:a=he.String;break;case he.Number:a=he.Number;break;case he.Boolean:a=he.Boolean;break;case he.Null:a=he.Null;break;case he.Enum:a=he.Enum;break;case he.KeyValue:a=he.KeyValue;break;case he.Untyped:a=he.Untyped;break;case he.KeyValue:a=he.KeyValue;break;case he.Date:a=he.Date;break;case he.UUID:a=he.UUID;break;case he.File:a=he.File;break;case he.Void:a=he.Void;break;case he.ActionDescriptor:a=he.ActionDescriptor;break;case he.Bytes:a=he.Bytes;break;case he.SqlProgram:a=he.SqlProgram;break;default:throw new Error(`Primitive type ${fi(s.entity,i)} is not supported`)}else a=he.Untyped;const c=Xr.new(r);c.name=a,c.parent=u.toReference();const e=we(c,i);return e.hydrateAncestors(),r==null||r.add(e,z.Added),e.addSelfToProject(r),e.initChildren(r),e}function Xd(s,u,i=new Set){var r,a,c,e;if(i.has(s.id))return[];if(i.add(s.id),mi.includes(s.type)){const f=zr(s);return P([f,...[f].flatMap(h=>Xd(h,u,i))])}else if(s.type===d.OutputMap){if(mi.includes(s.parent.type)&&((r=s.declaration)==null?void 0:r.type)===d.Property&&s.declaration.static)return P([s,s.declaration,...[s,s.declaration].flatMap(f=>Xd(f,u,i))])}else if(s.type===d.InputMap){if(mi.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&((c=s.declaration)!=null&&c.static))return P([s.declaration,...[s.declaration].flatMap(f=>Xd(f,u,i))])}else if(s.type===d.ValueDescriptor&&((e=s.parent)==null?void 0:e.type)===d.Search){const f=s.parent.inputs.find(h=>{var m;return((m=h.declaration)==null?void 0:m.id)===s.id});if(f)return[f]}return[s]}function VVe(s,u,i){return s}function N0(s,u,i=!1){const r=s.readsValue;let a=null;const c=Xu(r,u,i);if(c){const e={sources:[c],target:s};a={value:c.value,valueOwner:s,type:Ke.Inherited,inheritanceLink:e}}else a={value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null};return a}function Bi(s,u,i){var f;if(!u)return null;let r;if(((f=s==null?void 0:s.entity)==null?void 0:f.type)===d.PrimitiveEntity)switch(s.entity.name){case he.EntityTemplate:r=he.EntityTemplate;break;case he.String:r=he.String;break;case he.Number:r=he.Number;break;case he.Boolean:r=he.Boolean;break;case he.Null:r=he.Null;break;case he.Enum:r=he.Enum;break;case he.KeyValue:r=he.KeyValue;break;case he.Untyped:r=he.Untyped;break;case he.KeyValue:r=he.KeyValue;break;case he.Date:r=he.Date;break;case he.UUID:r=he.UUID;break;case he.File:r=he.File;break;case he.Void:r=he.Void;break;case he.ActionDescriptor:r=he.ActionDescriptor;break;case he.Bytes:r=he.Bytes;break;case he.SqlProgram:r=he.SqlProgram;break;default:throw new Error(`Primitive type ${fi(s.entity,i)} is not supported`)}else r=he.Untyped;if(!i.get(u.id))return null;const c=Xr.new(null);c.name=r,c.standaloneParent=u.toReference();let e=new Xr(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function xVe(s,u,i=!1){var c,e;if(u.execution&&u.execution.hasEntity(s)&&!i){const f=(c=u.lastExecutionResults)==null?void 0:c.readValue(s.id);if(f)return{value:f,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=(e=u.localTestValues)==null?void 0:e.readValue(s.id),a=u.getValueTypePreference(s.id);return r&&!i&&(a===null||a!==Ke.DefaultValue)?{value:r,valueOwner:s,type:Ke.Testing,inheritanceLink:null}:{value:null,valueOwner:s,type:Ke.QueuedAutocalculation,inheritanceLink:null}}function hI(s,u,i,r=!1){var e,f;const a={...s},c=u.type===d.VariableDeclaration?u.inputs:Jt.includes(u.type)?u.outputs:[];if(!c||c.length===0)return a;for(const h of c){if(!Dy(h))continue;const m=dE(h,i,r);if(m&&m.value)try{const v=ye(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||$r(v);a[b]=ua((m==null?void 0:m.value)||null)?a[b]:(f=m==null?void 0:m.value)==null?void 0:f.value}catch{}}return a}function Gv(s,u,i,r=!1){var e,f;const a={...s},c=u.inputs;if(!c)return a;for(const h of c){if(!Dy(h))continue;const m=Pb(h,i,r);if(m&&m.value&&m.type!==Ke.Undefined){const v=fi(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||$r(v);a[b]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return a}function $Ve(s,u,i=!1){var v,b,A,w,R,O,$,G;let r={};if(((b=(v=s.getDataType(null))==null?void 0:v.entity)==null?void 0:b.type)===d.DefinitionEntity&&(r={...r,...((A=s.getDataType(null))==null?void 0:A.entity).getActiveRawDefaultValue()}),u.execution&&u.execution.hasEntity(s)&&!i){const x=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(x){if(sn(x.value)){const W={...r,...x.value},te={...Gv(W,s,u,i)};x.metaSync({value:te},null)}return{value:x,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}}const a=!!((R=u.execution)!=null&&R.entities.length),c=(O=u.execution)==null?void 0:O.hasEntity(s),e=s.readsValue;let f=null;if(e){const x=($=u.execution)==null?void 0:$.hasEntity(e);if((!a||a&&x&&c||a&&!x&&!c)&&(f=N0(s,u,i),f&&f.value&&sn(f.value.value))){const W={...r,...f.value.value},te={...Gv(W,s,u,i)};f.value.metaSync({value:te},null)}}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const x=h;if(x&&x.value===null&&x.autogeneration){const k=Aw(x);if(x.metaSync({value:k},null),sn(k)){const W={...Gv(k,s,u,i)};x.metaSync({value:W},null)}}(i||m===null||m!==Ke.Testing)&&(f={value:x,valueOwner:s,type:ua(x)?s.readsValue?Ke.Inherited:Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const x=(G=u.localTestValues)==null?void 0:G.readValue(s.id);if(x){if(sn(x.value)){const k={...r,...x.value},W={...Gv(k,s,u,i)};x.metaSync({value:W},null)}return{value:x,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}}return ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function eL(s,u,i=!1){var f,h,m,v,b,A,w,R,O,$,G,x,k,W,te,ee,Q;let r={};if(((h=(f=s.getDataType(null))==null?void 0:f.entity)==null?void 0:h.type)===d.DefinitionEntity?r={...r,...((m=s.getDataType(null))==null?void 0:m.entity).getActiveRawDefaultValue()}:((b=(v=s.getDataType(null))==null?void 0:v.entity)==null?void 0:b.type)===d.BuiltInBaseEntity&&(r={...r,...((A=s.getDataType(null))==null?void 0:A.entity).getRawDefaultValue()}),u.execution&&u.execution.hasEntity(s)&&!i){const ne=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(ne){if(sn(ne.value)){const J={...r,...ne.value},ie=hI(J,s,u,i);ne==null||ne.metaSync({value:ie},null)}return{value:ne,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}}const a=(R=u.localTestValues)==null?void 0:R.readValue(s.id);let c=!1;if(s.type===d.VariableDeclaration){const ne=s,de=!!((O=u.execution)!=null&&O.entities.length),J=($=u.execution)==null?void 0:$.hasEntity(s),ie=ne.readsValue;if(ie){const se=(G=u.execution)==null?void 0:G.hasEntity(ie);c=!de||de&&se&&J||de&&!se&&!J}}const e=u.getValueTypePreference(s.id);if(a&&!i&&(!c||e===Ke.Testing)){if(sn(a.value)){const de={...r,...a.value},J=hI(de,s,u,i);a.metaSync({value:J},null)}return{value:a,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}if((x=s.getDataType(null))!=null&&x.entity&&(((W=(k=s.getDataType(null))==null?void 0:k.entity)==null?void 0:W.type)===d.DefinitionEntity||((ee=(te=s.getDataType(null))==null?void 0:te.entity)==null?void 0:ee.type)===d.BuiltInBaseEntity)&&((Q=s.getDataType(null))!=null&&Q.isObject())){const ne=Bi(s.dataType,s,u.project),de=hI(r,s,u,i);return ne==null||ne.metaSync({value:de},null),{value:ne,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null}}return null}function ID(s,u,i=!1){var v,b,A,w,R;if((v=s.dataType)!=null&&v.isObject())return $Ve(s,u,i);const r=Mt(s),a=!!((b=u.execution)!=null&&b.entities.length),c=(A=u.execution)==null?void 0:A.hasEntity(r),e=s.readsValue;let f=null;if(e){const O=(w=u.execution)==null?void 0:w.hasEntity(e);(!a||a&&O&&c||a&&!O&&!c)&&(f=N0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const O=h;if(O&&O.value===null&&O.autogeneration){const $=Aw(O);O.metaSync({value:$},null)}(i||m===null||m!==Ke.Testing)&&(f={value:O,valueOwner:s,type:ua(O)?s.readsValue?Ke.Inherited:Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const O=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(O)return{value:O,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}return ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function tL(s,u,i=!1){var a,c;if(u.execution&&u.execution.hasEntity(s)&&!i){const e=(a=u.lastExecutionResults)==null?void 0:a.readValue(s.id);if(e)return{value:e,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return(c=s.dataType)!=null&&c.isObject()||s.outputs.length?eL(s,u,i):ID(s,u,i)}function LVe(s,u,i=!1){var A,w,R,O;const r=!!((A=u.execution)!=null&&A.entities.length),a=(w=u.execution)==null?void 0:w.hasEntity(s);let c=null;const e=s.readsValue;if(e){const $=(R=u.execution)==null?void 0:R.hasEntity(e);(!r||r&&$&&a||r&&!$&&!a)&&(c=N0(s,u,i))}const f=s.declaration;if(!c&&f){const $=ID(f,u,i);$&&$.value&&(c=$)}const h=u.getValueTypePreference(s.id);if(!c||(c.type===Ke.DefaultValue||c.type===Ke.External)&&!i||h===Ke.Testing){const $=(O=u.localTestValues)==null?void 0:O.readValue(s.id);if($)return{value:$,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const m=pp(s),v=s.getDataType(null);return m&&a&&(!(c!=null&&c.value)||!_s(v)&&eu(c==null?void 0:c.value))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:a&&!m&&ua((c==null?void 0:c.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:c||{value:null,valueOwner:s,type:Ke.External,inheritanceLink:null}}function BVe(s,u,i=!1){return tL(s.declaration,u,i)}function MVe(s,u,i=!1){var w,R,O,$;if(!i&&u.execution&&u.execution.hasEntity(s)){const G=(w=u.lastExecutionResults)==null?void 0:w.readValue(s.id);if(G)return{value:G,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const G=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(G&&!i&&(a===null||a!==Ke.DefaultValue))return{value:G,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=Mt(s),e=s.parent.type===d.FunctionDeclaration&&s.parent.parent.type===d.Loop?s.parent:null,f=!!((O=u.execution)!=null&&O.hasEntity(c))||!!e&&!!(($=u.execution)!=null&&$.hasEntity(e));let h=null;const m=s.defaultValue;if(m){const G=m||null;if(G&&G.value===null&&G.autogeneration){const x=Aw(G);G.metaSync({value:x},null)}(i||a===null||a!==Ke.Testing)&&(h={value:G,valueOwner:s,type:ua(G)?Ke.Empty:Ke.DefaultValue,inheritanceLink:null})}!h||(h.type===Ke.DefaultValue||h.type===Ke.External)&&!i||Ke.Testing;const v=pp(s),b=s.getDataType(null);let A=v&&f&&(!(h!=null&&h.value)||!_s(b)&&eu(h==null?void 0:h.value));return c.type===d.Loop&&f&&(A=!1),A?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:f&&!v&&ua((h==null?void 0:h.value)||null)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:h||{value:null,valueOwner:s,type:Ke.External,inheritanceLink:null}}function iL(s,u,i=!1){var w,R,O,$,G,x;if((w=s.getDataType(null))!=null&&w.isObject()||s.outputs.length)return eL(s,u);if(u.execution&&u.execution.hasEntity(s)&&!i){const k=(R=u.lastExecutionResults)==null?void 0:R.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=Mt(s),a=!!((O=u.execution)!=null&&O.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null;if(e){const k=(G=u.execution)==null?void 0:G.hasEntity(e);(!a||a&&k&&c||a&&!k&&!c)&&(f=N0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const k=h;(i||m===null||m!==Ke.Testing)&&(f={value:k,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ke.DefaultValue||f.type===Ke.External)&&!i||m===Ke.Testing){const k=(x=u.localTestValues)==null?void 0:x.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const v=pp(s),b=s.getDataType(null);return v&&(!(f!=null&&f.value)||!_s(b)&&eu(f==null?void 0:f.value))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:!s.defaultValue&&!s.readsValue?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}:!v&&ua((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function GVe(s,u,i=!1){var e,f,h,m,v,b,A,w;if(u.execution&&u.execution.hasEntity(s)&&!i){const R=(e=u.lastExecutionResults)==null?void 0:e.readValue(s.id);if(R)return{value:R,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=$c(s);if(ip.includes(r.type)){const R=Xu(r,u,i),O=s.codeName||((f=s.declaration)==null?void 0:f.codeName)||$r(fi(s,u.project));if(R!=null&&R.value&&s.parentRelationType!==Cl.Error){const $=(R.value.value||{})[O];if($===void 0)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};const G=Bi(s.getDataType(null),s,u.project);return G==null||G.metaSync({value:$,rawString:typeof $=="string"&&typeof((h=R==null?void 0:R.value)==null?void 0:h.rawString)=="string"?(m=R==null?void 0:R.value)==null?void 0:m.rawString:void 0},null),{value:G,valueOwner:s,type:!mi.includes(r.type)&&R.type===Ke.Empty?Ke.QueuedAutocalculation:R.type,inheritanceLink:{sources:[R],target:s}}}return{value:null,valueOwner:s,type:mi.includes(r.type)?Ke.Empty:Ke.QueuedAutocalculation,inheritanceLink:null}}const a=(v=u.execution)==null?void 0:v.hasEntity(r),c=((b=u.execution)==null?void 0:b.state)===EL.Running;if((A=u.persistedExecutionResults)!=null&&A.values[s.id]&&!a&&!c&&!i){const R=(w=u.persistedExecutionResults)==null?void 0:w.readValue(s.id);if((R==null?void 0:R.value)!==null||(R==null?void 0:R.valueAsType)!==null)return{value:R,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return null}function LP(s,u,i=!1){var b,A,w,R,O;if(![...Jt,...mi].includes(s.parent.type)||!Dy(s))return null;if(((b=s.declaration)==null?void 0:b.type)===d.Property&&s.declaration.static)return Xu(s.declaration,u);const r=Pb(s,u,i);if(r&&r.type!==Ke.Empty&&r.type!==Ke.Missing&&r.type!==Ke.Undefined)return r;const a=zr(s.parent),c=Fo(a,u,i),e=s.codeName||((A=s.declaration)==null?void 0:A.codeName)||$r(fi(s,u.project)),f=Bi(s.getDataType(null),s,u.project),h=pp(s),m=(w=c==null?void 0:c.value)==null?void 0:w.value;if(m){let $=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:c?[c]:[],target:s}};f==null||f.metaSync({value:$,rawString:typeof $=="string"&&typeof((R=c==null?void 0:c.value)==null?void 0:R.rawString)=="string"?(O=c==null?void 0:c.value)==null?void 0:O.rawString:void 0},null);const G=pp(s),x=s.getDataType(null);return G&&(!f||!_s(x)&&eu(f))?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:{value:f,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}}return c!=null&&c.type&&c.type!==Ke.Missing&&c.type!==Ke.Empty&&c.type!==Ke.Undefined?{value:null,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}:h?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:{value:null,valueOwner:s,type:s.readsValue?Ke.Inherited:Ke.Empty,inheritanceLink:null}}function BP(s,u,i=!1){var m,v,b,A,w,R,O,$,G,x,k;if(![...Jt,...mi].includes(s.parent.type)||!Dy(s))return null;if(((m=s.declaration)==null?void 0:m.type)===d.Property&&s.declaration.static)return Xu(s.declaration,u,i);const r=Jt.includes(s.parent.type)?s.parent:zr(s.parent),a=Xu(r,u,i);let c=dE(s,u,i);if((c==null?void 0:c.type)===Ke.Undefined||(c==null?void 0:c.type)===Ke.Missing){const W=zr(s.parent);let te=s;W.type===d.VariableDeclaration&&(te=(s.parent===W?s:W.inputs.find(Q=>{var ne,de;return((ne=Q.declaration)==null?void 0:ne.id)===((de=s.declaration)==null?void 0:de.id)}))||s,c=dE(te,u,i))}const e=s.codeName||((v=s.declaration)==null?void 0:v.codeName)||$r(fi(s,u.project));let f=s.defaultValue||Bi(s.getDataType(null),s,u.project);const h=(b=a==null?void 0:a.value)==null?void 0:b.value;if(((a==null?void 0:a.type)===Ke.ExecutionResult||(a==null?void 0:a.type)===Ke.Testing)&&!i&&h){let W=(h||{})[e];if(h[e]===void 0&&!s.readsValue&&!s.defaultValue)return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}};f!=null&&f.parent&&!f.standaloneParent&&(f=f.clone(null,null,null,!1),f.setStandaloneParent(s,null));let te=W;return s.defaultValue&&(te=s.defaultValue.value),f==null||f.metaSync({value:te,rawString:typeof W=="string"&&typeof((A=a==null?void 0:a.value)==null?void 0:A.rawString)=="string"?(w=a==null?void 0:a.value)==null?void 0:w.rawString:void 0},null),{value:f,valueOwner:s,type:a.type,inheritanceLink:{sources:a?[a]:[],target:s}}}if(c&&c.type!==Ke.Empty&&c.type!==Ke.Missing&&c.type!==Ke.Undefined)return c;if(h){let W=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:W,rawString:typeof W=="string"&&typeof((R=a==null?void 0:a.value)==null?void 0:R.rawString)=="string"?(O=a==null?void 0:a.value)==null?void 0:O.rawString:void 0},null));const te=pp(s),ee=s.getDataType(null),Q=te&&(!f||!_s(ee)&&eu(f)),ne=!!(($=u.execution)!=null&&$.entities.length),de=(G=u.execution)==null?void 0:G.hasEntity(r),J=r.readsValue;if(J){const ie=(x=u.execution)==null?void 0:x.hasEntity(J);if(Q&&(!ne||ne&&ie&&de||ne&&!ie&&!de))return{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}}if(s.readsValue){const ie=(k=u.execution)==null?void 0:k.hasEntity(s.readsValue);if(Q&&(!ne||ne&&ie&&de||ne&&!ie&&!de))return{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}}return Q?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:h[e]===void 0&&!s.readsValue&&!s.defaultValue?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}}:{value:f,valueOwner:s,type:ua(f)&&!s.readsValue?Ke.Empty:Ke.Inherited,inheritanceLink:null}}return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}}function Pb(s,u,i=!1){var O,$,G,x,k;const r=Mt(s),a=!!((O=u.execution)!=null&&O.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null,h=!1;if(e){const W=(G=u.execution)==null?void 0:G.hasEntity(e);h=!a||a&&W&&c||a&&!W&&!c,h&&(f=N0(s,u,i))}const m=!!e&&h,v=s.defaultValue,b=u.getValueTypePreference(s.id);if(!f&&v&&(i||b===null||b!==Ke.Testing)&&(f={value:v,valueOwner:s,type:eu(v)?Ke.Empty:Ke.DefaultValue,inheritanceLink:null}),(!f||f.type===Ke.DefaultValue||(f==null?void 0:f.type)===Ke.Empty||b===Ke.Testing)&&!m){const W=(x=u.persistedExecutionResults)==null?void 0:x.readValue(s.id);if(W&&!i)return{value:W,valueOwner:s,type:Ke.Testing,inheritanceLink:null};const te=(k=u.localTestValues)==null?void 0:k.readValue(s.id);if(te&&!i&&(b===null||b===Ke.Testing))return{value:te,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}if(v&&!eu(v))return{value:v,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null};const A=pp(s),w=s.getDataType(null),R=A&&(!(f!=null&&f.value)||!_s(w)&&eu(f==null?void 0:f.value));return m&&R?{value:null,valueOwner:s,type:Ke.Inherited,inheritanceLink:null}:R?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!s.defaultValue&&!m?{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null}:!A&&(!f||f.type===Ke.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:s,type:m?Ke.Inherited:Ke.Empty,inheritanceLink:null}:f}function dE(s,u,i=!1){var a;if(u.execution&&u.execution.hasEntity(s)&&!i){const c=(a=u.lastExecutionResults)==null?void 0:a.readValue(s.id);if(c)return{value:c,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}return Pb(s,u,i)}function kVe(s,u,i=!1){var r,a;return mi.includes(s.parent.type)&&(r=zr(s.parent).dataType)!=null&&r.isObject()||Jt.includes(s.parent.type)&&(a=s.parent.getDataType(null))!=null&&a.isObject()?LP(s,u,i):Pb(s,u,i)}function rL(s,u,i=!1){var r,a;if(mi.includes(s.parent.type)){const c=zr(s.parent);if((r=c.dataType)!=null&&r.isObject()||c.inputs.length)return BP(s,u,i)}return Jt.includes(s.parent.type)&&((a=s.parent.getDataType(null))!=null&&a.isObject()||s.parent.outputs.length)?BP(s,u,i):dE(s,u,i)}function UVe(s,u,i=!1){var v,b;if(u.execution){const A=(v=u.lastExecutionResults)==null?void 0:v.readValue(s.id);if(A&&!i)return{value:A,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const A=(b=u.localTestValues)==null?void 0:b.readValue(s.id);if(A&&!i&&(a===null||a!==Ke.DefaultValue))return{value:A,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;c&&(i||a===null||a!==Ke.Testing)&&(e={value:c,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null});const f=pp(s),h=s.getDataType(null);return f&&(!(e!=null&&e.value)||!_s(h)&&eu(e==null?void 0:e.value))&&s.static?{value:null,valueOwner:s,type:Ke.Missing,inheritanceLink:null}:ua(e==null?void 0:e.value)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:e}function jVe(s,u,i=!1){var f,h,m;if(u.execution&&u.execution.hasEntity(s)&&!i){const v=(f=u.lastExecutionResults)==null?void 0:f.readValue(s.id);if(v)return{value:v,valueOwner:s,type:Ke.ExecutionResult,inheritanceLink:null}}const r=!u.execution||!u.execution.parentExecution,a=u.getValueTypePreference(s.id);if(r){const v=(h=u.localTestValues)==null?void 0:h.readValue(s.id);if(v&&!i&&(a===null||a!==Ke.DefaultValue))return{value:v,valueOwner:s,type:Ke.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;if(c&&(i||a===null||a!==Ke.Testing)&&(e={value:c,valueOwner:s,type:Ke.DefaultValue,inheritanceLink:null}),((m=s.parent)==null?void 0:m.type)===d.Search){const v=s.parent.inputs.find(b=>{var A;return((A=b.declaration)==null?void 0:A.id)===s.id});if(v)return rL(v,u,i)}return ua((e==null?void 0:e.value)||null)?{value:null,valueOwner:s,type:Ke.Empty,inheritanceLink:null}:e}function Xu(s,u,i=!1){if(om.has(s.id))return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};om.add(s.id);try{switch(s.type){case d.ArgumentDeclaration:return MVe(s,u,i);case d.InputMap:return rL(s,u,i);case d.VariableDeclaration:return tL(s,u,i);case d.VariableInstance:return BVe(s,u,i);case d.OutputMap:return GVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return iL(s,u,i);case d.Property:return UVe(s,u,i);case d.ValueDescriptor:return jVe(s,u,i);case d.Operation:case d.Loop:case d.FunctionCall:case d.InternalCall:case d.Search:return xVe(s,u,i);default:return null}}finally{om.delete(s.id)}}function Fo(s,u,i=!1){if(om.has(s.id))return{value:null,valueOwner:s,type:Ke.Undefined,inheritanceLink:null};om.add(s.id);try{switch(s.type){case d.InputMap:return kVe(s,u,i);case d.VariableDeclaration:return ID(s,u,i);case d.VariableInstance:return LVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return iL(s,u,i);default:return null}}finally{om.delete(s.id)}}function f1i(s){var u,i,r,a,c;if(s&&s.type===Ke.DefaultValue&&s.value&&s.valueOwner&&(!yR.includes(s.valueOwner.type)||((u=s.valueOwner.defaultValue)==null?void 0:u.id)===s.value.id)){const e=Bi(s.valueOwner.getDataType(null),s.valueOwner,s.valueOwner.project);return e==null||e.metaSync({value:(i=s.value)==null?void 0:i.value,rawString:typeof((r=s.value)==null?void 0:r.value)=="string"&&typeof((a=s.value)==null?void 0:a.rawString)=="string"?(c=s.value)==null?void 0:c.rawString:void 0},null),{type:Ke.DefaultValue,value:e,valueOwner:s.valueOwner,inheritanceLink:null}}return s}function y1i(s,u,i,r){var w,R,O,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=zr(s.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=a?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!a&&m&&m.id===((w=f.defaultValue)==null?void 0:w.id)&&(m=Bi(f.getDataType(null),f,u)):a?m=P0(f.getDataType(null),f,u,c):m=Bi(f.getDataType(null),f,u);const v=fi(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||$r(v);let A={};if((($=(O=f.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),sn(m==null?void 0:m.value)&&(A={...A,...m.value}),A[b]=i,m==null||m.metaSync({value:A},c),a||e==null||e.writeValue(f,m),(i===""||i===null||i===void 0)&&s.type===d.OutputMap){const G=f.inputs.find(x=>{var k,W;return((k=x.declaration)==null?void 0:k.id)===((W=s.declaration)==null?void 0:W.id)||fi(x,u)===v});if(G){let x=a?G.defaultValue:e==null?void 0:e.readValue(G.id);x&&x.metaSync({value:null},c),a||e==null||e.removeValue(G.id)}}return c}function h1i(s,u,i){const r=Xd(s,u);let a=!1,c=null,e=null;return i instanceof Z?(a=!0,c=i,e=null):(c=null,e=i),r.forEach(f=>{var m;let h=a?((m=f.getDefaultValue)==null?void 0:m.call(f))||null:e==null?void 0:e.readValue(f.id);a?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id)}),c}function m1i(s,u,i,r,a,c){const e=Xd(u,i);let f=!1,h=null,m=null;return r instanceof Z?(f=!0,h=r,m=null):(h=null,m=r),i.diggestedBuiltInBaseEntitiesIds.has(u.id)||e.forEach(v=>{var w,R,O,$;if(i.diggestedBuiltInBaseEntitiesIds.has(v.id))return;let b=null;if(f){const G=((w=v.getDefaultValue)==null?void 0:w.call(v))||null;G&&(i.diggestedBuiltInBaseEntitiesIds.has(G.id)||((R=G.parent)==null?void 0:R.id)!==v.id?b=G.clone(h,v):b=G)}else b=m==null?void 0:m.readValue(v.id);b?!f&&b&&b.id===(($=(O=v.getDefaultValue)==null?void 0:O.call(v))==null?void 0:$.id)&&(b=Bi(v.getDataType(null),v,i)):f?(b=P0(v.getDataType(null),v,i,h),h==null||h.add(b,z.Added)):b=Bi(v.getDataType(null),v,i),b==null||b.setValueAsType(null,h);let A=a||(b==null?void 0:b.name);(!(b!=null&&b.name)||(b==null?void 0:b.name)===he.Untyped)&&!a&&(typeof s=="string"?A=he.String:s===null?A=he.Null:typeof s=="number"?A=he.Number:typeof s=="boolean"&&(A=he.Boolean)),b==null||b.metaSync({value:s,name:A,rawString:c!==void 0?c:null},h),f||m==null||m.writeValue(v,b)}),h}function Ty(s,u,i,r){let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=s.parent;return u.getVariableDeclarations().forEach(m=>{var b,A,w,R,O,$;const v=m.getDataType(null);if(((b=v==null?void 0:v.entity)==null?void 0:b.id)===f.id){let G=a?m.defaultValue:e==null?void 0:e.readValue(m.id);G?!a&&G&&G.id===((A=m.defaultValue)==null?void 0:A.id)&&(G=Bi(m.getDataType(null),m,u)):a?G=P0(m.getDataType(null),m,u,c):G=Bi(m.getDataType(null),m,u);const x=fi(s,u),k=s.codeName||((w=s.extends)==null?void 0:w.codeName)||((R=s.implements[0])==null?void 0:R.codeName)||$r(x);let W={};(($=(O=m.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(W={...W,...m.dataType.entity.getActiveRawDefaultValue()}),sn(G==null?void 0:G.value)&&(W={...W,...G.value}),Array.isArray(i)?W[k]=(i==null?void 0:i.map(te=>te.toShallowJSON()))||null:W[k]=(i==null?void 0:i.toShallowJSON())||null,G==null||G.metaSync({value:W},c),a||e==null||e.writeValue(m,G);return}}),c}function uE(s,u,i,r){var w,R,O,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=zr(s.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=a?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!a&&m&&m.id===((w=f.defaultValue)==null?void 0:w.id)&&(m=Bi(f.getDataType(null),f,u)):a?m=P0(f.getDataType(null),f,u,c):m=Bi(f.getDataType(null),f,u);const v=fi(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||$r(v);let A={};if((($=(O=f.dataType)==null?void 0:O.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),sn(m==null?void 0:m.value)&&(A={...A,...m.value}),Array.isArray(i)?A[b]=(i==null?void 0:i.map(G=>G.toShallowJSON()))||null:A[b]=(i==null?void 0:i.toShallowJSON())||null,m==null||m.metaSync({value:A},c),a||e==null||e.writeValue(f,m),i==null&&s.type===d.OutputMap){const G=f.inputs.find(x=>{var k,W;return((k=x.declaration)==null?void 0:k.id)===((W=s.declaration)==null?void 0:W.id)||fi(x,u)===v});if(G){let x=a?G.defaultValue:e==null?void 0:e.readValue(G.id);x&&(Array.isArray(i)?x==null||x.setValueAsTypeList(i,c):x==null||x.setValueAsTypeSingle(i,c)),a||e==null||e.removeValue(G.id)}}return c}function FVe(s,u,i){var r,a,c,e;return s.type===d.InputMap?((r=s.declaration)==null?void 0:r.type)===d.Property&&s.declaration.static?Ty(s.declaration,u,null,i):mi.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&uE(s,u,null,i):s.type===d.OutputMap?((c=s.declaration)==null?void 0:c.type)===d.Property&&s.declaration.static?Ty(s.declaration,u,null,i):mi.includes(s.parent.type)&&((e=s.declaration)==null?void 0:e.type)===d.Property&&uE(s,u,null,i):s.type===d.Property&&s.static&&Ty(s,u,null,i),i}function KVe(s,u,i,r){var a,c,e,f;return u.type===d.InputMap?((a=u.declaration)==null?void 0:a.type)===d.Property&&u.declaration.static?Ty(u.declaration,i,s,r):mi.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===d.Property&&uE(u,i,s,r):u.type===d.OutputMap?((e=u.declaration)==null?void 0:e.type)===d.Property&&u.declaration.static?Ty(u.declaration,i,null,r):mi.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===d.Property&&uE(u,i,null,r):u.type===d.Property&&u.static&&Ty(u,i,s,r),r}function T1i(s,u,i){const r=Xd(s,u);let a=!1,c=null,e=null;return i instanceof Z?(a=!0,c=i,e=null):(c=null,e=i),r.forEach(f=>{var m;let h=a?(m=f.getDefaultValue)==null?void 0:m.call(f):e==null?void 0:e.readValue(f.id);a?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id),FVe(f,u,i)}),c}function v1i(s,u,i,r){const a=Xd(u,i);let c=!1,e=null,f=null;return r instanceof Z?(c=!0,e=r,f=null):(e=null,f=r),a.forEach(h=>{var v,b,A;let m=c?(v=h.getDefaultValue)==null?void 0:v.call(h):f==null?void 0:f.readValue(h.id);m?!c&&m&&m.id===((A=(b=h.getDefaultValue)==null?void 0:b.call(h))==null?void 0:A.id)&&(m=Bi(h.getDataType(null),h,h.project)):c?m=P0(h.getDataType(null),h,i,e):m=Bi(h.getDataType(null),h,i),Array.isArray(s)?m==null||m.setValueAsTypeList(s,e):m==null||m.setValueAsTypeSingle(s,e),m==null||m.metaSync({value:null},e),c||f==null||f.writeValue(h,m),KVe(s,h,i,r)}),e}function Ur(s,u){let i=s;return s&&s.parent&&s.project.get(s.id)&&(i=i.clone(null,null,null,!1),i.setStandaloneParent(u,null)),i}class RD{constructor(u,i){this.extensionsRegistry=u,this.contextType=i,this.off=this.extensionsRegistry.off.bind(this.extensionsRegistry),this.on=this.extensionsRegistry.on.bind(this.extensionsRegistry),this.emit=this.extensionsRegistry.emit.bind(this.extensionsRegistry),this.emitAsync=this.extensionsRegistry.emitAsync.bind(this.extensionsRegistry),this.emitAsyncAll=this.extensionsRegistry.emitAsyncAll.bind(this.extensionsRegistry),this.emitAsyncAllSettled=this.extensionsRegistry.emitAsyncAllSettled.bind(this.extensionsRegistry),this.emitAsyncSequentially=this.extensionsRegistry.emitAsyncSequentially.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAll=this.extensionsRegistry.emitAsyncSequentiallyAll.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAllSettled=this.extensionsRegistry.emitAsyncSequentiallyAllSettled.bind(this.extensionsRegistry)}on(u,i){this.extensionsRegistry.on(u,i)}emit(u,...i){this.extensionsRegistry.emit(u,...i)}off(u,i){this.extensionsRegistry.off(u,i)}emitAsync(u,...i){return this.extensionsRegistry.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.extensionsRegistry.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.extensionsRegistry.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.extensionsRegistry.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled(u,...i)}}var Ve=(s=>(s[s.High=1]="High",s[s.Normal=5]="Normal",s[s.Low=10]="Low",s))(Ve||{}),le=(s=>(s.Logic="logic",s.EditorGUI="editor-gui",s.GUI="gui",s.Editor="editor",s.Compile="compile",s.PublicationRun="publication-run",s))(le||{}),xe=(s=>(s.All="*",s.OnAll="on:*",s.EmitAll="emit:*",s.ReadAll="read:*",s.WriteAll="write:*",s.UpdateAll="update:*",s.DoAll="do:*",s.OnLogicAll="on:logic:*",s.EmitLogicAll="emit:logic:*",s.ReadLogicAll="read:logic:*",s.WriteLogicAll="write:logic:*",s.UpdateLogicAll="update:logic:*",s.DoLogicAll="do:logic:*",s.OnGUIAll="on:gui:*",s.EmitGUIAll="emit:gui:*",s.ReadGUIAll="read:gui:*",s.WriteGUIAll="write:gui:*",s.UpdateGUIAll="update:gui:*",s.DoGUIAll="do:gui:*",s.OnEditorAll="on:editor:*",s.EmitEditorAll="emit:editor:*",s.ReadEditorAll="read:editor:*",s.WriteEditorAll="write:editor:*",s.UpdateEditorAll="update:editor:*",s.DoEditorAll="do:editor:*",s.OnCompileBefore="on:compile:before:DefinitionEntity",s.OnCompileDefault="on:compile:default:DefinitionEntity",s.OnCompileAfter="on:compile:after:DefinitionEntity",s.EmitCompile="emit:compile:DefinitionEntity",s.DoEditorPublish="do:editor:publish",s.PostGUICanvasSlotNewToolbarButton="write:gui:canvas:slot:toolbar-button",s.ReadGUICanvasSlotToolbarButtons="read:gui:canvas:slot:toolbar-buttons",s.UpdateGUIGlobalTheme="update:gui:global:theme",s))(xe||{});class SVe{constructor(u){D(this,"state",new Map);u&&(this.state=new Map(Object.entries(u)))}get(u){return this.state.get(u)}set(u,i){this.state.set(u,i)}delete(u){this.state.delete(u)}}class qVe extends SVe{constructor(u,i){super(i),this.parentExtension=u}}class $e{constructor(u,i){D(this,"manifest");D(this,"module");D(this,"state");this.extensionsRegistry=u,this.state=new qVe(this,i)}}class MP extends RD{constructor(i,r){super(i,le.Logic);D(this,"id");this._project=r,this.id=r.id}get type(){return this._project.type}get name(){return this._project.name}get workspaceId(){return this._project.workspaceId}get description(){return this._project.description}get version(){return this._project.version}get createdAt(){return this._project.createdAt}get previousVersion(){return this._project.previousVersion}get author(){return this._project.author}get deleted(){return this._project.deleted}get editable(){return this._project.editable}get deletable(){return this._project.deletable}get entities(){return[...this._project.entities]}get projects(){return[...this._project.projects]}get functions(){return[...this._project.functions]}get events(){return[...this._project.events]}get variableDeclarations(){return[...this._project.variableDeclarations]}get variableInstances(){return[...this._project.variableInstances]}get conditions(){return[...this._project.conditions]}get operations(){return[...this._project.operations]}get functionCalls(){return[...this._project.functionCalls]}get loops(){return[...this._project.loops]}get searches(){return[...this._project.searches]}get primitives(){return[...this._project.primitives]}get builtInBaseEntities(){return[...this._project.builtInBaseEntities]}get operationDeclarations(){return[...this._project.operationDeclarations]}get globalEventActionDescriptors(){return[...this._project.globalEventActionDescriptors]}get loopDeclarations(){return[...this._project.loopDeclarations]}get loopDeclarationsBodies(){return[...this._project.loopDeclarationsBodies]}get conditionDeclarations(){return[...this._project.conditionDeclarations]}get valueDescriptors(){return[...this._project.valueDescriptors]}get dataTypes(){return[...this._project.dataTypes]}get errors(){return[...this._project.errors]}get history(){return[...this._project.history]}get undoableStackValueIndex(){return this._project.undoableStackValueIndex}get knownVersions(){return this._project.knownVersions}get activeVersion(){return this._project.activeVersion}get initialized(){return this._project.initialized}get startedInitialization(){return this._project.startedInitialization}closePersistChangeSetsSequentially(){return this._project.closePersistChangeSetsSequentially()}persistChangeSetSequentially(i){return this._project.persistChangeSetSequentially(i)}toLatestChangeSet(i,r,a,c=!1,e="here-this"){return this._project.toLatestChangeSet(i,r,a,c,e)}addChangeSet(i){return this._project.addChangeSet(i)}discardChangeSet(i){return this._project.discardChangeSet(i)}subscribeDependents(i){return this._project.subscribeDependents(i)}unsubscribeDependents(i){return this._project.unsubscribeDependents(i)}syncDependents(i){return this._project.syncDependents(i)}onDetachedDependencyRemoved(i,r,a){return this._project.onDetachedDependencyRemoved(i,r,a)}onDetachedDependencyRestored(i,r,a){return this._project.onDetachedDependencyRestored(i,r,a)}increaseVersion(i){return this._project.increaseVersion(i)}captureVersion(){return this._project.captureVersion()}restoreVersion(i){return this._project.restoreVersion(i)}updateWithShallowTransfer(i,r){return this._project.updateWithShallowTransfer(i,r)}hydrateAncestors(){return this._project.hydrateAncestors()}afterAllChildrenInitialized(i=null){return this._project.afterAllChildrenInitialized(i)}addSelfToProject(i){return this._project.addSelfToProject(i)}get instancesList(){return[...this._project.instancesList]}isOperationDeclaration(i){return this._project.isOperationDeclaration(i)}isGlobalEventActionDescriptor(i){return this._project.isGlobalEventActionDescriptor(i)}isLoopDeclaration(i){return this._project.isLoopDeclaration(i)}isConditionDeclaration(i){return this._project.isConditionDeclaration(i)}findSubscribedBuiltInInstance(i){return this._project.findSubscribedBuiltInInstance(i)}get(i){return this._project.get(i)}getDeleted(i){return this._project.getDeleted(i)}getManaged(i){return this._project.getManaged(i)}getBuiltIn(i){return this._project.getBuiltIn(i)}findSubscribedInstanceFromReference(i){return this._project.findSubscribedInstanceFromReference(i)}findSubscribedBuiltInInstanceFromReference(i){return this._project.findSubscribedBuiltInInstanceFromReference(i)}metaSync(i,r){return this._project.metaSync(i,r)}getAllBuiltInIds(){return this._project.getAllBuiltInIds()}getAllBuiltIn(){return this._project.getAllBuiltIn()}toFlat(i){return this._project.toFlat(i)}toFlatIds(i){return this._project.toFlatIds(i)}toMeta(){return this._project.toMeta()}toJSON(i){return this._project.toJSON(i)}toJSONClone(i){return this._project.toJSONClone(i)}toReference(i){return this._project.toReference(i)}toShallowJSON(i){return this._project.toShallowJSON(i)}toFlatJSON(i){return this._project.toFlatJSON(i)}toGenerationTarget(i){return this._project.toGenerationTarget(i)}toFlatGenerationTarget(i){return this._project.toFlatGenerationTarget(i)}clearErrors(){return this._project.clearErrors()}validate(){return this._project.validate()}validateChildren(){return this._project.validateChildren()}getErrors(){return this._project.getErrors()}getShallowErrors(){return this._project.getShallowErrors()}addDefinitionEntity(i){return this._project.addDefinitionEntity(i)}addFunctionDeclaration(i){return this._project.addFunctionDeclaration(i)}addFunctionCall(i){return this._project.addFunctionCall(i)}addVariableDeclaration(i){return this._project.addVariableDeclaration(i)}addVariableInstance(i){return this._project.addVariableInstance(i)}addInstalledProject(i){return this._project.addInstalledProject(i)}addGlobalEvent(i){return this._project.addGlobalEvent(i)}addCondition(i){return this._project.addCondition(i)}addOperation(i){return this._project.addOperation(i)}addLoop(i){return this._project.addLoop(i)}addSearch(i){return this._project.addSearch(i)}removeDefinitionEntity(i){return this._project.removeDefinitionEntity(i)}removeCondition(i){return this._project.removeCondition(i)}removeOperation(i){return this._project.removeOperation(i)}removeLoop(i){return this._project.removeLoop(i)}removeSearch(i){return this._project.removeSearch(i)}removeFunctionCall(i){return this._project.removeFunctionCall(i)}removeVariableInstance(i){return this._project.removeVariableInstance(i)}removeVariableDeclaration(i){return this._project.removeVariableDeclaration(i)}removeFunctionDeclaration(i){return this._project.removeFunctionDeclaration(i)}removeInstalledProject(i){return this._project.removeInstalledProject(i)}removeGlobalEvent(i){return this._project.removeGlobalEvent(i)}removeTopLevelVariableDeclaration(i){return this._project.removeTopLevelVariableDeclaration(i)}getEntryPoints(){return this._project.getEntryPoints()}getTerminationStatements(){return this._project.getTerminationStatements()}getFunctionDeclaration(i){return this._project.getFunctionDeclaration(i)}getConditions(){return this._project.getConditions()}getOperations(){return this._project.getOperations()}getVariables(){return this._project.getVariables()}getVariableInstances(){return this._project.getVariableInstances()}getVariableDeclarations(){return this._project.getVariableDeclarations()}getLoops(){return this._project.getLoops()}getSearches(){return this._project.getSearches()}getBuiltInPersistedEntity(){return this._project.getBuiltInPersistedEntity()}requestActiveDynamicValue(i,r=!1){return this._project.requestActiveDynamicValue(i,r)}undo(){return this._project.undo()}redo(){return this._project.redo()}applyExternalChangeSet(i){return this._project.applyExternalChangeSet(i)}toFullProjectTransfer(){return this._project.toFullProjectTransfer()}}function E1i(s,u){return u instanceof MP?u:new MP(s,u)}const ds="built-in-function-implementations__",ke="operations-implementations__",Ws="conditions-implementations__",Be={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:ds+yn.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:ds+yn.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:ds+yn.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:ds+yn.DeletePersistedEntity,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY:ke+ui.Empty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY:ke+ui.NotEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL:ke+ui.PrimitiveEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL:ke+ui.PrimitiveNotEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST:ke+Wn.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Wo.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+_e.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+Ns.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+pe.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+pe.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+pe.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+pe.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+pe.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+pe.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+pe.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+pe.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+pe.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+pe.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+pe.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+pe.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+pe.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+pe.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+pe.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+pe.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+pe.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+pe.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+pe.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+pe.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+pe.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+pe.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+pe.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+pe.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+pe.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+pe.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+pe.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+pe.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+pe.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+pe.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+pe.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+Y.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+Y.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+Y.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+Y.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+pe.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+pe.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+pe.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+Y.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+Y.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+Y.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+Y.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+Y.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+Y.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+Y.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+Y.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+Y.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+Y.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+Y.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+Y.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+Y.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+Y.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+Y.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+Y.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+Y.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+Y.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+Y.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+Y.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+Y.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+Y.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+Y.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+Y.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+Y.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+Y.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+Y.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+Y.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+Y.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+Y.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+Y.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+Y.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+Y.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+Y.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+Y.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+Y.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+Y.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+Y.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+Y.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+Y.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+Y.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+ce.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+ce.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+ce.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+ce.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+ce.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+ce.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+ce.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+ce.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+ce.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+ce.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+ce.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+ce.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+ce.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+ce.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+ce.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+ce.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+ce.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+ce.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+ce.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+ce.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+ce.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+ce.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+ce.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+ce.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+ce.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+ce.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+ce.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+ce.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+ce.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+ce.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+ce.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+ce.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+ce.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+ce.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+ce.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+ce.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+ce.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+ce.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+ce.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+ce.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+ce.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+ce.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+st.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+st.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+st.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+st.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+st.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+st.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+st.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+st.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+st.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+st.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+Y.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+Y.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+Y.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+Y.MatchesRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP:ke+S.GetCurrentTimestamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE:ke+S.FormatDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE:ke+S.ParseDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE:ke+S.AddToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE:ke+S.SubtractFromDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES:ke+S.DifferenceBetweenDates,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE:ke+S.ToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX:ke+S.ToUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX:ke+S.FromUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING:ke+S.ToISOString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR:ke+S.GetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH:ke+S.GetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE:ke+S.GetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR:ke+S.GetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE:ke+S.GetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND:ke+S.GetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND:ke+S.GetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY:ke+S.GetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR:ke+S.GetWeekOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER:ke+S.GetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR:ke+S.GetDayOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH:ke+S.GetDaysInMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE:ke+S.GetCurrentIanaTimeZone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR:ke+S.SetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH:ke+S.SetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE:ke+S.SetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR:ke+S.SetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE:ke+S.SetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND:ke+S.SetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND:ke+S.SetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY:ke+S.SetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER:ke+S.SetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF:ke+S.StartOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF:ke+S.EndOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO:ke+S.RoundTo,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE:Ws+S.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Ws+S.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Ws+S.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Ws+S.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Ws+S.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Ws+S.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Ws+S.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Ws+S.IsLeapYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE:ke+S.ClampToRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF:ke+S.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF:ke+S.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW:ke+S.FromNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW:ke+S.ToNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF:ke+S.HumanizeDiff,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS:ke+S.AddBusinessDays,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY:ke+S.NextWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY:ke+S.PreviousWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC:ke+S.ToUTC,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE:ke+S.ConvertTimezone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET:ke+S.GetTimezoneOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET:ke+S.SetUTCOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY:ke+_e.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+_e.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+_e.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+_e.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+_e.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+_e.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+_e.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Ws+_e.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Ws+_e.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Ws+_e.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Ws+_e.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Ws+_e.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+_e.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+_e.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+_e.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+_e.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+et.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+oi.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+oi.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+st.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+oi.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+oi.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+Qr.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+Qr.VerifyPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC:ke+gi.BuildJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC:ke+gi.VerifyJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE:ke+gi.DecodeJwt,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING:ke+et.FromBytesToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES:ke+et.ToBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER:ke+et.ToNumber,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING:ke+et.ToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64:ke+et.EncodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64:ke+et.DecodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL:ke+et.EncodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL:ke+et.DecodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX:ke+et.EncodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX:ke+et.DecodeHex,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE:ke+Yn.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+Yn.Stringify};class ZVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION,version:"1.0.0",description:'Implementation for the built-in function "Abort Execution". It terminates the execution of the current entity being run.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class HVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Delete SQL database table". It deletes the current entity as an entry in the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class WVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Create SQL database table". It saves the current entity state to the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class zVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Update SQL database table". It saves the current entity state to the persisted storage.',initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class YVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Editor]});D(this,"module",{main:async(i,r)=>({error:"Search module not implemented",data:null})})}}class JVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:Ve.High,permissions:[xe.All],contexts:[]});D(this,"module",RN)}}class QVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.Empty);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[ui.Empty].inputs.leftHand.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f==null;return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class XVe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.NotEmpty);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[ui.NotEmpty].inputs.leftHand.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f!=null;return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}const lR=class lR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.PrimitiveEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=(c=(a=r[0])==null?void 0:a.value)==null?void 0:c.name,b=(f=(e=r[0])==null?void 0:e.value)==null?void 0:f.value,A=(m=(h=r[1])==null?void 0:h.value)==null?void 0:m.value;let w=!1;return v&&lR.primitiveSet.has(v)?w=b===A:v===he.Untyped||v===he.KeyValue?w=JSON.stringify(b)===JSON.stringify(A):w=!1,{value:F.Success,error:null,result:w}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};D(lR,"primitiveSet",new Set([he.String,he.Number,he.Boolean,he.Null,he.Enum,he.Date,he.UUID]));let MI=lR;const oR=class oR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic);if(!r)return;const a=r.get(ui.PrimitiveNotEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=(c=(a=r[0])==null?void 0:a.value)==null?void 0:c.name,b=(f=(e=r[0])==null?void 0:e.value)==null?void 0:f.value,A=(m=(h=r[1])==null?void 0:h.value)==null?void 0:m.value;let w=!1;return v&&oR.primitiveSet.has(v)?w=b!==A:v===he.Untyped||v===he.KeyValue?w=JSON.stringify(b)!==JSON.stringify(A):w=!1,{value:F.Success,error:null,result:w}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};D(oR,"primitiveSet",new Set([he.String,he.Number,he.Boolean,he.Null,he.Enum,he.Date,he.UUID]));let GI=oR;var exe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="minute",r=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(c,e,f){var h=e.prototype;f.utc=function(O){var $={date:O,utc:!0,args:arguments};return new e($)},h.utc=function(O){var $=f(this.toDate(),{locale:this.$L,utc:!0});return O?$.add(this.utcOffset(),i):$},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(O){O.utc&&(this.$u=!0),this.$utils().u(O.$offset)||(this.$offset=O.$offset),m.call(this,O)};var v=h.init;h.init=function(){if(this.$u){var O=this.$d;this.$y=O.getUTCFullYear(),this.$M=O.getUTCMonth(),this.$D=O.getUTCDate(),this.$W=O.getUTCDay(),this.$H=O.getUTCHours(),this.$m=O.getUTCMinutes(),this.$s=O.getUTCSeconds(),this.$ms=O.getUTCMilliseconds()}else v.call(this)};var b=h.utcOffset;h.utcOffset=function(O,$){var G=this.$utils().u;if(G(O))return this.$u?0:G(this.$offset)?b.call(this):this.$offset;if(typeof O=="string"&&(O=function(te){te===void 0&&(te="");var ee=te.match(r);if(!ee)return null;var Q=(""+ee[0]).match(a)||["-",0,0],ne=Q[0],de=60*+Q[1]+ +Q[2];return de===0?0:ne==="+"?de:-de}(O),O===null))return this;var x=Math.abs(O)<=16?60*O:O;if(x===0)return this.utc($);var k=this.clone();if($)return k.$offset=x,k.$u=!1,k;var W=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(k=this.local().add(x+W,i)).$offset=x,k.$x.$localOffset=W,k};var A=h.format;h.format=function(O){var $=O||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return A.call(this,$)},h.valueOf=function(){var O=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*O},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var w=h.toDate;h.toDate=function(O){return O==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var R=h.diff;h.diff=function(O,$,G){if(O&&this.$u===O.$u)return R.call(this,O,$,G);var x=this.local(),k=f(O).local();return R.call(x,k,$,G)}}})})(exe);var b1i=exe.exports;const A1i=fl(b1i);var txe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(a,c,e){var f,h=function(A,w,R){R===void 0&&(R={});var O=new Date(A),$=function(G,x){x===void 0&&(x={});var k=x.timeZoneName||"short",W=G+"|"+k,te=r[W];return te||(te=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:G,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:k}),r[W]=te),te}(w,R);return $.formatToParts(O)},m=function(A,w){for(var R=h(A,w),O=[],$=0;$<R.length;$+=1){var G=R[$],x=G.type,k=G.value,W=i[x];W>=0&&(O[W]=parseInt(k,10))}var te=O[3],ee=te===24?0:te,Q=O[0]+"-"+O[1]+"-"+O[2]+" "+ee+":"+O[4]+":"+O[5]+":000",ne=+A;return(e.utc(Q).valueOf()-(ne-=ne%1e3))/6e4},v=c.prototype;v.tz=function(A,w){A===void 0&&(A=f);var R,O=this.utcOffset(),$=this.toDate(),G=$.toLocaleString("en-US",{timeZone:A}),x=Math.round(($-new Date(G))/1e3/60),k=15*-Math.round($.getTimezoneOffset()/15)-x;if(!Number(k))R=this.utcOffset(0,w);else if(R=e(G,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),w){var W=R.utcOffset();R=R.add(O-W,"minute")}return R.$x.$timezone=A,R},v.offsetName=function(A){var w=this.$x.$timezone||e.tz.guess(),R=h(this.valueOf(),w,{timeZoneName:A}).find(function(O){return O.type.toLowerCase()==="timezonename"});return R&&R.value};var b=v.startOf;v.startOf=function(A,w){if(!this.$x||!this.$x.$timezone)return b.call(this,A,w);var R=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(R,A,w).tz(this.$x.$timezone,!0)},e.tz=function(A,w,R){var O=R&&w,$=R||w||f,G=m(+e(),$);if(typeof A!="string")return e(A).tz($);var x=function(ee,Q,ne){var de=ee-60*Q*1e3,J=m(de,ne);if(Q===J)return[de,Q];var ie=m(de-=60*(J-Q)*1e3,ne);return J===ie?[de,J]:[ee-60*Math.min(J,ie)*1e3,Math.max(J,ie)]}(e.utc(A,O).valueOf(),G,$),k=x[0],W=x[1],te=e(k).utcOffset(W);return te.$x.$timezone=$,te},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(A){f=A}}})})(txe);var g1i=txe.exports;const I1i=fl(g1i);var ixe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){r.prototype.isBetween=function(c,e,f,h){var m=a(c),v=a(e),b=(h=h||"()")[0]==="(",A=h[1]===")";return(b?this.isAfter(m,f):!this.isBefore(m,f))&&(A?this.isBefore(v,f):!this.isAfter(v,f))||(b?this.isBefore(m,f):!this.isAfter(m,f))&&(A?this.isAfter(v,f):!this.isBefore(v,f))}}})})(ixe);var R1i=ixe.exports;const D1i=fl(R1i);var rxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isSameOrAfter=function(a,c){return this.isSame(a,c)||this.isAfter(a,c)}}})})(rxe);var w1i=rxe.exports;const C1i=fl(w1i);var nxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isSameOrBefore=function(a,c){return this.isSame(a,c)||this.isBefore(a,c)}}})})(nxe);var O1i=nxe.exports;const _1i=fl(O1i);var axe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="week",r="year";return function(a,c,e){var f=c.prototype;f.week=function(h){if(h===void 0&&(h=null),h!==null)return this.add(7*(h-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var v=e(this).startOf(r).add(1,r).date(m),b=e(this).endOf(i);if(v.isBefore(b))return 1}var A=e(this).startOf(r).date(m).startOf(i).subtract(1,"millisecond"),w=this.diff(A,i,!0);return w<0?e(this).startOf("week").week():Math.ceil(w)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(axe);var P1i=axe.exports;const N1i=fl(P1i);var sxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="day";return function(r,a,c){var e=function(m){return m.add(4-m.isoWeekday(),i)},f=a.prototype;f.isoWeekYear=function(){return e(this).year()},f.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),i);var v,b,A,w,R=e(this),O=(v=this.isoWeekYear(),b=this.$u,A=(b?c.utc:c)().year(v).startOf("year"),w=4-A.isoWeekday(),A.isoWeekday()>4&&(w+=7),A.add(w,i));return R.diff(O,"week")+1},f.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var h=f.startOf;f.startOf=function(m,v){var b=this.$utils(),A=!!b.u(v)||v;return b.p(m)==="isoweek"?A?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):h.bind(this)(m,v)}}})})(sxe);var V1i=sxe.exports;const x1i=fl(V1i);var lxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i="month",r="quarter";return function(a,c){var e=c.prototype;e.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var f=e.add;e.add=function(m,v){return m=Number(m),this.$utils().p(v)===r?this.add(3*m,i):f.bind(this)(m,v)};var h=e.startOf;e.startOf=function(m,v){var b=this.$utils(),A=!!b.u(v)||v;if(b.p(m)===r){var w=this.quarter()-1;return A?this.month(3*w).startOf(i).startOf("day"):this.month(3*w+2).endOf(i).endOf("day")}return h.bind(this)(m,v)}}})})(lxe);var $1i=lxe.exports;const L1i=fl($1i);var oxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){r.prototype.dayOfYear=function(c){var e=Math.round((a(this).startOf("day")-a(this).startOf("year"))/864e5)+1;return c==null?e:this.add(c-e,"day")}}})})(oxe);var B1i=oxe.exports;const M1i=fl(B1i);var dxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r,a){i=i||{};var c=r.prototype,e={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f(m,v,b,A){return c.fromToBase(m,v,b,A)}a.en.relativeTime=e,c.fromToBase=function(m,v,b,A,w){for(var R,O,$,G=b.$locale().relativeTime||e,x=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],k=x.length,W=0;W<k;W+=1){var te=x[W];te.d&&(R=A?a(m).diff(b,te.d,!0):b.diff(m,te.d,!0));var ee=(i.rounding||Math.round)(Math.abs(R));if($=R>0,ee<=te.r||!te.r){ee<=1&&W>0&&(te=x[W-1]);var Q=G[te.l];w&&(ee=w(""+ee)),O=typeof Q=="string"?Q.replace("%d",ee):Q(ee,v,te.l,$);break}}if(v)return O;var ne=$?G.future:G.past;return typeof ne=="function"?ne(O):ne.replace("%s",O)},c.to=function(m,v){return f(m,v,this,!0)},c.from=function(m,v){return f(m,v,this)};var h=function(m){return m.$u?a.utc():a()};c.toNow=function(m){return this.to(h(this),m)},c.fromNow=function(m){return this.from(h(this),m)}}})})(dxe);var G1i=dxe.exports;const k1i=fl(G1i);var uxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){var i,r,a=1e3,c=6e4,e=36e5,f=864e5,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=31536e6,v=2628e6,b=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,A={years:m,months:v,days:f,hours:e,minutes:c,seconds:a,milliseconds:1,weeks:6048e5},w=function(ee){return ee instanceof W},R=function(ee,Q,ne){return new W(ee,ne,Q.$l)},O=function(ee){return r.p(ee)+"s"},$=function(ee){return ee<0},G=function(ee){return $(ee)?Math.ceil(ee):Math.floor(ee)},x=function(ee){return Math.abs(ee)},k=function(ee,Q){return ee?$(ee)?{negative:!0,format:""+x(ee)+Q}:{negative:!1,format:""+ee+Q}:{negative:!1,format:""}},W=function(){function ee(ne,de,J){var ie=this;if(this.$d={},this.$l=J,ne===void 0&&(this.$ms=0,this.parseFromMilliseconds()),de)return R(ne*A[O(de)],this);if(typeof ne=="number")return this.$ms=ne,this.parseFromMilliseconds(),this;if(typeof ne=="object")return Object.keys(ne).forEach(function(ue){ie.$d[O(ue)]=ne[ue]}),this.calMilliseconds(),this;if(typeof ne=="string"){var se=ne.match(b);if(se){var fe=se.slice(2).map(function(ue){return ue!=null?Number(ue):0});return this.$d.years=fe[0],this.$d.months=fe[1],this.$d.weeks=fe[2],this.$d.days=fe[3],this.$d.hours=fe[4],this.$d.minutes=fe[5],this.$d.seconds=fe[6],this.calMilliseconds(),this}}return this}var Q=ee.prototype;return Q.calMilliseconds=function(){var ne=this;this.$ms=Object.keys(this.$d).reduce(function(de,J){return de+(ne.$d[J]||0)*A[J]},0)},Q.parseFromMilliseconds=function(){var ne=this.$ms;this.$d.years=G(ne/m),ne%=m,this.$d.months=G(ne/v),ne%=v,this.$d.days=G(ne/f),ne%=f,this.$d.hours=G(ne/e),ne%=e,this.$d.minutes=G(ne/c),ne%=c,this.$d.seconds=G(ne/a),ne%=a,this.$d.milliseconds=ne},Q.toISOString=function(){var ne=k(this.$d.years,"Y"),de=k(this.$d.months,"M"),J=+this.$d.days||0;this.$d.weeks&&(J+=7*this.$d.weeks);var ie=k(J,"D"),se=k(this.$d.hours,"H"),fe=k(this.$d.minutes,"M"),ue=this.$d.seconds||0;this.$d.milliseconds&&(ue+=this.$d.milliseconds/1e3,ue=Math.round(1e3*ue)/1e3);var me=k(ue,"S"),ve=ne.negative||de.negative||ie.negative||se.negative||fe.negative||me.negative,Ae=se.format||fe.format||me.format?"T":"",De=(ve?"-":"")+"P"+ne.format+de.format+ie.format+Ae+se.format+fe.format+me.format;return De==="P"||De==="-P"?"P0D":De},Q.toJSON=function(){return this.toISOString()},Q.format=function(ne){var de=ne||"YYYY-MM-DDTHH:mm:ss",J={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return de.replace(h,function(ie,se){return se||String(J[ie])})},Q.as=function(ne){return this.$ms/A[O(ne)]},Q.get=function(ne){var de=this.$ms,J=O(ne);return J==="milliseconds"?de%=1e3:de=J==="weeks"?G(de/A[J]):this.$d[J],de||0},Q.add=function(ne,de,J){var ie;return ie=de?ne*A[O(de)]:w(ne)?ne.$ms:R(ne,this).$ms,R(this.$ms+ie*(J?-1:1),this)},Q.subtract=function(ne,de){return this.add(ne,de,!0)},Q.locale=function(ne){var de=this.clone();return de.$l=ne,de},Q.clone=function(){return R(this.$ms,this)},Q.humanize=function(ne){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!ne)},Q.valueOf=function(){return this.asMilliseconds()},Q.milliseconds=function(){return this.get("milliseconds")},Q.asMilliseconds=function(){return this.as("milliseconds")},Q.seconds=function(){return this.get("seconds")},Q.asSeconds=function(){return this.as("seconds")},Q.minutes=function(){return this.get("minutes")},Q.asMinutes=function(){return this.as("minutes")},Q.hours=function(){return this.get("hours")},Q.asHours=function(){return this.as("hours")},Q.days=function(){return this.get("days")},Q.asDays=function(){return this.as("days")},Q.weeks=function(){return this.get("weeks")},Q.asWeeks=function(){return this.as("weeks")},Q.months=function(){return this.get("months")},Q.asMonths=function(){return this.as("months")},Q.years=function(){return this.get("years")},Q.asYears=function(){return this.as("years")},ee}(),te=function(ee,Q,ne){return ee.add(Q.years()*ne,"y").add(Q.months()*ne,"M").add(Q.days()*ne,"d").add(Q.hours()*ne,"h").add(Q.minutes()*ne,"m").add(Q.seconds()*ne,"s").add(Q.milliseconds()*ne,"ms")};return function(ee,Q,ne){i=ne,r=ne().$utils(),ne.duration=function(ie,se){var fe=ne.locale();return R(ie,{$l:fe},se)},ne.isDuration=w;var de=Q.prototype.add,J=Q.prototype.subtract;Q.prototype.add=function(ie,se){return w(ie)?te(this,ie,1):de.bind(this)(ie,se)},Q.prototype.subtract=function(ie,se){return w(ie)?te(this,ie,-1):J.bind(this)(ie,se)}}})})(uxe);var U1i=uxe.exports;const j1i=fl(U1i);var pxe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(On,function(){return function(i,r){r.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(pxe);var F1i=pxe.exports;const K1i=fl(F1i);U.extend(A1i);U.extend(I1i);U.extend(D1i);U.extend(C1i);U.extend(_1i);U.extend(N1i);U.extend(x1i);U.extend(L1i);U.extend(M1i);U.extend(k1i);U.extend(j1i);U.extend(K1i);const di=s=>U(s),Hr=s=>s.toISOString();function cxe(){return Hr(U())}function fxe(s,u){return di(s).format(u)}function yxe(s){return Hr(U(s))}function hxe(s){if(s==null)throw new TypeError("ToDate expects a non-null value.");if(typeof s=="string"){const u=U(s);if(!u.isValid())throw new TypeError("Invalid date string.");return u.toISOString()}if(typeof s=="number"&&Number.isFinite(s)){const u=Math.abs(s)<1e12?U.unix(s):U(s);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(s instanceof Date){const u=U(s);if(!u.isValid())throw new TypeError("Invalid Date object.");return u.toISOString()}throw new TypeError("Unsupported value type for ToDate. Provide a string, number, or Date.")}function mxe(s,u,i){return Hr(di(s).add(u,i))}function Txe(s,u,i){return Hr(di(s).subtract(u,i))}function vxe(s,u,i,r=!1){return di(s).diff(di(u),i,r)}function Exe(s){return di(s).unix()}function bxe(s){return Hr(U.unix(s))}function Axe(s){return Hr(di(s))}function gxe(s){return di(s).year()}function Ixe(s){return di(s).month()}function Rxe(s){return di(s).date()}function Dxe(s){return di(s).hour()}function wxe(s){return di(s).minute()}function Cxe(s){return di(s).second()}function Oxe(s){return di(s).millisecond()}function _xe(s){return di(s).isoWeekday()}function Pxe(s){return di(s).week()}function Nxe(s){return di(s).quarter()}function Vxe(s){return di(s).dayOfYear()}function xxe(s){return di(s).daysInMonth()}function $xe(s,u){return Hr(di(s).year(u))}function Lxe(s,u){return Hr(di(s).month(u))}function Bxe(s,u){return Hr(di(s).date(u))}function Mxe(s,u){return Hr(di(s).hour(u))}function Gxe(s,u){return Hr(di(s).minute(u))}function kxe(s,u){return Hr(di(s).second(u))}function Uxe(s,u){return Hr(di(s).millisecond(u))}function jxe(s,u){return Hr(di(s).isoWeekday(u))}function Fxe(s,u){return Hr(di(s).quarter(u))}function Kxe(s,u){return Hr(di(s).startOf(u))}function Sxe(s,u){return Hr(di(s).endOf(u))}function qxe(s,u){const i=di(s),r=i.startOf(u),a=i.endOf(u),c=r.valueOf()+(a.valueOf()-r.valueOf())/2;return Hr(i.valueOf()<c?r:a)}function Zxe(s,u,i){return di(s).isBefore(di(u),i)}function Hxe(s,u,i){return di(s).isAfter(di(u),i)}function Wxe(s,u,i){return di(s).isSame(di(u),i)}function zxe(s,u,i){return di(s).isSameOrBefore(di(u),i)}function Yxe(s,u,i){return di(s).isSameOrAfter(di(u),i)}function Jxe(s,u,i,r,a="()"){return di(s).isBetween(di(u),di(i),r,a)}function Qxe(s){return U(s).isValid()}function Xxe(s){return di(s).isLeapYear()}function e$e(s,u,i){const r=di(s);return r.isBefore(u)?Hr(di(u)):r.isAfter(i)?Hr(di(i)):Hr(r)}function t$e(s){if(s.length===0)throw new Error("minOf requires at least one date");let u=di(s[0]);for(let i=1;i<s.length;i++){const r=di(s[i]);r.isBefore(u)&&(u=r)}return Hr(u)}function i$e(s){if(s.length===0)throw new Error("maxOf requires at least one date");let u=di(s[0]);for(let i=1;i<s.length;i++){const r=di(s[i]);r.isAfter(u)&&(u=r)}return Hr(u)}function r$e(s,u=!1){return di(s).fromNow(u)}function n$e(s,u=!1){return di(s).toNow(u)}function a$e(s,u,i=!0){const r=di(s).diff(di(u),"millisecond",!0),a=Math.abs(r),e=U.duration(a,"milliseconds").humanize();return i?r>=0?`in ${e}`:`${e} ago`:e}function s$e(s,u,i=["6","7"],r=[]){const a=m=>r.some(v=>di(v).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=di(s);const f=u>=0?1:-1;let h=Math.abs(u);for(;h>0;){e=e.add(f,"day");const m=c(e);!i.includes(m)&&!a(e)&&h--}return Hr(e)}function l$e(s,u){let i=di(s);const r=u;for(let a=0;a<7;a++)if(i=i.add(1,"day"),i.isoWeekday()===r)return Hr(i);return Hr(i)}function o$e(s,u){let i=di(s);const r=u;for(let a=0;a<7;a++)if(i=i.subtract(1,"day"),i.isoWeekday()===r)return Hr(i);return Hr(i)}const d$e="Local";function nL(){try{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;if(s&&typeof s=="string")return s}catch{}try{if(typeof process<"u"&&process.env&&process.env.TZ)return process.env.TZ}catch{}return null}function aL(){const s=nL();if(s)return s;throw new Error("Unable to detect current IANA timezone from host environment.")}function u$e(s,u,i=!1){let r=u;if(r===d$e){const e=nL();if(!e)throw new Error("Unable to detect current timezone from host environment.");r=e}const a=r?U.tz(s,r):di(s),c=i?a.utc(!0):a.utc();return Hr(c)}function p$e(s,u,i=!1){const r=di(s);return Hr(i?r.tz(u,!0):r.tz(u))}function c$e(s,u){const i=s===d$e?aL():s;return di(u).tz(i).utcOffset()}function f$e(s,u,i=!1){return Hr(di(s).utcOffset(u,i))}class y$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetCurrentTimestamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=cxe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class h$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FormatDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.FormatDate].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.FormatDate].inputs.format.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=fxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class m$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ParseDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ParseDate].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=yxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class T$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.AddToDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.amount.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.AddToDate].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=mxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class v$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SubtractFromDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.amount.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.SubtractFromDate].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Txe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class E$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.DifferenceBetweenDates);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,v,b;try{const A=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.firstDate.id}),w=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),R=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.secondDate.id}),O=((e=R==null?void 0:R.value)==null?void 0:e.valueAsType)??((f=R==null?void 0:R.value)==null?void 0:f.value),$=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.unit.id}),G=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),x=r.find(te=>{var ee,Q;return((Q=(ee=te.valueOwner)==null?void 0:ee.declaration)==null?void 0:Q.id)===j.operation[S.DifferenceBetweenDates].inputs.asFloat.id}),k=((v=x==null?void 0:x.value)==null?void 0:v.valueAsType)??((b=x==null?void 0:x.value)==null?void 0:b.value)??!1,W=vxe(w,O,G,k);return{value:F.Success,error:null,result:W}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class S1i extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE,version:"1.0.0",description:"Date to-date operation implementation module (coerce to ISO 8601 string)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToDate].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=hxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class b$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToUnix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToUnix].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Exe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class A$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FromUnix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.FromUnix].inputs.seconds.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=bxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class g$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToISOString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.ToISOString].inputs.inputValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Axe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class I$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=gxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class R$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMonth].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Ixe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class D$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE,version:"1.0.0",description:"Date get-date (day of month) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDate].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Rxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class w$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetHour);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetHour].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Dxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class C$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMinute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMinute].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=wxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class O$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetSecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetSecond].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Cxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class _$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetMillisecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetMillisecond].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Oxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class P$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetIsoWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetIsoWeekday].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_xe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class N$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR,version:"1.0.0",description:"Date get-week-of-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetWeekOfYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetWeekOfYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Pxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class V$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetQuarter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetQuarter].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Nxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class x$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR,version:"1.0.0",description:"Date get-day-of-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDayOfYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDayOfYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Vxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class $$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH,version:"1.0.0",description:"Date get-days-in-month operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetDaysInMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.GetDaysInMonth].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=xxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class L$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE,version:"1.0.0",description:"Date get-current-iana-timezone operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetCurrentIanaTimeZone);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=aL();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class B$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetYear].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetYear].inputs.year.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=$xe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class M$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH,version:"1.0.0",description:"Date set-month operation implementation module (0-based month)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMonth);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMonth].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMonth].inputs.month.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Lxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class G$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE,version:"1.0.0",description:"Date set-date (day of month) operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetDate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetDate].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetDate].inputs.date.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Bxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class k$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetHour);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetHour].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetHour].inputs.hour.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Mxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class U$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMinute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMinute].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMinute].inputs.minute.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Gxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class j$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetSecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetSecond].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetSecond].inputs.second.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=kxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class F$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetMillisecond);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMillisecond].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetMillisecond].inputs.millisecond.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Uxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class K$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetIsoWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetIsoWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetIsoWeekday].inputs.isoWeekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=jxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class S$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetQuarter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetQuarter].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.SetQuarter].inputs.quarter.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Fxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class q$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.StartOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.StartOf].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.StartOf].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Kxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Z$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.EndOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.EndOf].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.EndOf].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=Sxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class H$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.RoundTo);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.RoundTo].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.RoundTo].inputs.unit.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=qxe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class W$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsBefore);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsBefore].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Zxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class z$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsAfter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsAfter].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Hxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class Y$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSame);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSame].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Wxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class J$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE,version:"1.0.0",description:"Date is-same-or-before operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSameOrBefore);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrBefore].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=zxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class Q$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER,version:"1.0.0",description:"Date is-same-or-after operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsSameOrAfter);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.leftHand.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.rightHand.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.IsSameOrAfter].inputs.unit.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=Yxe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class X$e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsBetween);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,v,b,A,w;try{const R=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.target.id}),O=((a=R==null?void 0:R.value)==null?void 0:a.valueAsType)??((c=R==null?void 0:R.value)==null?void 0:c.value),$=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.start.id}),G=((e=$==null?void 0:$.value)==null?void 0:e.valueAsType)??((f=$==null?void 0:$.value)==null?void 0:f.value),x=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.end.id}),k=((h=x==null?void 0:x.value)==null?void 0:h.valueAsType)??((m=x==null?void 0:x.value)==null?void 0:m.value),W=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.unit.id}),te=((v=W==null?void 0:W.value)==null?void 0:v.valueAsType)??((b=W==null?void 0:W.value)==null?void 0:b.value),ee=r.find(de=>{var J,ie;return((ie=(J=de.valueOwner)==null?void 0:J.declaration)==null?void 0:ie.id)===j.operation[S.IsBetween].inputs.inclusivity.id}),Q=((A=ee==null?void 0:ee.value)==null?void 0:A.valueAsType)??((w=ee==null?void 0:ee.value)==null?void 0:w.value),ne=Jxe(O,G,k,te,Q??void 0);return{value:F.Success,error:null,result:ne}}catch(R){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:R,result:null}}}})}}class eLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsValid);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.IsValid].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class tLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.IsLeapYear);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[S.IsLeapYear].inputs.dateValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xxe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class iLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ClampToRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.min.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[S.ClampToRange].inputs.max.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=e$e(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class rLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.MinOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[S.MinOf].inputs.dates.id}).map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=t$e(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class nLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.MaxOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[S.MaxOf].inputs.dates.id}).map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=i$e(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class aLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.FromNow);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.FromNow].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.FromNow].inputs.withoutSuffix.id}),A=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value)??!1,w=r$e(m,A);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class sLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToNow);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.ToNow].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[S.ToNow].inputs.withoutSuffix.id}),A=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value)??!1,w=n$e(m,A);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class lLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.HumanizeDiff);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.firstDate.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.secondDate.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.HumanizeDiff].inputs.withoutSuffix.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!0,G=a$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class oLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS,version:"1.1.0",description:"Date add-business-days operation implementation module (ISO-weekend strings)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.AddBusinessDays);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(b=>{var A,w;return((w=(A=b.valueOwner)==null?void 0:A.declaration)==null?void 0:w.id)===j.operation[S.AddBusinessDays].inputs.dateValue.id}).map(b=>{var A,w;return((A=b.value)==null?void 0:A.valueAsType)??((w=b.value)==null?void 0:w.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],v=s$e(e,f,h,m);return{value:F.Success,error:null,result:v}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class dLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.NextWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.NextWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.NextWeekday].inputs.weekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=l$e(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class uLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.PreviousWeekday);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.PreviousWeekday].inputs.dateValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[S.PreviousWeekday].inputs.weekday.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=o$e(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class pLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ToUTC);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.filter(v=>{var b,A;return((A=(b=v.valueOwner)==null?void 0:b.declaration)==null?void 0:A.id)===j.operation[S.ToUTC].inputs.dateValue.id}).map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)??((A=v.value)==null?void 0:A.value)}),e=c[0],f=c[1]||void 0,h=c[2]??!1,m=u$e(e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class cLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.ConvertTimezone);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.targetTimezone.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.ConvertTimezone].inputs.keepLocalTime.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!1,G=p$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class fLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.GetTimezoneOffset);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[S.GetTimezoneOffset].inputs.timezone.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[S.GetTimezoneOffset].inputs.atDate.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),R=c$e(m,b);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class yLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(S.SetUTCOffset);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.dateValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.offsetMinutes.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(x=>{var k,W;return((W=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:W.id)===j.operation[S.SetUTCOffset].inputs.keepLocalTime.id}),$=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value)??!1,G=f$e(b,w,$);return{value:F.Success,error:null,result:G}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class hLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Ns.Wait);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[Ns.Wait].inputs.duration.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return typeof f!="number"||f<0?{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid wait time provided",result:null}:(await new Promise(h=>setTimeout(h,f)),{value:F.Success,error:null,result:null})}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}const q1i=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,sL=s=>s===null||["string","number","boolean"].includes(typeof s);function Oa(s,u="Input must be an array"){if(!Array.isArray(s))throw new TypeError(u);return s}function wd(s){const u=Oa(s,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function lL(s){return Array.isArray(s)?s:[]}function Vl(s){return Number(s)}function mLe(s){if(!s||s.length===0)throw new TypeError("No input lists provided");if(!s.every(r=>Array.isArray(r)))throw new TypeError("All inputs must be arrays");const[u,...i]=s;return i.reduce((r,a)=>r.concat(a),u)}function TLe(s,...u){if(!Array.isArray(s))throw new TypeError("First input must be an array");if(!u.every(i=>Array.isArray(i)))throw new TypeError("All subsequent inputs must be arrays");return s.concat(...u)}function vLe(s,u){const i=wd(s),r=Vl(u);return[i.slice(0,r),i.slice(r)]}function ELe(s){return wd(s).slice().reverse()}function bLe(s){return wd(s).slice(0,-1)}function ALe(s){return wd(s).slice(1)}function gLe(s,u,i){const r=Oa(s),a=Vl(u);if(a<0||a>r.length)throw new TypeError("Index out of bounds");return[...r.slice(0,a),i,...r.slice(a)]}function ILe(s,u,i){const r=wd(s),a=Vl(u);if(a<0||a>=r.length)throw new TypeError("Index out of bounds");const c=[...r];return c[a]=i,c}function RLe(s,u,i){const r=wd(s),a=r.indexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function DLe(s,u,i){const r=wd(s),a=r.lastIndexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function wLe(s,u,i){return wd(s).map(a=>a===u?i:a)}function CLe(s,u){const i=wd(s),r=Vl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i[r]}function OLe(s){return wd(s)[0]}function _Le(s){const u=wd(s);return u[u.length-1]}function PLe(s,u,...i){return[...Oa(s),u,...i]}function NLe(s,u){const i=Oa(s);return[u,...i]}function VLe(s){return Oa(s).length}function xLe(s,u){const i=Oa(s),r=Vl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i.slice(0,r).concat(i.slice(r+1))}function $Le(s,u){const i=Oa(s),r=Math.max(0,Vl(u)??0);return i.slice(0,r)}function LLe(s,u){const i=Oa(s),r=Math.max(0,Vl(u)??0);return r===0?[]:i.slice(-r)}function BLe(s,u,i){const r=Oa(s),a=u==null?void 0:Vl(u),c=i==null?void 0:Vl(i);return r.slice(a,c)}function MLe(s,u){return Oa(s).indexOf(u)}function GLe(s,u){return Oa(s).lastIndexOf(u)}function kLe(s){const u=Oa(s),i=[],r=new Set;for(const a of u)r.has(a)||(r.add(a),i.push(a));return i}function ULe(s){return Oa(s).reduce((i,r)=>i.concat(r),[])}function jLe(s){const u=Oa(s);if(u.length<=1)return[...u];const i=u[0],r=typeof i=="number"&&u.every(e=>typeof e=="number"&&Number.isFinite(e)),a=typeof i=="string"&&u.every(e=>typeof e=="string");let c=null;if(r?c="number":a&&(c=u.every(f=>q1i.test(f)&&U(f).isValid())?"date":"string"),!c)throw new TypeError("All items must be of the same supported type: number, string, or ISO date string.");return c==="number"?[...u].sort((e,f)=>e-f):c==="string"?[...u].sort((e,f)=>e.localeCompare(f)):[...u].sort((e,f)=>U(e).valueOf()-U(f).valueOf())}function FLe(s){const i=[...Oa(s)];for(let r=i.length-1;r>0;r--){const a=Math.floor(vD()*(r+1));[i[r],i[a]]=[i[a],i[r]]}return i}function KLe(s,u){const i=Oa(s),r=Math.max(1,Vl(u)||1),a=[];for(let c=0;c<i.length;c+=r)a.push(i.slice(c,c+r));return a}function SLe(s,u,i){const r=Oa(s),a=Math.max(0,Vl(u)||0);if(r.length>=a)return[...r];const c=a-r.length;return Array(c).fill(i).concat(r)}function qLe(s,u,i){const r=Oa(s),a=Math.max(0,Vl(u)||0);if(r.length>=a)return[...r];const c=a-r.length,e=Array(c).fill(i);return r.concat(e)}function ZLe(s,u){const i=Oa(s),r=Math.max(0,Vl(u)||0),a=[];for(let c=0;c<r;c++)a.push(...i);return a}function HLe(s,u){if(!sL(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return lL(s).some(r=>r===u)}function WLe(s,u){const i=lL(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(sL))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return r.every(a=>i.includes(a))}function zLe(s,u){const i=lL(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(sL))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return r.some(a=>i.includes(a))}class YLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.firstList.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.separator.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Join].inputs.secondList.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)}),R=mLe([m,b,...w]);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class JLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Split);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[pe.Split].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(R=>{var O,$;return(($=(O=R.valueOwner)==null?void 0:O.declaration)==null?void 0:$.id)===j.operation[pe.Split].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),[A,w]=vLe(m,b);return{value:F.Success,error:null,result:[A,w]}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class QLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Reverse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Reverse].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ELe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class XLe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.DeleteLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.DeleteLastNItems].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=bLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class eBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.DeleteFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.DeleteFirstNItems].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ALe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class tBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.AddAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.index.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.AddAtIndex].inputs.value.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=gLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class iBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.index.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAtIndex].inputs.value.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=ILe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class rBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceFirstNItems].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=RLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class nBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceLastNItems].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=DLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class aBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.ReplaceAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.searchValue.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.ReplaceAll].inputs.replaceValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=wLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class sBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexItem].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexItem].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=CLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class lBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetFirst);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.GetFirst].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=OLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class oBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.GetLast);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.GetLast].inputs.list.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_Le(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class dBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.elementToAppend.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[pe.Append].inputs.dynamicArgument.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)}),R=PLe(m,b,...w);return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class uBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(pe.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Prepend].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Prepend].inputs.listPrependOperationValueArg.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=NLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class pBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLength);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,v;return((v=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:v.id)===j.operation[pe.GetLength].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:VLe(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class cBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX,version:"1.0.0",description:"List delete one item at index (non-mutating)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.DeleteAtIndex].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.DeleteAtIndex].inputs.index.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=xLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class fBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetFirstNItems].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetFirstNItems].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=$Le(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class yBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastNItems].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastNItems].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=LLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class hBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Slice);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.startIndex.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.Slice].inputs.endIndex.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=BLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class mBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Concat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),[c,...e]=a,f=TLe(c,...e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class TBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexOf].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetIndexOf].inputs.searchValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=MLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class vBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastIndexOf].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.GetLastIndexOf].inputs.searchValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=GLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class EBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Unique);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Unique].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=kLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class bBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Flatten);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Flatten].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ULe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class ABe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT,version:"1.0.0",description:"List sort (non-mutating). Supports lists of strings (alphabetic), numbers (numeric), or ISO date strings (chronological).",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Sort);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Sort].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class gBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Shuffle);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var v,b;return((b=(v=m.valueOwner)==null?void 0:v.declaration)==null?void 0:b.id)===j.operation[pe.Shuffle].inputs.listValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=FLe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class IBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Chunk);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Chunk].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Chunk].inputs.size.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=KLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class RBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.PadStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.targetLength.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadStart].inputs.padValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=SLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class DBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.PadEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const v=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.listValue.id}),b=((a=v==null?void 0:v.value)==null?void 0:a.valueAsType)??((c=v==null?void 0:v.value)==null?void 0:c.value),A=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.targetLength.id}),w=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),R=r.find(G=>{var x,k;return((k=(x=G.valueOwner)==null?void 0:x.declaration)==null?void 0:k.id)===j.operation[pe.PadEnd].inputs.padValue.id}),O=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=qLe(b,w,O);return{value:F.Success,error:null,result:$}}catch(v){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:v,result:null}}}})}}class wBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Repeat].inputs.listValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Repeat].inputs.count.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=ZLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class CBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Contains].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.Contains].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=HLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class OBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.ContainsAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAll].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAll].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=WLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class _Be extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(pe.ContainsAny);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAny].inputs.list.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(w=>{var R,O;return((O=(R=w.valueOwner)==null?void 0:R.declaration)==null?void 0:O.id)===j.operation[pe.ContainsAny].inputs.needle.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),A=zLe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Z1i extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.GetLength);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.length;return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class PBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.separator.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.first.id}),v=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.second.id}),A=((e=b==null?void 0:b.value)==null?void 0:e.value)||"",R=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[Y.Join].inputs.dynamicString.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)||((x=$.value)==null?void 0:x.value)||""}),O=[v,A,...R].join(h);return{value:F.Success,error:null,result:O}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class NBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1],f={firstPart:c.slice(0,e),secondPart:c.slice(e)};return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class VBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS,version:"1.0.0",description:"String split at all the occurrences of separators operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtAllSeparators);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1],f=c.split(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class xBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR,version:"1.0.0",description:"String split at the first occurrence of a separator operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtFirstSeparator);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=c.indexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class $Be extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR,version:"1.0.0",description:"String split at the last occurrence of a separator operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.SplitAtLastSeparator);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=c.lastIndexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class LBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS,version:"1.0.0",description:"String delete last number of characters operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,-e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class BBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS,version:"1.0.0",description:"String delete first number of characters operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class MBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Reverse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.split("").reverse().join("");return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class GBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ToLowerCase);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.toLowerCase();return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class kBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ToUpperCase);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const e=c.toUpperCase();return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class UBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=Math.min(f,c.length-e),m=c.slice(0,e)+c.slice(e+h);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class jBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.AddAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,e)+f+c.slice(e);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class FBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1]??1,f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=f+c.slice(e);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class KBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1]??1,f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,-e)+f;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class SBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2]??1,h=a[3];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const m=(c.slice(0,e)||"")+h+(c.slice(e+f)||"");return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class qBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceFirstMatch);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.replace(e,f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class ZBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceLastMatch);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)||((A=v.value)==null?void 0:A.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.lastIndexOf(e),m=h===-1?c:c.substring(0,h)+f+c.substring(h+e.length);return{value:F.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class HBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.ReplaceAllMatches);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)||((b=m.value)==null?void 0:b.value)}),c=a[0],e=a[1],f=a[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const h=c.split(e).join(f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class WBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.charAt(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class zBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS,version:"1.0.0",description:"String get last N chars operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetLastNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(-e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class YBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS,version:"1.0.0",description:"String get first N chars operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetFirstNChars);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class JBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};if(typeof e!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No search value provided",result:null};const f=c.indexOf(e);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class QBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.stringValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.valueToAppend.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter(O=>{var $,G;return((G=($=O.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===j.operation[Y.Append].inputs.dynamicArgument.id}).map(O=>{var $,G;return(($=O.value)==null?void 0:$.valueAsType)??((G=O.value)==null?void 0:G.value)});if(typeof m!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};if(typeof b!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No value to append provided",result:null};if(!w.every(O=>typeof O=="string"))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"All values to append must be strings",result:null};const R=[m,b,...w].join("");return{value:F.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class XBe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(Y.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)||((v=h.value)==null?void 0:v.value)}),c=a[0],e=a[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No string provided",result:null};const f=e+c;return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class eMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Trim);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trim();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class tMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.TrimStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trimStart();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class iMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.TrimEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=a.trimEnd();return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class rMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Substring);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.substring(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class nMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Slice);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.slice(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class aMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.lastIndexOf(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class sMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.PadStart);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.padStart(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class lMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.PadEnd);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)}),f=a.padEnd(c,e??void 0);return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class oMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=a.repeat(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class dMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),f=new RegExp(String(c??""),e?String(e):void 0),h=String(a??"").match(f);return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class uMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchAllRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(b=>{var A,w;return((A=b.value)==null?void 0:A.valueAsType)??((w=b.value)==null?void 0:w.value)}),f=e?String(e):"",h=f.includes("g")?f:f+"g",m=new RegExp(String(c??""),h),v=Array.from(String(a??"").matchAll(m),b=>Array.from(b));return{value:F.Success,error:null,result:v}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class pMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.SearchRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(h=>{var m,v;return((m=h.value)==null?void 0:m.valueAsType)??((v=h.value)==null?void 0:v.value)});let f=-1;try{const h=new RegExp(String(c??""),e?String(e):void 0);f=String(a??"").search(h)}catch{f=-1}return{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class cMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.ReplaceRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(v=>{var b,A;return((b=v.value)==null?void 0:b.valueAsType)??((A=v.value)==null?void 0:A.value)});let h=String(a??"");const m=new RegExp(String(c??""),f?String(f):void 0);return h=h.replace(m,String(e??"")),{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class fMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.NormalizeUnicode);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=a.normalize(c||"NFC");return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}const dR=class dR extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemoveDiacritics);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a??"").normalize("NFD").replace(dR.COMBINING_MARKS,"");return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}};D(dR,"COMBINING_MARKS",/[\u0300-\u036f]/g);let kI=dR;class yMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.CountOccurrences);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=f===""?0:e.split(f).length-1;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class hMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX,version:"1.0.0",description:"Ensure string starts with given prefix (add if missing)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EnsurePrefix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.startsWith(f)?e:f+e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class mMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX,version:"1.0.0",description:"Ensure string ends with given suffix (add if missing)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EnsureSuffix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.endsWith(f)?e:e+f;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class TMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemovePrefix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.startsWith(f)?e.slice(f.length):e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class vMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.RemoveSuffix);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)}),e=String(a??""),f=String(c??""),h=e.endsWith(f)?e.slice(0,-f.length):e;return{value:F.Success,error:null,result:h}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class EMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.StartsWith);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("StartsWith expects two strings.");const e=a.startsWith(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class bMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.EndsWith);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("EndsWith expects two strings.");const e=a.endsWith(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class AMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("Contains expects two strings.");const e=a.includes(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class gMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX,version:"1.0.0",description:"Regex test: new RegExp(pattern, flags?).test(src) -> boolean",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(Y.MatchesRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(m=>{var v,b;return((v=m.value)==null?void 0:v.valueAsType)??((b=m.value)==null?void 0:b.value)});if(typeof a!="string"||typeof c!="string")throw new TypeError("MatchesRegex expects source and pattern to be strings.");if(!(e===void 0||typeof e=="string"))throw new TypeError("MatchesRegex flags must be a string if provided.");let f=!1;return f=new RegExp(c,e).test(a),{value:F.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}function IMe(s,u){const i=Number(s),a=10**Math.max(0,Number(u)||0);return Math.round(i*a)/a}function RMe(s,u){const i=Number(s),r=Math.abs(Number(u)||0);return r===0?i:Math.round(i/r)*r}function DMe(s,u,i){const r=Number(s),a=Number(u),c=Number(i);return Math.min(Math.max(r,a),c)}function wMe(s,u,i,r,a){const c=Number(s),e=Number(u),f=Number(i),h=Number(r),m=Number(a);if(e===f)throw new Error("Input range cannot be zero");const v=(c-e)/(f-e);return h+v*(m-h)}function CMe(...s){const u=s.map(r=>Number(r));return u.length===0?0:u.reduce((r,a)=>r+a,0)/u.length}function OMe(...s){const u=s.map(r=>Number(r)).sort((r,a)=>r-a);if(u.length===0)return 0;const i=Math.floor(u.length/2);return u.length%2?u[i]:(u[i-1]+u[i])/2}function _Me(s,u){const i=Number(s),r=Number(u);return r===0?NaN:i<0&&r%2===1?-Math.pow(-i,1/r):Math.pow(i,1/r)}function PMe(s,u){const i=Number(s),r=Number(u);return i===0?1/0:(r-i)/i*100}const Cr=s=>s.map(u=>{var i,r;return((i=u.value)==null?void 0:i.valueAsType)??((r=u.value)==null?void 0:r.value)});class NMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Addition);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=Cr(r).reduce((e,f)=>e+f,0);return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class VMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Subtraction);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=Cr(r).reduce((e,f)=>e-f,0);return{value:F.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class xMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Multiplication);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.firstFactor.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.secondFactor.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Multiplication].inputs.dynamicFactor.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),O=[m,b,...w].reduce(($,G)=>$*G,1);return{value:F.Success,error:null,result:O}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class $Me extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Division);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r);if(c===0)throw new Error("Division by zero is not allowed");const e=a/c;return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class LMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Remainder);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r);if(c===0)throw new Error("Division by zero is not allowed");const e=a%c;return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class BMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(a=>a.contextType===le.Logic);if(r){const a=r.get(ce.Exponentiation);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Cr(r),e=Math.pow(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class MMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Negate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:-a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class GMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Absolute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.abs(Number(a))}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class kMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Sign);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sign(Number(a))}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class UMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Round);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.round(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class jMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Floor);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.floor(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class FMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Ceil);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.ceil(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class KMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Trunc);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.trunc(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class SMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.RoundToDecimals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=IMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class qMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP,version:"1.0.0",description:"Snap a number to the nearest multiple of step (>=0 step)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.SnapToStep);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=RMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class ZMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Clamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Cr(r),f=DMe(a,c,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class HMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MapRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h]=Cr(r),m=wMe(a,c,e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class WMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Average);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Average].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w],O=CMe(...R);return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class zMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Median);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.Median].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w],O=OMe(...R);return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class YMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MinOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MinOf].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w].filter($=>typeof $=="number"&&!Number.isNaN($)),O=R.length?Math.min(...R):1/0;return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class JMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MaxOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.firstValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),v=r.find($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.secondValue.id}),b=((e=v==null?void 0:v.value)==null?void 0:e.valueAsType)??((f=v==null?void 0:v.value)==null?void 0:f.value),w=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===j.operation[ce.MaxOf].inputs.dynamicValue.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),R=[m,b,...w].filter($=>typeof $=="number"&&!Number.isNaN($)),O=R.length?Math.max(...R):-1/0;return{value:F.Success,error:null,result:O}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class QMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.SquareRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sqrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class XMe extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.CubeRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.cbrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class e2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.NthRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=_Me(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class t2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Exp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.exp(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class i2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LogNatural);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.log(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class r2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Log10);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r),c=Number(a),e=Math.log10?Math.log10(c):Math.log(c)/Math.LN10;return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class n2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Sin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.sin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class a2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Cos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.cos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class s2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Tan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.tan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class l2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Asin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.asin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class o2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Acos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.acos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class d2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Atan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Math.atan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class u2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.Atan2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:Math.atan2(Number(a),Number(c))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class p2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.ToRadians);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Number(a)*Math.PI/180}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class c2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.ToDegrees);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Cr(r);return{value:F.Success,error:null,result:Number(a)*180/Math.PI}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class f2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.PercentOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=Number(a)/100*Number(c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class GP extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.PercentageChange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r),e=PMe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class y2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LessThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a<c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class h2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MoreThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a>c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class m2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.LessThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a<=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class T2e extends $e{constructor(){super(...arguments);D(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:Ve.High,permissions:[xe.All],contexts:[le.Logic]});D(this,"module",{init:i=>{const r=i.find(c=>c.contextType===le.Logic),a=r==null?void 0:r.get(ce.MoreThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Cr(r);return{value:F.Success,error:null,result:a>=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}function v2e(s,u){return function(){return s.apply(u,arguments)}}const{toString:H1i}=Object.prototype,{getPrototypeOf:oL}=Object,{iterator:DD,toStringTag:E2e}=Symbol,wD=(s=>u=>{const i=H1i.call(u);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Cd=s=>(s=s.toLowerCase(),u=>wD(u)===s),CD=s=>u=>typeof u===s,{isArray:V0}=Array,Em=CD("undefined");function Nb(s){return s!==null&&!Em(s)&&s.constructor!==null&&!Em(s.constructor)&&il(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const b2e=Cd("ArrayBuffer");function W1i(s){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(s):u=s&&s.buffer&&b2e(s.buffer),u}const z1i=CD("string"),il=CD("function"),A2e=CD("number"),Vb=s=>s!==null&&typeof s=="object",Y1i=s=>s===!0||s===!1,mI=s=>{if(wD(s)!=="object")return!1;const u=oL(s);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(E2e in s)&&!(DD in s)},J1i=s=>{if(!Vb(s)||Nb(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},Q1i=Cd("Date"),X1i=Cd("File"),eDi=s=>!!(s&&typeof s.uri<"u"),tDi=s=>s&&typeof s.getParts<"u",iDi=Cd("Blob"),rDi=Cd("FileList"),nDi=s=>Vb(s)&&il(s.pipe);function aDi(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const _j=aDi(),Pj=typeof _j.FormData<"u"?_j.FormData:void 0,sDi=s=>{let u;return s&&(Pj&&s instanceof Pj||il(s.append)&&((u=wD(s))==="formdata"||u==="object"&&il(s.toString)&&s.toString()==="[object FormData]"))},lDi=Cd("URLSearchParams"),[oDi,dDi,uDi,pDi]=["ReadableStream","Request","Response","Headers"].map(Cd),cDi=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xb(s,u,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let r,a;if(typeof s!="object"&&(s=[s]),V0(s))for(r=0,a=s.length;r<a;r++)u.call(null,s[r],r,s);else{if(Nb(s))return;const c=i?Object.getOwnPropertyNames(s):Object.keys(s),e=c.length;let f;for(r=0;r<e;r++)f=c[r],u.call(null,s[f],f,s)}}function g2e(s,u){if(Nb(s))return null;u=u.toLowerCase();const i=Object.keys(s);let r=i.length,a;for(;r-- >0;)if(a=i[r],u===a.toLowerCase())return a;return null}const fy=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),I2e=s=>!Em(s)&&s!==fy;function kP(){const{caseless:s,skipUndefined:u}=I2e(this)&&this||{},i={},r=(a,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=s&&g2e(i,c)||c;mI(i[e])&&mI(a)?i[e]=kP(i[e],a):mI(a)?i[e]=kP({},a):V0(a)?i[e]=a.slice():(!u||!Em(a))&&(i[e]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&xb(arguments[a],r);return i}const fDi=(s,u,i,{allOwnKeys:r}={})=>(xb(u,(a,c)=>{i&&il(a)?Object.defineProperty(s,c,{value:v2e(a,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,c,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),s),yDi=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),hDi=(s,u,i,r)=>{s.prototype=Object.create(u.prototype,r),Object.defineProperty(s.prototype,"constructor",{value:s,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(s,"super",{value:u.prototype}),i&&Object.assign(s.prototype,i)},mDi=(s,u,i,r)=>{let a,c,e;const f={};if(u=u||{},s==null)return u;do{for(a=Object.getOwnPropertyNames(s),c=a.length;c-- >0;)e=a[c],(!r||r(e,s,u))&&!f[e]&&(u[e]=s[e],f[e]=!0);s=i!==!1&&oL(s)}while(s&&(!i||i(s,u))&&s!==Object.prototype);return u},TDi=(s,u,i)=>{s=String(s),(i===void 0||i>s.length)&&(i=s.length),i-=u.length;const r=s.indexOf(u,i);return r!==-1&&r===i},vDi=s=>{if(!s)return null;if(V0(s))return s;let u=s.length;if(!A2e(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=s[u];return i},EDi=(s=>u=>s&&u instanceof s)(typeof Uint8Array<"u"&&oL(Uint8Array)),bDi=(s,u)=>{const r=(s&&s[DD]).call(s);let a;for(;(a=r.next())&&!a.done;){const c=a.value;u.call(s,c[0],c[1])}},ADi=(s,u)=>{let i;const r=[];for(;(i=s.exec(u))!==null;)r.push(i);return r},gDi=Cd("HTMLFormElement"),IDi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,r,a){return r.toUpperCase()+a}),Nj=(({hasOwnProperty:s})=>(u,i)=>s.call(u,i))(Object.prototype),RDi=Cd("RegExp"),R2e=(s,u)=>{const i=Object.getOwnPropertyDescriptors(s),r={};xb(i,(a,c)=>{let e;(e=u(a,c,s))!==!1&&(r[c]=e||a)}),Object.defineProperties(s,r)},DDi=s=>{R2e(s,(u,i)=>{if(il(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const r=s[i];if(il(r)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},wDi=(s,u)=>{const i={},r=a=>{a.forEach(c=>{i[c]=!0})};return V0(s)?r(s):r(String(s).split(u)),i},CDi=()=>{},ODi=(s,u)=>s!=null&&Number.isFinite(s=+s)?s:u;function _Di(s){return!!(s&&il(s.append)&&s[E2e]==="FormData"&&s[DD])}const PDi=s=>{const u=new Array(10),i=(r,a)=>{if(Vb(r)){if(u.indexOf(r)>=0)return;if(Nb(r))return r;if(!("toJSON"in r)){u[a]=r;const c=V0(r)?[]:{};return xb(r,(e,f)=>{const h=i(e,a+1);!Em(h)&&(c[f]=h)}),u[a]=void 0,c}}return r};return i(s,0)},NDi=Cd("AsyncFunction"),VDi=s=>s&&(Vb(s)||il(s))&&il(s.then)&&il(s.catch),D2e=((s,u)=>s?setImmediate:u?((i,r)=>(fy.addEventListener("message",({source:a,data:c})=>{a===fy&&c===i&&r.length&&r.shift()()},!1),a=>{r.push(a),fy.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",il(fy.postMessage)),xDi=typeof queueMicrotask<"u"?queueMicrotask.bind(fy):typeof process<"u"&&process.nextTick||D2e,$Di=s=>s!=null&&il(s[DD]),Qe={isArray:V0,isArrayBuffer:b2e,isBuffer:Nb,isFormData:sDi,isArrayBufferView:W1i,isString:z1i,isNumber:A2e,isBoolean:Y1i,isObject:Vb,isPlainObject:mI,isEmptyObject:J1i,isReadableStream:oDi,isRequest:dDi,isResponse:uDi,isHeaders:pDi,isUndefined:Em,isDate:Q1i,isFile:X1i,isReactNativeBlob:eDi,isReactNative:tDi,isBlob:iDi,isRegExp:RDi,isFunction:il,isStream:nDi,isURLSearchParams:lDi,isTypedArray:EDi,isFileList:rDi,forEach:xb,merge:kP,extend:fDi,trim:cDi,stripBOM:yDi,inherits:hDi,toFlatObject:mDi,kindOf:wD,kindOfTest:Cd,endsWith:TDi,toArray:vDi,forEachEntry:bDi,matchAll:ADi,isHTMLForm:gDi,hasOwnProperty:Nj,hasOwnProp:Nj,reduceDescriptors:R2e,freezeMethods:DDi,toObjectSet:wDi,toCamelCase:IDi,noop:CDi,toFiniteNumber:ODi,findKey:g2e,global:fy,isContextDefined:I2e,isSpecCompliantForm:_Di,toJSONObject:PDi,isAsyncFn:NDi,isThenable:VDi,setImmediate:D2e,asap:xDi,isIterable:$Di};class Gs extends Error{static from(u,i,r,a,c,e){const f=new Gs(u.message,i||u.code,r,a,c);return f.cause=u,f.name=u.name,u.status!=null&&f.status==null&&(f.status=u.status),e&&Object.assign(f,e),f}constructor(u,i,r,a,c){super(u),Object.defineProperty(this,"message",{value:u,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),r&&(this.config=r),a&&(this.request=a),c&&(this.response=c,this.status=c.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qe.toJSONObject(this.config),code:this.code,status:this.status}}}Gs.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Gs.ERR_BAD_OPTION="ERR_BAD_OPTION";Gs.ECONNABORTED="ECONNABORTED";Gs.ETIMEDOUT="ETIMEDOUT";Gs.ERR_NETWORK="ERR_NETWORK";Gs.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Gs.ERR_DEPRECATED="ERR_DEPRECATED";Gs.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Gs.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Gs.ERR_CANCELED="ERR_CANCELED";Gs.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Gs.ERR_INVALID_URL="ERR_INVALID_URL";const Nr=Gs,LDi=null;function UP(s){return Qe.isPlainObject(s)||Qe.isArray(s)}function w2e(s){return Qe.endsWith(s,"[]")?s.slice(0,-2):s}function Y_(s,u,i){return s?s.concat(u).map(function(a,c){return a=w2e(a),!i&&c?"["+a+"]":a}).join(i?".":""):u}function BDi(s){return Qe.isArray(s)&&!s.some(UP)}const MDi=Qe.toFlatObject(Qe,{},null,function(u){return/^is[A-Z]/.test(u)});function OD(s,u,i){if(!Qe.isObject(s))throw new TypeError("target must be an object");u=u||new FormData,i=Qe.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,$){return!Qe.isUndefined($[O])});const r=i.metaTokens,a=i.visitor||v,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Qe.isSpecCompliantForm(u);if(!Qe.isFunction(a))throw new TypeError("visitor must be a function");function m(R){if(R===null)return"";if(Qe.isDate(R))return R.toISOString();if(Qe.isBoolean(R))return R.toString();if(!h&&Qe.isBlob(R))throw new Nr("Blob is not supported. Use a Buffer instead.");return Qe.isArrayBuffer(R)||Qe.isTypedArray(R)?h&&typeof Blob=="function"?new Blob([R]):Buffer.from(R):R}function v(R,O,$){let G=R;if(Qe.isReactNative(u)&&Qe.isReactNativeBlob(R))return u.append(Y_($,O,c),m(R)),!1;if(R&&!$&&typeof R=="object"){if(Qe.endsWith(O,"{}"))O=r?O:O.slice(0,-2),R=JSON.stringify(R);else if(Qe.isArray(R)&&BDi(R)||(Qe.isFileList(R)||Qe.endsWith(O,"[]"))&&(G=Qe.toArray(R)))return O=w2e(O),G.forEach(function(k,W){!(Qe.isUndefined(k)||k===null)&&u.append(e===!0?Y_([O],W,c):e===null?O:O+"[]",m(k))}),!1}return UP(R)?!0:(u.append(Y_($,O,c),m(R)),!1)}const b=[],A=Object.assign(MDi,{defaultVisitor:v,convertValue:m,isVisitable:UP});function w(R,O){if(!Qe.isUndefined(R)){if(b.indexOf(R)!==-1)throw Error("Circular reference detected in "+O.join("."));b.push(R),Qe.forEach(R,function(G,x){(!(Qe.isUndefined(G)||G===null)&&a.call(u,G,Qe.isString(x)?x.trim():x,O,A))===!0&&w(G,O?O.concat(x):[x])}),b.pop()}}if(!Qe.isObject(s))throw new TypeError("data must be an object");return w(s),u}function Vj(s){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return u[r]})}function dL(s,u){this._pairs=[],s&&OD(s,this,u)}const C2e=dL.prototype;C2e.append=function(u,i){this._pairs.push([u,i])};C2e.toString=function(u){const i=u?function(r){return u.call(this,r,Vj)}:Vj;return this._pairs.map(function(a){return i(a[0])+"="+i(a[1])},"").join("&")};function GDi(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function O2e(s,u,i){if(!u)return s;const r=i&&i.encode||GDi,a=Qe.isFunction(i)?{serialize:i}:i,c=a&&a.serialize;let e;if(c?e=c(u,a):e=Qe.isURLSearchParams(u)?u.toString():new dL(u,a).toString(r),e){const f=s.indexOf("#");f!==-1&&(s=s.slice(0,f)),s+=(s.indexOf("?")===-1?"?":"&")+e}return s}class kDi{constructor(){this.handlers=[]}use(u,i,r){return this.handlers.push({fulfilled:u,rejected:i,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){Qe.forEach(this.handlers,function(r){r!==null&&u(r)})}}const xj=kDi,uL={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},UDi=typeof URLSearchParams<"u"?URLSearchParams:dL,jDi=typeof FormData<"u"?FormData:null,FDi=typeof Blob<"u"?Blob:null,KDi={isBrowser:!0,classes:{URLSearchParams:UDi,FormData:jDi,Blob:FDi},protocols:["http","https","file","blob","url","data"]},pL=typeof window<"u"&&typeof document<"u",jP=typeof navigator=="object"&&navigator||void 0,SDi=pL&&(!jP||["ReactNative","NativeScript","NS"].indexOf(jP.product)<0),qDi=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ZDi=pL&&window.location.href||"http://localhost",HDi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pL,hasStandardBrowserEnv:SDi,hasStandardBrowserWebWorkerEnv:qDi,navigator:jP,origin:ZDi},Symbol.toStringTag,{value:"Module"})),ls={...HDi,...KDi};function WDi(s,u){return OD(s,new ls.classes.URLSearchParams,{visitor:function(i,r,a,c){return ls.isNode&&Qe.isBuffer(i)?(this.append(r,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function zDi(s){return Qe.matchAll(/\w+|\[(\w*)]/g,s).map(u=>u[0]==="[]"?"":u[1]||u[0])}function YDi(s){const u={},i=Object.keys(s);let r;const a=i.length;let c;for(r=0;r<a;r++)c=i[r],u[c]=s[c];return u}function _2e(s){function u(i,r,a,c){let e=i[c++];if(e==="__proto__")return!0;const f=Number.isFinite(+e),h=c>=i.length;return e=!e&&Qe.isArray(a)?a.length:e,h?(Qe.hasOwnProp(a,e)?a[e]=[a[e],r]:a[e]=r,!f):((!a[e]||!Qe.isObject(a[e]))&&(a[e]=[]),u(i,r,a[e],c)&&Qe.isArray(a[e])&&(a[e]=YDi(a[e])),!f)}if(Qe.isFormData(s)&&Qe.isFunction(s.entries)){const i={};return Qe.forEachEntry(s,(r,a)=>{u(zDi(r),a,i,0)}),i}return null}function JDi(s,u,i){if(Qe.isString(s))try{return(u||JSON.parse)(s),Qe.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(i||JSON.stringify)(s)}const cL={transitional:uL,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const r=i.getContentType()||"",a=r.indexOf("application/json")>-1,c=Qe.isObject(u);if(c&&Qe.isHTMLForm(u)&&(u=new FormData(u)),Qe.isFormData(u))return a?JSON.stringify(_2e(u)):u;if(Qe.isArrayBuffer(u)||Qe.isBuffer(u)||Qe.isStream(u)||Qe.isFile(u)||Qe.isBlob(u)||Qe.isReadableStream(u))return u;if(Qe.isArrayBufferView(u))return u.buffer;if(Qe.isURLSearchParams(u))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let f;if(c){if(r.indexOf("application/x-www-form-urlencoded")>-1)return WDi(u,this.formSerializer).toString();if((f=Qe.isFileList(u))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return OD(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||a?(i.setContentType("application/json",!1),JDi(u)):u}],transformResponse:[function(u){const i=this.transitional||cL.transitional,r=i&&i.forcedJSONParsing,a=this.responseType==="json";if(Qe.isResponse(u)||Qe.isReadableStream(u))return u;if(u&&Qe.isString(u)&&(r&&!this.responseType||a)){const e=!(i&&i.silentJSONParsing)&&a;try{return JSON.parse(u,this.parseReviver)}catch(f){if(e)throw f.name==="SyntaxError"?Nr.from(f,Nr.ERR_BAD_RESPONSE,this,null,this.response):f}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ls.classes.FormData,Blob:ls.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qe.forEach(["delete","get","head","post","put","patch"],s=>{cL.headers[s]={}});const fL=cL,QDi=Qe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),XDi=s=>{const u={};let i,r,a;return s&&s.split(`
|
|
50
50
|
`).forEach(function(e){a=e.indexOf(":"),i=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!(!i||u[i]&&QDi[i])&&(i==="set-cookie"?u[i]?u[i].push(r):u[i]=[r]:u[i]=u[i]?u[i]+", "+r:r)}),u},$j=Symbol("internals");function HT(s){return s&&String(s).trim().toLowerCase()}function TI(s){return s===!1||s==null?s:Qe.isArray(s)?s.map(TI):String(s)}function ewi(s){const u=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=i.exec(s);)u[r[1]]=r[2];return u}const twi=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function J_(s,u,i,r,a){if(Qe.isFunction(r))return r.call(this,u,i);if(a&&(u=i),!!Qe.isString(u)){if(Qe.isString(r))return u.indexOf(r)!==-1;if(Qe.isRegExp(r))return r.test(u)}}function iwi(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(u,i,r)=>i.toUpperCase()+r)}function rwi(s,u){const i=Qe.toCamelCase(" "+u);["get","set","has"].forEach(r=>{Object.defineProperty(s,r+i,{value:function(a,c,e){return this[r].call(this,u,a,c,e)},configurable:!0})})}class _D{constructor(u){u&&this.set(u)}set(u,i,r){const a=this;function c(f,h,m){const v=HT(h);if(!v)throw new Error("header name must be a non-empty string");const b=Qe.findKey(a,v);(!b||a[b]===void 0||m===!0||m===void 0&&a[b]!==!1)&&(a[b||h]=TI(f))}const e=(f,h)=>Qe.forEach(f,(m,v)=>c(m,v,h));if(Qe.isPlainObject(u)||u instanceof this.constructor)e(u,i);else if(Qe.isString(u)&&(u=u.trim())&&!twi(u))e(XDi(u),i);else if(Qe.isObject(u)&&Qe.isIterable(u)){let f={},h,m;for(const v of u){if(!Qe.isArray(v))throw TypeError("Object iterator must return a key-value pair");f[m=v[0]]=(h=f[m])?Qe.isArray(h)?[...h,v[1]]:[h,v[1]]:v[1]}e(f,i)}else u!=null&&c(i,u,r);return this}get(u,i){if(u=HT(u),u){const r=Qe.findKey(this,u);if(r){const a=this[r];if(!i)return a;if(i===!0)return ewi(a);if(Qe.isFunction(i))return i.call(this,a,r);if(Qe.isRegExp(i))return i.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(u,i){if(u=HT(u),u){const r=Qe.findKey(this,u);return!!(r&&this[r]!==void 0&&(!i||J_(this,this[r],r,i)))}return!1}delete(u,i){const r=this;let a=!1;function c(e){if(e=HT(e),e){const f=Qe.findKey(r,e);f&&(!i||J_(r,r[f],f,i))&&(delete r[f],a=!0)}}return Qe.isArray(u)?u.forEach(c):c(u),a}clear(u){const i=Object.keys(this);let r=i.length,a=!1;for(;r--;){const c=i[r];(!u||J_(this,this[c],c,u,!0))&&(delete this[c],a=!0)}return a}normalize(u){const i=this,r={};return Qe.forEach(this,(a,c)=>{const e=Qe.findKey(r,c);if(e){i[e]=TI(a),delete i[c];return}const f=u?iwi(c):String(c).trim();f!==c&&delete i[c],i[f]=TI(a),r[f]=!0}),this}concat(...u){return this.constructor.concat(this,...u)}toJSON(u){const i=Object.create(null);return Qe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(i[a]=u&&Qe.isArray(r)?r.join(", "):r)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([u,i])=>u+": "+i).join(`
|
|
51
51
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(u){return u instanceof this?u:new this(u)}static concat(u,...i){const r=new this(u);return i.forEach(a=>r.set(a)),r}static accessor(u){const r=(this[$j]=this[$j]={accessors:{}}).accessors,a=this.prototype;function c(e){const f=HT(e);r[f]||(rwi(a,e),r[f]=!0)}return Qe.isArray(u)?u.forEach(c):c(u),this}}_D.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Qe.reduceDescriptors(_D.prototype,({value:s},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>s,set(r){this[i]=r}}});Qe.freezeMethods(_D);const zo=_D;function Q_(s,u){const i=this||fL,r=u||i,a=zo.from(r.headers);let c=r.data;return Qe.forEach(s,function(f){c=f.call(i,c,a.normalize(),u?u.status:void 0)}),a.normalize(),c}function P2e(s){return!!(s&&s.__CANCEL__)}class nwi extends Nr{constructor(u,i,r){super(u??"canceled",Nr.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}}const $b=nwi;function N2e(s,u,i){const r=i.config.validateStatus;!i.status||!r||r(i.status)?s(i):u(new Nr("Request failed with status code "+i.status,[Nr.ERR_BAD_REQUEST,Nr.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function awi(s){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return u&&u[1]||""}function swi(s,u){s=s||10;const i=new Array(s),r=new Array(s);let a=0,c=0,e;return u=u!==void 0?u:1e3,function(h){const m=Date.now(),v=r[c];e||(e=m),i[a]=h,r[a]=m;let b=c,A=0;for(;b!==a;)A+=i[b++],b=b%s;if(a=(a+1)%s,a===c&&(c=(c+1)%s),m-e<u)return;const w=v&&m-v;return w?Math.round(A*1e3/w):void 0}}function lwi(s,u){let i=0,r=1e3/u,a,c;const e=(m,v=Date.now())=>{i=v,a=null,c&&(clearTimeout(c),c=null),s(...m)};return[(...m)=>{const v=Date.now(),b=v-i;b>=r?e(m,v):(a=m,c||(c=setTimeout(()=>{c=null,e(a)},r-b)))},()=>a&&e(a)]}const UI=(s,u,i=3)=>{let r=0;const a=swi(50,250);return lwi(c=>{const e=c.loaded,f=c.lengthComputable?c.total:void 0,h=e-r,m=a(h),v=e<=f;r=e;const b={loaded:e,total:f,progress:f?e/f:void 0,bytes:h,rate:m||void 0,estimated:m&&f&&v?(f-e)/m:void 0,event:c,lengthComputable:f!=null,[u?"download":"upload"]:!0};s(b)},i)},Lj=(s,u)=>{const i=s!=null;return[r=>u[0]({lengthComputable:i,total:s,loaded:r}),u[1]]},Bj=s=>(...u)=>Qe.asap(()=>s(...u)),owi=ls.hasStandardBrowserEnv?((s,u)=>i=>(i=new URL(i,ls.origin),s.protocol===i.protocol&&s.host===i.host&&(u||s.port===i.port)))(new URL(ls.origin),ls.navigator&&/(msie|trident)/i.test(ls.navigator.userAgent)):()=>!0,dwi=ls.hasStandardBrowserEnv?{write(s,u,i,r,a,c,e){if(typeof document>"u")return;const f=[`${s}=${encodeURIComponent(u)}`];Qe.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),Qe.isString(r)&&f.push(`path=${r}`),Qe.isString(a)&&f.push(`domain=${a}`),c===!0&&f.push("secure"),Qe.isString(e)&&f.push(`SameSite=${e}`),document.cookie=f.join("; ")},read(s){if(typeof document>"u")return null;const u=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return u?decodeURIComponent(u[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uwi(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function pwi(s,u){return u?s.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):s}function V2e(s,u,i){let r=!uwi(u);return s&&(r||i==!1)?pwi(s,u):u}const Mj=s=>s instanceof zo?{...s}:s;function by(s,u){u=u||{};const i={};function r(m,v,b,A){return Qe.isPlainObject(m)&&Qe.isPlainObject(v)?Qe.merge.call({caseless:A},m,v):Qe.isPlainObject(v)?Qe.merge({},v):Qe.isArray(v)?v.slice():v}function a(m,v,b,A){if(Qe.isUndefined(v)){if(!Qe.isUndefined(m))return r(void 0,m,b,A)}else return r(m,v,b,A)}function c(m,v){if(!Qe.isUndefined(v))return r(void 0,v)}function e(m,v){if(Qe.isUndefined(v)){if(!Qe.isUndefined(m))return r(void 0,m)}else return r(void 0,v)}function f(m,v,b){if(b in u)return r(m,v);if(b in s)return r(void 0,m)}const h={url:c,method:c,data:c,baseURL:e,transformRequest:e,transformResponse:e,paramsSerializer:e,timeout:e,timeoutMessage:e,withCredentials:e,withXSRFToken:e,adapter:e,responseType:e,xsrfCookieName:e,xsrfHeaderName:e,onUploadProgress:e,onDownloadProgress:e,decompress:e,maxContentLength:e,maxBodyLength:e,beforeRedirect:e,transport:e,httpAgent:e,httpsAgent:e,cancelToken:e,socketPath:e,responseEncoding:e,validateStatus:f,headers:(m,v,b)=>a(Mj(m),Mj(v),b,!0)};return Qe.forEach(Object.keys({...s,...u}),function(v){if(v==="__proto__"||v==="constructor"||v==="prototype")return;const b=Qe.hasOwnProp(h,v)?h[v]:a,A=b(s[v],u[v],v);Qe.isUndefined(A)&&b!==f||(i[v]=A)}),i}const x2e=s=>{const u=by({},s);let{data:i,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:c,headers:e,auth:f}=u;if(u.headers=e=zo.from(e),u.url=O2e(V2e(u.baseURL,u.url,u.allowAbsoluteUrls),s.params,s.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),Qe.isFormData(i)){if(ls.hasStandardBrowserEnv||ls.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(Qe.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([v,b])=>{m.includes(v.toLowerCase())&&e.set(v,b)})}}if(ls.hasStandardBrowserEnv&&(r&&Qe.isFunction(r)&&(r=r(u)),r||r!==!1&&owi(u.url))){const h=a&&c&&dwi.read(c);h&&e.set(a,h)}return u},cwi=typeof XMLHttpRequest<"u",fwi=cwi&&function(s){return new Promise(function(i,r){const a=x2e(s);let c=a.data;const e=zo.from(a.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=a,v,b,A,w,R;function O(){w&&w(),R&&R(),a.cancelToken&&a.cancelToken.unsubscribe(v),a.signal&&a.signal.removeEventListener("abort",v)}let $=new XMLHttpRequest;$.open(a.method.toUpperCase(),a.url,!0),$.timeout=a.timeout;function G(){if(!$)return;const k=zo.from("getAllResponseHeaders"in $&&$.getAllResponseHeaders()),te={data:!f||f==="text"||f==="json"?$.responseText:$.response,status:$.status,statusText:$.statusText,headers:k,config:s,request:$};N2e(function(Q){i(Q),O()},function(Q){r(Q),O()},te),$=null}"onloadend"in $?$.onloadend=G:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(G)},$.onabort=function(){$&&(r(new Nr("Request aborted",Nr.ECONNABORTED,s,$)),$=null)},$.onerror=function(W){const te=W&&W.message?W.message:"Network Error",ee=new Nr(te,Nr.ERR_NETWORK,s,$);ee.event=W||null,r(ee),$=null},$.ontimeout=function(){let W=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const te=a.transitional||uL;a.timeoutErrorMessage&&(W=a.timeoutErrorMessage),r(new Nr(W,te.clarifyTimeoutError?Nr.ETIMEDOUT:Nr.ECONNABORTED,s,$)),$=null},c===void 0&&e.setContentType(null),"setRequestHeader"in $&&Qe.forEach(e.toJSON(),function(W,te){$.setRequestHeader(te,W)}),Qe.isUndefined(a.withCredentials)||($.withCredentials=!!a.withCredentials),f&&f!=="json"&&($.responseType=a.responseType),m&&([A,R]=UI(m,!0),$.addEventListener("progress",A)),h&&$.upload&&([b,w]=UI(h),$.upload.addEventListener("progress",b),$.upload.addEventListener("loadend",w)),(a.cancelToken||a.signal)&&(v=k=>{$&&(r(!k||k.type?new $b(null,s,$):k),$.abort(),$=null)},a.cancelToken&&a.cancelToken.subscribe(v),a.signal&&(a.signal.aborted?v():a.signal.addEventListener("abort",v)));const x=awi(a.url);if(x&&ls.protocols.indexOf(x)===-1){r(new Nr("Unsupported protocol "+x+":",Nr.ERR_BAD_REQUEST,s));return}$.send(c||null)})},ywi=(s,u)=>{const{length:i}=s=s?s.filter(Boolean):[];if(u||i){let r=new AbortController,a;const c=function(m){if(!a){a=!0,f();const v=m instanceof Error?m:this.reason;r.abort(v instanceof Nr?v:new $b(v instanceof Error?v.message:v))}};let e=u&&setTimeout(()=>{e=null,c(new Nr(`timeout of ${u}ms exceeded`,Nr.ETIMEDOUT))},u);const f=()=>{s&&(e&&clearTimeout(e),e=null,s.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),s=null)};s.forEach(m=>m.addEventListener("abort",c));const{signal:h}=r;return h.unsubscribe=()=>Qe.asap(f),h}},hwi=ywi,mwi=function*(s,u){let i=s.byteLength;if(!u||i<u){yield s;return}let r=0,a;for(;r<i;)a=r+u,yield s.slice(r,a),r=a},Twi=async function*(s,u){for await(const i of vwi(s))yield*mwi(i,u)},vwi=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const u=s.getReader();try{for(;;){const{done:i,value:r}=await u.read();if(i)break;yield r}}finally{await u.cancel()}},Gj=(s,u,i,r)=>{const a=Twi(s,u);let c=0,e,f=h=>{e||(e=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:v}=await a.next();if(m){f(),h.close();return}let b=v.byteLength;if(i){let A=c+=b;i(A)}h.enqueue(new Uint8Array(v))}catch(m){throw f(m),m}},cancel(h){return f(h),a.return()}},{highWaterMark:2})},kj=64*1024,{isFunction:sI}=Qe,Ewi=(({Request:s,Response:u})=>({Request:s,Response:u}))(Qe.global),{ReadableStream:Uj,TextEncoder:jj}=Qe.global,Fj=(s,...u)=>{try{return!!s(...u)}catch{return!1}},bwi=s=>{s=Qe.merge.call({skipUndefined:!0},Ewi,s);const{fetch:u,Request:i,Response:r}=s,a=u?sI(u):typeof fetch=="function",c=sI(i),e=sI(r);if(!a)return!1;const f=a&&sI(Uj),h=a&&(typeof jj=="function"?(R=>O=>R.encode(O))(new jj):async R=>new Uint8Array(await new i(R).arrayBuffer())),m=c&&f&&Fj(()=>{let R=!1;const O=new i(ls.origin,{body:new Uj,method:"POST",get duplex(){return R=!0,"half"}}).headers.has("Content-Type");return R&&!O}),v=e&&f&&Fj(()=>Qe.isReadableStream(new r("").body)),b={stream:v&&(R=>R.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(R=>{!b[R]&&(b[R]=(O,$)=>{let G=O&&O[R];if(G)return G.call(O);throw new Nr(`Response type '${R}' is not supported`,Nr.ERR_NOT_SUPPORT,$)})});const A=async R=>{if(R==null)return 0;if(Qe.isBlob(R))return R.size;if(Qe.isSpecCompliantForm(R))return(await new i(ls.origin,{method:"POST",body:R}).arrayBuffer()).byteLength;if(Qe.isArrayBufferView(R)||Qe.isArrayBuffer(R))return R.byteLength;if(Qe.isURLSearchParams(R)&&(R=R+""),Qe.isString(R))return(await h(R)).byteLength},w=async(R,O)=>{const $=Qe.toFiniteNumber(R.getContentLength());return $??A(O)};return async R=>{let{url:O,method:$,data:G,signal:x,cancelToken:k,timeout:W,onDownloadProgress:te,onUploadProgress:ee,responseType:Q,headers:ne,withCredentials:de="same-origin",fetchOptions:J}=x2e(R),ie=u||fetch;Q=Q?(Q+"").toLowerCase():"text";let se=hwi([x,k&&k.toAbortSignal()],W),fe=null;const ue=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let me;try{if(ee&&m&&$!=="get"&&$!=="head"&&(me=await w(ne,G))!==0){let Ge=new i(O,{method:"POST",body:G,duplex:"half"}),Ie;if(Qe.isFormData(G)&&(Ie=Ge.headers.get("content-type"))&&ne.setContentType(Ie),Ge.body){const[Ue,We]=Lj(me,UI(Bj(ee)));G=Gj(Ge.body,kj,Ue,We)}}Qe.isString(de)||(de=de?"include":"omit");const ve=c&&"credentials"in i.prototype,Ae={...J,signal:se,method:$.toUpperCase(),headers:ne.normalize().toJSON(),body:G,duplex:"half",credentials:ve?de:void 0};fe=c&&new i(O,Ae);let De=await(c?ie(fe,J):ie(O,Ae));const Ce=v&&(Q==="stream"||Q==="response");if(v&&(te||Ce&&ue)){const Ge={};["status","statusText","headers"].forEach(Se=>{Ge[Se]=De[Se]});const Ie=Qe.toFiniteNumber(De.headers.get("content-length")),[Ue,We]=te&&Lj(Ie,UI(Bj(te),!0))||[];De=new r(Gj(De.body,kj,Ue,()=>{We&&We(),ue&&ue()}),Ge)}Q=Q||"text";let Le=await b[Qe.findKey(b,Q)||"text"](De,R);return!Ce&&ue&&ue(),await new Promise((Ge,Ie)=>{N2e(Ge,Ie,{data:Le,headers:zo.from(De.headers),status:De.status,statusText:De.statusText,config:R,request:fe})})}catch(ve){throw ue&&ue(),ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)?Object.assign(new Nr("Network Error",Nr.ERR_NETWORK,R,fe,ve&&ve.response),{cause:ve.cause||ve}):Nr.from(ve,ve&&ve.code,R,fe,ve&&ve.response)}}},Awi=new Map,$2e=s=>{let u=s&&s.env||{};const{fetch:i,Request:r,Response:a}=u,c=[r,a,i];let e=c.length,f=e,h,m,v=Awi;for(;f--;)h=c[f],m=v.get(h),m===void 0&&v.set(h,m=f?new Map:bwi(u)),v=m;return m};$2e();const yL={http:LDi,xhr:fwi,fetch:{get:$2e}};Qe.forEach(yL,(s,u)=>{if(s){try{Object.defineProperty(s,"name",{value:u})}catch{}Object.defineProperty(s,"adapterName",{value:u})}});const Kj=s=>`- ${s}`,gwi=s=>Qe.isFunction(s)||s===null||s===!1;function Iwi(s,u){s=Qe.isArray(s)?s:[s];const{length:i}=s;let r,a;const c={};for(let e=0;e<i;e++){r=s[e];let f;if(a=r,!gwi(r)&&(a=yL[(f=String(r)).toLowerCase()],a===void 0))throw new Nr(`Unknown adapter '${f}'`);if(a&&(Qe.isFunction(a)||(a=a.get(u))))break;c[f||"#"+e]=a}if(!a){const e=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let f=i?e.length>1?`since :
|
|
52
52
|
`+e.map(Kj).join(`
|