@elyx-code/project-logic-tree 0.0.7023 → 0.0.7024

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 CHANGED
@@ -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,j().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,D,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=(D=(A=this.body)==null?void 0:A.dataType)==null?void 0:D.unsubscribeDependents)==null||R.call(D,[{entity:this,field:"loop-body-data-type-field"}]),this}subscribeToDependencies(){var i,r,a,c,e,f,h,m,v,b,A,D,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=(D=(A=this.body)==null?void 0:A.dataType)==null?void 0:D.subscribeDependents)==null||R.call(D,[{entity:this,field:"loop-body-data-type-field"}]),this}increaseVersion(i){var r;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!j(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&j(i).isSame(j(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=j(i).toISOString()||j().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[D,R]of A.knownVersions)v.set(D,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,j().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(i.declaration),c=this.project.get(a);c&&this.setDeclaration(c)}if(i.calledByEntry.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addEntryCaller(e,r),e.addCall(this,r))}),[...this.calledByEntry].forEach(a=>{i.calledByEntry.find(e=>ue(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.calledBySuccess.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addSuccessCaller(e,r),e.addSuccessCall(this,r))}),[...this.calledBySuccess].forEach(a=>{i.calledBySuccess.find(e=>ue(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.calledByError.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addErrorCaller(e,r),e.addErrorCall(this,r))}),[...this.calledByError].forEach(a=>{i.calledByError.find(e=>ue(e)===a.id)||(this.removeCaller(a,r),a.removeCall(this,r))}),i.dataType){const a=ue(i.dataType),c=this.project.get(a);c&&this.setDataType(c,r)}else this.setDataType(null,r);return i.outputs.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addOutput(e,r),e.setParent(this,r))}),[...this.outputs].forEach(a=>{i.outputs.find(e=>ue(e)===a.id)||(this.removeOutput(a,r),a.removeFromParent(r))}),i.inputs.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addInput(e,r),e.setParent(this,r))}),[...this.inputs].forEach(a=>{i.inputs.find(e=>ue(e)===a.id)||(this.removeInput(a,r),a.removeFromParent(r))}),i.writesValues.forEach(a=>{const c=ue(a),e=this.project.get(c);e&&(this.addValueReader(e,r),e.setValueWriter(this,r))}),[...this.writesValues].forEach(a=>{i.writesValues.find(e=>ue(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,j().toISOString(),this,!0,_.UpdateWithGenerationTarget))){var a,c,e;if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(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=>ue(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=ue(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=>ue(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(e=i.calledByError)==null||e.forEach(f=>{const h=ue(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=>ue(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=ue(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=ue(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=ue(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,j().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return re.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,D;return(v.index??((A=v.declaration)==null?void 0:A.index))-(b.index??((D=b.declaration)==null?void 0:D.index))}),this.outputs.sort((v,b)=>{var A,D;return(v.index??((A=v.declaration)==null?void 0:A.index))-(b.index??((D=b.declaration)==null?void 0:D.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,j().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,j().toISOString(),this,!0,_.RemoveInput))){if(!this.checkCanEdit(this,r))return re.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,Y.Affected))),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this}addInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Affected),r==null||r.attemptAutoclose(_.AddInput,this.id),this):(re.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,j().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,Y.Affected),r==null||r.attemptAutoclose("add-output",this.id),this):(re.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,j().toISOString(),this,!0,"remove-output"))){if(!this.checkCanEdit(this,r))return re.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,Y.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,j().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}--${Ue.CannotSuccessCallItself}`,action:_.AddSuccessCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotEntryCallItself}`,action:_.AddEntryCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Ue.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,Y.Affected)),r==null||r.attemptAutoclose(_.AddErrorCall,this.id),this):this}addSuccessCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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:Ue.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,Y.Affected)),r==null||r.attemptAutoclose(_.AddSuccessCall,this.id),this):this}removeCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),r==null||r.add(this,Y.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,j().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,Y.Updated),r==null||r.add(c,Y.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,Y.Updated),r==null||r.add(c,Y.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,Y.Updated),r==null||r.add(c,Y.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,j().toISOString(),this,!0,_.SetErrorEntity))){if(!this.checkCanEdit(this,r))return re.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,Y.Affected)),r==null||r.attemptAutoclose(_.SetErrorEntity,this.id),this}setParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.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,j().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=Yn(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=Yn(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,j().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r),c=Pn(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,Y.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,Y.Added):c&&(r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=ze,...r){return await Pi.repository.APILoad(this.id,...r),this}async APICreate(i=ze,...r){return await Pi.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=ze,...r){return await Pi.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=ze,...r){return await Pi.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=ze,...r){return await Pi.repository.APIClone(this.id,...r),this}async APILoadVersion(i=ze,r,...a){return await Pi.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return re.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,j().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return re.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}--${Ue.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Ue.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,j().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return re.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||Mn(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||j().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=P$(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await _Pe(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=re.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,j().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){var R,C;const e=vn(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)||j().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const b=$r(f,e);r?b.setParent(r,i):b.setParent(this.parent,null),c&&b.subscribe(),b.initChildren(i),i==null||i.add(b,Y.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 D=(C=this.outputs)==null?void 0:C.map(($,G)=>$.clone(i,b,v+"-output-map-"+G+"-id",c));return b.outputs=D,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?Ur(this.body).filter(a=>a.type===d.VariableInstance):[]}addReturnStatement(i){return hi.includes(this.parent.type)&&this.parent.addReturnStatement(i),this}removeReturnStatement(i){return hi.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,j().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 D;return!A.deleted&&!((D=A.declaration)!=null&&D.deleted)}),b=f.filter(A=>!v.find(D=>ye(A,this.project)===ye(D,this.project)&&Ri(A.dataType,D.dataType)));b.length&&(r.push(m),i==null||i.add(m,Y.Updated)),b.forEach(A=>{const D=A.clone(i,m);i==null||i.add(D,Y.Added),D.addSelfToProject(i),a.push(D)})}),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,j().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,j().toISOString(),this,!0,"sync-body-arguments-declarations"))){var C,$,G,x,k,X;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;if(v.sort((te,ie)=>te.index-ie.index),((G=($=(C=this.body)==null?void 0:C.dataType)==null?void 0:$.entity)==null?void 0:G.id)!==U["primitive-entity"].void.id&&!b.find(ie=>{var z,ee,de,Q,H,ae,pe;return ie.id!==((z=this.currentIterationNumberArgumentDeclaration)==null?void 0:z.id)&&ie.id!==((ee=this.currentValueArgumentDeclaration)==null?void 0:ee.id)&&((Q=(de=ie.dataType)==null?void 0:de.entity)==null?void 0:Q.id)===((pe=(ae=(H=this.body)==null?void 0:H.dataType)==null?void 0:ae.entity)==null?void 0:pe.id)})){let ie=0;this.currentIterationNumberArgumentDeclaration&&ie++,this.currentValueArgumentDeclaration&&ie++;const z=Ns.new(i);z.name="Aggregate result",z.description="Aggretated list of all previously outputted values from each iteration",z.constant=!0,z.index=ie,z.required=!1,z.parent=this.body.toReference();const ee=we(z,this.project);if(ee.hydrateAncestors(),ee.addSelfToProject(i),i==null||i.add(ee,Y.Added),a.push(ee),ee.setParent(this.body,i),ee.initChildren(i),!ee.dataType&&((x=this.body)!=null&&x.dataType)){const de=Sr.new(i);de.parent=ee.toReference();const Q=we(de,this.project);Q.hydrateAncestors(),Q.addSelfToProject(i),a.push(Q),Q.setParent(ee,i),Q.initChildren(i),Q.merge((k=this.body)==null?void 0:k.dataType,i),Q.setEntity((X=this.body)==null?void 0:X.dataType.entity,i),i==null||i.add(Q,Y.Added),i||Q.captureVersion()}i||ee.captureVersion()}const{updated:A,added:D,removed:R}=this.removeExtraBodyArgumentDeclarations(i);return r.push(...A),a.push(...D),c.push(...R),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,j().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 X;return!k.deleted&&!((X=k.declaration)!=null&&X.deleted)}),D=A.filter(k=>!k.declaration&&!!k.readsValue),R=A.filter(k=>!k.declaration&&!k.readsValue);let C=(((x=(G=($=this.body)==null?void 0:$.dataType)==null?void 0:G.entity)==null?void 0:x.properties)||[]).filter(k=>!A.find(X=>{var te,ie;return!X.deleted&&!((te=X.declaration)!=null&&te.deleted)&&((ie=X.declaration)==null?void 0:ie.id)===k.id}));D.forEach(k=>{const X=k.getDataType(i);if(k.readsValue){const te=ye(k.readsValue,this.project),ie=C.find(z=>ye(z,this.project)===te&&Ri(z.dataType,X));if(ie){k.setDeclaration(ie,i),r.push(k),C=C.filter(z=>z!==ie);return}}}),R.forEach(k=>{const X=k.getDataType(i),te=C.find(ie=>Ri(ie.dataType,X));if(te){k.setDeclaration(te,i),r.push(k),C=C.filter(ie=>ie!==te);return}}),A.forEach(k=>{const X=C.find(te=>ye(te,this.project)===ye(k,this.project));k.declaration&&!C.includes(k.declaration)&&X&&(k.setDeclaration(X,i),r.push(k),C=C.filter(te=>te!==X))})}),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,j().toISOString(),this,!0,"sync-outputs-properties"))){var C,$,G,x,k,X,te,ie,z,ee,de,Q,H,ae,pe,le,he,ve,ge,Ie,Me,Ge,Be;const r=[],a=[],c=[],e=[],f=[...this.breakStatements,...this.continueStatements];if(!f.every(Ce=>Ce.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(!((C=this.body)!=null&&C.dataType)){const Ce=Sr.new(i);Ce.parent=this.body.toReference(),Ce.inferred=!0;const qe=we(Ce,this.project);qe.hydrateAncestors(),qe.addSelfToProject(i),i==null||i.add(qe,Y.Added),qe.initChildren(i),a.push(qe),h=!0}const m=f.find(Ce=>!!Ce.readsValue);if(m){const Ce=($=m.readsValue)==null?void 0:$.getDataType(i);Ce&&((x=(G=this.body)==null?void 0:G.dataType)==null||x.merge(Ce,i))}h&&(i||(X=(k=this.body)==null?void 0:k.dataType)==null||X.captureVersion());const v=this.getUniqueInputMaps();let b=(ie=(te=this.body)==null?void 0:te.dataType)==null?void 0:ie.entity;if(v.length&&(!b||b.id===U["primitive-entity"].void.id)){const Ce=Fn.new(i);Ce.parent=((z=this.body)==null?void 0:z.dataType).toReference(),Ce.name=`${ye(this,this.project)} output definition`,Ce.description=`The definition of the output data type of the loop '${ye(this,this.project)}'`;const qe=we(Ce,this.project);qe.setParent((ee=this.body)==null?void 0:ee.dataType,i),qe.hydrateAncestors(),i==null||i.add(qe,Y.Added),qe.addSelfToProject(i),qe.initChildren(i),a.push(qe),b=qe,(Q=(de=this.body)==null?void 0:de.dataType)==null||Q.metaSync({inferred:!0},i),i||qe.captureVersion()}const A=(b==null?void 0:b.properties)||[];(ae=(H=this.body)==null?void 0:H.dataType)!=null&&ae.inferred&&((le=(pe=this.body)==null?void 0:pe.dataType.entity)==null?void 0:le.type)===d.DefinitionEntity&&(v.forEach(Ce=>{var mt,lt,dt,vi,Bi;const qe=Ce.getDataType(i);let Ye=A.find(gt=>ye(gt,this.project)===ye(Ce,this.project)&&Ri(gt.dataType,Ce.dataType));if(!Ye){const gt=_s.new(i);gt.name=ye(Ce,this.project),gt.description=`Aggretated list of all previously outputted values from each iteration by the output '${ye(Ce,this.project)}'`,gt.index=Ce.index,gt.required=((mt=Ce.declaration)==null?void 0:mt.required)||!1,gt.parent=((dt=(lt=this.body)==null?void 0:lt.dataType)==null?void 0:dt.entity).toReference();const ot=we(gt,this.project);ot.hydrateAncestors(),ot.setParent((Bi=(vi=this.body)==null?void 0:vi.dataType)==null?void 0:Bi.entity,i),ot.addSelfToProject(i),i==null||i.add(ot,Y.Added),ot.initChildren(i),a.push(ot),Ye=ot,i||ot.captureVersion()}Ye.index!==Ce.index&&(Ye.metaSync({index:Ce.index},i),r.push(Ye));let $t=Ye.getDataType(i);if(qe)if(!$t||!Ri($t,qe)){if(!$t){const gt=qe.clone(i,Ye);i==null||i.add(gt,Y.Added),gt.addSelfToProject(i),$t=gt,a.push(gt),r.push(Ye)}$t.merge(qe,i),$t.metaSync({isList:!0},i)}else $t.isList||($t.metaSync({isList:!0},i),r.push($t));if(!qe&&!$t){const gt={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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:!0,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:Ye.toReference()},ot=we(gt,this.project);ot.metaSync({isList:!0},i),ot.hydrateAncestors(),ot.setParent(Ye,i),ot.addSelfToProject(i),i==null||i.add(ot,Y.Added),ot.initChildren(i),a.push(ot),i||ot.captureVersion()}}),this.reAttachAllTerminationInputMapsToDeclarations(i)),(ve=(he=this.body)==null?void 0:he.dataType)!=null&&ve.inferred&&((Ie=(ge=this.body)==null?void 0:ge.dataType.entity)==null?void 0:Ie.type)===d.DefinitionEntity&&A.filter(qe=>!v.find(Ye=>ye(qe,this.project)===ye(Ye,this.project))).forEach(qe=>{if(!(i!=null&&i.hasRemoved(qe.id))&&!qe.deleted){const{updated:Xe,removed:Ye}=qe.remove({ignoreUpstream:!1},i);r.push(...Xe),c.push(...Ye)}}),f.forEach(Ce=>{Ce.outputs.filter(Xe=>{var Ye;return!Xe.deleted&&!((Ye=Xe.declaration)!=null&&Ye.deleted)}).forEach(Xe=>{var ft,$t,mt;if(!(((mt=($t=(ft=this.body)==null?void 0:ft.dataType)==null?void 0:$t.entity)==null?void 0:mt.properties)||[]).find(lt=>{var dt;return((dt=Xe.declaration)==null?void 0:dt.id)===lt.id})&&!(i!=null&&i.hasRemoved(Xe.id))&&!Xe.deleted){const{updated:lt,removed:dt}=Xe.remove({ignoreUpstream:!1},i);r.push(...lt),c.push(...dt)}})});const D=this.getUniqueInputMaps();if(f.every(Ce=>!Ce.readsValue)&&!D.length){const Ce=this.project.getBuiltIn(U["primitive-entity"].void.id);(Ge=(Me=this.body)==null?void 0:Me.dataType)==null||Ge.setEntity(Ce,i),r.push((Be=this.body)==null?void 0:Be.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,j().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(D=>{var $;let C=h.find(G=>{var x,k;return((x=G.declaration)==null?void 0:x.id)===D.id&&Ri((k=G.declaration)==null?void 0:k.dataType,D.dataType)});if(C)(($=C.declaration)==null?void 0:$.id)!==D.id&&(C.setDeclaration(D,i),r.push(C));else{const G={dataType:null,id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().toISOString(),author:L.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:d.OutputMap,index:D.index,declaration:D.toJSON(),writesValues:[],parent:this.toReference()},x=we(G,this.project);x.hydrateAncestors(),x.setParent(this,i),x.addSelfToProject(i),i==null||i.add(x,Y.Added),x.initChildren(i),a.push(x),i||x.captureVersion(),C=x}C.index!==D.index&&(C.metaSync({index:D.index},i),r.push(C))}),h.filter(D=>!f.find(C=>{var $;return(($=D.declaration)==null?void 0:$.id)===C.id})).forEach(D=>{const{updated:R,removed:C}=D.remove({ignoreUpstream:!1},i);r.push(...R),c.push(...C)}),this.outputs.forEach(D=>{const{updated:R,added:C,removed:$}=D.afterAllChildrenInitialized(i);r.push(...R),a.push(...C),c.push(...$)}),this.outputs.sort((D,R)=>D.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,j().toISOString(),this,!0,"create-current-iteration-number-argument-declaration"))){const r=[],a=[],c=[],e=[];let h=this.body.inputs.find(A=>{var D;return A.name===Pi.CURRENT_ITERATION_NUMBER_ARG_NAME||A.id===((D=this.currentIterationNumberArgumentDeclaration)==null?void 0:D.id)});const m=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!h){const A={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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:[]},D=we(A,this.project);D.hydrateAncestors(),D.setParent(this.body,i),D.addSelfToProject(i),i==null||i.add(D,Y.Added),D.initChildren(i),a.push(D),i||D.captureVersion(),h=D}!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)||j().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()},D=we(A,this.project);D.hydrateAncestors(),D.setParent(h,i),D.addSelfToProject(i),i==null||i.add(D,Y.Added),D.initChildren(i),a.push(D),i||D.captureVersion(),b=D}if(!b.entity||b.entity.type!==d.PrimitiveEntity||b.entity.name!==me.Number||b.entity.id!==U["primitive-entity"].number.id){const A=this.project.getBuiltIn(U["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,j().toISOString(),this,!0,"remove-extra-body-argument-declarations"))){const r=[],a=[],c=[],e=[];return this.body.inputs.filter(m=>{var v,b,A,D,R,C,$,G;return m===this.currentIterationNumberArgumentDeclaration||m===this.currentValueArgumentDeclaration?!1:((A=(b=(v=this.body)==null?void 0:v.dataType)==null?void 0:b.entity)==null?void 0:A.id)===U["primitive-entity"].void.id?!0:((R=(D=m.dataType)==null?void 0:D.entity)==null?void 0:R.id)!==((G=($=(C=this.body)==null?void 0:C.dataType)==null?void 0:$.entity)==null?void 0:G.id)}).forEach(m=>{const{updated:v,removed:b}=m.remove({ignoreUpstream:!1},i);r.push(...v),c.push(...b)}),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,j().toISOString(),this,!0,"create-current-value-input-based-on-input-map"))){var v,b,A,D,R,C,$,G,x;const r=[],a=[],c=[],e=[];switch(this.declaration.id){case Ot.List:{const k=this.body.inputs.find(ie=>!!ie.implements.find(z=>z.id===U[d.Loop][Ot.List].body.inputs.currentValue.id)),X=this.inputs.find(ie=>{var z;return((z=ie.declaration)==null?void 0:z.id)===U[d.Loop][Ot.List].inputs.list.id});if(!X)break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(de=>de.id===te.id)&&(k.addImplementation(te,i),r.push(k));let z=k.getDataType(i);if(!z){const de={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},Q=we(de,this.project);Q.hydrateAncestors(),Q.setParent(this.currentValueArgumentDeclaration,i),Q.addSelfToProject(i),i==null||i.add(Q,Y.Added),Q.initChildren(i),a.push(Q),i||Q.captureVersion(),z=Q}const ee=X.getDataType(i);z.merge(ee,i),z.metaSync({isList:!1},i)}else{const ie={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},z=we(ie,this.project);z.hydrateAncestors(),z.setParent(this.body,i),z.addSelfToProject(i),i==null||i.add(z,Y.Added),z.initChildren(i),te&&!z.implements.find(ee=>ee.id===te.id)&&(z.addImplementation(te,i),r.push(z)),a.push(z),i||z.captureVersion()}break}case Ot.ManualFlow:break;case Ot.Counted:break;case Ot.ObjectKeys:{const k=this.body.inputs.find(ie=>!!ie.implements.find(z=>z.id===U[d.Loop][Ot.ObjectKeys].body.inputs.currentValue.id));if(!this.inputs.find(ie=>{var z;return((z=ie.declaration)==null?void 0:z.id)===U[d.Loop][Ot.ObjectKeys].inputs.object.id}))break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ee=>ee.id===te.id)&&(k.addImplementation(te),r.push(k));let z=k.getDataType(i);if(z){const ee=this.project.getBuiltIn(U["primitive-entity"].string.id);((A=z.entity)==null?void 0:A.id)!==ee.id&&(z.setEntity(ee,i),r.push(z))}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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(ee,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,Y.Added),de.initChildren(i),i||de.captureVersion(),z=de}}else{const ie={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},z=we(ie,this.project);z.hydrateAncestors(),z.setParent(this.body,i),z.addSelfToProject(i),i==null||i.add(z,Y.Added),z.initChildren(i),te&&!z.implements.find(ee=>ee.id===te.id)&&(z.addImplementation(te,i),r.push(z)),a.push(z),i||z.captureVersion()}break}case Ot.ObjectValues:{const k=this.body.inputs.find(ie=>!!ie.implements.find(z=>z.id===U[d.Loop][Ot.ObjectValues].body.inputs.currentValue.id)),X=this.inputs.find(ie=>{var z;return((z=ie.declaration)==null?void 0:z.id)===U[d.Loop][Ot.ObjectValues].inputs.object.id});if(!X)break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ee=>ee.id===te.id)&&(k.addImplementation(te,i),r.push(k));let z=k.getDataType(i);if(z){const ee=X.getDataType(i),de=((C=ee==null?void 0:ee.entity)==null?void 0:C.properties)||[];($=z.orChildrenGroup)==null||$.forEach(Q=>{const{updated:H,removed:ae}=Q.remove({ignoreUpstream:!1},i);r.push(...H),c.push(...ae)}),de.forEach(Q=>{if(!Q.getDataType(i)){const ae={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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:z.toReference()},pe=we(ae,this.project);pe.hydrateAncestors(),pe.setParent(z,i),pe.addSelfToProject(i),i==null||i.add(pe,Y.Added),pe.initChildren(i),i||pe.captureVersion(),a.push(pe)}})}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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:(D=this.currentValueArgumentDeclaration)==null?void 0:D.toReference()},de=we(ee,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,Y.Added),de.initChildren(i),i||de.captureVersion(),z=de;const Q=X.getDataType(i);(((R=Q==null?void 0:Q.entity)==null?void 0:R.properties)||[]).forEach(ae=>{if(!ae.getDataType(i)){const le={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},he=we(le,this.project);he.hydrateAncestors(),he.setParent(de,i),he.addSelfToProject(i),i==null||i.add(he,Y.Added),he.initChildren(i),i||he.captureVersion(),a.push(he)}})}}else{const ie={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},z=we(ie,this.project);z.hydrateAncestors(),z.setParent(this.body,i),z.addSelfToProject(i),i==null||i.add(z,Y.Added),z.initChildren(i),te&&!z.implements.find(ee=>ee.id===te.id)&&(z.addImplementation(te,i),r.push(z)),a.push(z),i||z.captureVersion()}break}case Ot.String:{const k=this.body.inputs.find(ie=>!!ie.implements.find(z=>z.id===U[d.Loop][Ot.String].body.inputs.currentValue.id));if(!this.inputs.find(ie=>{var z;return((z=ie.declaration)==null?void 0:z.id)===U[d.Loop][Ot.String].inputs.string.id}))break;const te=this.getCurrentValueBuiltInValueDescriptor();if(k){te&&!k.implements.find(ee=>ee.id===te.id)&&(k.addImplementation(te,i),r.push(k));let z=k.getDataType(i);if(z){const ee=this.project.getBuiltIn(U["primitive-entity"].string.id);((x=z.entity)==null?void 0:x.id)!==ee.id&&(z.setEntity(ee,i),r.push(z))}else{const ee={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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(ee,this.project);de.hydrateAncestors(),de.setParent(this.currentValueArgumentDeclaration,i),de.addSelfToProject(i),i==null||i.add(de,Y.Added),de.initChildren(i),i||de.captureVersion(),a.push(de),z=de}}else{const ie={id:L.UUID.uuid(),version:L.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||j().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()},z=we(ie,this.project);z.hydrateAncestors(),z.setParent(this.body,i),z.addSelfToProject(i),i==null||i.add(z,Y.Added),z.initChildren(i),te&&!z.implements.find(ee=>ee.id===te.id)&&(z.addImplementation(te,i),r.push(z)),a.push(z),i||z.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,j().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,j().toISOString(),this,!0,"sync-input-maps"))){const r=[],a=[],c=[],e=[];switch(this.declaration.id){case Ot.List:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===U[d.Loop]["list-loop"].inputs.list.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==U[d.Loop]["list-loop"].inputs.list.id){const m=this.project.get(U[d.Loop]["list-loop"].inputs.list.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(U[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)||j().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,Y.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==U[d.Loop]["list-loop"].inputs.list.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>j(m.createdAt).isBefore(j(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Ot.ManualFlow:{this.inputs.forEach(f=>{f.remove({ignoreUpstream:!1},i),c.push(f)});break}case Ot.Counted:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===U[d.Loop]["counted-loop"].inputs.number.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==U[d.Loop]["counted-loop"].inputs.number.id){const m=this.project.get(U[d.Loop]["counted-loop"].inputs.number.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(U[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)||j().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,Y.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==U[d.Loop]["counted-loop"].inputs.number.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>j(m.createdAt).isBefore(j(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Ot.ObjectKeys:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===U[d.Loop]["object-keys-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==U[d.Loop]["object-keys-loop"].inputs.object.id){const m=this.project.get(U[d.Loop]["object-keys-loop"].inputs.object.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(U[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)||j().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,Y.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==U[d.Loop]["object-keys-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>j(m.createdAt).isBefore(j(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Ot.ObjectValues:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===U[d.Loop]["object-values-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==U[d.Loop]["object-values-loop"].inputs.object.id){const m=this.project.get(U[d.Loop]["object-values-loop"].inputs.object.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(U[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)||j().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,Y.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==U[d.Loop]["object-values-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>j(m.createdAt).isBefore(j(v.createdAt))?-1:1).forEach((m,v)=>{v!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Ot.String:{let f=null;if(this.inputs.forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)===U[d.Loop]["string-loop"].inputs.string.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==U[d.Loop]["string-loop"].inputs.string.id){const m=this.project.get(U[d.Loop]["string-loop"].inputs.string.id);f.setDeclaration(m,i),r.push(f)}}else{const m=this.project.get(U[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)||j().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,Y.Added),b.initChildren(i),i||b.captureVersion(),a.push(b)}[...this.inputs].forEach(m=>{var v;((v=m.declaration)==null?void 0:v.id)!==U[d.Loop]["string-loop"].inputs.string.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,v)=>j(m.createdAt).isBefore(j(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 Ot.List:return U[d.Loop]["list-loop"].inputs.list.id;case Ot.ObjectKeys:return U[d.Loop]["object-keys-loop"].inputs.object.id;case Ot.ObjectValues:return U[d.Loop]["object-values-loop"].inputs.object.id;case Ot.String:return U[d.Loop]["string-loop"].inputs.string.id;case Ot.Counted:return U[d.Loop]["counted-loop"].inputs.number.id;default:return null}}getCurrentValueBuiltInValueDescriptor(){var r;if(this.declaration.id===Ot.ManualFlow||this.declaration.id===Ot.Counted)return null;const i=(r=U[d.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:r.id;return i?this.project.get(i):null}getCurrentIterationNumberBuiltInValueDescriptor(){const i=U[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,j().toISOString(),this,!0,"sync-body"))){var m;const r=[],a=[],c=[],e=[],f=U[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=eu.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,Y.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 b,A,D,R,C,$,G,x,k,X,te,ie,z,ee,de,Q,H,ae,pe,le,he,ve,ge,Ie,Me;if((!this.body||!((b=this.body)!=null&&b.dataType)||!((A=this.body)!=null&&A.dataType.entity))&&this.id)return!1;const i=[Ot.List,Ot.ObjectKeys,Ot.ObjectValues,Ot.String],r=this.body.inputs.find(Ge=>Ge.implements.find(Be=>Be.id===U[d.Loop][this.declaration.id].body.inputs.iterationNumber.id))||null,a=this.body.inputs.find(Ge=>Ge.implements.find(Be=>{var Ce;return Be.id===((Ce=U[d.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:Ce.id)}))||null;if(!r||i.includes(this.declaration.id)&&!a)return!1;if(this.declaration.id===Ot.List){const Ge=this.inputs.find(Be=>{var Ce;return((Ce=Be.declaration)==null?void 0:Ce.id)===U[d.Loop]["list-loop"].inputs.list.id});if(Ge&&a){const Be=Ge.getDataType(null),Ce=a.getDataType(null),qe=Ri(Be,Ce,{ignoreTopListDif:!0});if(!qe.compatible||!qe.exact||(Ce==null?void 0:Ce.isList)!==!1)return!1}}const c=[...this.breakStatements,...this.continueStatements];if(((C=(R=(D=this.body)==null?void 0:D.dataType)==null?void 0:R.entity)==null?void 0:C.id)!==U["primitive-entity"].void.id){if(!this.body.inputs.find(Be=>{var Ce,qe,Xe,Ye,ft;return((qe=(Ce=Be.dataType)==null?void 0:Ce.entity)==null?void 0:qe.id)===((ft=(Ye=(Xe=this.body)==null?void 0:Xe.dataType)==null?void 0:Ye.entity)==null?void 0:ft.id)})||((x=(G=($=this.body)==null?void 0:$.dataType)==null?void 0:G.entity)==null?void 0:x.type)===d.DefinitionEntity&&(!((X=(k=this.body)==null?void 0:k.dataType)==null?void 0:X.entity).properties.every(qe=>this.outputs.find(Xe=>{var Ye;return((Ye=Xe.declaration)==null?void 0:Ye.id)===qe.id}))||!c.every(qe=>{var $t,mt;const Xe=qe.outputs.filter(lt=>!lt.deleted),Ye=((mt=($t=this.body)==null?void 0:$t.dataType)==null?void 0:mt.entity).properties.every(lt=>Xe.find(dt=>{var vi;return((vi=dt.declaration)==null?void 0:vi.id)===lt.id})),ft=Xe.every(lt=>{var dt,vi;return((vi=(dt=this.body)==null?void 0:dt.dataType)==null?void 0:vi.entity).properties.find(Bi=>{var gt;return Bi.id===((gt=lt.declaration)==null?void 0:gt.id)})});return Ye&&ft})))return!1}else if(this.body.inputs.find(Ce=>{var qe,Xe,Ye,ft,$t;return((Xe=(qe=Ce.dataType)==null?void 0:qe.entity)==null?void 0:Xe.id)===(($t=(ft=(Ye=this.body)==null?void 0:Ye.dataType)==null?void 0:ft.entity)==null?void 0:$t.id)})||this.outputs.length>0||![...this.breakStatements,...this.continueStatements].every(Ce=>Ce.outputs.filter(qe=>!qe.deleted).length===0))return!1;if([Ot.List,Ot.Counted,Ot.ObjectKeys,Ot.ObjectValues,Ot.String].includes(this.declaration.id)){if(this.inputs.length!==1)return!1;const Ge=this.inputs[0],Be=this.getValueInputMapDeclarationId();if(((te=Ge.declaration)==null?void 0:te.id)!==Be)return!1}else if(this.inputs.length>0)return!1;if((z=(ie=this.body)==null?void 0:ie.dataType)!=null&&z.inferred){const Ge=this.getUniqueInputMaps();if(c.every(Xe=>!Xe.readsValue)&&!Ge.length&&((Q=(de=(ee=this.body)==null?void 0:ee.dataType)==null?void 0:de.entity)==null?void 0:Q.id)!==U["primitive-entity"].void.id)return!1;const Ce=c.find(Xe=>Xe.readsValue),qe=(pe=(ae=(H=Ce==null?void 0:Ce.readsValue)==null?void 0:H.getDataType(null))==null?void 0:ae.entity)==null?void 0:pe.id;if(qe&&qe!==((ve=(he=(le=this.body)==null?void 0:le.dataType)==null?void 0:he.entity)==null?void 0:ve.id))return!1}const f=((Me=(Ie=(ge=this.body)==null?void 0:ge.dataType)==null?void 0:Ie.entity)==null?void 0:Me.properties)||[],h=this.outputs,m=f.every(Ge=>h.find(Be=>{var Ce;return((Ce=Be.declaration)==null?void 0:Ce.id)===Ge.id})),v=h.every(Ge=>f.find(Be=>{var Ce;return Be.id===((Ce=Ge.declaration)==null?void 0:Ce.id)}));return!(!m||!v)}syncFromDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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:D,added:R,removed:C}=this.syncBodyInputIndexes(i);r.push(...D),a.push(...R),c.push(...C);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,j().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:D,added:R,removed:C}=this.syncTerminationStatements(i);r.push(...D),a.push(...R),c.push(...C);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,j().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:Ue.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:Ue.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,Y.Affected),this)}setDataType(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.SetDataType))){if(!this.checkCanEdit(this,r))return re.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,Y.Affected)),r==null||r.attemptAutoclose(_.SetDataType,this.id),this}removeValueReader(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Affected),this):(r==null||r.attemptAutoclose(_.RemoveValueReader,this.id),this):this}removeDataType(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveDataType))){return this.checkCanEdit(this,i)?(this.dataType&&(this.dataType.remove({ignoreUpstream:!0},i),i==null||i.add(this,Y.Affected),this.dataType=null),i==null||i.attemptAutoclose(_.RemoveDataType,this.id),this):(re.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,j().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}};w(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}),w(Pi,"type",d.Loop),w(Pi,"USER_MANAGED_PARENT_TYPES",[...Xr,d.Project]),w(Pi,"PARENT_TYPES",[...Rr.USER_MANAGED_PARENT_TYPES]),w(Pi,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),w(Pi,"CURRENT_VALUE_ARG_NAME","Current value"),w(Pi,"MUTABLE_BASE_PROPERTIES",["catchesError"]),w(Pi,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),w(Pi,"BASE_PROPERTIES",[...Pi.MUTABLE_BASE_PROPERTIES,...Pi.INMUTABLE_BASE_PROPERTIES]),w(Pi,"MUTABLE_META_PROPERTIES",[...Pi.MUTABLE_BASE_PROPERTIES,"x","y"]),w(Pi,"INMUTABLE_META_PROPERTIES",[...Pi.INMUTABLE_BASE_PROPERTIES]),w(Pi,"META_PROPERTIES",[...Pi.MUTABLE_META_PROPERTIES,...Pi.INMUTABLE_META_PROPERTIES]),w(Pi,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),w(Pi,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration","dataType"]),w(Pi,"UPSTREAM_PROPERTIES",[...Pi.MUTABLE_UPSTREAM_PROPERTIES,...Pi.INMUTABLE_UPSTREAM_PROPERTIES]),w(Pi,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),w(Pi,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),w(Pi,"DOWNSTREAM_PROPERTIES",[...Pi.MUTABLE_DOWNSTREAM_PROPERTIES,...Pi.INMUTABLE_DOWNSTREAM_PROPERTIES]),w(Pi,"PROPERTIES",[...Pi.META_PROPERTIES,...Pi.UPSTREAM_PROPERTIES,...Pi.DOWNSTREAM_PROPERTIES]);let Tc=Pi;async function xPe(s,u={}){const i=re.YieldTracker.from(u),r=Xa(s),a=es(s),c=ts(s),e=LPe(s),f=[...r,...a,...c,...e],h=mi(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 $Pe(s){s.inputs.forEach(e=>e.validate());const u=Xa(s),i=es(s),r=ts(s),a=LPe(s),c=[...u,...i,...r,...a];return(s.andChildrenGroup||[]).forEach(e=>e.validate()),(s.orChildrenGroup||[]).forEach(e=>e.validate()),mi(s.errors,c)}function LPe(s){var i,r;const u=[];if(((i=s.declaration)==null?void 0:i.id)!==U.condition["condition-group-and"].id&&((r=s.declaration)==null?void 0:r.id)!==U.condition["condition-group-or"].id)return u;if(!s.andChildrenGroup&&!s.orChildrenGroup){const a=zt({id:`${s.id}--${Ae.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:Ae.EmptyGroupCondition,entity:s});u.push(a.error)}return mi(s.errors,u)}const hIi=Object.freeze(Object.defineProperty({__proto__:null,validate:$Pe,validateAsync:xPe},Symbol.toStringTag,{value:"Module"}));var BPe=(s=>(s.Parent="parent",s))(BPe||{});const pr=class pr extends Gn{constructor(i,r){super(i);w(this,"initialData");w(this,"id");w(this,"x");w(this,"y");w(this,"type",d.Condition);w(this,"index",null);w(this,"successCalls",[]);w(this,"errorCalls",[]);w(this,"declaration");w(this,"inputs",[]);w(this,"calledBySuccess",[]);w(this,"calledByError",[]);w(this,"calledByEntry",[]);w(this,"andChildrenGroup",null);w(this,"orChildrenGroup",null);w(this,"project");w(this,"errors",[]);w(this,"parent");w(this,"detachedDependents",{});w(this,"knownVersions",null);w(this,"activeVersion",!1);w(this,"initialized",!1);w(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)||j().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,C;const c=a===void 0?r.addChangeSet(new Z(r,L.sessionAuthor,j().toISOString(),r,!0,_.CreateFromGenerationTarget)):a;let e=r;if(i.parent){const $=ue(i.parent);e=r.get($)}const f=(i.calledByEntry||[]).map($=>{const G=ue($);return r.get(G)}),h=(i.calledBySuccess||[]).map($=>{const G=ue($);return r.get(G)}),m=(i.calledByError||[]).map($=>{const G=ue($);return r.get(G)});let v;if(i.declaration){const $=ue(i.declaration);v=r.get($)}let b=null;e&&e.type===d.Condition&&(((R=e.declaration)==null?void 0:R.id)===an.Or?b=(e.orChildrenGroup||[]).length:((C=e.declaration)==null?void 0:C.id)===an.And&&(b=(e.andChildrenGroup||[]).length));const A={id:i.id,version:L.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||j().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()},D=we(A,r);return D.hydrateAncestors(),D.setParent(e,c),D.addSelfToProject(c),c==null||c.add(D,Y.Added),D.initChildren(c),c||D.captureVersion(),D}static validateGenerationTarget(i,r){let a=JSON.parse(JSON.stringify(i));const c=[],e=[],f=ca(a,{parent:{list:!1,types:[...Xr,d.Project],optional:!0}},r);c.push(...f.explanations),a=f.modifiedData;const h=_n(a);if(e.push(...f.errors,...h.errors),c.push(...h.explanations),!i.declaration)e.push(new Pe({id:`${i.id}--${_e.InvalidObjectStructure}`,code:_e.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:Ir.AllConditionActionDescriptors,message:FI(r)});else if(!r.get(i.declaration))e.push(new Pe({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:Ir.AllConditionActionDescriptors,message:FI(r)});else{const v=TUe(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 Pe({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,j().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&&!j(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&j(i).isSame(j(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=j(i).toISOString()||j().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new pr(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 pr(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[D,R]of A.knownVersions)v.set(D,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 pr(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,j().toISOString(),this,!0,_.UpdateWithShallowTransfer))){var a,c;if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(i.declaration),f=this.project.get(e);f&&this.setDeclaration(f)}return(a=i.andChildrenGroup)==null||a.forEach(e=>{const f=ue(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=>ue(m)===e.id))||(this.removeChildGroup(e,r),e.removeFromParent(r))}),(c=i.orChildrenGroup)==null||c.forEach(e=>{const f=ue(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=>ue(m)===e.id))||(this.removeChildGroup(e,r),e.removeFromParent(r))}),i.calledByEntry.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&(this.addEntryCaller(h,r),h.addCall(this,r))}),[...this.calledByEntry].forEach(e=>{i.calledByEntry.find(h=>ue(h)===e.id)||(this.removeCaller(e,r),e.removeCall(this,r))}),i.calledBySuccess.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&(this.addSuccessCaller(h,r),h.addSuccessCall(this,r))}),[...this.calledBySuccess].forEach(e=>{i.calledBySuccess.find(h=>ue(h)===e.id)||(this.removeCaller(e,r),e.removeCall(this,r))}),i.calledByError.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&(this.addErrorCaller(h,r),h.addErrorCall(this,r))}),[...this.calledByError].forEach(e=>{i.calledByError.find(h=>ue(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,j().toISOString(),this,!0,_.UpdateWithGenerationTarget))){var a,c,e;if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(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=>ue(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=ue(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=>ue(v)===f.id))||(this.removeCaller(f,r),f.removeCall(this,r))}),(e=i.calledByError)==null||e.forEach(f=>{const h=ue(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=>ue(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=ue(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=ue(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=ue(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=ue(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,j().toISOString(),this,!0,_.AfterAllChildrenInitialized))){var v,b;if(!this.checkCanEdit(this,i))return re.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 D=(this.parent.declaration.id===an.And?this.parent.andChildrenGroup||[]:this.parent.orChildrenGroup||[]).filter(C=>!C.deleted&&C.id!==this.id);D.length&&(A>D.length+1?A=D.length:A<0&&(A=0)),D.find(C=>(C.index||0)===A&&!C.deleted)&&D.filter(C=>(C.index||0)>=A&&!C.deleted).forEach(C=>{C.metaSync({index:(C.index||0)+1},i),i==null||i.add(C,Y.Updated),r.push(C)}),this.metaSync({index:A},i)}(v=this.andChildrenGroup)!=null&&v.length&&this.andChildrenGroup.sort((A,D)=>(A.index||0)-(D.index||0)),(b=this.orChildrenGroup)!=null&&b.length&&this.orChildrenGroup.sort((A,D)=>(A.index||0)-(D.index||0)),this.inputs.sort((A,D)=>{var R,C;return(A.index??((R=A.declaration)==null?void 0:R.index))-(D.index??((C=D.declaration)==null?void 0:C.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,j().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===an.And?this.parent.addToAndGroup(this,i):this.parent.declaration.id===an.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,j().toISOString(),this,!0,_.RemoveInput))){if(!this.checkCanEdit(this,r))return re.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,Y.Affected))),r==null||r.attemptAutoclose(_.RemoveInput,this.id),this}addInput(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Affected),r==null||r.attemptAutoclose(_.AddInput,this.id),this):(re.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,j().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}--${Ue.CannotSuccessCallItself}`,action:_.AddSuccessCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotEntryCallItself}`,action:_.AddEntryCaller,owner:this,errorReason:Ue.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,Y.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,j().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}--${Ue.CannotErrorCallItself}`,action:_.AddErrorCaller,owner:this,errorReason:Ue.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,Y.Affected)),r==null||r.attemptAutoclose(_.AddErrorCall,this.id),this):this}addSuccessCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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:Ue.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,Y.Affected)),r==null||r.attemptAutoclose(_.AddSuccessCall,this.id),this):this}removeCall(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),r==null||r.add(this,Y.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,j().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,Y.Updated),r==null||r.add(c,Y.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,Y.Updated),r==null||r.add(c,Y.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(r==null||r.add(this,Y.Updated),r==null||r.add(c,Y.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,j().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,Y.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}removeChildGroup(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveChildGroup))){if(!this.checkCanEdit(this,r))return re.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,Y.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,Y.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,j().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=Yn(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=Yn(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,j().toISOString(),this,!0,"meta-sync"))){const a=Vn(this,i,r),c=Pn(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,Y.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,Y.Added):c&&(r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=ze,...r){return await pr.repository.APILoad(this.id,...r),this}async APICreate(i=ze,...r){return await pr.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=ze,...r){return await pr.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=ze,...r){return await pr.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=ze,...r){return await pr.repository.APIClone(this.id,...r),this}async APILoadVersion(i=ze,r,...a){return await pr.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveFromParent))){var f;if(!this.checkCanEdit(this,i))return re.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,j().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return re.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}--${Ue.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Ue.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,j().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return re.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||Mn(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||j().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=$Pe(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await xPe(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=re.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,j().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){var C,$,G;const e=vn(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)||j().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const b=$r(f,e);r?b.setParent(r,i):b.setParent(this.parent,null),c&&b.subscribe(),b.initChildren(i),i==null||i.add(b,Y.Added);const A=(C=this.andChildrenGroup)==null?void 0:C.map(x=>x.clone(i,b,L.UUID.uuid(),c)),D=($=this.orChildrenGroup)==null?void 0:$.map(x=>x.clone(i,b,L.UUID.uuid(),c));b.andChildrenGroup=A||null,b.orChildrenGroup=D||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,j().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,Y.Affected)),r==null||r.attemptAutoclose(_.AddToAndGroup,this.id),this):(re.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,j().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,Y.Affected)),r==null||r.attemptAutoclose(_.AddToOrGroup,this.id),this):(re.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,j().toISOString(),this,!0,_.RemoveUnrecognizedInputs))){if(!this.checkCanEdit(this,i))return re.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 j(b==null?void 0:b.createdAt).isSame(j(h.createdAt))?m>v:!!j(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,j().toISOString(),this,!0,_.SyncInputs))){if(!this.checkCanEdit(this,i))return re.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)||j().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()},D=we(A,this.project);D.setParent(this,i),D.addSelfToProject(i),i==null||i.add(D,Y.Added),D.initChildren(i),i||D.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:D,removed:R}=b.afterAllChildrenInitialized(i);r.push(...A),a.push(...D),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,j().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}};w(pr,"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}),w(pr,"type",d.Condition),w(pr,"USER_MANAGED_PARENT_TYPES",[...Xr,d.Project,d.Condition]),w(pr,"PARENT_TYPES",[...pr.USER_MANAGED_PARENT_TYPES]),w(pr,"MUTABLE_BASE_PROPERTIES",["operator"]),w(pr,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion","index"]),w(pr,"BASE_PROPERTIES",[...pr.MUTABLE_BASE_PROPERTIES,...pr.INMUTABLE_BASE_PROPERTIES]),w(pr,"MUTABLE_META_PROPERTIES",["x","y"]),w(pr,"INMUTABLE_META_PROPERTIES",[...pr.INMUTABLE_BASE_PROPERTIES]),w(pr,"META_PROPERTIES",[...pr.MUTABLE_META_PROPERTIES,...pr.INMUTABLE_META_PROPERTIES]),w(pr,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),w(pr,"INMUTABLE_UPSTREAM_PROPERTIES",[]),w(pr,"UPSTREAM_PROPERTIES",[...pr.MUTABLE_UPSTREAM_PROPERTIES,...pr.INMUTABLE_UPSTREAM_PROPERTIES]),w(pr,"MUTABLE_DOWNSTREAM_PROPERTIES",["andChildrenGroup","orChildrenGroup","successCalls","errorCalls","inputsDeclarations","inputs"]),w(pr,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),w(pr,"DOWNSTREAM_PROPERTIES",[...pr.MUTABLE_DOWNSTREAM_PROPERTIES,...pr.INMUTABLE_DOWNSTREAM_PROPERTIES]),w(pr,"PROPERTIES",[...pr.META_PROPERTIES,...pr.UPSTREAM_PROPERTIES,...pr.DOWNSTREAM_PROPERTIES]);let vc=pr;async function mIi(s,u={}){const i=re.YieldTracker.from(u),r=[],a=mi(s.errors,r);return await i.tick(),a}function TIi(s){const u=[];return mi(s.errors,u)}async function MPe(s,u={}){const i=re.YieldTracker.from(u),r=[],a=mi(s.errors,r);return await i.tick(),a}function GPe(s){const u=[];return mi(s.errors,u)}const vIi=Object.freeze(Object.defineProperty({__proto__:null,validate:GPe,validateAsync:MPe},Symbol.toStringTag,{value:"Module"}));function EIi(s,u){const i=[],r=[];if(s.parent)if(s.parent){const a=u.get(s.parent);a?pn.USER_MANAGED_PARENT_TYPES.includes(a.type)||r.push(new Pe({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(pn.USER_MANAGED_PARENT_TYPES,"', '","' or '")}'.`})):r.push(new Pe({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 Pe({id:`${s.id}--${_e.InvalidObjectStructure}`,code:_e.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(pn.USER_MANAGED_PARENT_TYPES,"', '","', or '")}'.`}));else return r.push(new Pe({id:`${s.id}--${_e.InvalidObjectStructure}`,code:_e.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(pn.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=Hw(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 Pe({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 Pe({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 kPe=(s=>(s.ValueAsTypeSingle="value-as-type-single",s.ValueAsTypeList="value-as-type-list",s))(kPe||{});const Ki=class Ki extends Gn{constructor(i,r){super(i);w(this,"initialData");w(this,"type",d.LiteralValue);w(this,"id");w(this,"name");w(this,"autogeneration",null);w(this,"value",null);w(this,"rawString",null);w(this,"valueAsTypeSingle",null);w(this,"valueAsTypeList",null);w(this,"errors",[]);w(this,"parent",null);w(this,"standaloneParent",null);w(this,"project");w(this,"detachedDependents",{});w(this,"knownVersions",null);w(this,"activeVersion",!1);w(this,"initialized",!1);w(this,"startedInitialization",!1);w(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)||j().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,j().toISOString(),r,!0,_.CreateFromGenerationTarget)):a,e=ue(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)||j().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,Y.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=me.EntityTemplate);const c=[],e=[],f=EIi(a,r),h=_n(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&&!io(this.parent.parent))}validateGeneratedUpdate(i){const r=[],a=[];return i.parent&&r.push(new Pe({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,j().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,Y.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),a==null||a.add(this,Y.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,Y.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],a==null||a.add(this,Y.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&&!j(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&j(i).isSame(j(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=j(i).toISOString()||j().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new Ki(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 Ki(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[D,R]of A.knownVersions)v.set(D,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 Ki(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,j().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>ue(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=ue(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,j().toISOString(),this,!0,_.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>ue(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=ue(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=ue(this.initialData.parent),f=this.project.get(e),h=ue(this.initialData.standaloneParent),m=this.project.get(h);let v="";throw f?v+=` Parent -> ${f.type}: '${f.id}' "${ci(f,this.project)}".`:v+=" Parent -> not-found.",m?v+=` Standalone Parent -> ${m.type}: '${m.id}' "${ci(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=ue(this.initialData.parent),f=this.project.get(e);if(re.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)re.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw re.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=ue(this.initialData.standaloneParent),f=this.project.get(e);if(re.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)re.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw re.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 re.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=ue(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=ue(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,j().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return re.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,j().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,j().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,Y.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}setStandaloneParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Updated))),r==null||r.attemptAutoclose(_.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Updated)),r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this):(re.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,j().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,Y.Updated))),r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this):(re.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,j().toISOString(),this,!0,_.SetValueAsTypeSingle))){return this.checkCanEdit(this,r)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this):(re.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,j().toISOString(),this,!0,_.SetValueAsTypeList))){var a,c;return this.checkCanEdit(this,r)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,r==null||r.add(this,Y.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)):i&&this.valueAsTypeList&&((a=this.valueAsTypeList)==null?void 0:a.length)!==i.length?(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this):(re.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,j().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):(re.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,j().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=ue(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,j().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=Pn(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!==me.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,Y.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,Y.Added):c&&(r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=ze,...r){return await Ki.repository.APILoad(this.id,...r),this}async APICreate(i=ze,...r){return await Ki.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=ze,...r){return await Ki.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=ze,...r){return await Ki.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=ze,...r){return await Ki.repository.APIClone(this.id,...r),this}async APILoadVersion(i=ze,r,...a){return await Ki.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return re.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):nR.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,j().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return re.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}--${Ue.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Ue.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,j().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return re.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.valueAsTypeSingle)?this.valueAsTypeSingle.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||Mn(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||j().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.valueAsTypeSingle&&Array.isArray(this.valueAsTypeSingle)?this.valueAsTypeSingle.map(b=>this.project.getBuiltIn(b.id)?b.toJSON(i.seenEntities):b.toJSONClone({...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.valueAsTypeSingle)?this.valueAsTypeSingle.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.valueAsTypeSingle)?this.valueAsTypeSingle.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=GPe(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await MPe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const r=re.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,j().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){const e=vn(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)||j().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=$r(f,e);return m.hydrateAncestors(),r&&m.setParent(r,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,Y.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,j().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}}};w(Ki,"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}),w(Ki,"type",d.LiteralValue),w(Ki,"USER_MANAGED_PARENT_TYPES",[d.DataType,d.InputMap,d.Property,d.ArgumentDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement,d.VariableDeclaration,d.VariableInstance,d.ValueDescriptor]),w(Ki,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...rR]),w(Ki,"PARENT_TYPES",[...Ki.USER_MANAGED_PARENT_TYPES]),w(Ki,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),w(Ki,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),w(Ki,"BASE_PROPERTIES",[...Ki.MUTABLE_BASE_PROPERTIES,...Ki.INMUTABLE_BASE_PROPERTIES]),w(Ki,"MUTABLE_META_PROPERTIES",[...Ki.MUTABLE_BASE_PROPERTIES]),w(Ki,"INMUTABLE_META_PROPERTIES",[...Ki.INMUTABLE_BASE_PROPERTIES]),w(Ki,"META_PROPERTIES",[...Ki.MUTABLE_META_PROPERTIES,...Ki.INMUTABLE_META_PROPERTIES]),w(Ki,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),w(Ki,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),w(Ki,"UPSTREAM_PROPERTIES",[...Ki.MUTABLE_UPSTREAM_PROPERTIES,...Ki.INMUTABLE_UPSTREAM_PROPERTIES]),w(Ki,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),w(Ki,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),w(Ki,"DOWNSTREAM_PROPERTIES",[...Ki.MUTABLE_DOWNSTREAM_PROPERTIES,...Ki.INMUTABLE_DOWNSTREAM_PROPERTIES]),w(Ki,"PROPERTIES",[...Ki.META_PROPERTIES,...Ki.UPSTREAM_PROPERTIES,...Ki.DOWNSTREAM_PROPERTIES]);let pn=Ki;function Ky(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 jPe(s,u){const i=u-s+1,a=ow()*i;return Math.floor(a)+s}function UPe(){const s=Ky(4);return(s[0]<<24|s[1]<<16|s[2]<<8|s[3])>>>0}function ow(){return UPe()/2**32}function V$(s){const u=Ky(s);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const IP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function N$(s){let u="";const i=Ky(s);for(let r=0;r<s;r++)u+=IP[i[r]%IP.length];return u}function FPe(s){const u=Ky(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 x$(s){return N$(s)}function $$(s,u=IP){let i="";const r=Ky(s);for(let a=0;a<s;a++)i+=u[r[a]%u.length];return i}function oc(){const s=Ky(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 KPe(){return $$(6)}function SPe(){return V$(32)}const bIi=63,AIi=/^[a-z][a-z0-9-]*[a-z0-9]$/;function gIi(s){return s.length>=1&&s.length<=bIi&&AIi.test(s)&&!s.includes("--")}function*IIi(){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 RIi(s,u){const i=new Set(s.map(a=>a.toLowerCase())),r=u>0?"secondarydb":"main";for(const a of IIi()){const c=a?`${r}${a}`:r;if(gIi(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function qPe(s,u){switch(s.id){case U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=s.project.entities.filter(h=>!!h.implements.find(m=>m.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),r=i.find(h=>{const m=h.properties.find(A=>A.implements.find(D=>D.id===U["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===U["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:me.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,Y.Added),A.initChildren(u),u||A.captureVersion(),{newEntities:[A]}}return{newEntities:[]}}else if(r)return{newEntities:[]};const a=s.project.get(U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=dw(a,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===U["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:me.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,Y.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function ZPe(s,u){const i=[],r=[],a=[],c=[];return s.implements.filter(f=>f.type===d.BuiltInBaseEntity).forEach(f=>{var h,m,v,b,A,D,R,C,$;switch(f.id){case U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const G=s.project.entities.filter(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=G.find(z=>!!z.properties.find(ee=>{var de;return ee.implements.find(Q=>Q.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((de=ee.getDefaultValue())==null?void 0:de.value)===!0}));if(!x&&G.length)x=G[0];else if(!x&&!G.length){x=s.project.getBuiltIn(U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const ee=x.properties.find(de=>de.implements.find(Q=>Q.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=ee==null?void 0:ee.defaultValue)==null||h.metaSync({value:!0},u),r.push(x)}const k=s.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(k&&!(k!=null&&k.defaultValue)){const z={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:me.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:k==null?void 0:k.toReference()},ee=we(z,s.project);ee.hydrateAncestors(),ee.setParent(k,u),ee.addSelfToProject(u),u==null||u.add(ee,Y.Added),ee.initChildren(u),(k==null?void 0:k.defaultValue).setValueAsTypeSingle(x||null,u),r.push(ee),u||ee.captureVersion();return}else k!=null&&k.defaultValue&&!(k!=null&&k.defaultValue.valueAsTypeSingle)&&(k==null||k.defaultValue.setValueAsTypeSingle(x||null,u));const X=s.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!X)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${U["built-in-base-entity"]}`);let te=!1;if(!X.dataType){const z=Sr.new(u);z.parent=X.toReference();const ee=we(z,s.project);ee.hydrateAncestors(),ee.setParent(X,u),ee.addSelfToProject(u),u==null||u.add(ee,Y.Added),ee.initChildren(u),te=!0}const ie=s.project.getBuiltIn(U["primitive-entity"].number.id);(m=X.dataType)==null||m.setEntity(ie,u),te&&(u||(v=X.dataType)==null||v.captureVersion());return}case U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const G=s.project.entities.filter(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&Q.id!==s.id),x=G.map(Q=>{var pe;const H=Q.properties.find(le=>le.implements.find(he=>he.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(pe=H==null?void 0:H.getDefaultValue())==null?void 0:pe.value}).filter(Q=>!!Q),k=s.properties.find(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!G.find(Q=>!!Q.properties.find(H=>{var ae;return H.implements.find(pe=>pe.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((ae=H.getDefaultValue())==null?void 0:ae.value)===!0}))){const Q=s.properties.find(ae=>ae.implements.find(pe=>pe.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!Q)throw new Error("Default boolean property not found for relational database entity with id: "+s.id);let H=!1;if(!(Q!=null&&Q.defaultValue)){const ae=pn.new(u);ae.parent=Q.toReference();const pe=we(ae,s.project);pe.hydrateAncestors(),pe.setParent(Q,u),pe.addSelfToProject(u),u==null||u.add(pe,Y.Added),pe.initChildren(u),H=!0}(b=Q==null?void 0:Q.defaultValue)==null||b.metaSync({value:!0},u),H&&(u||(A=Q==null?void 0:Q.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 Q=pn.new(u);Q.parent=k.toReference();const H=we(Q,s.project);H.hydrateAncestors(),H.setParent(k,u),H.addSelfToProject(u),u==null||u.add(H,Y.Added),H.initChildren(u),te=!0}const ie=RIi(x,G.length);(D=k.defaultValue)==null||D.metaSync({value:ie},u),te&&(u||(R=k.defaultValue)==null||R.captureVersion());const z=s.properties.find(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!z)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${s.id}`);let ee=!1;if(!z.defaultValue){const Q=pn.new(u);Q.parent=z.toReference();const H=we(Q,s.project);H.hydrateAncestors(),H.setParent(z,u),H.addSelfToProject(u),u==null||u.add(H,Y.Added),H.initChildren(u),r.push(H),ee=!0}const de=x$(24);(C=z.defaultValue)==null||C.metaSync({value:de},u),ee&&(u||($=z.defaultValue)==null||$.captureVersion());return}case U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const G=s.properties.find(te=>te.implements.find(ie=>ie.id===U["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 ${U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let x=G.defaultValue||null;if(!x){const te=pn.new(u);te.parent=G.toReference(),te.name=me.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,Y.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(ie=>ie.id===U["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 ${U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let X=k.defaultValue||null;if(!X){const te=pn.new(u);te.name=me.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),X=we(te,s.project),X.hydrateAncestors(),X.setParent(k,u),X.addSelfToProject(u),X.initChildren(u),u==null||u.add(X,Y.Added)}}}}),{self:s,updated:P(i),added:P(r),removed:P(a),affected:P(c)}}function dw(s,u,i,r){const a=r||L.UUID.uuid(),c=Fn.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,qPe(s,i);const e=we(c,s.project);return e.hydrateAncestors(),i==null||i.add(e,Y.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),ZPe(e,i),e.afterAllChildrenInitialized(i),e}function L$(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 HPe(s,u,i,r=rt.OrDataTypeGroup){const a=[],c=[],e=[],f=[],h=L.UUID.uuid(),m=Sr.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,Y.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 B$(s,u,i,r,a){var m,v,b,A,D,R,C,$;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(U[d.PrimitiveEntity][me.Date].id);u.setEntity(k,r);break}else{const k=u.project.getBuiltIn(U[d.PrimitiveEntity][me.String].id);u.setEntity(k,r);break}case"number":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":if(s===null){u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.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(U[d.PrimitiveEntity][me.String].id),r);break;case"number":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Null].id),r);break}else{const te=[];let ie=!1;k.forEach(ee=>{var de,Q,H,ae;if(Array.isArray(ee)&&(ie=!0),typeof ee=="object"&&!Array.isArray(ee)&&ee!==null){const pe=nI(ee,u.project,{...i,id:L.UUID.uuid()},r,a);pe.hasCreated&&te.push((de=pe.changeSet)==null?void 0:de.self),c.push(...(Q=pe.changeSet)==null?void 0:Q.updated),e.push(...(H=pe.changeSet)==null?void 0:H.added),f.push(...(ae=pe.changeSet)==null?void 0:ae.removed)}});const z=P(te);if(!z.length&&!ie){k.forEach(ee=>{const de=Sr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const Q=we(de,u.project);switch(Q.hydrateAncestors(),Q.setParent(u,r),Q.addSelfToProject(r),r==null||r.add(Q,Y.Added),Q.initChildren(r),typeof ee){case"string":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.String].id),r);break;case"number":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Null].id),r);break}r||Q.captureVersion()});break}else z.length===1&&!ie?u.setEntity(z[0],r):k.forEach(ee=>{if(typeof ee=="object"&&!Array.isArray(ee)&&ee!==null){const de=L$(Object.keys(ee),u.project);if(de){const Q=HPe(de||z[0],u,r,rt.OrDataTypeGroup);c.push(...Q.updated),e.push(...Q.added),f.push(...Q.removed)}}else{const de=Sr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const Q=we(de,u.project);Q.hydrateAncestors(),Q.setParent(u,r),Q.addSelfToProject(r),r==null||r.add(Q,Y.Added),Q.initChildren(r);const H=B$(ee,Q,{...i,id:L.UUID.uuid()},r,a);c.push(...H.updated),e.push(...H.added),f.push(...H.removed),r||Q.captureVersion()}})}}else{const k=nI(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=nI(s,u.project,{...i},r,a);u.setEntity((D=k.changeSet)==null?void 0:D.self,r),c.push(...(R=k.changeSet)==null?void 0:R.updated),e.push(...(C=k.changeSet)==null?void 0:C.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 nI(s,u,i,r,a){const c=[],e=[],f=[],h=[],m=Object.keys(s),v=L$(m,u);if(v)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:v}};const b=a?i.name+" of "+a.name:i.name,D={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(D,u);return R.hydrateAncestors(),R.setParent(u,r),R.addSelfToProject(r),r==null||r.add(R,Y.Added),R.initChildren(r),e.push(R),m.forEach((C,$)=>{const G=L.UUID.uuid(),x=_s.new(r);x.id=G,x.name=C,x.codeName=C,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,Y.Added),k.initChildren(r),e.push(k);const X=s[C],te=L.UUID.uuid(),ie=Sr.new(r);ie.id=te,ie.parent=k.toReference(),ie.like=!0,ie.isList=!1;const z=we(ie,u);z.hydrateAncestors(),z.setParent(k,r),z.addSelfToProject(r),r==null||r.add(z,Y.Added),z.initChildren(r),e.push(z);const ee=B$(X,z,{...i,name:C,id:L.UUID.uuid()},r,a||R);c.push(...ee.updated),e.push(...ee.added),f.push(...ee.removed),r||(k.captureVersion(),z.captureVersion())}),r||R.captureVersion(),{hasCreated:!0,changeSet:{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:R}}}function Gu(s,u,i,r){const a=[];return!s.length||!u.length?{errors:a,overlap:!1}:(s.length>u.length?s.forEach(c=>{const e=u.find(h=>h.name===c.name),f=u.find(h=>{var m,v;return Array.isArray(h.implements)?h.implements.some(b=>!!c.implements.find(A=>A.id===b.id)):((m=h.implements)==null?void 0:m.id)===((v=c.implements)==null?void 0:v.id)});if(e){const h=new Gi({id:c.id+"--"+e.id+"--"+r,message:`Entity of type ${c.type} named "${c.name}" with id "${c.id}" overrides a base ${e.type} ${e.name} with id "${e.id}" that has the same name`,severity:Ee.Error,code:r,entity:c,firstRelationship:e});a.push(h)}if(f){const h=new Gi({id:c.id+"--"+f.id+"--"+i,message:`Entity of type ${c.type} named "${c.name}" with id "${c.id}" overrides a base ${f.type} ${f.name} with id "${f.id}" that implements the same base descriptor`,severity:Ee.Error,code:i,entity:c,firstRelationship:f});a.push(h)}}):u.forEach(c=>{var h;const e=s.find(m=>m.name===c.name),f=s.find(m=>{var v,b;return m.implements&&Array.isArray(m.implements)?m.implements.some(A=>!!c.implements.find(D=>D.id===A.id)):((v=m.implements)==null?void 0:v.id)===((b=c.implements)==null?void 0:b.id)});if(e){const m=new Gi({id:e.id+"--"+c.id+"--"+r,message:`Entity of type ${e.type} named "${e.name}" with id "${e.id}" overrides a base entity ${c.name} with id "${c.id}" that has the same name`,severity:Ee.Error,code:r,entity:e,firstRelationship:c});a.push(m)}if(f){const m=new Gi({id:f.id+"--"+c.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base entity ${c.name} with id "${c.id}" that implements the same base ${Array.isArray(f==null?void 0:f.implements)?qt(f==null?void 0:f.implements.map(v=>v.type),"', '","' and '"):(h=f.implements)==null?void 0:h.id}`,severity:Ee.Error,code:i,entity:f,firstRelationship:c});a.push(m)}}),{errors:a,overlap:!!a.length})}function wIi(s,u){return s.abstract||(s.properties.forEach(r=>{r.abstract||r.metaSync({abstract:!0},u)}),Object.values(s.detachedDependents).forEach(r=>{r.field===oB.EntityField&&r.entity.remove({ignoreUpstream:!1},u)}),s.metaSync({abstract:!0},u)),s}function DIi(s,u){return s.abstract&&(s.properties.forEach(r=>{r.abstract&&r.metaSync({abstract:!1},u)}),Object.values(s.detachedDependents).forEach(r=>{(r.field===KI.Implements||r.field===KI.Extends)&&r.entity.onDetachedDependencyRemoved(s,r.field,u)}),s.metaSync({abstract:!1},u)),s}function CIi(s,u){return s.static||(s.properties.forEach(r=>{r.static||r.metaSync({static:!0},u)}),s.metaSync({static:!0},u)),s}function OIi(s,u){return s.static&&s.metaSync({static:!1},u),s}const zv=class zv extends D${constructor(i,r){super(i);w(this,"initialData");w(this,"id");w(this,"version");w(this,"name");w(this,"description",null);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",!1);w(this,"static");w(this,"additionalProperties",!1);w(this,"properties",[]);w(this,"allPropertiesImplement",null);w(this,"additionalPropertiesDataType",null);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"interactive",!1);w(this,"errors",[]);w(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=ze,...r){return await zv.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=TIi(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await mIi(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=re.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,j().toISOString(),null,!0,"implement-built-in-base-entity")),a){const c=dw(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 zv&&i.push(...this.extends.getAllInteractiveMethods())}return P(i)}getRawDefaultValue(){const i={};return this.properties.forEach(r=>{var e;if(!TE(r)||!r.defaultValue)return;const a=ye(r,this.project),c=r.codeName||lc(r,this.project)||Qs(xr(a));i[c]=((e=r.getDefaultValue())==null?void 0:e.value)||null}),i}};w(zv,"repository",{APILoad:async(i,...r)=>null});let tu=zv;class WPe extends tu{constructor(i){super(la,i);w(this,"initialData");w(this,"id",Re.PERSISTED_ENTITY);w(this,"version","1");w(this,"name",Re.PERSISTED_ENTITY);w(this,"description",la.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",la.abstract);w(this,"static",la.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=la,this.project=i,this.id=la.id,this.version=la.version,this.name=la.name,this.static=la.static,this.abstract=la.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 ga=(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))(ga||{});function M$(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 Gi({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 zPe(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 Gi({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 Gi({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 iu=(s=>(s.StatusCodeMustBeNumber="status-code-must-be-number",s.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",s))(iu||{}),JPe=(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))(JPe||{});function RP(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(c!==e&&!f&&!h)return!1}return!0}function YPe(s,u){const i=[];if(typeof u!="number"){const r=new Gi({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 Gi({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 QPe extends tu{constructor(i){var f,h;super(Ws,i);w(this,"initialData");w(this,"id",Re.HTTP_ENDPOINT);w(this,"version","1");w(this,"name",Re.HTTP_ENDPOINT);w(this,"description",Ws.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",Ws.abstract);w(this,"static",Ws.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=Ws,this.project=i,this.id=Ws.id,this.version=Ws.version,this.name=Ws.name,this.static=Ws.static,this.abstract=Ws.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===U["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=M$(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 Gi({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,X="";for(let te=0;te<A.length;te++){const ie=A[te];if(ie==="{")k=!0,X+=ie;else if(ie==="}"){if(!k){const z=new Gi({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(z)}k=!1,X+=ie}else X+=k?ie:ie.toLowerCase()}if(A=X,k){const te=new Gi({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 Gi({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 D=m.parent,R=D.properties.find(x=>x.implements.find(k=>k.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),C=(G=R==null?void 0:R.getDefaultValue())==null?void 0:G.value;if(m.project.entities.filter(x=>ki(x,Re.HTTP_ENDPOINT)&&x.id!==D.id).some(x=>{var te,ie;const k=x.properties.find(z=>z.implements.find(ee=>ee.id===U["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)!==C)return!1;const X=x.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!X)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return RP((ie=X.getDefaultValue())==null?void 0:ie.value,A)})){const x=new Gi({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${A}" conflicts with another endpoint using the ${C} 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===U["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,D=A.properties.find(G=>G.implements.find(x=>x.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),R=($=D==null?void 0:D.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(G=>ki(G,Re.HTTP_ENDPOINT)&&G.id!==A.id).some(G=>{var X,te;const x=G.properties.find(ie=>ie.implements.find(z=>z.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!RP((X=x==null?void 0:x.getDefaultValue())==null?void 0:X.value,R))return!1;const k=G.properties.find(ie=>ie.implements.find(z=>z.id===U["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 Gi({id:m.id+"--"+ga.MustBeUniqueAmongSameEntities,message:`Method "${v}" cannot be used because another endpoint is already using the ${v} method on path "${R}".`,severity:Ee.Error,code:ga.MustBeUniqueAmongSameEntities,entity:m});b.errors.push(G)}return b});const c=this.abstractMethods.find(m=>m.id===U["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===U["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)=>YPe(m,v)}}var kv=(s=>(s.InvalidCharacters="cron-invalid-characters",s.MustHaveSixFields="cron-must-have-six-fields",s.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",s))(kv||{});function XPe(s,u){const i=[];let r=u;if(typeof u!="string"){const e=new Gi({id:s.id+"--"+ga.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:ga.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 Gi({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 Gi({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 Gi({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 eVe extends tu{constructor(i){super(gl,i);w(this,"initialData");w(this,"id",Re.CRON_JOB);w(this,"version","1");w(this,"name",Re.CRON_JOB);w(this,"description",gl.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",gl.abstract);w(this,"static",gl.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=gl,this.project=i,this.id=gl.id,this.version=gl.version,this.name=gl.name,this.static=gl.static,this.abstract=gl.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===U["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)=>XPe(a,c)}}class tVe extends tu{constructor(i){super(Aa,i);w(this,"initialData");w(this,"id",Re.RELATIONAL_DATABASE);w(this,"version","1");w(this,"name",Re.RELATIONAL_DATABASE);w(this,"description",Aa.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",Aa.abstract);w(this,"static",Aa.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=Aa,this.project=i,this.id=Aa.id,this.version=Aa.version,this.name=Aa.name,this.static=Aa.static,this.abstract=Aa.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===U["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=(a,c)=>zPe(a,c)}}class iVe extends Rr{constructor(i){super(Za,i);w(this,"id",Za.id);w(this,"name",Za.name);w(this,"description",Za.description);w(this,"version",Za.version);w(this,"autoexecutable",!1);w(this,"type",d.ActionDescriptor);w(this,"inputs",[]);w(this,"dataType",null);w(this,"error",null);w(this,"project");this.project=i,this.inputs=Za.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.dataType=we(Za.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=Za.error?we(Za.error,this.project):null}}var Xs=(s=>(s.UUIDMustBeString="uuid-must-be-string",s.UUIDMustBeValidFormat="uuid-must-be-valid-format",s.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",s))(Xs||{});function _Ii(s,u){const i=[];if(typeof u!="string"){const a=new Gi({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=M$(s,u);if(r.errors.length>0)return i.push(...r.errors),{errors:i,override:u};if(!w$(u)){const a=new Gi({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 Fe=(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))(Fe||{});const rVe={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function Dv(s,u){return{...rVe,id:s,project:u}}class Cv{constructor(u,i){w(this,"initialized",!1);w(this,"id");w(this,"project");w(this,"values",{});w(this,"onWriteCallback",()=>{});w(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 pn(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=bVe(e,f,this.project);h?i[a]=h:delete u[a]}catch(f){re.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 pn)a=i;else if(i)a=$r(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:ku(u.getDataType(null))};a=$r(c,this.project)}a.standalone=!0,a.initialData.standaloneParent||re.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 nn(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function G$(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 uw(s,u,i){if(s==null)return i;const r=G$(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 PIi=new Set(["__proto__","prototype","constructor"]);function nVe(s){return typeof s=="string"&&PIi.has(s)}function VIi(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=G$(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(nVe(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",D=Array.isArray(f)&&typeof m=="number";if(v){if(D&&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],C=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(!C||$){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 k$(s,u,i,r){const a=G$(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(nVe(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",D=c(A?[]:{},f+1);return v[h]=D,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 yU=Symbol("missing"),NIi=s=>s!=null&&typeof s=="object";function pw(s,u){if(typeof s!="string")throw new TypeError(`${u} expects the key to be a string.`);return s}function b0(s,u){if(typeof s!="string"&&!Array.isArray(s))throw new TypeError(`${u} expects the path to be string or array.`);return s}function Sy(s,u){if(!nn(s))throw new TypeError(`${u} expects the first argument to be an object.`);return s??{}}function aVe(s,u){const i=pw(u,"ReadKey");return(s??{})[i]}function sVe(s,u,i){const r=pw(u,"WriteKey");if(s&&typeof s=="object"){const a=Array.isArray(s)?[...s]:{...s};return a[r]=i,a}return{[r]:i}}function lVe(s,u){if(!s||typeof s!="object")return{};const i=String(u),{[i]:r,...a}=s;return a}function oVe(s,u,i){const r=Sy(s,"ReadNestedKey"),a=b0(u,"ReadNestedKey");return uw(r,a,i)}function dVe(s,u,i){const r=Sy(s,"WriteNestedKey"),a=b0(u,"WriteNestedKey");return k$(r,a,i,"strict-set")}function uVe(s,u,i){const r=Sy(s,"WriteSafeNestedKeyRecursively"),a=b0(u,"WriteSafeNestedKeyRecursively");return k$(r,a,i,"safe-set")}function pVe(s,u){const i=Sy(s,"DeleteNestedKey"),r=b0(u,"DeleteNestedKey");return k$(i,r,null,"strict-delete")}function cVe(s,u){const i=pw(u,"HasKey"),r=s;return r!=null&&NIi(r)&&Object.prototype.hasOwnProperty.call(r,i)}function fVe(s,u,i){const r=pw(u,"KeyValueEquals");return s==null||typeof s!="object"?!1:s[r]===i}function yVe(s,u){const i=s,r=b0(u,"HasNestedKey");return uw(i,r,yU)!==yU}function hVe(s,u,i){const r=b0(u,"NestedKeyValueEquals");return uw(s,r)===i}function mVe(...s){const u={};for(let i=0;i<s.length;i++){const r=s[i];if(r!=null){if(!nn(r))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,r)}}return u}function TVe(s){const u=Sy(s,"ObjectKeys");return Object.keys(u)}function vVe(s){const u=Sy(s,"ObjectValues");return Object.values(u)}function EVe(s){const u=Sy(s,"ObjectEntries");return Object.entries(u)}const em=new Set;function xIi(s){return{execution:null,project:s,localTestValues:Dv("local-test-values",s),resolvedValues:Dv("resolved-values",s),persistedExecutionResults:Dv("persisted-execution-results",s),lastExecutionResults:Dv("last-execution-results",s),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function A0(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 me.EntityTemplate:a=me.EntityTemplate;break;case me.String:a=me.String;break;case me.Number:a=me.Number;break;case me.Boolean:a=me.Boolean;break;case me.Null:a=me.Null;break;case me.Enum:a=me.Enum;break;case me.KeyValue:a=me.KeyValue;break;case me.Untyped:a=me.Untyped;break;case me.KeyValue:a=me.KeyValue;break;case me.Date:a=me.Date;break;case me.UUID:a=me.UUID;break;case me.File:a=me.File;break;case me.Void:a=me.Void;break;case me.ActionDescriptor:a=me.ActionDescriptor;break;case me.Bytes:a=me.Bytes;break;case me.SqlProgram:a=me.SqlProgram;break;default:throw new Error(`Primitive type ${ci(s.entity,i)} is not supported`)}else a=me.Untyped;const c=pn.new(r);c.name=a,c.parent=u.toReference();const e=we(c,i);return e.hydrateAncestors(),r==null||r.add(e,Y.Added),e.addSelfToProject(r),e.initChildren(r),e}function Wd(s,u,i=new Set){var r,a,c,e;if(i.has(s.id))return[];if(i.add(s.id),Ei.includes(s.type)){const f=Wr(s);return P([f,...[f].flatMap(h=>Wd(h,u,i))])}else if(s.type===d.OutputMap){if(Ei.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=>Wd(f,u,i))])}else if(s.type===d.InputMap){if(Ei.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=>Wd(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 bVe(s,u,i){return s}function g0(s,u,i=!1){const r=s.readsValue;let a=null;const c=Su(r,u,i);if(c){const e={sources:[c],target:s};a={value:c.value,valueOwner:s,type:Fe.Inherited,inheritanceLink:e}}else a={value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null};return a}function $i(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 me.EntityTemplate:r=me.EntityTemplate;break;case me.String:r=me.String;break;case me.Number:r=me.Number;break;case me.Boolean:r=me.Boolean;break;case me.Null:r=me.Null;break;case me.Enum:r=me.Enum;break;case me.KeyValue:r=me.KeyValue;break;case me.Untyped:r=me.Untyped;break;case me.KeyValue:r=me.KeyValue;break;case me.Date:r=me.Date;break;case me.UUID:r=me.UUID;break;case me.File:r=me.File;break;case me.Void:r=me.Void;break;case me.ActionDescriptor:r=me.ActionDescriptor;break;case me.Bytes:r=me.Bytes;break;case me.SqlProgram:r=me.SqlProgram;break;default:throw new Error(`Primitive type ${ci(s.entity,i)} is not supported`)}else r=me.Untyped;if(!i.get(u.id))return null;const c=pn.new(null);c.name=r,c.standaloneParent=u.toReference();let e=new pn(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function AVe(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:Fe.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!==Fe.DefaultValue)?{value:r,valueOwner:s,type:Fe.Testing,inheritanceLink:null}:{value:null,valueOwner:s,type:Fe.QueuedAutocalculation,inheritanceLink:null}}function aI(s,u,i,r=!1){var e,f;const a={...s},c=u.type===d.VariableDeclaration?u.inputs:St.includes(u.type)?u.outputs:[];if(!c||c.length===0)return a;for(const h of c){if(!Ty(h))continue;const m=Qv(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)||xr(v);a[b]=oa((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 Ov(s,u,i,r=!1){var e,f;const a={...s},c=u.inputs;if(!c)return a;for(const h of c){if(!Ty(h))continue;const m=bb(h,i,r);if(m&&m.value&&m.type!==Fe.Undefined){const v=ci(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||xr(v);a[b]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return a}function gVe(s,u,i=!1){var v,b,A,D,R,C,$,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=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(x){if(nn(x.value)){const X={...r,...x.value},te={...Ov(X,s,u,i)};x.metaSync({value:te},null)}return{value:x,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}}const a=!!((R=u.execution)!=null&&R.entities.length),c=(C=u.execution)==null?void 0:C.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=g0(s,u,i),f&&f.value&&nn(f.value.value))){const X={...r,...f.value.value},te={...Ov(X,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=pD(x);if(x.metaSync({value:k},null),nn(k)){const X={...Ov(k,s,u,i)};x.metaSync({value:X},null)}}(i||m===null||m!==Fe.Testing)&&(f={value:x,valueOwner:s,type:oa(x)?s.readsValue?Fe.Inherited:Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const x=(G=u.localTestValues)==null?void 0:G.readValue(s.id);if(x){if(nn(x.value)){const k={...r,...x.value},X={...Ov(k,s,u,i)};x.metaSync({value:X},null)}return{value:x,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}}return oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function j$(s,u,i=!1){var f,h,m,v,b,A,D,R,C,$,G,x,k,X,te,ie,z;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 ee=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(ee){if(nn(ee.value)){const Q={...r,...ee.value},H=aI(Q,s,u,i);ee==null||ee.metaSync({value:H},null)}return{value:ee,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}}const a=(R=u.localTestValues)==null?void 0:R.readValue(s.id);let c=!1;if(s.type===d.VariableDeclaration){const ee=s,de=!!((C=u.execution)!=null&&C.entities.length),Q=($=u.execution)==null?void 0:$.hasEntity(s),H=ee.readsValue;if(H){const ae=(G=u.execution)==null?void 0:G.hasEntity(H);c=!de||de&&ae&&Q||de&&!ae&&!Q}}const e=u.getValueTypePreference(s.id);if(a&&!i&&(!c||e===Fe.Testing)){if(nn(a.value)){const de={...r,...a.value},Q=aI(de,s,u,i);a.metaSync({value:Q},null)}return{value:a,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}if((x=s.getDataType(null))!=null&&x.entity&&(((X=(k=s.getDataType(null))==null?void 0:k.entity)==null?void 0:X.type)===d.DefinitionEntity||((ie=(te=s.getDataType(null))==null?void 0:te.entity)==null?void 0:ie.type)===d.BuiltInBaseEntity)&&((z=s.getDataType(null))!=null&&z.isObject())){const ee=$i(s.dataType,s,u.project),de=aI(r,s,u,i);return ee==null||ee.metaSync({value:de},null),{value:ee,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null}}return null}function cw(s,u,i=!1){var v,b,A,D,R;if((v=s.dataType)!=null&&v.isObject())return gVe(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 C=(D=u.execution)==null?void 0:D.hasEntity(e);(!a||a&&C&&c||a&&!C&&!c)&&(f=g0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const C=h;if(C&&C.value===null&&C.autogeneration){const $=pD(C);C.metaSync({value:$},null)}(i||m===null||m!==Fe.Testing)&&(f={value:C,valueOwner:s,type:oa(C)?s.readsValue?Fe.Inherited:Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const C=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(C)return{value:C,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}return oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function U$(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:Fe.ExecutionResult,inheritanceLink:null}}return(c=s.dataType)!=null&&c.isObject()||s.outputs.length?j$(s,u,i):cw(s,u,i)}function IVe(s,u,i=!1){var A,D,R,C;const r=!!((A=u.execution)!=null&&A.entities.length),a=(D=u.execution)==null?void 0:D.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=g0(s,u,i))}const f=s.declaration;if(!c&&f){const $=cw(f,u,i);$&&$.value&&(c=$)}const h=u.getValueTypePreference(s.id);if(!c||(c.type===Fe.DefaultValue||c.type===Fe.External)&&!i||h===Fe.Testing){const $=(C=u.localTestValues)==null?void 0:C.readValue(s.id);if($)return{value:$,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const m=tp(s),v=s.getDataType(null);return m&&a&&(!(c!=null&&c.value)||!Os(v)&&zd(c==null?void 0:c.value))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:a&&!m&&oa((c==null?void 0:c.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:c||{value:null,valueOwner:s,type:Fe.External,inheritanceLink:null}}function RVe(s,u,i=!1){return U$(s.declaration,u,i)}function wVe(s,u,i=!1){var D,R,C,$;if(!i&&u.execution&&u.execution.hasEntity(s)){const G=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(G)return{value:G,valueOwner:s,type:Fe.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!==Fe.DefaultValue))return{value:G,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=Mt(s),e=s.parent.type===d.FunctionDeclaration&&s.parent.parent.type===d.Loop?s.parent:null,f=!!((C=u.execution)!=null&&C.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=pD(G);G.metaSync({value:x},null)}(i||a===null||a!==Fe.Testing)&&(h={value:G,valueOwner:s,type:oa(G)?Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}!h||(h.type===Fe.DefaultValue||h.type===Fe.External)&&!i||Fe.Testing;const v=tp(s),b=s.getDataType(null);let A=v&&f&&(!(h!=null&&h.value)||!Os(b)&&zd(h==null?void 0:h.value));return c.type===d.Loop&&f&&(A=!1),A?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:f&&!v&&oa((h==null?void 0:h.value)||null)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:h||{value:null,valueOwner:s,type:Fe.External,inheritanceLink:null}}function F$(s,u,i=!1){var D,R,C,$,G,x;if((D=s.getDataType(null))!=null&&D.isObject()||s.outputs.length)return j$(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:Fe.ExecutionResult,inheritanceLink:null}}const r=Mt(s),a=!!((C=u.execution)!=null&&C.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=g0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const k=h;(i||m===null||m!==Fe.Testing)&&(f={value:k,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const k=(x=u.localTestValues)==null?void 0:x.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const v=tp(s),b=s.getDataType(null);return v&&(!(f!=null&&f.value)||!Os(b)&&zd(f==null?void 0:f.value))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:!s.defaultValue&&!s.readsValue?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}:!v&&oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function DVe(s,u,i=!1){var e,f,h,m,v,b,A,D;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:Fe.ExecutionResult,inheritanceLink:null}}const r=Cc(s);if(Hu.includes(r.type)){const R=Su(r,u,i),C=s.codeName||((f=s.declaration)==null?void 0:f.codeName)||xr(ci(s,u.project));if(R!=null&&R.value&&s.parentRelationType!==Il.Error){const $=(R.value.value||{})[C];if($===void 0)return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};const G=$i(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:!Ei.includes(r.type)&&R.type===Fe.Empty?Fe.QueuedAutocalculation:R.type,inheritanceLink:{sources:[R],target:s}}}return{value:null,valueOwner:s,type:Ei.includes(r.type)?Fe.Empty:Fe.QueuedAutocalculation,inheritanceLink:null}}const a=(v=u.execution)==null?void 0:v.hasEntity(r),c=((b=u.execution)==null?void 0:b.state)===aL.Running;if((A=u.persistedExecutionResults)!=null&&A.values[s.id]&&!a&&!c&&!i){const R=(D=u.persistedExecutionResults)==null?void 0:D.readValue(s.id);if((R==null?void 0:R.value)!==null||(R==null?void 0:R.valueAsType)!==null)return{value:R,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}return null}function wP(s,u,i=!1){var b,A,D,R,C;if(![...St,...Ei].includes(s.parent.type)||!Ty(s))return null;if(((b=s.declaration)==null?void 0:b.type)===d.Property&&s.declaration.static)return Su(s.declaration,u);const r=bb(s,u,i);if(r&&r.type!==Fe.Empty&&r.type!==Fe.Missing&&r.type!==Fe.Undefined)return r;const a=Wr(s.parent),c=Mo(a,u,i),e=s.codeName||((A=s.declaration)==null?void 0:A.codeName)||xr(ci(s,u.project)),f=$i(s.getDataType(null),s,u.project),h=tp(s),m=(D=c==null?void 0:c.value)==null?void 0:D.value;if(m){let $=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:s,type:Fe.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"?(C=c==null?void 0:c.value)==null?void 0:C.rawString:void 0},null);const G=tp(s),x=s.getDataType(null);return G&&(!f||!Os(x)&&zd(f))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:{value:f,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}}return c!=null&&c.type&&c.type!==Fe.Missing&&c.type!==Fe.Empty&&c.type!==Fe.Undefined?{value:null,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}:h?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}}function DP(s,u,i=!1){var m,v,b,A,D,R,C,$,G,x,k;if(![...St,...Ei].includes(s.parent.type)||!Ty(s))return null;if(((m=s.declaration)==null?void 0:m.type)===d.Property&&s.declaration.static)return Su(s.declaration,u,i);const r=St.includes(s.parent.type)?s.parent:Wr(s.parent),a=Su(r,u,i);let c=Qv(s,u,i);if((c==null?void 0:c.type)===Fe.Undefined||(c==null?void 0:c.type)===Fe.Missing){const X=Wr(s.parent);let te=s;X.type===d.VariableDeclaration&&(te=(s.parent===X?s:X.inputs.find(z=>{var ee,de;return((ee=z.declaration)==null?void 0:ee.id)===((de=s.declaration)==null?void 0:de.id)}))||s,c=Qv(te,u,i))}const e=s.codeName||((v=s.declaration)==null?void 0:v.codeName)||xr(ci(s,u.project));let f=s.defaultValue||$i(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)===Fe.ExecutionResult||(a==null?void 0:a.type)===Fe.Testing)&&!i&&h){let X=(h||{})[e];if(h[e]===void 0&&!s.readsValue&&!s.defaultValue)return{value:null,valueOwner:s,type:Fe.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=X;return s.defaultValue&&(te=s.defaultValue.value),f==null||f.metaSync({value:te,rawString:typeof X=="string"&&typeof((A=a==null?void 0:a.value)==null?void 0:A.rawString)=="string"?(D=a==null?void 0:a.value)==null?void 0:D.rawString:void 0},null),{value:f,valueOwner:s,type:a.type,inheritanceLink:{sources:a?[a]:[],target:s}}}if(c&&c.type!==Fe.Empty&&c.type!==Fe.Missing&&c.type!==Fe.Undefined)return c;if(h){let X=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:X,rawString:typeof X=="string"&&typeof((R=a==null?void 0:a.value)==null?void 0:R.rawString)=="string"?(C=a==null?void 0:a.value)==null?void 0:C.rawString:void 0},null));const te=tp(s),ie=s.getDataType(null),z=te&&(!f||!Os(ie)&&zd(f)),ee=!!(($=u.execution)!=null&&$.entities.length),de=(G=u.execution)==null?void 0:G.hasEntity(r),Q=r.readsValue;if(Q){const H=(x=u.execution)==null?void 0:x.hasEntity(Q);if(z&&(!ee||ee&&H&&de||ee&&!H&&!de))return{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}}if(s.readsValue){const H=(k=u.execution)==null?void 0:k.hasEntity(s.readsValue);if(z&&(!ee||ee&&H&&de||ee&&!H&&!de))return{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}}return z?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:h[e]===void 0&&!s.readsValue&&!s.defaultValue?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}}:{value:f,valueOwner:s,type:oa(f)&&!s.readsValue?Fe.Empty:Fe.Inherited,inheritanceLink:null}}return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}}function bb(s,u,i=!1){var C,$,G,x,k;const r=Mt(s),a=!!((C=u.execution)!=null&&C.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null,h=!1;if(e){const X=(G=u.execution)==null?void 0:G.hasEntity(e);h=!a||a&&X&&c||a&&!X&&!c,h&&(f=g0(s,u,i))}const m=!!e&&h,v=s.defaultValue,b=u.getValueTypePreference(s.id);if(!f&&v&&(i||b===null||b!==Fe.Testing)&&(f={value:v,valueOwner:s,type:zd(v)?Fe.Empty:Fe.DefaultValue,inheritanceLink:null}),(!f||f.type===Fe.DefaultValue||(f==null?void 0:f.type)===Fe.Empty||b===Fe.Testing)&&!m){const X=(x=u.persistedExecutionResults)==null?void 0:x.readValue(s.id);if(X&&!i)return{value:X,valueOwner:s,type:Fe.Testing,inheritanceLink:null};const te=(k=u.localTestValues)==null?void 0:k.readValue(s.id);if(te&&!i&&(b===null||b===Fe.Testing))return{value:te,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}if(v&&!zd(v))return{value:v,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null};const A=tp(s),D=s.getDataType(null),R=A&&(!(f!=null&&f.value)||!Os(D)&&zd(f==null?void 0:f.value));return m&&R?{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}:R?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!s.defaultValue&&!m?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}:!A&&(!f||f.type===Fe.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:s,type:m?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function Qv(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:Fe.ExecutionResult,inheritanceLink:null}}return bb(s,u,i)}function CVe(s,u,i=!1){var r,a;return Ei.includes(s.parent.type)&&(r=Wr(s.parent).dataType)!=null&&r.isObject()||St.includes(s.parent.type)&&(a=s.parent.getDataType(null))!=null&&a.isObject()?wP(s,u,i):bb(s,u,i)}function K$(s,u,i=!1){var r,a;if(Ei.includes(s.parent.type)){const c=Wr(s.parent);if((r=c.dataType)!=null&&r.isObject()||c.inputs.length)return DP(s,u,i)}return St.includes(s.parent.type)&&((a=s.parent.getDataType(null))!=null&&a.isObject()||s.parent.outputs.length)?DP(s,u,i):Qv(s,u,i)}function OVe(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:Fe.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!==Fe.DefaultValue))return{value:A,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;c&&(i||a===null||a!==Fe.Testing)&&(e={value:c,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null});const f=tp(s),h=s.getDataType(null);return f&&(!(e!=null&&e.value)||!Os(h)&&zd(e==null?void 0:e.value))&&s.static?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:oa(e==null?void 0:e.value)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:e}function _Ve(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:Fe.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!==Fe.DefaultValue))return{value:v,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;if(c&&(i||a===null||a!==Fe.Testing)&&(e={value:c,valueOwner:s,type:Fe.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 K$(v,u,i)}return oa((e==null?void 0:e.value)||null)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:e}function Su(s,u,i=!1){if(em.has(s.id))return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};em.add(s.id);try{switch(s.type){case d.ArgumentDeclaration:return wVe(s,u,i);case d.InputMap:return K$(s,u,i);case d.VariableDeclaration:return U$(s,u,i);case d.VariableInstance:return RVe(s,u,i);case d.OutputMap:return DVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return F$(s,u,i);case d.Property:return OVe(s,u,i);case d.ValueDescriptor:return _Ve(s,u,i);case d.Operation:case d.FunctionCall:case d.InternalCall:case d.Search:return AVe(s,u,i);default:return null}}finally{em.delete(s.id)}}function Mo(s,u,i=!1){if(em.has(s.id))return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};em.add(s.id);try{switch(s.type){case d.InputMap:return CVe(s,u,i);case d.VariableDeclaration:return cw(s,u,i);case d.VariableInstance:return IVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return F$(s,u,i);default:return null}}finally{em.delete(s.id)}}function $Ii(s){var u,i,r,a,c;if(s&&s.type===Fe.DefaultValue&&s.value&&s.valueOwner&&(!nR.includes(s.valueOwner.type)||((u=s.valueOwner.defaultValue)==null?void 0:u.id)===s.value.id)){const e=$i(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:Fe.DefaultValue,value:e,valueOwner:s.valueOwner,inheritanceLink:null}}return s}function LIi(s,u,i,r){var D,R,C,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=Wr(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===((D=f.defaultValue)==null?void 0:D.id)&&(m=$i(f.getDataType(null),f,u)):a?m=A0(f.getDataType(null),f,u,c):m=$i(f.getDataType(null),f,u);const v=ci(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||xr(v);let A={};if((($=(C=f.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),nn(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,X;return((k=x.declaration)==null?void 0:k.id)===((X=s.declaration)==null?void 0:X.id)||ci(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 BIi(s,u,i){const r=Wd(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 MIi(s,u,i,r,a,c){const e=Wd(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 D,R,C,$;if(i.diggestedBuiltInBaseEntitiesIds.has(v.id))return;let b=null;if(f){const G=((D=v.getDefaultValue)==null?void 0:D.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===(($=(C=v.getDefaultValue)==null?void 0:C.call(v))==null?void 0:$.id)&&(b=$i(v.getDataType(null),v,i)):f?(b=A0(v.getDataType(null),v,i,h),h==null||h.add(b,Y.Added)):b=$i(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)===me.Untyped)&&!a&&(typeof s=="string"?A=me.String:s===null?A=me.Null:typeof s=="number"?A=me.Number:typeof s=="boolean"&&(A=me.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 dy(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,D,R,C,$;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=$i(m.getDataType(null),m,u)):a?G=A0(m.getDataType(null),m,u,c):G=$i(m.getDataType(null),m,u);const x=ci(s,u),k=s.codeName||((D=s.extends)==null?void 0:D.codeName)||((R=s.implements[0])==null?void 0:R.codeName)||xr(x);let X={};(($=(C=m.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(X={...X,...m.dataType.entity.getActiveRawDefaultValue()}),nn(G==null?void 0:G.value)&&(X={...X,...G.value}),Array.isArray(i)?X[k]=(i==null?void 0:i.map(te=>te.toShallowJSON()))||null:X[k]=(i==null?void 0:i.toShallowJSON())||null,G==null||G.metaSync({value:X},c),a||e==null||e.writeValue(m,G);return}}),c}function Xv(s,u,i,r){var D,R,C,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=Wr(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===((D=f.defaultValue)==null?void 0:D.id)&&(m=$i(f.getDataType(null),f,u)):a?m=A0(f.getDataType(null),f,u,c):m=$i(f.getDataType(null),f,u);const v=ci(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||xr(v);let A={};if((($=(C=f.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),nn(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,X;return((k=x.declaration)==null?void 0:k.id)===((X=s.declaration)==null?void 0:X.id)||ci(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 PVe(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?dy(s.declaration,u,null,i):Ei.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&Xv(s,u,null,i):s.type===d.OutputMap?((c=s.declaration)==null?void 0:c.type)===d.Property&&s.declaration.static?dy(s.declaration,u,null,i):Ei.includes(s.parent.type)&&((e=s.declaration)==null?void 0:e.type)===d.Property&&Xv(s,u,null,i):s.type===d.Property&&s.static&&dy(s,u,null,i),i}function VVe(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?dy(u.declaration,i,s,r):Ei.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===d.Property&&Xv(u,i,s,r):u.type===d.OutputMap?((e=u.declaration)==null?void 0:e.type)===d.Property&&u.declaration.static?dy(u.declaration,i,null,r):Ei.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===d.Property&&Xv(u,i,null,r):u.type===d.Property&&u.static&&dy(u,i,s,r),r}function GIi(s,u,i){const r=Wd(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),PVe(f,u,i)}),c}function kIi(s,u,i,r){const a=Wd(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=$i(h.getDataType(null),h,h.project)):c?m=A0(h.getDataType(null),h,i,e):m=$i(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),VVe(s,h,i,r)}),e}function kr(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 fw{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||{}),oe=(s=>(s.Logic="logic",s.EditorGUI="editor-gui",s.GUI="gui",s.Editor="editor",s.Compile="compile",s.PublicationRun="publication-run",s))(oe||{}),Ne=(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))(Ne||{});class NVe{constructor(u){w(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 xVe extends NVe{constructor(u,i){super(i),this.parentExtension=u}}class xe{constructor(u,i){w(this,"manifest");w(this,"module");w(this,"state");this.extensionsRegistry=u,this.state=new xVe(this,i)}}class CP extends fw{constructor(i,r){super(i,oe.Logic);w(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 jIi(s,u){return u instanceof CP?u:new CP(s,u)}const ls="built-in-function-implementations__",ke="operations-implementations__",Hs="conditions-implementations__",$e={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:ls+fn.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:ls+fn.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:ls+fn.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:ls+fn.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+Hn.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Ko.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+Oe.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+Ps.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+ce.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+ce.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+ce.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+ce.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+ce.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+ce.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+ce.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+ce.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+ce.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+ce.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+ce.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+ce.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+ce.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+ce.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+ce.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+ce.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+ce.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+ce.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+ce.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+ce.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+ce.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+ce.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+ce.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+ce.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+ce.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+ce.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+ce.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+ce.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+ce.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+ce.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+ce.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+J.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+J.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+J.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+J.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+ce.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+ce.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+ce.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+J.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+J.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+J.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+J.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+J.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+J.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+J.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+J.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+J.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+J.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+J.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+J.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+J.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+J.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+J.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+J.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+J.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+J.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+J.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+J.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+J.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+J.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+J.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+J.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+J.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+J.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+J.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+J.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+J.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+J.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+J.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+J.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+J.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+J.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+J.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+J.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+J.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+J.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+J.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+J.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+J.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+fe.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+fe.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+fe.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+fe.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+fe.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+fe.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+fe.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+fe.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+fe.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+fe.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+fe.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+fe.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+fe.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+fe.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+fe.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+fe.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+fe.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+fe.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+fe.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+fe.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+fe.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+fe.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+fe.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+fe.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+fe.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+fe.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+fe.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+fe.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+fe.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+fe.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+fe.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+fe.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+fe.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+fe.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+fe.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+fe.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+fe.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+fe.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+fe.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+fe.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+fe.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+fe.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+at.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+at.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+at.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+at.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+at.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+at.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+at.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+at.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+at.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+at.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+J.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+J.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+J.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+J.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:Hs+S.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Hs+S.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Hs+S.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Hs+S.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Hs+S.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Hs+S.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Hs+S.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Hs+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+Oe.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+Oe.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+Oe.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+Oe.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+Oe.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+Oe.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+Oe.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Hs+Oe.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Hs+Oe.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Hs+Oe.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Hs+Oe.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Hs+Oe.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+Oe.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+Oe.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+Oe.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+Oe.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+et.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+li.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+li.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+at.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+li.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+li.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+Yr.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+Yr.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+zn.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+zn.Stringify};class $Ve extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class LVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class BVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class MVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class GVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({error:"Search module not implemented",data:null})})}}class kVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:Ve.High,permissions:[Ne.All],contexts:[]});w(this,"module",yV)}}class jVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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)===U.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 UVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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)===U.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 YI=class YI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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 D=!1;return v&&YI.primitiveSet.has(v)?D=b===A:v===me.Untyped||v===me.KeyValue?D=JSON.stringify(b)===JSON.stringify(A):D=!1,{value:F.Success,error:null,result:D}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};w(YI,"primitiveSet",new Set([me.String,me.Number,me.Boolean,me.Null,me.Enum,me.Date,me.UUID]));let CI=YI;const QI=class QI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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 D=!1;return v&&QI.primitiveSet.has(v)?D=b!==A:v===me.Untyped||v===me.KeyValue?D=JSON.stringify(b)!==JSON.stringify(A):D=!1,{value:F.Success,error:null,result:D}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};w(QI,"primitiveSet",new Set([me.String,me.Number,me.Boolean,me.Null,me.Enum,me.Date,me.UUID]));let OI=QI;var FVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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(C){var $={date:C,utc:!0,args:arguments};return new e($)},h.utc=function(C){var $=f(this.toDate(),{locale:this.$L,utc:!0});return C?$.add(this.utcOffset(),i):$},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),m.call(this,C)};var v=h.init;h.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else v.call(this)};var b=h.utcOffset;h.utcOffset=function(C,$){var G=this.$utils().u;if(G(C))return this.$u?0:G(this.$offset)?b.call(this):this.$offset;if(typeof C=="string"&&(C=function(te){te===void 0&&(te="");var ie=te.match(r);if(!ie)return null;var z=(""+ie[0]).match(a)||["-",0,0],ee=z[0],de=60*+z[1]+ +z[2];return de===0?0:ee==="+"?de:-de}(C),C===null))return this;var x=Math.abs(C)<=16?60*C:C;if(x===0)return this.utc($);var k=this.clone();if($)return k.$offset=x,k.$u=!1,k;var X=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(k=this.local().add(x+X,i)).$offset=x,k.$x.$localOffset=X,k};var A=h.format;h.format=function(C){var $=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return A.call(this,$)},h.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var D=h.toDate;h.toDate=function(C){return C==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():D.call(this)};var R=h.diff;h.diff=function(C,$,G){if(C&&this.$u===C.$u)return R.call(this,C,$,G);var x=this.local(),k=f(C).local();return R.call(x,k,$,G)}}})})(FVe);var UIi=FVe.exports;const FIi=pl(UIi);var KVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D,R){R===void 0&&(R={});var C=new Date(A),$=function(G,x){x===void 0&&(x={});var k=x.timeZoneName||"short",X=G+"|"+k,te=r[X];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[X]=te),te}(D,R);return $.formatToParts(C)},m=function(A,D){for(var R=h(A,D),C=[],$=0;$<R.length;$+=1){var G=R[$],x=G.type,k=G.value,X=i[x];X>=0&&(C[X]=parseInt(k,10))}var te=C[3],ie=te===24?0:te,z=C[0]+"-"+C[1]+"-"+C[2]+" "+ie+":"+C[4]+":"+C[5]+":000",ee=+A;return(e.utc(z).valueOf()-(ee-=ee%1e3))/6e4},v=c.prototype;v.tz=function(A,D){A===void 0&&(A=f);var R,C=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,D);else if(R=e(G,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),D){var X=R.utcOffset();R=R.add(C-X,"minute")}return R.$x.$timezone=A,R},v.offsetName=function(A){var D=this.$x.$timezone||e.tz.guess(),R=h(this.valueOf(),D,{timeZoneName:A}).find(function(C){return C.type.toLowerCase()==="timezonename"});return R&&R.value};var b=v.startOf;v.startOf=function(A,D){if(!this.$x||!this.$x.$timezone)return b.call(this,A,D);var R=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(R,A,D).tz(this.$x.$timezone,!0)},e.tz=function(A,D,R){var C=R&&D,$=R||D||f,G=m(+e(),$);if(typeof A!="string")return e(A).tz($);var x=function(ie,z,ee){var de=ie-60*z*1e3,Q=m(de,ee);if(z===Q)return[de,z];var H=m(de-=60*(Q-z)*1e3,ee);return Q===H?[de,Q]:[ie-60*Math.min(Q,H)*1e3,Math.max(Q,H)]}(e.utc(A,C).valueOf(),G,$),k=x[0],X=x[1],te=e(k).utcOffset(X);return te.$x.$timezone=$,te},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(A){f=A}}})})(KVe);var KIi=KVe.exports;const SIi=pl(KIi);var SVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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))}}})})(SVe);var qIi=SVe.exports;const ZIi=pl(qIi);var qVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isSameOrAfter=function(a,c){return this.isSame(a,c)||this.isAfter(a,c)}}})})(qVe);var HIi=qVe.exports;const WIi=pl(HIi);var ZVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isSameOrBefore=function(a,c){return this.isSame(a,c)||this.isBefore(a,c)}}})})(ZVe);var zIi=ZVe.exports;const JIi=pl(zIi);var HVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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"),D=this.diff(A,i,!0);return D<0?e(this).startOf("week").week():Math.ceil(D)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(HVe);var YIi=HVe.exports;const QIi=pl(YIi);var WVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D,R=e(this),C=(v=this.isoWeekYear(),b=this.$u,A=(b?c.utc:c)().year(v).startOf("year"),D=4-A.isoWeekday(),A.isoWeekday()>4&&(D+=7),A.add(D,i));return R.diff(C,"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)}}})})(WVe);var XIi=WVe.exports;const eRi=pl(XIi);var zVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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 D=this.quarter()-1;return A?this.month(3*D).startOf(i).startOf("day"):this.month(3*D+2).endOf(i).endOf("day")}return h.bind(this)(m,v)}}})})(zVe);var tRi=zVe.exports;const iRi=pl(tRi);var JVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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")}}})})(JVe);var rRi=JVe.exports;const nRi=pl(rRi);var YVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D){for(var R,C,$,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,X=0;X<k;X+=1){var te=x[X];te.d&&(R=A?a(m).diff(b,te.d,!0):b.diff(m,te.d,!0));var ie=(i.rounding||Math.round)(Math.abs(R));if($=R>0,ie<=te.r||!te.r){ie<=1&&X>0&&(te=x[X-1]);var z=G[te.l];D&&(ie=D(""+ie)),C=typeof z=="string"?z.replace("%d",ie):z(ie,v,te.l,$);break}}if(v)return C;var ee=$?G.future:G.past;return typeof ee=="function"?ee(C):ee.replace("%s",C)},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)}}})})(YVe);var aRi=YVe.exports;const sRi=pl(aRi);var QVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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},D=function(ie){return ie instanceof X},R=function(ie,z,ee){return new X(ie,ee,z.$l)},C=function(ie){return r.p(ie)+"s"},$=function(ie){return ie<0},G=function(ie){return $(ie)?Math.ceil(ie):Math.floor(ie)},x=function(ie){return Math.abs(ie)},k=function(ie,z){return ie?$(ie)?{negative:!0,format:""+x(ie)+z}:{negative:!1,format:""+ie+z}:{negative:!1,format:""}},X=function(){function ie(ee,de,Q){var H=this;if(this.$d={},this.$l=Q,ee===void 0&&(this.$ms=0,this.parseFromMilliseconds()),de)return R(ee*A[C(de)],this);if(typeof ee=="number")return this.$ms=ee,this.parseFromMilliseconds(),this;if(typeof ee=="object")return Object.keys(ee).forEach(function(le){H.$d[C(le)]=ee[le]}),this.calMilliseconds(),this;if(typeof ee=="string"){var ae=ee.match(b);if(ae){var pe=ae.slice(2).map(function(le){return le!=null?Number(le):0});return this.$d.years=pe[0],this.$d.months=pe[1],this.$d.weeks=pe[2],this.$d.days=pe[3],this.$d.hours=pe[4],this.$d.minutes=pe[5],this.$d.seconds=pe[6],this.calMilliseconds(),this}}return this}var z=ie.prototype;return z.calMilliseconds=function(){var ee=this;this.$ms=Object.keys(this.$d).reduce(function(de,Q){return de+(ee.$d[Q]||0)*A[Q]},0)},z.parseFromMilliseconds=function(){var ee=this.$ms;this.$d.years=G(ee/m),ee%=m,this.$d.months=G(ee/v),ee%=v,this.$d.days=G(ee/f),ee%=f,this.$d.hours=G(ee/e),ee%=e,this.$d.minutes=G(ee/c),ee%=c,this.$d.seconds=G(ee/a),ee%=a,this.$d.milliseconds=ee},z.toISOString=function(){var ee=k(this.$d.years,"Y"),de=k(this.$d.months,"M"),Q=+this.$d.days||0;this.$d.weeks&&(Q+=7*this.$d.weeks);var H=k(Q,"D"),ae=k(this.$d.hours,"H"),pe=k(this.$d.minutes,"M"),le=this.$d.seconds||0;this.$d.milliseconds&&(le+=this.$d.milliseconds/1e3,le=Math.round(1e3*le)/1e3);var he=k(le,"S"),ve=ee.negative||de.negative||H.negative||ae.negative||pe.negative||he.negative,ge=ae.format||pe.format||he.format?"T":"",Ie=(ve?"-":"")+"P"+ee.format+de.format+H.format+ge+ae.format+pe.format+he.format;return Ie==="P"||Ie==="-P"?"P0D":Ie},z.toJSON=function(){return this.toISOString()},z.format=function(ee){var de=ee||"YYYY-MM-DDTHH:mm:ss",Q={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(H,ae){return ae||String(Q[H])})},z.as=function(ee){return this.$ms/A[C(ee)]},z.get=function(ee){var de=this.$ms,Q=C(ee);return Q==="milliseconds"?de%=1e3:de=Q==="weeks"?G(de/A[Q]):this.$d[Q],de||0},z.add=function(ee,de,Q){var H;return H=de?ee*A[C(de)]:D(ee)?ee.$ms:R(ee,this).$ms,R(this.$ms+H*(Q?-1:1),this)},z.subtract=function(ee,de){return this.add(ee,de,!0)},z.locale=function(ee){var de=this.clone();return de.$l=ee,de},z.clone=function(){return R(this.$ms,this)},z.humanize=function(ee){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!ee)},z.valueOf=function(){return this.asMilliseconds()},z.milliseconds=function(){return this.get("milliseconds")},z.asMilliseconds=function(){return this.as("milliseconds")},z.seconds=function(){return this.get("seconds")},z.asSeconds=function(){return this.as("seconds")},z.minutes=function(){return this.get("minutes")},z.asMinutes=function(){return this.as("minutes")},z.hours=function(){return this.get("hours")},z.asHours=function(){return this.as("hours")},z.days=function(){return this.get("days")},z.asDays=function(){return this.as("days")},z.weeks=function(){return this.get("weeks")},z.asWeeks=function(){return this.as("weeks")},z.months=function(){return this.get("months")},z.asMonths=function(){return this.as("months")},z.years=function(){return this.get("years")},z.asYears=function(){return this.as("years")},ie}(),te=function(ie,z,ee){return ie.add(z.years()*ee,"y").add(z.months()*ee,"M").add(z.days()*ee,"d").add(z.hours()*ee,"h").add(z.minutes()*ee,"m").add(z.seconds()*ee,"s").add(z.milliseconds()*ee,"ms")};return function(ie,z,ee){i=ee,r=ee().$utils(),ee.duration=function(H,ae){var pe=ee.locale();return R(H,{$l:pe},ae)},ee.isDuration=D;var de=z.prototype.add,Q=z.prototype.subtract;z.prototype.add=function(H,ae){return D(H)?te(this,H,1):de.bind(this)(H,ae)},z.prototype.subtract=function(H,ae){return D(H)?te(this,H,-1):Q.bind(this)(H,ae)}}})})(QVe);var lRi=QVe.exports;const oRi=pl(lRi);var XVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(XVe);var dRi=XVe.exports;const uRi=pl(dRi);j.extend(FIi);j.extend(SIi);j.extend(ZIi);j.extend(WIi);j.extend(JIi);j.extend(QIi);j.extend(eRi);j.extend(iRi);j.extend(nRi);j.extend(sRi);j.extend(oRi);j.extend(uRi);const oi=s=>j(s),Zr=s=>s.toISOString();function eNe(){return Zr(j())}function tNe(s,u){return oi(s).format(u)}function iNe(s){return Zr(j(s))}function rNe(s){if(s==null)throw new TypeError("ToDate expects a non-null value.");if(typeof s=="string"){const u=j(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?j.unix(s):j(s);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(s instanceof Date){const u=j(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 nNe(s,u,i){return Zr(oi(s).add(u,i))}function aNe(s,u,i){return Zr(oi(s).subtract(u,i))}function sNe(s,u,i,r=!1){return oi(s).diff(oi(u),i,r)}function lNe(s){return oi(s).unix()}function oNe(s){return Zr(j.unix(s))}function dNe(s){return Zr(oi(s))}function uNe(s){return oi(s).year()}function pNe(s){return oi(s).month()}function cNe(s){return oi(s).date()}function fNe(s){return oi(s).hour()}function yNe(s){return oi(s).minute()}function hNe(s){return oi(s).second()}function mNe(s){return oi(s).millisecond()}function TNe(s){return oi(s).isoWeekday()}function vNe(s){return oi(s).week()}function ENe(s){return oi(s).quarter()}function bNe(s){return oi(s).dayOfYear()}function ANe(s){return oi(s).daysInMonth()}function gNe(s,u){return Zr(oi(s).year(u))}function INe(s,u){return Zr(oi(s).month(u))}function RNe(s,u){return Zr(oi(s).date(u))}function wNe(s,u){return Zr(oi(s).hour(u))}function DNe(s,u){return Zr(oi(s).minute(u))}function CNe(s,u){return Zr(oi(s).second(u))}function ONe(s,u){return Zr(oi(s).millisecond(u))}function _Ne(s,u){return Zr(oi(s).isoWeekday(u))}function PNe(s,u){return Zr(oi(s).quarter(u))}function VNe(s,u){return Zr(oi(s).startOf(u))}function NNe(s,u){return Zr(oi(s).endOf(u))}function xNe(s,u){const i=oi(s),r=i.startOf(u),a=i.endOf(u),c=r.valueOf()+(a.valueOf()-r.valueOf())/2;return Zr(i.valueOf()<c?r:a)}function $Ne(s,u,i){return oi(s).isBefore(oi(u),i)}function LNe(s,u,i){return oi(s).isAfter(oi(u),i)}function BNe(s,u,i){return oi(s).isSame(oi(u),i)}function MNe(s,u,i){return oi(s).isSameOrBefore(oi(u),i)}function GNe(s,u,i){return oi(s).isSameOrAfter(oi(u),i)}function kNe(s,u,i,r,a="()"){return oi(s).isBetween(oi(u),oi(i),r,a)}function jNe(s){return j(s).isValid()}function UNe(s){return oi(s).isLeapYear()}function FNe(s,u,i){const r=oi(s);return r.isBefore(u)?Zr(oi(u)):r.isAfter(i)?Zr(oi(i)):Zr(r)}function KNe(s){if(s.length===0)throw new Error("minOf requires at least one date");let u=oi(s[0]);for(let i=1;i<s.length;i++){const r=oi(s[i]);r.isBefore(u)&&(u=r)}return Zr(u)}function SNe(s){if(s.length===0)throw new Error("maxOf requires at least one date");let u=oi(s[0]);for(let i=1;i<s.length;i++){const r=oi(s[i]);r.isAfter(u)&&(u=r)}return Zr(u)}function qNe(s,u=!1){return oi(s).fromNow(u)}function ZNe(s,u=!1){return oi(s).toNow(u)}function HNe(s,u,i=!0){const r=oi(s).diff(oi(u),"millisecond",!0),a=Math.abs(r),e=j.duration(a,"milliseconds").humanize();return i?r>=0?`in ${e}`:`${e} ago`:e}function WNe(s,u,i=["6","7"],r=[]){const a=m=>r.some(v=>oi(v).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=oi(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 Zr(e)}function zNe(s,u){let i=oi(s);const r=u;for(let a=0;a<7;a++)if(i=i.add(1,"day"),i.isoWeekday()===r)return Zr(i);return Zr(i)}function JNe(s,u){let i=oi(s);const r=u;for(let a=0;a<7;a++)if(i=i.subtract(1,"day"),i.isoWeekday()===r)return Zr(i);return Zr(i)}const YNe="Local";function S$(){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 q$(){const s=S$();if(s)return s;throw new Error("Unable to detect current IANA timezone from host environment.")}function QNe(s,u,i=!1){let r=u;if(r===YNe){const e=S$();if(!e)throw new Error("Unable to detect current timezone from host environment.");r=e}const a=r?j.tz(s,r):oi(s),c=i?a.utc(!0):a.utc();return Zr(c)}function XNe(s,u,i=!1){const r=oi(s);return Zr(i?r.tz(u,!0):r.tz(u))}function exe(s,u){const i=s===YNe?q$():s;return oi(u).tz(i).utcOffset()}function txe(s,u,i=!1){return Zr(oi(s).utcOffset(u,i))}class ixe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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=eNe();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 rxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=tNe(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 nxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=iNe(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 axe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.AddToDate].inputs.amount.id}),D=((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)===U.operation[S.AddToDate].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=nNe(b,D,C);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 sxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.SubtractFromDate].inputs.amount.id}),D=((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)===U.operation[S.SubtractFromDate].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=aNe(b,D,C);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 lxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.operation[S.DifferenceBetweenDates].inputs.firstDate.id}),D=((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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.operation[S.DifferenceBetweenDates].inputs.secondDate.id}),C=((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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.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,X=sNe(D,C,G,k);return{value:F.Success,error:null,result:X}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class pRi extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=rNe(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 oxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=lNe(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 dxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=oNe(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 uxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=dNe(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 pxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=uNe(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 cxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=pNe(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 fxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=cNe(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 yxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=fNe(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 hxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=yNe(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 mxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=hNe(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 Txe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=mNe(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 vxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=TNe(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 Exe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=vNe(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 bxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=ENe(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 Axe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=bNe(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 gxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=ANe(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 Ixe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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=q$();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 Rxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=gNe(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 wxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=INe(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 Dxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=RNe(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 Cxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=wNe(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 Oxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=DNe(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 _xe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=CNe(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 Pxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=ONe(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 Vxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=_Ne(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 Nxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=PNe(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 xxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=VNe(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 $xe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=NNe(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 Lxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=xNe(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 Bxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsBefore].inputs.rightHand.id}),D=((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)===U.operation[S.IsBefore].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=$Ne(b,D,C);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 Mxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsAfter].inputs.rightHand.id}),D=((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)===U.operation[S.IsAfter].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=LNe(b,D,C);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 Gxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSame].inputs.rightHand.id}),D=((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)===U.operation[S.IsSame].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=BNe(b,D,C);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 kxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSameOrBefore].inputs.rightHand.id}),D=((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)===U.operation[S.IsSameOrBefore].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=MNe(b,D,C);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 jxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSameOrAfter].inputs.rightHand.id}),D=((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)===U.operation[S.IsSameOrAfter].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=GNe(b,D,C);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 Uxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,D;try{const R=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.target.id}),C=((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 Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.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 Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.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),X=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.unit.id}),te=((v=X==null?void 0:X.value)==null?void 0:v.valueAsType)??((b=X==null?void 0:X.value)==null?void 0:b.value),ie=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.inclusivity.id}),z=((A=ie==null?void 0:ie.value)==null?void 0:A.valueAsType)??((D=ie==null?void 0:ie.value)==null?void 0:D.value),ee=kNe(C,G,k,te,z??void 0);return{value:F.Success,error:null,result:ee}}catch(R){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:R,result:null}}}})}}class Fxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=jNe(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 Kxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=UNe(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 Sxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.ClampToRange].inputs.min.id}),D=((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)===U.operation[S.ClampToRange].inputs.max.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=FNe(b,D,C);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 qxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=KNe(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 Zxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=SNe(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 Hxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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,D=qNe(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Wxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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,D=ZNe(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class zxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.HumanizeDiff].inputs.secondDate.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=HNe(b,D,$);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 Jxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,D;return((D=(A=b.valueOwner)==null?void 0:A.declaration)==null?void 0:D.id)===U.operation[S.AddBusinessDays].inputs.dateValue.id}).map(b=>{var A,D;return((A=b.value)==null?void 0:A.valueAsType)??((D=b.value)==null?void 0:D.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],v=WNe(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 Yxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=zNe(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 Qxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=JNe(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 Xxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=QNe(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 e$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.ConvertTimezone].inputs.targetTimezone.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=XNe(b,D,$);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 t$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.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=exe(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 i$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.SetUTCOffset].inputs.offsetMinutes.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=txe(b,D,$);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 r$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(Ps.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)===U.operation[Ps.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 cRi=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,Z$=s=>s===null||["string","number","boolean"].includes(typeof s);function Da(s,u="Input must be an array"){if(!Array.isArray(s))throw new TypeError(u);return s}function Ad(s){const u=Da(s,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function H$(s){return Array.isArray(s)?s:[]}function Cl(s){return Number(s)}function n$e(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 a$e(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 s$e(s,u){const i=Ad(s),r=Cl(u);return[i.slice(0,r),i.slice(r)]}function l$e(s){return Ad(s).slice().reverse()}function o$e(s){return Ad(s).slice(0,-1)}function d$e(s){return Ad(s).slice(1)}function u$e(s,u,i){const r=Da(s),a=Cl(u);if(a<0||a>r.length)throw new TypeError("Index out of bounds");return[...r.slice(0,a),i,...r.slice(a)]}function p$e(s,u,i){const r=Ad(s),a=Cl(u);if(a<0||a>=r.length)throw new TypeError("Index out of bounds");const c=[...r];return c[a]=i,c}function c$e(s,u,i){const r=Ad(s),a=r.indexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function f$e(s,u,i){const r=Ad(s),a=r.lastIndexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function y$e(s,u,i){return Ad(s).map(a=>a===u?i:a)}function h$e(s,u){const i=Ad(s),r=Cl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i[r]}function m$e(s){return Ad(s)[0]}function T$e(s){const u=Ad(s);return u[u.length-1]}function v$e(s,u,...i){return[...Da(s),u,...i]}function E$e(s,u){const i=Da(s);return[u,...i]}function b$e(s){return Da(s).length}function A$e(s,u){const i=Da(s),r=Cl(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 g$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)??0);return i.slice(0,r)}function I$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)??0);return r===0?[]:i.slice(-r)}function R$e(s,u,i){const r=Da(s),a=u==null?void 0:Cl(u),c=i==null?void 0:Cl(i);return r.slice(a,c)}function w$e(s,u){return Da(s).indexOf(u)}function D$e(s,u){return Da(s).lastIndexOf(u)}function C$e(s){const u=Da(s),i=[],r=new Set;for(const a of u)r.has(a)||(r.add(a),i.push(a));return i}function O$e(s){return Da(s).reduce((i,r)=>i.concat(r),[])}function _$e(s){const u=Da(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=>cRi.test(f)&&j(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)=>j(e).valueOf()-j(f).valueOf())}function P$e(s){const i=[...Da(s)];for(let r=i.length-1;r>0;r--){const a=Math.floor(ow()*(r+1));[i[r],i[a]]=[i[a],i[r]]}return i}function V$e(s,u){const i=Da(s),r=Math.max(1,Cl(u)||1),a=[];for(let c=0;c<i.length;c+=r)a.push(i.slice(c,c+r));return a}function N$e(s,u,i){const r=Da(s),a=Math.max(0,Cl(u)||0);if(r.length>=a)return[...r];const c=a-r.length;return Array(c).fill(i).concat(r)}function x$e(s,u,i){const r=Da(s),a=Math.max(0,Cl(u)||0);if(r.length>=a)return[...r];const c=a-r.length,e=Array(c).fill(i);return r.concat(e)}function $$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)||0),a=[];for(let c=0;c<r;c++)a.push(...i);return a}function L$e(s,u){if(!Z$(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return H$(s).some(r=>r===u)}function B$e(s,u){const i=H$(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(Z$))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return r.every(a=>i.includes(a))}function M$e(s,u){const i=H$(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(Z$))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return r.some(a=>i.includes(a))}class G$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.Join].inputs.secondList.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.value)==null?void 0:G.value)}),R=n$e([m,b,...D]);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 k$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.operation[ce.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.operation[ce.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,D]=s$e(m,b);return{value:F.Success,error:null,result:[A,D]}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class j$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=l$e(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 U$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=o$e(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 F$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=d$e(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 K$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.AddAtIndex].inputs.index.id}),D=((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)===U.operation[ce.AddAtIndex].inputs.value.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=u$e(b,D,C);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 S$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceAtIndex].inputs.index.id}),D=((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)===U.operation[ce.ReplaceAtIndex].inputs.value.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=p$e(b,D,C);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 xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceFirstNItems].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceFirstNItems].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=c$e(b,D,C);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 xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceLastNItems].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceLastNItems].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=f$e(b,D,C);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 H$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceAll].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceAll].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=y$e(b,D,C);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 W$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=h$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 z$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=m$e(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 J$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=T$e(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 Y$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.Append].inputs.dynamicArgument.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.value)==null?void 0:G.value)}),R=v$e(m,b,...D);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 Q$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=E$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 X$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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:b$e(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class eLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=A$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 tLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=g$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 iLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=I$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 rLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.Slice].inputs.startIndex.id}),D=((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)===U.operation[ce.Slice].inputs.endIndex.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=R$e(b,D,C);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 nLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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=a$e(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 aLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=w$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 sLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=D$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 lLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=C$e(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 oLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=O$e(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 dLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=_$e(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 uLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=P$e(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 pLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Chunk);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=V$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 cLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.PadStart].inputs.targetLength.id}),D=((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)===U.operation[ce.PadStart].inputs.padValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=N$e(b,D,C);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 fLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.PadEnd].inputs.targetLength.id}),D=((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)===U.operation[ce.PadEnd].inputs.padValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=x$e(b,D,C);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 yLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=$$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 hLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=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 mLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.ContainsAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=B$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 TLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.ContainsAny);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=M$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 fRi extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 vLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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)===U.operation[J.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)===U.operation[J.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)===U.operation[J.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)===U.operation[J.Join].inputs.dynamicString.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)||((x=$.value)==null?void 0:x.value)||""}),C=[v,A,...R].join(h);return{value:F.Success,error:null,result:C}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class ELe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 bLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 ALe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 gLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 ILe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 RLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 wLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 DLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 CLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 OLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 _Le extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 PLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 VLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 NLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 xLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 $Le extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 LLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 BLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 MLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 GLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 kLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 jLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.Append].inputs.dynamicArgument.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.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(!D.every(C=>typeof C=="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,...D].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 ULe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 FLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 KLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 SLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 qLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 ZLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 HLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 WLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 zLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 JLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 YLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 QLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.MatchAllRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(b=>{var A,D;return((A=b.value)==null?void 0:A.valueAsType)??((D=b.value)==null?void 0:D.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 XLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 eBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 tBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 XI=class XI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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(XI.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}}}})}};w(XI,"COMBINING_MARKS",/[\u0300-\u036f]/g);let _I=XI;class iBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 rBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 nBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 aBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 sBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 lBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 oBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 dBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 uBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 pBe(s,u){const i=Number(s),a=10**Math.max(0,Number(u)||0);return Math.round(i*a)/a}function cBe(s,u){const i=Number(s),r=Math.abs(Number(u)||0);return r===0?i:Math.round(i/r)*r}function fBe(s,u,i){const r=Number(s),a=Number(u),c=Number(i);return Math.min(Math.max(r,a),c)}function yBe(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 hBe(...s){const u=s.map(r=>Number(r));return u.length===0?0:u.reduce((r,a)=>r+a,0)/u.length}function mBe(...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 TBe(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 vBe(s,u){const i=Number(s),r=Number(u);return i===0?1/0:(r-i)/i*100}const wr=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 EBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Addition);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=wr(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 bBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Subtraction);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=wr(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 ABe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.Multiplication].inputs.dynamicFactor.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),C=[m,b,...D].reduce(($,G)=>$*G,1);return{value:F.Success,error:null,result:C}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class gBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Division);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 IBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Remainder);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 RBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Exponentiation);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 wBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Negate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 DBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Absolute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 CBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Sign);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 OBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Round);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.round(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class _Be extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Floor);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.floor(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class PBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Ceil);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.ceil(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class VBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Trunc);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.trunc(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class NBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.RoundToDecimals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=pBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class xBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.SnapToStep);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=cBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class $Be extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Clamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=wr(r),f=fBe(a,c,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class LBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MapRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h]=wr(r),m=yBe(a,c,e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class BBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D],C=hBe(...R);return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class MBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D],C=mBe(...R);return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class GBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D].filter($=>typeof $=="number"&&!Number.isNaN($)),C=R.length?Math.min(...R):1/0;return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class kBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D].filter($=>typeof $=="number"&&!Number.isNaN($)),C=R.length?Math.max(...R):-1/0;return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class jBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.SquareRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.sqrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class UBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.CubeRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.cbrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class FBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.NthRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=TBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class KBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Exp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.exp(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class SBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LogNatural);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.log(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class qBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Log10);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 ZBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Sin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.sin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class HBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Cos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.cos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class WBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Tan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.tan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class zBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Asin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.asin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class JBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Acos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.acos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class YBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Atan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.atan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class QBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Atan2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(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 XBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.ToRadians);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Number(a)*Math.PI/180}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class eMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.ToDegrees);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Number(a)*180/Math.PI}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class tMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.PercentOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(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 OP extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.PercentageChange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=vBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class iMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LessThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a<c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class rMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MoreThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a>c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class nMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LessThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a<=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class aMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MoreThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a>=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}function sMe(s,u){return function(){return s.apply(u,arguments)}}const{toString:yRi}=Object.prototype,{getPrototypeOf:W$}=Object,{iterator:yw,toStringTag:lMe}=Symbol,hw=(s=>u=>{const i=yRi.call(u);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),gd=s=>(s=s.toLowerCase(),u=>hw(u)===s),mw=s=>u=>typeof u===s,{isArray:I0}=Array,pm=mw("undefined");function Ab(s){return s!==null&&!pm(s)&&s.constructor!==null&&!pm(s.constructor)&&el(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const oMe=gd("ArrayBuffer");function hRi(s){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(s):u=s&&s.buffer&&oMe(s.buffer),u}const mRi=mw("string"),el=mw("function"),dMe=mw("number"),gb=s=>s!==null&&typeof s=="object",TRi=s=>s===!0||s===!1,sI=s=>{if(hw(s)!=="object")return!1;const u=W$(s);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(lMe in s)&&!(yw in s)},vRi=s=>{if(!gb(s)||Ab(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},ERi=gd("Date"),bRi=gd("File"),ARi=s=>!!(s&&typeof s.uri<"u"),gRi=s=>s&&typeof s.getParts<"u",IRi=gd("Blob"),RRi=gd("FileList"),wRi=s=>gb(s)&&el(s.pipe);function DRi(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const hU=DRi(),mU=typeof hU.FormData<"u"?hU.FormData:void 0,CRi=s=>{let u;return s&&(mU&&s instanceof mU||el(s.append)&&((u=hw(s))==="formdata"||u==="object"&&el(s.toString)&&s.toString()==="[object FormData]"))},ORi=gd("URLSearchParams"),[_Ri,PRi,VRi,NRi]=["ReadableStream","Request","Response","Headers"].map(gd),xRi=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ib(s,u,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let r,a;if(typeof s!="object"&&(s=[s]),I0(s))for(r=0,a=s.length;r<a;r++)u.call(null,s[r],r,s);else{if(Ab(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 uMe(s,u){if(Ab(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 ay=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),pMe=s=>!pm(s)&&s!==ay;function _P(){const{caseless:s,skipUndefined:u}=pMe(this)&&this||{},i={},r=(a,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=s&&uMe(i,c)||c;sI(i[e])&&sI(a)?i[e]=_P(i[e],a):sI(a)?i[e]=_P({},a):I0(a)?i[e]=a.slice():(!u||!pm(a))&&(i[e]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&Ib(arguments[a],r);return i}const $Ri=(s,u,i,{allOwnKeys:r}={})=>(Ib(u,(a,c)=>{i&&el(a)?Object.defineProperty(s,c,{value:sMe(a,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,c,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),s),LRi=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),BRi=(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)},MRi=(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&&W$(s)}while(s&&(!i||i(s,u))&&s!==Object.prototype);return u},GRi=(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},kRi=s=>{if(!s)return null;if(I0(s))return s;let u=s.length;if(!dMe(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=s[u];return i},jRi=(s=>u=>s&&u instanceof s)(typeof Uint8Array<"u"&&W$(Uint8Array)),URi=(s,u)=>{const r=(s&&s[yw]).call(s);let a;for(;(a=r.next())&&!a.done;){const c=a.value;u.call(s,c[0],c[1])}},FRi=(s,u)=>{let i;const r=[];for(;(i=s.exec(u))!==null;)r.push(i);return r},KRi=gd("HTMLFormElement"),SRi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,r,a){return r.toUpperCase()+a}),TU=(({hasOwnProperty:s})=>(u,i)=>s.call(u,i))(Object.prototype),qRi=gd("RegExp"),cMe=(s,u)=>{const i=Object.getOwnPropertyDescriptors(s),r={};Ib(i,(a,c)=>{let e;(e=u(a,c,s))!==!1&&(r[c]=e||a)}),Object.defineProperties(s,r)},ZRi=s=>{cMe(s,(u,i)=>{if(el(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const r=s[i];if(el(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+"'")})}})},HRi=(s,u)=>{const i={},r=a=>{a.forEach(c=>{i[c]=!0})};return I0(s)?r(s):r(String(s).split(u)),i},WRi=()=>{},zRi=(s,u)=>s!=null&&Number.isFinite(s=+s)?s:u;function JRi(s){return!!(s&&el(s.append)&&s[lMe]==="FormData"&&s[yw])}const YRi=s=>{const u=new Array(10),i=(r,a)=>{if(gb(r)){if(u.indexOf(r)>=0)return;if(Ab(r))return r;if(!("toJSON"in r)){u[a]=r;const c=I0(r)?[]:{};return Ib(r,(e,f)=>{const h=i(e,a+1);!pm(h)&&(c[f]=h)}),u[a]=void 0,c}}return r};return i(s,0)},QRi=gd("AsyncFunction"),XRi=s=>s&&(gb(s)||el(s))&&el(s.then)&&el(s.catch),fMe=((s,u)=>s?setImmediate:u?((i,r)=>(ay.addEventListener("message",({source:a,data:c})=>{a===ay&&c===i&&r.length&&r.shift()()},!1),a=>{r.push(a),ay.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",el(ay.postMessage)),e1i=typeof queueMicrotask<"u"?queueMicrotask.bind(ay):typeof process<"u"&&process.nextTick||fMe,t1i=s=>s!=null&&el(s[yw]),Je={isArray:I0,isArrayBuffer:oMe,isBuffer:Ab,isFormData:CRi,isArrayBufferView:hRi,isString:mRi,isNumber:dMe,isBoolean:TRi,isObject:gb,isPlainObject:sI,isEmptyObject:vRi,isReadableStream:_Ri,isRequest:PRi,isResponse:VRi,isHeaders:NRi,isUndefined:pm,isDate:ERi,isFile:bRi,isReactNativeBlob:ARi,isReactNative:gRi,isBlob:IRi,isRegExp:qRi,isFunction:el,isStream:wRi,isURLSearchParams:ORi,isTypedArray:jRi,isFileList:RRi,forEach:Ib,merge:_P,extend:$Ri,trim:xRi,stripBOM:LRi,inherits:BRi,toFlatObject:MRi,kindOf:hw,kindOfTest:gd,endsWith:GRi,toArray:kRi,forEachEntry:URi,matchAll:FRi,isHTMLForm:KRi,hasOwnProperty:TU,hasOwnProp:TU,reduceDescriptors:cMe,freezeMethods:ZRi,toObjectSet:HRi,toCamelCase:SRi,noop:WRi,toFiniteNumber:zRi,findKey:uMe,global:ay,isContextDefined:pMe,isSpecCompliantForm:JRi,toJSONObject:YRi,isAsyncFn:QRi,isThenable:XRi,setImmediate:fMe,asap:e1i,isIterable:t1i};class Ms extends Error{static from(u,i,r,a,c,e){const f=new Ms(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:Je.toJSONObject(this.config),code:this.code,status:this.status}}}Ms.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ms.ERR_BAD_OPTION="ERR_BAD_OPTION";Ms.ECONNABORTED="ECONNABORTED";Ms.ETIMEDOUT="ETIMEDOUT";Ms.ERR_NETWORK="ERR_NETWORK";Ms.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ms.ERR_DEPRECATED="ERR_DEPRECATED";Ms.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ms.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ms.ERR_CANCELED="ERR_CANCELED";Ms.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ms.ERR_INVALID_URL="ERR_INVALID_URL";const _r=Ms,i1i=null;function PP(s){return Je.isPlainObject(s)||Je.isArray(s)}function yMe(s){return Je.endsWith(s,"[]")?s.slice(0,-2):s}function j_(s,u,i){return s?s.concat(u).map(function(a,c){return a=yMe(a),!i&&c?"["+a+"]":a}).join(i?".":""):u}function r1i(s){return Je.isArray(s)&&!s.some(PP)}const n1i=Je.toFlatObject(Je,{},null,function(u){return/^is[A-Z]/.test(u)});function Tw(s,u,i){if(!Je.isObject(s))throw new TypeError("target must be an object");u=u||new FormData,i=Je.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,$){return!Je.isUndefined($[C])});const r=i.metaTokens,a=i.visitor||v,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Je.isSpecCompliantForm(u);if(!Je.isFunction(a))throw new TypeError("visitor must be a function");function m(R){if(R===null)return"";if(Je.isDate(R))return R.toISOString();if(Je.isBoolean(R))return R.toString();if(!h&&Je.isBlob(R))throw new _r("Blob is not supported. Use a Buffer instead.");return Je.isArrayBuffer(R)||Je.isTypedArray(R)?h&&typeof Blob=="function"?new Blob([R]):Buffer.from(R):R}function v(R,C,$){let G=R;if(Je.isReactNative(u)&&Je.isReactNativeBlob(R))return u.append(j_($,C,c),m(R)),!1;if(R&&!$&&typeof R=="object"){if(Je.endsWith(C,"{}"))C=r?C:C.slice(0,-2),R=JSON.stringify(R);else if(Je.isArray(R)&&r1i(R)||(Je.isFileList(R)||Je.endsWith(C,"[]"))&&(G=Je.toArray(R)))return C=yMe(C),G.forEach(function(k,X){!(Je.isUndefined(k)||k===null)&&u.append(e===!0?j_([C],X,c):e===null?C:C+"[]",m(k))}),!1}return PP(R)?!0:(u.append(j_($,C,c),m(R)),!1)}const b=[],A=Object.assign(n1i,{defaultVisitor:v,convertValue:m,isVisitable:PP});function D(R,C){if(!Je.isUndefined(R)){if(b.indexOf(R)!==-1)throw Error("Circular reference detected in "+C.join("."));b.push(R),Je.forEach(R,function(G,x){(!(Je.isUndefined(G)||G===null)&&a.call(u,G,Je.isString(x)?x.trim():x,C,A))===!0&&D(G,C?C.concat(x):[x])}),b.pop()}}if(!Je.isObject(s))throw new TypeError("data must be an object");return D(s),u}function vU(s){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return u[r]})}function z$(s,u){this._pairs=[],s&&Tw(s,this,u)}const hMe=z$.prototype;hMe.append=function(u,i){this._pairs.push([u,i])};hMe.toString=function(u){const i=u?function(r){return u.call(this,r,vU)}:vU;return this._pairs.map(function(a){return i(a[0])+"="+i(a[1])},"").join("&")};function a1i(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function mMe(s,u,i){if(!u)return s;const r=i&&i.encode||a1i,a=Je.isFunction(i)?{serialize:i}:i,c=a&&a.serialize;let e;if(c?e=c(u,a):e=Je.isURLSearchParams(u)?u.toString():new z$(u,a).toString(r),e){const f=s.indexOf("#");f!==-1&&(s=s.slice(0,f)),s+=(s.indexOf("?")===-1?"?":"&")+e}return s}class s1i{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){Je.forEach(this.handlers,function(r){r!==null&&u(r)})}}const EU=s1i,J$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},l1i=typeof URLSearchParams<"u"?URLSearchParams:z$,o1i=typeof FormData<"u"?FormData:null,d1i=typeof Blob<"u"?Blob:null,u1i={isBrowser:!0,classes:{URLSearchParams:l1i,FormData:o1i,Blob:d1i},protocols:["http","https","file","blob","url","data"]},Y$=typeof window<"u"&&typeof document<"u",VP=typeof navigator=="object"&&navigator||void 0,p1i=Y$&&(!VP||["ReactNative","NativeScript","NS"].indexOf(VP.product)<0),c1i=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),f1i=Y$&&window.location.href||"http://localhost",y1i=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Y$,hasStandardBrowserEnv:p1i,hasStandardBrowserWebWorkerEnv:c1i,navigator:VP,origin:f1i},Symbol.toStringTag,{value:"Module"})),as={...y1i,...u1i};function h1i(s,u){return Tw(s,new as.classes.URLSearchParams,{visitor:function(i,r,a,c){return as.isNode&&Je.isBuffer(i)?(this.append(r,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function m1i(s){return Je.matchAll(/\w+|\[(\w*)]/g,s).map(u=>u[0]==="[]"?"":u[1]||u[0])}function T1i(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 TMe(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&&Je.isArray(a)?a.length:e,h?(Je.hasOwnProp(a,e)?a[e]=[a[e],r]:a[e]=r,!f):((!a[e]||!Je.isObject(a[e]))&&(a[e]=[]),u(i,r,a[e],c)&&Je.isArray(a[e])&&(a[e]=T1i(a[e])),!f)}if(Je.isFormData(s)&&Je.isFunction(s.entries)){const i={};return Je.forEachEntry(s,(r,a)=>{u(m1i(r),a,i,0)}),i}return null}function v1i(s,u,i){if(Je.isString(s))try{return(u||JSON.parse)(s),Je.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(i||JSON.stringify)(s)}const Q$={transitional:J$,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const r=i.getContentType()||"",a=r.indexOf("application/json")>-1,c=Je.isObject(u);if(c&&Je.isHTMLForm(u)&&(u=new FormData(u)),Je.isFormData(u))return a?JSON.stringify(TMe(u)):u;if(Je.isArrayBuffer(u)||Je.isBuffer(u)||Je.isStream(u)||Je.isFile(u)||Je.isBlob(u)||Je.isReadableStream(u))return u;if(Je.isArrayBufferView(u))return u.buffer;if(Je.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 h1i(u,this.formSerializer).toString();if((f=Je.isFileList(u))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Tw(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||a?(i.setContentType("application/json",!1),v1i(u)):u}],transformResponse:[function(u){const i=this.transitional||Q$.transitional,r=i&&i.forcedJSONParsing,a=this.responseType==="json";if(Je.isResponse(u)||Je.isReadableStream(u))return u;if(u&&Je.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"?_r.from(f,_r.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:as.classes.FormData,Blob:as.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],s=>{Q$.headers[s]={}});const X$=Q$,E1i=Je.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"]),b1i=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,j().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,Y.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),a==null||a.add(this,Y.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,Y.Updated)),r==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],a==null||a.add(this,Y.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&&!j(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&j(i).isSame(j(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=j(i).toISOString()||j().toISOString(),this}captureVersion(){var r;const i=((r=this.knownVersions)==null?void 0:r.get(this.version))||new Ki(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 Ki(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[D,R]of A.knownVersions)v.set(D,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 Ki(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,j().toISOString(),this,!0,_.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>ue(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=ue(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,j().toISOString(),this,!0,_.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,r))return re.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=ue(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=ue(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=ue(a),e=this.project.get(c);e&&this.addValueAsTypeToList(e,r)}),[...this.valueAsTypeList].forEach(a=>{(i.valueAsTypeList||[]).find(e=>ue(e)===a.id)||this.removeValueAsTypeFromList(a,r)}),this.setValueAsTypeSingle(null,r),this.metaSync({value:null},r);else if(i.valueAsTypeSingle){const a=ue(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=ue(this.initialData.parent),f=this.project.get(e),h=ue(this.initialData.standaloneParent),m=this.project.get(h);let v="";throw f?v+=` Parent -> ${f.type}: '${f.id}' "${ci(f,this.project)}".`:v+=" Parent -> not-found.",m?v+=` Standalone Parent -> ${m.type}: '${m.id}' "${ci(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=ue(this.initialData.parent),f=this.project.get(e);if(re.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)re.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw re.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=ue(this.initialData.standaloneParent),f=this.project.get(e);if(re.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)re.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw re.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 re.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=ue(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=ue(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,j().toISOString(),this,!0,_.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return re.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,j().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,j().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,Y.Updated))),r==null||r.attemptAutoclose(_.SetParent,this.id),this):this}setStandaloneParent(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Updated))),r==null||r.attemptAutoclose(_.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,r=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().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,Y.Updated)),r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.AddValueAsTypeToList,this.id),this):(re.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,j().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,Y.Updated))),r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.RemoveValueAsTypeFromList,this.id),this):(re.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,j().toISOString(),this,!0,_.SetValueAsTypeSingle))){return this.checkCanEdit(this,r)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeSingle,this.id),this):(re.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,j().toISOString(),this,!0,_.SetValueAsTypeList))){var a,c;return this.checkCanEdit(this,r)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,r==null||r.add(this,Y.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)):i&&this.valueAsTypeList&&((a=this.valueAsTypeList)==null?void 0:a.length)!==i.length?(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose(_.SetValueAsTypeList,this.id),this):(re.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,j().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):(re.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,j().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=ue(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,j().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=Pn(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!==me.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,Y.Removed):a.deleted===!1&&e.deleted?r==null||r.add(this,Y.Added):c&&(r==null||r.add(this,Y.Updated)),r==null||r.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=ze,...r){return await Ki.repository.APILoad(this.id,...r),this}async APICreate(i=ze,...r){return await Ki.repository.APICreate(this.toShallowJSON(),...r),this}async APIUpdate(i=ze,...r){return await Ki.repository.APIUpdate(this.toShallowJSON(),...r),this}async APIDelete(i=ze,...r){return await Ki.repository.APIDelete(this.toShallowJSON(),...r),this}async APIClone(i=ze,...r){return await Ki.repository.APIClone(this.id,...r),this}async APILoadVersion(i=ze,r,...a){return await Ki.repository.APILoadVersion(this.id,r,...a)}removeFromParent(i=this.project.addChangeSet(new Z(this.project,L.sessionAuthor,j().toISOString(),this,!0,_.RemoveFromParent))){if(!this.checkCanEdit(this,i))return re.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):nR.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,j().toISOString(),this,!0,_.RemoveEntity))){var h;if(!this.checkCanDelete(this,r))return re.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}--${Ue.ActionOwnerEntityNonDeletable}`,action:_.RemoveEntity,owner:this,errorReason:Ue.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,j().toISOString(),this,!0,_.RestoreEntity))){if(!this.checkCanEdit(this,i))return re.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.valueAsTypeSingle)?this.valueAsTypeSingle.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||Mn(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||j().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.valueAsTypeSingle&&Array.isArray(this.valueAsTypeSingle)?this.valueAsTypeSingle.map(b=>this.project.getBuiltIn(b.id)?b.toJSON(i.seenEntities):b.toJSONClone({...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.valueAsTypeSingle)?this.valueAsTypeSingle.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.valueAsTypeSingle)?this.valueAsTypeSingle.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=GPe(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await MPe(this,{tracker:r}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const r=re.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,j().toISOString(),this,!0,_.CloneEntity)),r=null,a=null,c=!0){const e=vn(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)||j().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=$r(f,e);return m.hydrateAncestors(),r&&m.setParent(r,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,Y.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,j().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}}};w(Ki,"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}),w(Ki,"type",d.LiteralValue),w(Ki,"USER_MANAGED_PARENT_TYPES",[d.DataType,d.InputMap,d.Property,d.ArgumentDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement,d.VariableDeclaration,d.VariableInstance,d.ValueDescriptor]),w(Ki,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...rR]),w(Ki,"PARENT_TYPES",[...Ki.USER_MANAGED_PARENT_TYPES]),w(Ki,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),w(Ki,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),w(Ki,"BASE_PROPERTIES",[...Ki.MUTABLE_BASE_PROPERTIES,...Ki.INMUTABLE_BASE_PROPERTIES]),w(Ki,"MUTABLE_META_PROPERTIES",[...Ki.MUTABLE_BASE_PROPERTIES]),w(Ki,"INMUTABLE_META_PROPERTIES",[...Ki.INMUTABLE_BASE_PROPERTIES]),w(Ki,"META_PROPERTIES",[...Ki.MUTABLE_META_PROPERTIES,...Ki.INMUTABLE_META_PROPERTIES]),w(Ki,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),w(Ki,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),w(Ki,"UPSTREAM_PROPERTIES",[...Ki.MUTABLE_UPSTREAM_PROPERTIES,...Ki.INMUTABLE_UPSTREAM_PROPERTIES]),w(Ki,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),w(Ki,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),w(Ki,"DOWNSTREAM_PROPERTIES",[...Ki.MUTABLE_DOWNSTREAM_PROPERTIES,...Ki.INMUTABLE_DOWNSTREAM_PROPERTIES]),w(Ki,"PROPERTIES",[...Ki.META_PROPERTIES,...Ki.UPSTREAM_PROPERTIES,...Ki.DOWNSTREAM_PROPERTIES]);let pn=Ki;function Ky(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 jPe(s,u){const i=u-s+1,a=ow()*i;return Math.floor(a)+s}function UPe(){const s=Ky(4);return(s[0]<<24|s[1]<<16|s[2]<<8|s[3])>>>0}function ow(){return UPe()/2**32}function V$(s){const u=Ky(s);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const IP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function N$(s){let u="";const i=Ky(s);for(let r=0;r<s;r++)u+=IP[i[r]%IP.length];return u}function FPe(s){const u=Ky(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 x$(s){return N$(s)}function $$(s,u=IP){let i="";const r=Ky(s);for(let a=0;a<s;a++)i+=u[r[a]%u.length];return i}function oc(){const s=Ky(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 KPe(){return $$(6)}function SPe(){return V$(32)}const bIi=63,AIi=/^[a-z][a-z0-9-]*[a-z0-9]$/;function gIi(s){return s.length>=1&&s.length<=bIi&&AIi.test(s)&&!s.includes("--")}function*IIi(){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 RIi(s,u){const i=new Set(s.map(a=>a.toLowerCase())),r=u>0?"secondarydb":"main";for(const a of IIi()){const c=a?`${r}${a}`:r;if(gIi(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function qPe(s,u){switch(s.id){case U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=s.project.entities.filter(h=>!!h.implements.find(m=>m.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),r=i.find(h=>{const m=h.properties.find(A=>A.implements.find(D=>D.id===U["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===U["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:me.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,Y.Added),A.initChildren(u),u||A.captureVersion(),{newEntities:[A]}}return{newEntities:[]}}else if(r)return{newEntities:[]};const a=s.project.get(U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=dw(a,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===U["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:me.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,Y.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function ZPe(s,u){const i=[],r=[],a=[],c=[];return s.implements.filter(f=>f.type===d.BuiltInBaseEntity).forEach(f=>{var h,m,v,b,A,D,R,C,$;switch(f.id){case U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const G=s.project.entities.filter(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=G.find(z=>!!z.properties.find(ee=>{var de;return ee.implements.find(Q=>Q.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((de=ee.getDefaultValue())==null?void 0:de.value)===!0}));if(!x&&G.length)x=G[0];else if(!x&&!G.length){x=s.project.getBuiltIn(U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const ee=x.properties.find(de=>de.implements.find(Q=>Q.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=ee==null?void 0:ee.defaultValue)==null||h.metaSync({value:!0},u),r.push(x)}const k=s.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(k&&!(k!=null&&k.defaultValue)){const z={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:me.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:k==null?void 0:k.toReference()},ee=we(z,s.project);ee.hydrateAncestors(),ee.setParent(k,u),ee.addSelfToProject(u),u==null||u.add(ee,Y.Added),ee.initChildren(u),(k==null?void 0:k.defaultValue).setValueAsTypeSingle(x||null,u),r.push(ee),u||ee.captureVersion();return}else k!=null&&k.defaultValue&&!(k!=null&&k.defaultValue.valueAsTypeSingle)&&(k==null||k.defaultValue.setValueAsTypeSingle(x||null,u));const X=s.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!X)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${U["built-in-base-entity"]}`);let te=!1;if(!X.dataType){const z=Sr.new(u);z.parent=X.toReference();const ee=we(z,s.project);ee.hydrateAncestors(),ee.setParent(X,u),ee.addSelfToProject(u),u==null||u.add(ee,Y.Added),ee.initChildren(u),te=!0}const ie=s.project.getBuiltIn(U["primitive-entity"].number.id);(m=X.dataType)==null||m.setEntity(ie,u),te&&(u||(v=X.dataType)==null||v.captureVersion());return}case U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const G=s.project.entities.filter(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&Q.id!==s.id),x=G.map(Q=>{var pe;const H=Q.properties.find(le=>le.implements.find(he=>he.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(pe=H==null?void 0:H.getDefaultValue())==null?void 0:pe.value}).filter(Q=>!!Q),k=s.properties.find(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!G.find(Q=>!!Q.properties.find(H=>{var ae;return H.implements.find(pe=>pe.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((ae=H.getDefaultValue())==null?void 0:ae.value)===!0}))){const Q=s.properties.find(ae=>ae.implements.find(pe=>pe.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!Q)throw new Error("Default boolean property not found for relational database entity with id: "+s.id);let H=!1;if(!(Q!=null&&Q.defaultValue)){const ae=pn.new(u);ae.parent=Q.toReference();const pe=we(ae,s.project);pe.hydrateAncestors(),pe.setParent(Q,u),pe.addSelfToProject(u),u==null||u.add(pe,Y.Added),pe.initChildren(u),H=!0}(b=Q==null?void 0:Q.defaultValue)==null||b.metaSync({value:!0},u),H&&(u||(A=Q==null?void 0:Q.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 Q=pn.new(u);Q.parent=k.toReference();const H=we(Q,s.project);H.hydrateAncestors(),H.setParent(k,u),H.addSelfToProject(u),u==null||u.add(H,Y.Added),H.initChildren(u),te=!0}const ie=RIi(x,G.length);(D=k.defaultValue)==null||D.metaSync({value:ie},u),te&&(u||(R=k.defaultValue)==null||R.captureVersion());const z=s.properties.find(Q=>Q.implements.find(H=>H.id===U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!z)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${U["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${s.id}`);let ee=!1;if(!z.defaultValue){const Q=pn.new(u);Q.parent=z.toReference();const H=we(Q,s.project);H.hydrateAncestors(),H.setParent(z,u),H.addSelfToProject(u),u==null||u.add(H,Y.Added),H.initChildren(u),r.push(H),ee=!0}const de=x$(24);(C=z.defaultValue)==null||C.metaSync({value:de},u),ee&&(u||($=z.defaultValue)==null||$.captureVersion());return}case U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const G=s.properties.find(te=>te.implements.find(ie=>ie.id===U["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 ${U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let x=G.defaultValue||null;if(!x){const te=pn.new(u);te.parent=G.toReference(),te.name=me.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,Y.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(ie=>ie.id===U["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 ${U["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`);let X=k.defaultValue||null;if(!X){const te=pn.new(u);te.name=me.EntityTemplate,te.parent=k.toReference(),te.id=L.UUID.uuid(),X=we(te,s.project),X.hydrateAncestors(),X.setParent(k,u),X.addSelfToProject(u),X.initChildren(u),u==null||u.add(X,Y.Added)}}}}),{self:s,updated:P(i),added:P(r),removed:P(a),affected:P(c)}}function dw(s,u,i,r){const a=r||L.UUID.uuid(),c=Fn.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,qPe(s,i);const e=we(c,s.project);return e.hydrateAncestors(),i==null||i.add(e,Y.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),ZPe(e,i),e.afterAllChildrenInitialized(i),e}function L$(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 HPe(s,u,i,r=rt.OrDataTypeGroup){const a=[],c=[],e=[],f=[],h=L.UUID.uuid(),m=Sr.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,Y.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 B$(s,u,i,r,a){var m,v,b,A,D,R,C,$;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(U[d.PrimitiveEntity][me.Date].id);u.setEntity(k,r);break}else{const k=u.project.getBuiltIn(U[d.PrimitiveEntity][me.String].id);u.setEntity(k,r);break}case"number":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":if(s===null){u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.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(U[d.PrimitiveEntity][me.String].id),r);break;case"number":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":u.setEntity(u.project.getBuiltIn(U[d.PrimitiveEntity][me.Null].id),r);break}else{const te=[];let ie=!1;k.forEach(ee=>{var de,Q,H,ae;if(Array.isArray(ee)&&(ie=!0),typeof ee=="object"&&!Array.isArray(ee)&&ee!==null){const pe=nI(ee,u.project,{...i,id:L.UUID.uuid()},r,a);pe.hasCreated&&te.push((de=pe.changeSet)==null?void 0:de.self),c.push(...(Q=pe.changeSet)==null?void 0:Q.updated),e.push(...(H=pe.changeSet)==null?void 0:H.added),f.push(...(ae=pe.changeSet)==null?void 0:ae.removed)}});const z=P(te);if(!z.length&&!ie){k.forEach(ee=>{const de=Sr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const Q=we(de,u.project);switch(Q.hydrateAncestors(),Q.setParent(u,r),Q.addSelfToProject(r),r==null||r.add(Q,Y.Added),Q.initChildren(r),typeof ee){case"string":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.String].id),r);break;case"number":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Number].id),r);break;case"boolean":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Boolean].id),r);break;case"object":Q.setEntity(Q.project.getBuiltIn(U[d.PrimitiveEntity][me.Null].id),r);break}r||Q.captureVersion()});break}else z.length===1&&!ie?u.setEntity(z[0],r):k.forEach(ee=>{if(typeof ee=="object"&&!Array.isArray(ee)&&ee!==null){const de=L$(Object.keys(ee),u.project);if(de){const Q=HPe(de||z[0],u,r,rt.OrDataTypeGroup);c.push(...Q.updated),e.push(...Q.added),f.push(...Q.removed)}}else{const de=Sr.new(r);de.parentRelationType=rt.OrDataTypeGroup,de.parent=u.toReference();const Q=we(de,u.project);Q.hydrateAncestors(),Q.setParent(u,r),Q.addSelfToProject(r),r==null||r.add(Q,Y.Added),Q.initChildren(r);const H=B$(ee,Q,{...i,id:L.UUID.uuid()},r,a);c.push(...H.updated),e.push(...H.added),f.push(...H.removed),r||Q.captureVersion()}})}}else{const k=nI(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=nI(s,u.project,{...i},r,a);u.setEntity((D=k.changeSet)==null?void 0:D.self,r),c.push(...(R=k.changeSet)==null?void 0:R.updated),e.push(...(C=k.changeSet)==null?void 0:C.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 nI(s,u,i,r,a){const c=[],e=[],f=[],h=[],m=Object.keys(s),v=L$(m,u);if(v)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:v}};const b=a?i.name+" of "+a.name:i.name,D={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(D,u);return R.hydrateAncestors(),R.setParent(u,r),R.addSelfToProject(r),r==null||r.add(R,Y.Added),R.initChildren(r),e.push(R),m.forEach((C,$)=>{const G=L.UUID.uuid(),x=_s.new(r);x.id=G,x.name=C,x.codeName=C,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,Y.Added),k.initChildren(r),e.push(k);const X=s[C],te=L.UUID.uuid(),ie=Sr.new(r);ie.id=te,ie.parent=k.toReference(),ie.like=!0,ie.isList=!1;const z=we(ie,u);z.hydrateAncestors(),z.setParent(k,r),z.addSelfToProject(r),r==null||r.add(z,Y.Added),z.initChildren(r),e.push(z);const ee=B$(X,z,{...i,name:C,id:L.UUID.uuid()},r,a||R);c.push(...ee.updated),e.push(...ee.added),f.push(...ee.removed),r||(k.captureVersion(),z.captureVersion())}),r||R.captureVersion(),{hasCreated:!0,changeSet:{updated:P(c),added:P(e),removed:P(f),affected:P(h),self:R}}}function Gu(s,u,i,r){const a=[];return!s.length||!u.length?{errors:a,overlap:!1}:(s.length>u.length?s.forEach(c=>{const e=u.find(h=>h.name===c.name),f=u.find(h=>{var m,v;return Array.isArray(h.implements)?h.implements.some(b=>!!c.implements.find(A=>A.id===b.id)):((m=h.implements)==null?void 0:m.id)===((v=c.implements)==null?void 0:v.id)});if(e){const h=new Gi({id:c.id+"--"+e.id+"--"+r,message:`Entity of type ${c.type} named "${c.name}" with id "${c.id}" overrides a base ${e.type} ${e.name} with id "${e.id}" that has the same name`,severity:Ee.Error,code:r,entity:c,firstRelationship:e});a.push(h)}if(f){const h=new Gi({id:c.id+"--"+f.id+"--"+i,message:`Entity of type ${c.type} named "${c.name}" with id "${c.id}" overrides a base ${f.type} ${f.name} with id "${f.id}" that implements the same base descriptor`,severity:Ee.Error,code:i,entity:c,firstRelationship:f});a.push(h)}}):u.forEach(c=>{var h;const e=s.find(m=>m.name===c.name),f=s.find(m=>{var v,b;return m.implements&&Array.isArray(m.implements)?m.implements.some(A=>!!c.implements.find(D=>D.id===A.id)):((v=m.implements)==null?void 0:v.id)===((b=c.implements)==null?void 0:b.id)});if(e){const m=new Gi({id:e.id+"--"+c.id+"--"+r,message:`Entity of type ${e.type} named "${e.name}" with id "${e.id}" overrides a base entity ${c.name} with id "${c.id}" that has the same name`,severity:Ee.Error,code:r,entity:e,firstRelationship:c});a.push(m)}if(f){const m=new Gi({id:f.id+"--"+c.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base entity ${c.name} with id "${c.id}" that implements the same base ${Array.isArray(f==null?void 0:f.implements)?qt(f==null?void 0:f.implements.map(v=>v.type),"', '","' and '"):(h=f.implements)==null?void 0:h.id}`,severity:Ee.Error,code:i,entity:f,firstRelationship:c});a.push(m)}}),{errors:a,overlap:!!a.length})}function wIi(s,u){return s.abstract||(s.properties.forEach(r=>{r.abstract||r.metaSync({abstract:!0},u)}),Object.values(s.detachedDependents).forEach(r=>{r.field===oB.EntityField&&r.entity.remove({ignoreUpstream:!1},u)}),s.metaSync({abstract:!0},u)),s}function DIi(s,u){return s.abstract&&(s.properties.forEach(r=>{r.abstract&&r.metaSync({abstract:!1},u)}),Object.values(s.detachedDependents).forEach(r=>{(r.field===KI.Implements||r.field===KI.Extends)&&r.entity.onDetachedDependencyRemoved(s,r.field,u)}),s.metaSync({abstract:!1},u)),s}function CIi(s,u){return s.static||(s.properties.forEach(r=>{r.static||r.metaSync({static:!0},u)}),s.metaSync({static:!0},u)),s}function OIi(s,u){return s.static&&s.metaSync({static:!1},u),s}const zv=class zv extends D${constructor(i,r){super(i);w(this,"initialData");w(this,"id");w(this,"version");w(this,"name");w(this,"description",null);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",!1);w(this,"static");w(this,"additionalProperties",!1);w(this,"properties",[]);w(this,"allPropertiesImplement",null);w(this,"additionalPropertiesDataType",null);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"interactive",!1);w(this,"errors",[]);w(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=ze,...r){return await zv.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=TIi(this),{success:!0}}async validateAsync(i={}){const r=re.YieldTracker.from(i);return this.errors=await mIi(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=re.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,j().toISOString(),null,!0,"implement-built-in-base-entity")),a){const c=dw(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 zv&&i.push(...this.extends.getAllInteractiveMethods())}return P(i)}getRawDefaultValue(){const i={};return this.properties.forEach(r=>{var e;if(!TE(r)||!r.defaultValue)return;const a=ye(r,this.project),c=r.codeName||lc(r,this.project)||Qs(xr(a));i[c]=((e=r.getDefaultValue())==null?void 0:e.value)||null}),i}};w(zv,"repository",{APILoad:async(i,...r)=>null});let tu=zv;class WPe extends tu{constructor(i){super(la,i);w(this,"initialData");w(this,"id",Re.PERSISTED_ENTITY);w(this,"version","1");w(this,"name",Re.PERSISTED_ENTITY);w(this,"description",la.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",la.abstract);w(this,"static",la.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=la,this.project=i,this.id=la.id,this.version=la.version,this.name=la.name,this.static=la.static,this.abstract=la.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 ga=(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))(ga||{});function M$(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 Gi({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 zPe(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 Gi({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 Gi({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 iu=(s=>(s.StatusCodeMustBeNumber="status-code-must-be-number",s.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",s))(iu||{}),JPe=(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))(JPe||{});function RP(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 YPe(s,u){const i=[];if(typeof u!="number"){const r=new Gi({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 Gi({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 QPe extends tu{constructor(i){var f,h;super(Ws,i);w(this,"initialData");w(this,"id",Re.HTTP_ENDPOINT);w(this,"version","1");w(this,"name",Re.HTTP_ENDPOINT);w(this,"description",Ws.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",Ws.abstract);w(this,"static",Ws.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=Ws,this.project=i,this.id=Ws.id,this.version=Ws.version,this.name=Ws.name,this.static=Ws.static,this.abstract=Ws.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===U["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=M$(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 Gi({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,X="";for(let te=0;te<A.length;te++){const ie=A[te];if(ie==="{")k=!0,X+=ie;else if(ie==="}"){if(!k){const z=new Gi({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(z)}k=!1,X+=ie}else X+=k?ie:ie.toLowerCase()}if(A=X,k){const te=new Gi({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 Gi({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 D=m.parent,R=D.properties.find(x=>x.implements.find(k=>k.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),C=(G=R==null?void 0:R.getDefaultValue())==null?void 0:G.value;if(m.project.entities.filter(x=>ki(x,Re.HTTP_ENDPOINT)&&x.id!==D.id).some(x=>{var te,ie;const k=x.properties.find(z=>z.implements.find(ee=>ee.id===U["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)!==C)return!1;const X=x.properties.find(z=>z.implements.find(ee=>ee.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!X)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return RP((ie=X.getDefaultValue())==null?void 0:ie.value,A)})){const x=new Gi({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${A}" conflicts with another endpoint using the ${C} 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===U["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,D=A.properties.find(G=>G.implements.find(x=>x.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),R=($=D==null?void 0:D.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(G=>ki(G,Re.HTTP_ENDPOINT)&&G.id!==A.id).some(G=>{var X,te;const x=G.properties.find(ie=>ie.implements.find(z=>z.id===U["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!RP((X=x==null?void 0:x.getDefaultValue())==null?void 0:X.value,R))return!1;const k=G.properties.find(ie=>ie.implements.find(z=>z.id===U["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 Gi({id:m.id+"--"+ga.MustBeUniqueAmongSameEntities,message:`Method "${v}" cannot be used because another endpoint is already using the ${v} method on path "${R}".`,severity:Ee.Error,code:ga.MustBeUniqueAmongSameEntities,entity:m});b.errors.push(G)}return b});const c=this.abstractMethods.find(m=>m.id===U["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===U["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)=>YPe(m,v)}}var kv=(s=>(s.InvalidCharacters="cron-invalid-characters",s.MustHaveSixFields="cron-must-have-six-fields",s.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",s))(kv||{});function XPe(s,u){const i=[];let r=u;if(typeof u!="string"){const e=new Gi({id:s.id+"--"+ga.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:ga.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 Gi({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 Gi({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 Gi({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 eVe extends tu{constructor(i){super(gl,i);w(this,"initialData");w(this,"id",Re.CRON_JOB);w(this,"version","1");w(this,"name",Re.CRON_JOB);w(this,"description",gl.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",gl.abstract);w(this,"static",gl.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=gl,this.project=i,this.id=gl.id,this.version=gl.version,this.name=gl.name,this.static=gl.static,this.abstract=gl.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===U["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)=>XPe(a,c)}}class tVe extends tu{constructor(i){super(Aa,i);w(this,"initialData");w(this,"id",Re.RELATIONAL_DATABASE);w(this,"version","1");w(this,"name",Re.RELATIONAL_DATABASE);w(this,"description",Aa.description);w(this,"type",d.BuiltInBaseEntity);w(this,"abstract",Aa.abstract);w(this,"static",Aa.static);w(this,"properties",[]);w(this,"methods",[]);w(this,"abstractMethods",[]);w(this,"extends",null);w(this,"errors",[]);w(this,"project");this.initialData=Aa,this.project=i,this.id=Aa.id,this.version=Aa.version,this.name=Aa.name,this.static=Aa.static,this.abstract=Aa.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===U["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=(a,c)=>zPe(a,c)}}class iVe extends Rr{constructor(i){super(Za,i);w(this,"id",Za.id);w(this,"name",Za.name);w(this,"description",Za.description);w(this,"version",Za.version);w(this,"autoexecutable",!1);w(this,"type",d.ActionDescriptor);w(this,"inputs",[]);w(this,"dataType",null);w(this,"error",null);w(this,"project");this.project=i,this.inputs=Za.inputs.map(r=>{const a=we(r,this.project);return a.setParent(this,null),a.initChildren(null),a}),this.dataType=we(Za.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=Za.error?we(Za.error,this.project):null}}var Xs=(s=>(s.UUIDMustBeString="uuid-must-be-string",s.UUIDMustBeValidFormat="uuid-must-be-valid-format",s.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",s))(Xs||{});function _Ii(s,u){const i=[];if(typeof u!="string"){const a=new Gi({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=M$(s,u);if(r.errors.length>0)return i.push(...r.errors),{errors:i,override:u};if(!w$(u)){const a=new Gi({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 Fe=(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))(Fe||{});const rVe={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function Dv(s,u){return{...rVe,id:s,project:u}}class Cv{constructor(u,i){w(this,"initialized",!1);w(this,"id");w(this,"project");w(this,"values",{});w(this,"onWriteCallback",()=>{});w(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 pn(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=bVe(e,f,this.project);h?i[a]=h:delete u[a]}catch(f){re.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 pn)a=i;else if(i)a=$r(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:ku(u.getDataType(null))};a=$r(c,this.project)}a.standalone=!0,a.initialData.standaloneParent||re.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 nn(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function G$(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 uw(s,u,i){if(s==null)return i;const r=G$(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 PIi=new Set(["__proto__","prototype","constructor"]);function nVe(s){return typeof s=="string"&&PIi.has(s)}function VIi(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=G$(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(nVe(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",D=Array.isArray(f)&&typeof m=="number";if(v){if(D&&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],C=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(!C||$){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 k$(s,u,i,r){const a=G$(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(nVe(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",D=c(A?[]:{},f+1);return v[h]=D,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 yU=Symbol("missing"),NIi=s=>s!=null&&typeof s=="object";function pw(s,u){if(typeof s!="string")throw new TypeError(`${u} expects the key to be a string.`);return s}function b0(s,u){if(typeof s!="string"&&!Array.isArray(s))throw new TypeError(`${u} expects the path to be string or array.`);return s}function Sy(s,u){if(!nn(s))throw new TypeError(`${u} expects the first argument to be an object.`);return s??{}}function aVe(s,u){const i=pw(u,"ReadKey");return(s??{})[i]}function sVe(s,u,i){const r=pw(u,"WriteKey");if(s&&typeof s=="object"){const a=Array.isArray(s)?[...s]:{...s};return a[r]=i,a}return{[r]:i}}function lVe(s,u){if(!s||typeof s!="object")return{};const i=String(u),{[i]:r,...a}=s;return a}function oVe(s,u,i){const r=Sy(s,"ReadNestedKey"),a=b0(u,"ReadNestedKey");return uw(r,a,i)}function dVe(s,u,i){const r=Sy(s,"WriteNestedKey"),a=b0(u,"WriteNestedKey");return k$(r,a,i,"strict-set")}function uVe(s,u,i){const r=Sy(s,"WriteSafeNestedKeyRecursively"),a=b0(u,"WriteSafeNestedKeyRecursively");return k$(r,a,i,"safe-set")}function pVe(s,u){const i=Sy(s,"DeleteNestedKey"),r=b0(u,"DeleteNestedKey");return k$(i,r,null,"strict-delete")}function cVe(s,u){const i=pw(u,"HasKey"),r=s;return r!=null&&NIi(r)&&Object.prototype.hasOwnProperty.call(r,i)}function fVe(s,u,i){const r=pw(u,"KeyValueEquals");return s==null||typeof s!="object"?!1:s[r]===i}function yVe(s,u){const i=s,r=b0(u,"HasNestedKey");return uw(i,r,yU)!==yU}function hVe(s,u,i){const r=b0(u,"NestedKeyValueEquals");return uw(s,r)===i}function mVe(...s){const u={};for(let i=0;i<s.length;i++){const r=s[i];if(r!=null){if(!nn(r))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,r)}}return u}function TVe(s){const u=Sy(s,"ObjectKeys");return Object.keys(u)}function vVe(s){const u=Sy(s,"ObjectValues");return Object.values(u)}function EVe(s){const u=Sy(s,"ObjectEntries");return Object.entries(u)}const em=new Set;function xIi(s){return{execution:null,project:s,localTestValues:Dv("local-test-values",s),resolvedValues:Dv("resolved-values",s),persistedExecutionResults:Dv("persisted-execution-results",s),lastExecutionResults:Dv("last-execution-results",s),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function A0(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 me.EntityTemplate:a=me.EntityTemplate;break;case me.String:a=me.String;break;case me.Number:a=me.Number;break;case me.Boolean:a=me.Boolean;break;case me.Null:a=me.Null;break;case me.Enum:a=me.Enum;break;case me.KeyValue:a=me.KeyValue;break;case me.Untyped:a=me.Untyped;break;case me.KeyValue:a=me.KeyValue;break;case me.Date:a=me.Date;break;case me.UUID:a=me.UUID;break;case me.File:a=me.File;break;case me.Void:a=me.Void;break;case me.ActionDescriptor:a=me.ActionDescriptor;break;case me.Bytes:a=me.Bytes;break;case me.SqlProgram:a=me.SqlProgram;break;default:throw new Error(`Primitive type ${ci(s.entity,i)} is not supported`)}else a=me.Untyped;const c=pn.new(r);c.name=a,c.parent=u.toReference();const e=we(c,i);return e.hydrateAncestors(),r==null||r.add(e,Y.Added),e.addSelfToProject(r),e.initChildren(r),e}function Wd(s,u,i=new Set){var r,a,c,e;if(i.has(s.id))return[];if(i.add(s.id),Ei.includes(s.type)){const f=Wr(s);return P([f,...[f].flatMap(h=>Wd(h,u,i))])}else if(s.type===d.OutputMap){if(Ei.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=>Wd(f,u,i))])}else if(s.type===d.InputMap){if(Ei.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=>Wd(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 bVe(s,u,i){return s}function g0(s,u,i=!1){const r=s.readsValue;let a=null;const c=Su(r,u,i);if(c){const e={sources:[c],target:s};a={value:c.value,valueOwner:s,type:Fe.Inherited,inheritanceLink:e}}else a={value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null};return a}function $i(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 me.EntityTemplate:r=me.EntityTemplate;break;case me.String:r=me.String;break;case me.Number:r=me.Number;break;case me.Boolean:r=me.Boolean;break;case me.Null:r=me.Null;break;case me.Enum:r=me.Enum;break;case me.KeyValue:r=me.KeyValue;break;case me.Untyped:r=me.Untyped;break;case me.KeyValue:r=me.KeyValue;break;case me.Date:r=me.Date;break;case me.UUID:r=me.UUID;break;case me.File:r=me.File;break;case me.Void:r=me.Void;break;case me.ActionDescriptor:r=me.ActionDescriptor;break;case me.Bytes:r=me.Bytes;break;case me.SqlProgram:r=me.SqlProgram;break;default:throw new Error(`Primitive type ${ci(s.entity,i)} is not supported`)}else r=me.Untyped;if(!i.get(u.id))return null;const c=pn.new(null);c.name=r,c.standaloneParent=u.toReference();let e=new pn(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function AVe(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:Fe.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!==Fe.DefaultValue)?{value:r,valueOwner:s,type:Fe.Testing,inheritanceLink:null}:{value:null,valueOwner:s,type:Fe.QueuedAutocalculation,inheritanceLink:null}}function aI(s,u,i,r=!1){var e,f;const a={...s},c=u.type===d.VariableDeclaration?u.inputs:St.includes(u.type)?u.outputs:[];if(!c||c.length===0)return a;for(const h of c){if(!Ty(h))continue;const m=Qv(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)||xr(v);a[b]=oa((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 Ov(s,u,i,r=!1){var e,f;const a={...s},c=u.inputs;if(!c)return a;for(const h of c){if(!Ty(h))continue;const m=bb(h,i,r);if(m&&m.value&&m.type!==Fe.Undefined){const v=ci(h,i.project),b=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||xr(v);a[b]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return a}function gVe(s,u,i=!1){var v,b,A,D,R,C,$,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=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(x){if(nn(x.value)){const X={...r,...x.value},te={...Ov(X,s,u,i)};x.metaSync({value:te},null)}return{value:x,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}}const a=!!((R=u.execution)!=null&&R.entities.length),c=(C=u.execution)==null?void 0:C.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=g0(s,u,i),f&&f.value&&nn(f.value.value))){const X={...r,...f.value.value},te={...Ov(X,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=pD(x);if(x.metaSync({value:k},null),nn(k)){const X={...Ov(k,s,u,i)};x.metaSync({value:X},null)}}(i||m===null||m!==Fe.Testing)&&(f={value:x,valueOwner:s,type:oa(x)?s.readsValue?Fe.Inherited:Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const x=(G=u.localTestValues)==null?void 0:G.readValue(s.id);if(x){if(nn(x.value)){const k={...r,...x.value},X={...Ov(k,s,u,i)};x.metaSync({value:X},null)}return{value:x,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}}return oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function j$(s,u,i=!1){var f,h,m,v,b,A,D,R,C,$,G,x,k,X,te,ie,z;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 ee=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(ee){if(nn(ee.value)){const Q={...r,...ee.value},H=aI(Q,s,u,i);ee==null||ee.metaSync({value:H},null)}return{value:ee,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}}const a=(R=u.localTestValues)==null?void 0:R.readValue(s.id);let c=!1;if(s.type===d.VariableDeclaration){const ee=s,de=!!((C=u.execution)!=null&&C.entities.length),Q=($=u.execution)==null?void 0:$.hasEntity(s),H=ee.readsValue;if(H){const ae=(G=u.execution)==null?void 0:G.hasEntity(H);c=!de||de&&ae&&Q||de&&!ae&&!Q}}const e=u.getValueTypePreference(s.id);if(a&&!i&&(!c||e===Fe.Testing)){if(nn(a.value)){const de={...r,...a.value},Q=aI(de,s,u,i);a.metaSync({value:Q},null)}return{value:a,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}if((x=s.getDataType(null))!=null&&x.entity&&(((X=(k=s.getDataType(null))==null?void 0:k.entity)==null?void 0:X.type)===d.DefinitionEntity||((ie=(te=s.getDataType(null))==null?void 0:te.entity)==null?void 0:ie.type)===d.BuiltInBaseEntity)&&((z=s.getDataType(null))!=null&&z.isObject())){const ee=$i(s.dataType,s,u.project),de=aI(r,s,u,i);return ee==null||ee.metaSync({value:de},null),{value:ee,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null}}return null}function cw(s,u,i=!1){var v,b,A,D,R;if((v=s.dataType)!=null&&v.isObject())return gVe(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 C=(D=u.execution)==null?void 0:D.hasEntity(e);(!a||a&&C&&c||a&&!C&&!c)&&(f=g0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const C=h;if(C&&C.value===null&&C.autogeneration){const $=pD(C);C.metaSync({value:$},null)}(i||m===null||m!==Fe.Testing)&&(f={value:C,valueOwner:s,type:oa(C)?s.readsValue?Fe.Inherited:Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const C=(R=u.localTestValues)==null?void 0:R.readValue(s.id);if(C)return{value:C,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}return oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function U$(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:Fe.ExecutionResult,inheritanceLink:null}}return(c=s.dataType)!=null&&c.isObject()||s.outputs.length?j$(s,u,i):cw(s,u,i)}function IVe(s,u,i=!1){var A,D,R,C;const r=!!((A=u.execution)!=null&&A.entities.length),a=(D=u.execution)==null?void 0:D.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=g0(s,u,i))}const f=s.declaration;if(!c&&f){const $=cw(f,u,i);$&&$.value&&(c=$)}const h=u.getValueTypePreference(s.id);if(!c||(c.type===Fe.DefaultValue||c.type===Fe.External)&&!i||h===Fe.Testing){const $=(C=u.localTestValues)==null?void 0:C.readValue(s.id);if($)return{value:$,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const m=tp(s),v=s.getDataType(null);return m&&a&&(!(c!=null&&c.value)||!Os(v)&&zd(c==null?void 0:c.value))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:a&&!m&&oa((c==null?void 0:c.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:c||{value:null,valueOwner:s,type:Fe.External,inheritanceLink:null}}function RVe(s,u,i=!1){return U$(s.declaration,u,i)}function wVe(s,u,i=!1){var D,R,C,$;if(!i&&u.execution&&u.execution.hasEntity(s)){const G=(D=u.lastExecutionResults)==null?void 0:D.readValue(s.id);if(G)return{value:G,valueOwner:s,type:Fe.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!==Fe.DefaultValue))return{value:G,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=Mt(s),e=s.parent.type===d.FunctionDeclaration&&s.parent.parent.type===d.Loop?s.parent:null,f=!!((C=u.execution)!=null&&C.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=pD(G);G.metaSync({value:x},null)}(i||a===null||a!==Fe.Testing)&&(h={value:G,valueOwner:s,type:oa(G)?Fe.Empty:Fe.DefaultValue,inheritanceLink:null})}!h||(h.type===Fe.DefaultValue||h.type===Fe.External)&&!i||Fe.Testing;const v=tp(s),b=s.getDataType(null);let A=v&&f&&(!(h!=null&&h.value)||!Os(b)&&zd(h==null?void 0:h.value));return c.type===d.Loop&&f&&(A=!1),A?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:f&&!v&&oa((h==null?void 0:h.value)||null)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:h||{value:null,valueOwner:s,type:Fe.External,inheritanceLink:null}}function F$(s,u,i=!1){var D,R,C,$,G,x;if((D=s.getDataType(null))!=null&&D.isObject()||s.outputs.length)return j$(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:Fe.ExecutionResult,inheritanceLink:null}}const r=Mt(s),a=!!((C=u.execution)!=null&&C.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=g0(s,u,i))}const h=s.defaultValue,m=u.getValueTypePreference(s.id);if(!f&&h){const k=h;(i||m===null||m!==Fe.Testing)&&(f={value:k,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Fe.DefaultValue||f.type===Fe.External)&&!i||m===Fe.Testing){const k=(x=u.localTestValues)==null?void 0:x.readValue(s.id);if(k)return{value:k,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const v=tp(s),b=s.getDataType(null);return v&&(!(f!=null&&f.value)||!Os(b)&&zd(f==null?void 0:f.value))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:!s.defaultValue&&!s.readsValue?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}:!v&&oa((f==null?void 0:f.value)||null)?{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function DVe(s,u,i=!1){var e,f,h,m,v,b,A,D;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:Fe.ExecutionResult,inheritanceLink:null}}const r=Cc(s);if(Hu.includes(r.type)){const R=Su(r,u,i),C=s.codeName||((f=s.declaration)==null?void 0:f.codeName)||xr(ci(s,u.project));if(R!=null&&R.value&&s.parentRelationType!==Il.Error){const $=(R.value.value||{})[C];if($===void 0)return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};const G=$i(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:!Ei.includes(r.type)&&R.type===Fe.Empty?Fe.QueuedAutocalculation:R.type,inheritanceLink:{sources:[R],target:s}}}return{value:null,valueOwner:s,type:Ei.includes(r.type)?Fe.Empty:Fe.QueuedAutocalculation,inheritanceLink:null}}const a=(v=u.execution)==null?void 0:v.hasEntity(r),c=((b=u.execution)==null?void 0:b.state)===aL.Running;if((A=u.persistedExecutionResults)!=null&&A.values[s.id]&&!a&&!c&&!i){const R=(D=u.persistedExecutionResults)==null?void 0:D.readValue(s.id);if((R==null?void 0:R.value)!==null||(R==null?void 0:R.valueAsType)!==null)return{value:R,valueOwner:s,type:Fe.ExecutionResult,inheritanceLink:null}}return null}function wP(s,u,i=!1){var b,A,D,R,C;if(![...St,...Ei].includes(s.parent.type)||!Ty(s))return null;if(((b=s.declaration)==null?void 0:b.type)===d.Property&&s.declaration.static)return Su(s.declaration,u);const r=bb(s,u,i);if(r&&r.type!==Fe.Empty&&r.type!==Fe.Missing&&r.type!==Fe.Undefined)return r;const a=Wr(s.parent),c=Mo(a,u,i),e=s.codeName||((A=s.declaration)==null?void 0:A.codeName)||xr(ci(s,u.project)),f=$i(s.getDataType(null),s,u.project),h=tp(s),m=(D=c==null?void 0:c.value)==null?void 0:D.value;if(m){let $=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:s,type:Fe.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"?(C=c==null?void 0:c.value)==null?void 0:C.rawString:void 0},null);const G=tp(s),x=s.getDataType(null);return G&&(!f||!Os(x)&&zd(f))?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:{value:f,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}}return c!=null&&c.type&&c.type!==Fe.Missing&&c.type!==Fe.Empty&&c.type!==Fe.Undefined?{value:null,valueOwner:s,type:c.type,inheritanceLink:{sources:c?[c]:[],target:s}}:h?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:{value:null,valueOwner:s,type:s.readsValue?Fe.Inherited:Fe.Empty,inheritanceLink:null}}function DP(s,u,i=!1){var m,v,b,A,D,R,C,$,G,x,k;if(![...St,...Ei].includes(s.parent.type)||!Ty(s))return null;if(((m=s.declaration)==null?void 0:m.type)===d.Property&&s.declaration.static)return Su(s.declaration,u,i);const r=St.includes(s.parent.type)?s.parent:Wr(s.parent),a=Su(r,u,i);let c=Qv(s,u,i);if((c==null?void 0:c.type)===Fe.Undefined||(c==null?void 0:c.type)===Fe.Missing){const X=Wr(s.parent);let te=s;X.type===d.VariableDeclaration&&(te=(s.parent===X?s:X.inputs.find(z=>{var ee,de;return((ee=z.declaration)==null?void 0:ee.id)===((de=s.declaration)==null?void 0:de.id)}))||s,c=Qv(te,u,i))}const e=s.codeName||((v=s.declaration)==null?void 0:v.codeName)||xr(ci(s,u.project));let f=s.defaultValue||$i(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)===Fe.ExecutionResult||(a==null?void 0:a.type)===Fe.Testing)&&!i&&h){let X=(h||{})[e];if(h[e]===void 0&&!s.readsValue&&!s.defaultValue)return{value:null,valueOwner:s,type:Fe.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=X;return s.defaultValue&&(te=s.defaultValue.value),f==null||f.metaSync({value:te,rawString:typeof X=="string"&&typeof((A=a==null?void 0:a.value)==null?void 0:A.rawString)=="string"?(D=a==null?void 0:a.value)==null?void 0:D.rawString:void 0},null),{value:f,valueOwner:s,type:a.type,inheritanceLink:{sources:a?[a]:[],target:s}}}if(c&&c.type!==Fe.Empty&&c.type!==Fe.Missing&&c.type!==Fe.Undefined)return c;if(h){let X=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:X,rawString:typeof X=="string"&&typeof((R=a==null?void 0:a.value)==null?void 0:R.rawString)=="string"?(C=a==null?void 0:a.value)==null?void 0:C.rawString:void 0},null));const te=tp(s),ie=s.getDataType(null),z=te&&(!f||!Os(ie)&&zd(f)),ee=!!(($=u.execution)!=null&&$.entities.length),de=(G=u.execution)==null?void 0:G.hasEntity(r),Q=r.readsValue;if(Q){const H=(x=u.execution)==null?void 0:x.hasEntity(Q);if(z&&(!ee||ee&&H&&de||ee&&!H&&!de))return{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}}if(s.readsValue){const H=(k=u.execution)==null?void 0:k.hasEntity(s.readsValue);if(z&&(!ee||ee&&H&&de||ee&&!H&&!de))return{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}}return z?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:h[e]===void 0&&!s.readsValue&&!s.defaultValue?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:{sources:a?[a]:[],target:s}}:{value:f,valueOwner:s,type:oa(f)&&!s.readsValue?Fe.Empty:Fe.Inherited,inheritanceLink:null}}return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}}function bb(s,u,i=!1){var C,$,G,x,k;const r=Mt(s),a=!!((C=u.execution)!=null&&C.entities.length),c=($=u.execution)==null?void 0:$.hasEntity(r),e=s.readsValue;let f=null,h=!1;if(e){const X=(G=u.execution)==null?void 0:G.hasEntity(e);h=!a||a&&X&&c||a&&!X&&!c,h&&(f=g0(s,u,i))}const m=!!e&&h,v=s.defaultValue,b=u.getValueTypePreference(s.id);if(!f&&v&&(i||b===null||b!==Fe.Testing)&&(f={value:v,valueOwner:s,type:zd(v)?Fe.Empty:Fe.DefaultValue,inheritanceLink:null}),(!f||f.type===Fe.DefaultValue||(f==null?void 0:f.type)===Fe.Empty||b===Fe.Testing)&&!m){const X=(x=u.persistedExecutionResults)==null?void 0:x.readValue(s.id);if(X&&!i)return{value:X,valueOwner:s,type:Fe.Testing,inheritanceLink:null};const te=(k=u.localTestValues)==null?void 0:k.readValue(s.id);if(te&&!i&&(b===null||b===Fe.Testing))return{value:te,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}if(v&&!zd(v))return{value:v,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null};const A=tp(s),D=s.getDataType(null),R=A&&(!(f!=null&&f.value)||!Os(D)&&zd(f==null?void 0:f.value));return m&&R?{value:null,valueOwner:s,type:Fe.Inherited,inheritanceLink:null}:R?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!s.defaultValue&&!m?{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null}:!A&&(!f||f.type===Fe.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:s,type:m?Fe.Inherited:Fe.Empty,inheritanceLink:null}:f}function Qv(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:Fe.ExecutionResult,inheritanceLink:null}}return bb(s,u,i)}function CVe(s,u,i=!1){var r,a;return Ei.includes(s.parent.type)&&(r=Wr(s.parent).dataType)!=null&&r.isObject()||St.includes(s.parent.type)&&(a=s.parent.getDataType(null))!=null&&a.isObject()?wP(s,u,i):bb(s,u,i)}function K$(s,u,i=!1){var r,a;if(Ei.includes(s.parent.type)){const c=Wr(s.parent);if((r=c.dataType)!=null&&r.isObject()||c.inputs.length)return DP(s,u,i)}return St.includes(s.parent.type)&&((a=s.parent.getDataType(null))!=null&&a.isObject()||s.parent.outputs.length)?DP(s,u,i):Qv(s,u,i)}function OVe(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:Fe.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!==Fe.DefaultValue))return{value:A,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;c&&(i||a===null||a!==Fe.Testing)&&(e={value:c,valueOwner:s,type:Fe.DefaultValue,inheritanceLink:null});const f=tp(s),h=s.getDataType(null);return f&&(!(e!=null&&e.value)||!Os(h)&&zd(e==null?void 0:e.value))&&s.static?{value:null,valueOwner:s,type:Fe.Missing,inheritanceLink:null}:oa(e==null?void 0:e.value)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:e}function _Ve(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:Fe.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!==Fe.DefaultValue))return{value:v,valueOwner:s,type:Fe.Testing,inheritanceLink:null}}const c=s.defaultValue;let e=null;if(c&&(i||a===null||a!==Fe.Testing)&&(e={value:c,valueOwner:s,type:Fe.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 K$(v,u,i)}return oa((e==null?void 0:e.value)||null)?{value:null,valueOwner:s,type:Fe.Empty,inheritanceLink:null}:e}function Su(s,u,i=!1){if(em.has(s.id))return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};em.add(s.id);try{switch(s.type){case d.ArgumentDeclaration:return wVe(s,u,i);case d.InputMap:return K$(s,u,i);case d.VariableDeclaration:return U$(s,u,i);case d.VariableInstance:return RVe(s,u,i);case d.OutputMap:return DVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return F$(s,u,i);case d.Property:return OVe(s,u,i);case d.ValueDescriptor:return _Ve(s,u,i);case d.Operation:case d.FunctionCall:case d.InternalCall:case d.Search:return AVe(s,u,i);default:return null}}finally{em.delete(s.id)}}function Mo(s,u,i=!1){if(em.has(s.id))return{value:null,valueOwner:s,type:Fe.Undefined,inheritanceLink:null};em.add(s.id);try{switch(s.type){case d.InputMap:return CVe(s,u,i);case d.VariableDeclaration:return cw(s,u,i);case d.VariableInstance:return IVe(s,u,i);case d.ReturnStatement:case d.BreakStatement:case d.ContinueStatement:return F$(s,u,i);default:return null}}finally{em.delete(s.id)}}function $Ii(s){var u,i,r,a,c;if(s&&s.type===Fe.DefaultValue&&s.value&&s.valueOwner&&(!nR.includes(s.valueOwner.type)||((u=s.valueOwner.defaultValue)==null?void 0:u.id)===s.value.id)){const e=$i(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:Fe.DefaultValue,value:e,valueOwner:s.valueOwner,inheritanceLink:null}}return s}function LIi(s,u,i,r){var D,R,C,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=Wr(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===((D=f.defaultValue)==null?void 0:D.id)&&(m=$i(f.getDataType(null),f,u)):a?m=A0(f.getDataType(null),f,u,c):m=$i(f.getDataType(null),f,u);const v=ci(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||xr(v);let A={};if((($=(C=f.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),nn(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,X;return((k=x.declaration)==null?void 0:k.id)===((X=s.declaration)==null?void 0:X.id)||ci(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 BIi(s,u,i){const r=Wd(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 MIi(s,u,i,r,a,c){const e=Wd(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 D,R,C,$;if(i.diggestedBuiltInBaseEntitiesIds.has(v.id))return;let b=null;if(f){const G=((D=v.getDefaultValue)==null?void 0:D.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===(($=(C=v.getDefaultValue)==null?void 0:C.call(v))==null?void 0:$.id)&&(b=$i(v.getDataType(null),v,i)):f?(b=A0(v.getDataType(null),v,i,h),h==null||h.add(b,Y.Added)):b=$i(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)===me.Untyped)&&!a&&(typeof s=="string"?A=me.String:s===null?A=me.Null:typeof s=="number"?A=me.Number:typeof s=="boolean"&&(A=me.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 dy(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,D,R,C,$;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=$i(m.getDataType(null),m,u)):a?G=A0(m.getDataType(null),m,u,c):G=$i(m.getDataType(null),m,u);const x=ci(s,u),k=s.codeName||((D=s.extends)==null?void 0:D.codeName)||((R=s.implements[0])==null?void 0:R.codeName)||xr(x);let X={};(($=(C=m.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(X={...X,...m.dataType.entity.getActiveRawDefaultValue()}),nn(G==null?void 0:G.value)&&(X={...X,...G.value}),Array.isArray(i)?X[k]=(i==null?void 0:i.map(te=>te.toShallowJSON()))||null:X[k]=(i==null?void 0:i.toShallowJSON())||null,G==null||G.metaSync({value:X},c),a||e==null||e.writeValue(m,G);return}}),c}function Xv(s,u,i,r){var D,R,C,$;let a=!1,c=null,e=null;r instanceof Z?(a=!0,c=r,e=null):(c=null,e=r);const f=Wr(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===((D=f.defaultValue)==null?void 0:D.id)&&(m=$i(f.getDataType(null),f,u)):a?m=A0(f.getDataType(null),f,u,c):m=$i(f.getDataType(null),f,u);const v=ci(s,u),b=s.codeName||((R=s.declaration)==null?void 0:R.codeName)||xr(v);let A={};if((($=(C=f.dataType)==null?void 0:C.entity)==null?void 0:$.type)===d.DefinitionEntity&&(A={...A,...f.dataType.entity.getActiveRawDefaultValue()}),nn(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,X;return((k=x.declaration)==null?void 0:k.id)===((X=s.declaration)==null?void 0:X.id)||ci(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 PVe(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?dy(s.declaration,u,null,i):Ei.includes(s.parent.type)&&((a=s.declaration)==null?void 0:a.type)===d.Property&&Xv(s,u,null,i):s.type===d.OutputMap?((c=s.declaration)==null?void 0:c.type)===d.Property&&s.declaration.static?dy(s.declaration,u,null,i):Ei.includes(s.parent.type)&&((e=s.declaration)==null?void 0:e.type)===d.Property&&Xv(s,u,null,i):s.type===d.Property&&s.static&&dy(s,u,null,i),i}function VVe(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?dy(u.declaration,i,s,r):Ei.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===d.Property&&Xv(u,i,s,r):u.type===d.OutputMap?((e=u.declaration)==null?void 0:e.type)===d.Property&&u.declaration.static?dy(u.declaration,i,null,r):Ei.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===d.Property&&Xv(u,i,null,r):u.type===d.Property&&u.static&&dy(u,i,s,r),r}function GIi(s,u,i){const r=Wd(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),PVe(f,u,i)}),c}function kIi(s,u,i,r){const a=Wd(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=$i(h.getDataType(null),h,h.project)):c?m=A0(h.getDataType(null),h,i,e):m=$i(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),VVe(s,h,i,r)}),e}function kr(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 fw{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||{}),oe=(s=>(s.Logic="logic",s.EditorGUI="editor-gui",s.GUI="gui",s.Editor="editor",s.Compile="compile",s.PublicationRun="publication-run",s))(oe||{}),Ne=(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))(Ne||{});class NVe{constructor(u){w(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 xVe extends NVe{constructor(u,i){super(i),this.parentExtension=u}}class xe{constructor(u,i){w(this,"manifest");w(this,"module");w(this,"state");this.extensionsRegistry=u,this.state=new xVe(this,i)}}class CP extends fw{constructor(i,r){super(i,oe.Logic);w(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 jIi(s,u){return u instanceof CP?u:new CP(s,u)}const ls="built-in-function-implementations__",ke="operations-implementations__",Hs="conditions-implementations__",$e={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:ls+fn.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:ls+fn.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:ls+fn.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:ls+fn.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+Hn.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Ko.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+Oe.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+Ps.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+ce.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+ce.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+ce.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+ce.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+ce.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+ce.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+ce.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+ce.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+ce.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+ce.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+ce.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+ce.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+ce.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+ce.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+ce.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+ce.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+ce.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+ce.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+ce.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+ce.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+ce.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+ce.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+ce.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+ce.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+ce.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+ce.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+ce.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+ce.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+ce.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+ce.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+ce.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+J.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+J.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+J.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+J.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+ce.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+ce.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+ce.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+J.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+J.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+J.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+J.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+J.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+J.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+J.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+J.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+J.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+J.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+J.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+J.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+J.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+J.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+J.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+J.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+J.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+J.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+J.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+J.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+J.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+J.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+J.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+J.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+J.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+J.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+J.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+J.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+J.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+J.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+J.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+J.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+J.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+J.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+J.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+J.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+J.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+J.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+J.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+J.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+J.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+fe.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+fe.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+fe.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+fe.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+fe.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+fe.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+fe.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+fe.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+fe.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+fe.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+fe.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+fe.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+fe.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+fe.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+fe.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+fe.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+fe.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+fe.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+fe.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+fe.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+fe.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+fe.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+fe.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+fe.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+fe.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+fe.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+fe.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+fe.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+fe.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+fe.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+fe.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+fe.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+fe.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+fe.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+fe.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+fe.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+fe.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+fe.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+fe.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+fe.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+fe.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+fe.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+at.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+at.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+at.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+at.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+at.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+at.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+at.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+at.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+at.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+at.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+J.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+J.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+J.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+J.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:Hs+S.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Hs+S.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Hs+S.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Hs+S.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Hs+S.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Hs+S.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Hs+S.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Hs+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+Oe.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+Oe.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+Oe.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+Oe.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+Oe.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+Oe.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+Oe.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Hs+Oe.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Hs+Oe.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Hs+Oe.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Hs+Oe.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Hs+Oe.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+Oe.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+Oe.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+Oe.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+Oe.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+et.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+li.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+li.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+at.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+li.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+li.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+Yr.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+Yr.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+zn.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+zn.Stringify};class $Ve extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class LVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class BVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class MVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,entity:i,error:null,result:null})})}}class GVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Editor]});w(this,"module",{main:async(i,r)=>({error:"Search module not implemented",data:null})})}}class kVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:Ve.High,permissions:[Ne.All],contexts:[]});w(this,"module",yV)}}class jVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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)===U.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 UVe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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)===U.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 YI=class YI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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 D=!1;return v&&YI.primitiveSet.has(v)?D=b===A:v===me.Untyped||v===me.KeyValue?D=JSON.stringify(b)===JSON.stringify(A):D=!1,{value:F.Success,error:null,result:D}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};w(YI,"primitiveSet",new Set([me.String,me.Number,me.Boolean,me.Null,me.Enum,me.Date,me.UUID]));let CI=YI;const QI=class QI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.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 D=!1;return v&&QI.primitiveSet.has(v)?D=b!==A:v===me.Untyped||v===me.KeyValue?D=JSON.stringify(b)!==JSON.stringify(A):D=!1,{value:F.Success,error:null,result:D}}catch(v){return{value:F.UnhandledError,error:v,result:null}}}})}};w(QI,"primitiveSet",new Set([me.String,me.Number,me.Boolean,me.Null,me.Enum,me.Date,me.UUID]));let OI=QI;var FVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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(C){var $={date:C,utc:!0,args:arguments};return new e($)},h.utc=function(C){var $=f(this.toDate(),{locale:this.$L,utc:!0});return C?$.add(this.utcOffset(),i):$},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),m.call(this,C)};var v=h.init;h.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else v.call(this)};var b=h.utcOffset;h.utcOffset=function(C,$){var G=this.$utils().u;if(G(C))return this.$u?0:G(this.$offset)?b.call(this):this.$offset;if(typeof C=="string"&&(C=function(te){te===void 0&&(te="");var ie=te.match(r);if(!ie)return null;var z=(""+ie[0]).match(a)||["-",0,0],ee=z[0],de=60*+z[1]+ +z[2];return de===0?0:ee==="+"?de:-de}(C),C===null))return this;var x=Math.abs(C)<=16?60*C:C;if(x===0)return this.utc($);var k=this.clone();if($)return k.$offset=x,k.$u=!1,k;var X=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(k=this.local().add(x+X,i)).$offset=x,k.$x.$localOffset=X,k};var A=h.format;h.format=function(C){var $=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return A.call(this,$)},h.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var D=h.toDate;h.toDate=function(C){return C==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():D.call(this)};var R=h.diff;h.diff=function(C,$,G){if(C&&this.$u===C.$u)return R.call(this,C,$,G);var x=this.local(),k=f(C).local();return R.call(x,k,$,G)}}})})(FVe);var UIi=FVe.exports;const FIi=pl(UIi);var KVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D,R){R===void 0&&(R={});var C=new Date(A),$=function(G,x){x===void 0&&(x={});var k=x.timeZoneName||"short",X=G+"|"+k,te=r[X];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[X]=te),te}(D,R);return $.formatToParts(C)},m=function(A,D){for(var R=h(A,D),C=[],$=0;$<R.length;$+=1){var G=R[$],x=G.type,k=G.value,X=i[x];X>=0&&(C[X]=parseInt(k,10))}var te=C[3],ie=te===24?0:te,z=C[0]+"-"+C[1]+"-"+C[2]+" "+ie+":"+C[4]+":"+C[5]+":000",ee=+A;return(e.utc(z).valueOf()-(ee-=ee%1e3))/6e4},v=c.prototype;v.tz=function(A,D){A===void 0&&(A=f);var R,C=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,D);else if(R=e(G,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),D){var X=R.utcOffset();R=R.add(C-X,"minute")}return R.$x.$timezone=A,R},v.offsetName=function(A){var D=this.$x.$timezone||e.tz.guess(),R=h(this.valueOf(),D,{timeZoneName:A}).find(function(C){return C.type.toLowerCase()==="timezonename"});return R&&R.value};var b=v.startOf;v.startOf=function(A,D){if(!this.$x||!this.$x.$timezone)return b.call(this,A,D);var R=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(R,A,D).tz(this.$x.$timezone,!0)},e.tz=function(A,D,R){var C=R&&D,$=R||D||f,G=m(+e(),$);if(typeof A!="string")return e(A).tz($);var x=function(ie,z,ee){var de=ie-60*z*1e3,Q=m(de,ee);if(z===Q)return[de,z];var H=m(de-=60*(Q-z)*1e3,ee);return Q===H?[de,Q]:[ie-60*Math.min(Q,H)*1e3,Math.max(Q,H)]}(e.utc(A,C).valueOf(),G,$),k=x[0],X=x[1],te=e(k).utcOffset(X);return te.$x.$timezone=$,te},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(A){f=A}}})})(KVe);var KIi=KVe.exports;const SIi=pl(KIi);var SVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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))}}})})(SVe);var qIi=SVe.exports;const ZIi=pl(qIi);var qVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isSameOrAfter=function(a,c){return this.isSame(a,c)||this.isAfter(a,c)}}})})(qVe);var HIi=qVe.exports;const WIi=pl(HIi);var ZVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isSameOrBefore=function(a,c){return this.isSame(a,c)||this.isBefore(a,c)}}})})(ZVe);var zIi=ZVe.exports;const JIi=pl(zIi);var HVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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"),D=this.diff(A,i,!0);return D<0?e(this).startOf("week").week():Math.ceil(D)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(HVe);var YIi=HVe.exports;const QIi=pl(YIi);var WVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D,R=e(this),C=(v=this.isoWeekYear(),b=this.$u,A=(b?c.utc:c)().year(v).startOf("year"),D=4-A.isoWeekday(),A.isoWeekday()>4&&(D+=7),A.add(D,i));return R.diff(C,"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)}}})})(WVe);var XIi=WVe.exports;const eRi=pl(XIi);var zVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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 D=this.quarter()-1;return A?this.month(3*D).startOf(i).startOf("day"):this.month(3*D+2).endOf(i).endOf("day")}return h.bind(this)(m,v)}}})})(zVe);var tRi=zVe.exports;const iRi=pl(tRi);var JVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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")}}})})(JVe);var rRi=JVe.exports;const nRi=pl(rRi);var YVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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,D){for(var R,C,$,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,X=0;X<k;X+=1){var te=x[X];te.d&&(R=A?a(m).diff(b,te.d,!0):b.diff(m,te.d,!0));var ie=(i.rounding||Math.round)(Math.abs(R));if($=R>0,ie<=te.r||!te.r){ie<=1&&X>0&&(te=x[X-1]);var z=G[te.l];D&&(ie=D(""+ie)),C=typeof z=="string"?z.replace("%d",ie):z(ie,v,te.l,$);break}}if(v)return C;var ee=$?G.future:G.past;return typeof ee=="function"?ee(C):ee.replace("%s",C)},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)}}})})(YVe);var aRi=YVe.exports;const sRi=pl(aRi);var QVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,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},D=function(ie){return ie instanceof X},R=function(ie,z,ee){return new X(ie,ee,z.$l)},C=function(ie){return r.p(ie)+"s"},$=function(ie){return ie<0},G=function(ie){return $(ie)?Math.ceil(ie):Math.floor(ie)},x=function(ie){return Math.abs(ie)},k=function(ie,z){return ie?$(ie)?{negative:!0,format:""+x(ie)+z}:{negative:!1,format:""+ie+z}:{negative:!1,format:""}},X=function(){function ie(ee,de,Q){var H=this;if(this.$d={},this.$l=Q,ee===void 0&&(this.$ms=0,this.parseFromMilliseconds()),de)return R(ee*A[C(de)],this);if(typeof ee=="number")return this.$ms=ee,this.parseFromMilliseconds(),this;if(typeof ee=="object")return Object.keys(ee).forEach(function(le){H.$d[C(le)]=ee[le]}),this.calMilliseconds(),this;if(typeof ee=="string"){var ae=ee.match(b);if(ae){var pe=ae.slice(2).map(function(le){return le!=null?Number(le):0});return this.$d.years=pe[0],this.$d.months=pe[1],this.$d.weeks=pe[2],this.$d.days=pe[3],this.$d.hours=pe[4],this.$d.minutes=pe[5],this.$d.seconds=pe[6],this.calMilliseconds(),this}}return this}var z=ie.prototype;return z.calMilliseconds=function(){var ee=this;this.$ms=Object.keys(this.$d).reduce(function(de,Q){return de+(ee.$d[Q]||0)*A[Q]},0)},z.parseFromMilliseconds=function(){var ee=this.$ms;this.$d.years=G(ee/m),ee%=m,this.$d.months=G(ee/v),ee%=v,this.$d.days=G(ee/f),ee%=f,this.$d.hours=G(ee/e),ee%=e,this.$d.minutes=G(ee/c),ee%=c,this.$d.seconds=G(ee/a),ee%=a,this.$d.milliseconds=ee},z.toISOString=function(){var ee=k(this.$d.years,"Y"),de=k(this.$d.months,"M"),Q=+this.$d.days||0;this.$d.weeks&&(Q+=7*this.$d.weeks);var H=k(Q,"D"),ae=k(this.$d.hours,"H"),pe=k(this.$d.minutes,"M"),le=this.$d.seconds||0;this.$d.milliseconds&&(le+=this.$d.milliseconds/1e3,le=Math.round(1e3*le)/1e3);var he=k(le,"S"),ve=ee.negative||de.negative||H.negative||ae.negative||pe.negative||he.negative,ge=ae.format||pe.format||he.format?"T":"",Ie=(ve?"-":"")+"P"+ee.format+de.format+H.format+ge+ae.format+pe.format+he.format;return Ie==="P"||Ie==="-P"?"P0D":Ie},z.toJSON=function(){return this.toISOString()},z.format=function(ee){var de=ee||"YYYY-MM-DDTHH:mm:ss",Q={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(H,ae){return ae||String(Q[H])})},z.as=function(ee){return this.$ms/A[C(ee)]},z.get=function(ee){var de=this.$ms,Q=C(ee);return Q==="milliseconds"?de%=1e3:de=Q==="weeks"?G(de/A[Q]):this.$d[Q],de||0},z.add=function(ee,de,Q){var H;return H=de?ee*A[C(de)]:D(ee)?ee.$ms:R(ee,this).$ms,R(this.$ms+H*(Q?-1:1),this)},z.subtract=function(ee,de){return this.add(ee,de,!0)},z.locale=function(ee){var de=this.clone();return de.$l=ee,de},z.clone=function(){return R(this.$ms,this)},z.humanize=function(ee){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!ee)},z.valueOf=function(){return this.asMilliseconds()},z.milliseconds=function(){return this.get("milliseconds")},z.asMilliseconds=function(){return this.as("milliseconds")},z.seconds=function(){return this.get("seconds")},z.asSeconds=function(){return this.as("seconds")},z.minutes=function(){return this.get("minutes")},z.asMinutes=function(){return this.as("minutes")},z.hours=function(){return this.get("hours")},z.asHours=function(){return this.as("hours")},z.days=function(){return this.get("days")},z.asDays=function(){return this.as("days")},z.weeks=function(){return this.get("weeks")},z.asWeeks=function(){return this.as("weeks")},z.months=function(){return this.get("months")},z.asMonths=function(){return this.as("months")},z.years=function(){return this.get("years")},z.asYears=function(){return this.as("years")},ie}(),te=function(ie,z,ee){return ie.add(z.years()*ee,"y").add(z.months()*ee,"M").add(z.days()*ee,"d").add(z.hours()*ee,"h").add(z.minutes()*ee,"m").add(z.seconds()*ee,"s").add(z.milliseconds()*ee,"ms")};return function(ie,z,ee){i=ee,r=ee().$utils(),ee.duration=function(H,ae){var pe=ee.locale();return R(H,{$l:pe},ae)},ee.isDuration=D;var de=z.prototype.add,Q=z.prototype.subtract;z.prototype.add=function(H,ae){return D(H)?te(this,H,1):de.bind(this)(H,ae)},z.prototype.subtract=function(H,ae){return D(H)?te(this,H,-1):Q.bind(this)(H,ae)}}})})(QVe);var lRi=QVe.exports;const oRi=pl(lRi);var XVe={exports:{}};(function(s,u){(function(i,r){s.exports=r()})(Cn,function(){return function(i,r){r.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(XVe);var dRi=XVe.exports;const uRi=pl(dRi);j.extend(FIi);j.extend(SIi);j.extend(ZIi);j.extend(WIi);j.extend(JIi);j.extend(QIi);j.extend(eRi);j.extend(iRi);j.extend(nRi);j.extend(sRi);j.extend(oRi);j.extend(uRi);const oi=s=>j(s),Zr=s=>s.toISOString();function eNe(){return Zr(j())}function tNe(s,u){return oi(s).format(u)}function iNe(s){return Zr(j(s))}function rNe(s){if(s==null)throw new TypeError("ToDate expects a non-null value.");if(typeof s=="string"){const u=j(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?j.unix(s):j(s);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(s instanceof Date){const u=j(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 nNe(s,u,i){return Zr(oi(s).add(u,i))}function aNe(s,u,i){return Zr(oi(s).subtract(u,i))}function sNe(s,u,i,r=!1){return oi(s).diff(oi(u),i,r)}function lNe(s){return oi(s).unix()}function oNe(s){return Zr(j.unix(s))}function dNe(s){return Zr(oi(s))}function uNe(s){return oi(s).year()}function pNe(s){return oi(s).month()}function cNe(s){return oi(s).date()}function fNe(s){return oi(s).hour()}function yNe(s){return oi(s).minute()}function hNe(s){return oi(s).second()}function mNe(s){return oi(s).millisecond()}function TNe(s){return oi(s).isoWeekday()}function vNe(s){return oi(s).week()}function ENe(s){return oi(s).quarter()}function bNe(s){return oi(s).dayOfYear()}function ANe(s){return oi(s).daysInMonth()}function gNe(s,u){return Zr(oi(s).year(u))}function INe(s,u){return Zr(oi(s).month(u))}function RNe(s,u){return Zr(oi(s).date(u))}function wNe(s,u){return Zr(oi(s).hour(u))}function DNe(s,u){return Zr(oi(s).minute(u))}function CNe(s,u){return Zr(oi(s).second(u))}function ONe(s,u){return Zr(oi(s).millisecond(u))}function _Ne(s,u){return Zr(oi(s).isoWeekday(u))}function PNe(s,u){return Zr(oi(s).quarter(u))}function VNe(s,u){return Zr(oi(s).startOf(u))}function NNe(s,u){return Zr(oi(s).endOf(u))}function xNe(s,u){const i=oi(s),r=i.startOf(u),a=i.endOf(u),c=r.valueOf()+(a.valueOf()-r.valueOf())/2;return Zr(i.valueOf()<c?r:a)}function $Ne(s,u,i){return oi(s).isBefore(oi(u),i)}function LNe(s,u,i){return oi(s).isAfter(oi(u),i)}function BNe(s,u,i){return oi(s).isSame(oi(u),i)}function MNe(s,u,i){return oi(s).isSameOrBefore(oi(u),i)}function GNe(s,u,i){return oi(s).isSameOrAfter(oi(u),i)}function kNe(s,u,i,r,a="()"){return oi(s).isBetween(oi(u),oi(i),r,a)}function jNe(s){return j(s).isValid()}function UNe(s){return oi(s).isLeapYear()}function FNe(s,u,i){const r=oi(s);return r.isBefore(u)?Zr(oi(u)):r.isAfter(i)?Zr(oi(i)):Zr(r)}function KNe(s){if(s.length===0)throw new Error("minOf requires at least one date");let u=oi(s[0]);for(let i=1;i<s.length;i++){const r=oi(s[i]);r.isBefore(u)&&(u=r)}return Zr(u)}function SNe(s){if(s.length===0)throw new Error("maxOf requires at least one date");let u=oi(s[0]);for(let i=1;i<s.length;i++){const r=oi(s[i]);r.isAfter(u)&&(u=r)}return Zr(u)}function qNe(s,u=!1){return oi(s).fromNow(u)}function ZNe(s,u=!1){return oi(s).toNow(u)}function HNe(s,u,i=!0){const r=oi(s).diff(oi(u),"millisecond",!0),a=Math.abs(r),e=j.duration(a,"milliseconds").humanize();return i?r>=0?`in ${e}`:`${e} ago`:e}function WNe(s,u,i=["6","7"],r=[]){const a=m=>r.some(v=>oi(v).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=oi(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 Zr(e)}function zNe(s,u){let i=oi(s);const r=u;for(let a=0;a<7;a++)if(i=i.add(1,"day"),i.isoWeekday()===r)return Zr(i);return Zr(i)}function JNe(s,u){let i=oi(s);const r=u;for(let a=0;a<7;a++)if(i=i.subtract(1,"day"),i.isoWeekday()===r)return Zr(i);return Zr(i)}const YNe="Local";function S$(){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 q$(){const s=S$();if(s)return s;throw new Error("Unable to detect current IANA timezone from host environment.")}function QNe(s,u,i=!1){let r=u;if(r===YNe){const e=S$();if(!e)throw new Error("Unable to detect current timezone from host environment.");r=e}const a=r?j.tz(s,r):oi(s),c=i?a.utc(!0):a.utc();return Zr(c)}function XNe(s,u,i=!1){const r=oi(s);return Zr(i?r.tz(u,!0):r.tz(u))}function exe(s,u){const i=s===YNe?q$():s;return oi(u).tz(i).utcOffset()}function txe(s,u,i=!1){return Zr(oi(s).utcOffset(u,i))}class ixe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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=eNe();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 rxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=tNe(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 nxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=iNe(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 axe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.AddToDate].inputs.amount.id}),D=((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)===U.operation[S.AddToDate].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=nNe(b,D,C);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 sxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.SubtractFromDate].inputs.amount.id}),D=((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)===U.operation[S.SubtractFromDate].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=aNe(b,D,C);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 lxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.operation[S.DifferenceBetweenDates].inputs.firstDate.id}),D=((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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.operation[S.DifferenceBetweenDates].inputs.secondDate.id}),C=((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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.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 ie,z;return((z=(ie=te.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===U.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,X=sNe(D,C,G,k);return{value:F.Success,error:null,result:X}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class pRi extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=rNe(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 oxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=lNe(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 dxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=oNe(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 uxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=dNe(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 pxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=uNe(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 cxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=pNe(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 fxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=cNe(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 yxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=fNe(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 hxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=yNe(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 mxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=hNe(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 Txe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=mNe(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 vxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=TNe(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 Exe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=vNe(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 bxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=ENe(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 Axe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=bNe(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 gxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=ANe(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 Ixe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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=q$();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 Rxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=gNe(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 wxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=INe(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 Dxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=RNe(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 Cxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=wNe(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 Oxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=DNe(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 _xe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=CNe(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 Pxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=ONe(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 Vxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=_Ne(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 Nxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=PNe(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 xxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=VNe(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 $xe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=NNe(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 Lxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=xNe(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 Bxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsBefore].inputs.rightHand.id}),D=((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)===U.operation[S.IsBefore].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=$Ne(b,D,C);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 Mxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsAfter].inputs.rightHand.id}),D=((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)===U.operation[S.IsAfter].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=LNe(b,D,C);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 Gxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSame].inputs.rightHand.id}),D=((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)===U.operation[S.IsSame].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=BNe(b,D,C);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 kxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSameOrBefore].inputs.rightHand.id}),D=((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)===U.operation[S.IsSameOrBefore].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=MNe(b,D,C);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 jxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.IsSameOrAfter].inputs.rightHand.id}),D=((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)===U.operation[S.IsSameOrAfter].inputs.unit.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=GNe(b,D,C);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 Uxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,D;try{const R=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.target.id}),C=((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 Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.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 Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.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),X=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.unit.id}),te=((v=X==null?void 0:X.value)==null?void 0:v.valueAsType)??((b=X==null?void 0:X.value)==null?void 0:b.value),ie=r.find(de=>{var Q,H;return((H=(Q=de.valueOwner)==null?void 0:Q.declaration)==null?void 0:H.id)===U.operation[S.IsBetween].inputs.inclusivity.id}),z=((A=ie==null?void 0:ie.value)==null?void 0:A.valueAsType)??((D=ie==null?void 0:ie.value)==null?void 0:D.value),ee=kNe(C,G,k,te,z??void 0);return{value:F.Success,error:null,result:ee}}catch(R){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:R,result:null}}}})}}class Fxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=jNe(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 Kxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=UNe(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 Sxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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)===U.operation[S.ClampToRange].inputs.min.id}),D=((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)===U.operation[S.ClampToRange].inputs.max.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=FNe(b,D,C);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 qxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=KNe(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 Zxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=SNe(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 Hxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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,D=qNe(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class Wxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.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,D=ZNe(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class zxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.HumanizeDiff].inputs.secondDate.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=HNe(b,D,$);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 Jxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,D;return((D=(A=b.valueOwner)==null?void 0:A.declaration)==null?void 0:D.id)===U.operation[S.AddBusinessDays].inputs.dateValue.id}).map(b=>{var A,D;return((A=b.value)==null?void 0:A.valueAsType)??((D=b.value)==null?void 0:D.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],v=WNe(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 Yxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=zNe(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 Qxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.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=JNe(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 Xxe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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)===U.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=QNe(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 e$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.ConvertTimezone].inputs.targetTimezone.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=XNe(b,D,$);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 t$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.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=exe(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 i$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.operation[S.SetUTCOffset].inputs.offsetMinutes.id}),D=((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,X;return((X=(k=x.valueOwner)==null?void 0:k.declaration)==null?void 0:X.id)===U.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=txe(b,D,$);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 r$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(Ps.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)===U.operation[Ps.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 cRi=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,Z$=s=>s===null||["string","number","boolean"].includes(typeof s);function Da(s,u="Input must be an array"){if(!Array.isArray(s))throw new TypeError(u);return s}function Ad(s){const u=Da(s,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function H$(s){return Array.isArray(s)?s:[]}function Cl(s){return Number(s)}function n$e(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 a$e(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 s$e(s,u){const i=Ad(s),r=Cl(u);return[i.slice(0,r),i.slice(r)]}function l$e(s){return Ad(s).slice().reverse()}function o$e(s){return Ad(s).slice(0,-1)}function d$e(s){return Ad(s).slice(1)}function u$e(s,u,i){const r=Da(s),a=Cl(u);if(a<0||a>r.length)throw new TypeError("Index out of bounds");return[...r.slice(0,a),i,...r.slice(a)]}function p$e(s,u,i){const r=Ad(s),a=Cl(u);if(a<0||a>=r.length)throw new TypeError("Index out of bounds");const c=[...r];return c[a]=i,c}function c$e(s,u,i){const r=Ad(s),a=r.indexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function f$e(s,u,i){const r=Ad(s),a=r.lastIndexOf(u);if(a===-1)return r;const c=[...r];return c[a]=i,c}function y$e(s,u,i){return Ad(s).map(a=>a===u?i:a)}function h$e(s,u){const i=Ad(s),r=Cl(u);if(r<0||r>=i.length)throw new TypeError("Index out of bounds");return i[r]}function m$e(s){return Ad(s)[0]}function T$e(s){const u=Ad(s);return u[u.length-1]}function v$e(s,u,...i){return[...Da(s),u,...i]}function E$e(s,u){const i=Da(s);return[u,...i]}function b$e(s){return Da(s).length}function A$e(s,u){const i=Da(s),r=Cl(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 g$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)??0);return i.slice(0,r)}function I$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)??0);return r===0?[]:i.slice(-r)}function R$e(s,u,i){const r=Da(s),a=u==null?void 0:Cl(u),c=i==null?void 0:Cl(i);return r.slice(a,c)}function w$e(s,u){return Da(s).indexOf(u)}function D$e(s,u){return Da(s).lastIndexOf(u)}function C$e(s){const u=Da(s),i=[],r=new Set;for(const a of u)r.has(a)||(r.add(a),i.push(a));return i}function O$e(s){return Da(s).reduce((i,r)=>i.concat(r),[])}function _$e(s){const u=Da(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=>cRi.test(f)&&j(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)=>j(e).valueOf()-j(f).valueOf())}function P$e(s){const i=[...Da(s)];for(let r=i.length-1;r>0;r--){const a=Math.floor(ow()*(r+1));[i[r],i[a]]=[i[a],i[r]]}return i}function V$e(s,u){const i=Da(s),r=Math.max(1,Cl(u)||1),a=[];for(let c=0;c<i.length;c+=r)a.push(i.slice(c,c+r));return a}function N$e(s,u,i){const r=Da(s),a=Math.max(0,Cl(u)||0);if(r.length>=a)return[...r];const c=a-r.length;return Array(c).fill(i).concat(r)}function x$e(s,u,i){const r=Da(s),a=Math.max(0,Cl(u)||0);if(r.length>=a)return[...r];const c=a-r.length,e=Array(c).fill(i);return r.concat(e)}function $$e(s,u){const i=Da(s),r=Math.max(0,Cl(u)||0),a=[];for(let c=0;c<r;c++)a.push(...i);return a}function L$e(s,u){if(!Z$(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return H$(s).some(r=>r===u)}function B$e(s,u){const i=H$(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(Z$))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return r.every(a=>i.includes(a))}function M$e(s,u){const i=H$(s),r=Array.isArray(u)?u:[u];if(r.length===0)return!1;if(!r.every(Z$))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return r.some(a=>i.includes(a))}class G$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Join);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.Join].inputs.secondList.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.value)==null?void 0:G.value)}),R=n$e([m,b,...D]);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 k$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.operation[ce.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 C,$;return(($=(C=R.valueOwner)==null?void 0:C.declaration)==null?void 0:$.id)===U.operation[ce.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,D]=s$e(m,b);return{value:F.Success,error:null,result:[A,D]}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class j$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=l$e(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 U$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=o$e(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 F$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=d$e(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 K$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.AddAtIndex].inputs.index.id}),D=((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)===U.operation[ce.AddAtIndex].inputs.value.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=u$e(b,D,C);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 S$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceAtIndex].inputs.index.id}),D=((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)===U.operation[ce.ReplaceAtIndex].inputs.value.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=p$e(b,D,C);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 xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceFirstNItems].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceFirstNItems].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=c$e(b,D,C);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 xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceLastNItems].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceLastNItems].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=f$e(b,D,C);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 H$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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)===U.operation[ce.ReplaceAll].inputs.searchValue.id}),D=((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)===U.operation[ce.ReplaceAll].inputs.replaceValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=y$e(b,D,C);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 W$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.GetIndexItem);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=h$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 z$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=m$e(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 J$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.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)===U.operation[ce.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=T$e(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 Y$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[ce.Append].inputs.dynamicArgument.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.value)==null?void 0:G.value)}),R=v$e(m,b,...D);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 Q$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(ce.Prepend);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=E$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 X$e extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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:b$e(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class eLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.DeleteAtIndex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=A$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 tLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetFirstNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=g$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 iLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetLastNItems);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=I$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 rLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.Slice].inputs.startIndex.id}),D=((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)===U.operation[ce.Slice].inputs.endIndex.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=R$e(b,D,C);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 nLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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=a$e(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 aLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=w$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 sLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.GetLastIndexOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=D$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 lLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=C$e(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 oLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=O$e(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 dLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=_$e(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 uLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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=P$e(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 pLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Chunk);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=V$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 cLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.PadStart].inputs.targetLength.id}),D=((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)===U.operation[ce.PadStart].inputs.padValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=N$e(b,D,C);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 fLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.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)===U.operation[ce.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)===U.operation[ce.PadEnd].inputs.targetLength.id}),D=((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)===U.operation[ce.PadEnd].inputs.padValue.id}),C=((h=R==null?void 0:R.value)==null?void 0:h.valueAsType)??((m=R==null?void 0:R.value)==null?void 0:m.value),$=x$e(b,D,C);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 yLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Repeat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=$$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 hLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.Contains);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=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 mLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.ContainsAll);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=B$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 TLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(ce.ContainsAny);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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(D=>{var R,C;return((C=(R=D.valueOwner)==null?void 0:R.declaration)==null?void 0:C.id)===U.operation[ce.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=M$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 fRi extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 vLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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)===U.operation[J.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)===U.operation[J.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)===U.operation[J.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)===U.operation[J.Join].inputs.dynamicString.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)||((x=$.value)==null?void 0:x.value)||""}),C=[v,A,...R].join(h);return{value:F.Success,error:null,result:C}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class ELe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 bLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 ALe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 gLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 ILe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 RLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 wLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 DLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 CLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 OLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 _Le extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 PLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 VLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 NLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 xLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 $Le extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 LLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 BLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 MLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 GLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 kLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 jLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.Append);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.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(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.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),D=r.filter(C=>{var $,G;return((G=($=C.valueOwner)==null?void 0:$.declaration)==null?void 0:G.id)===U.operation[J.Append].inputs.dynamicArgument.id}).map(C=>{var $,G;return(($=C.value)==null?void 0:$.valueAsType)??((G=C.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(!D.every(C=>typeof C=="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,...D].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 ULe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(J.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 FLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 KLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 SLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 qLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 ZLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 HLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 WLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 zLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 JLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 YLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 QLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.MatchAllRegex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=r.map(b=>{var A,D;return((A=b.value)==null?void 0:A.valueAsType)??((D=b.value)==null?void 0:D.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 XLe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 eBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 tBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 XI=class XI extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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(XI.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}}}})}};w(XI,"COMBINING_MARKS",/[\u0300-\u036f]/g);let _I=XI;class iBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 rBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 nBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 aBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 sBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 lBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 oBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 dBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 uBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(J.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 pBe(s,u){const i=Number(s),a=10**Math.max(0,Number(u)||0);return Math.round(i*a)/a}function cBe(s,u){const i=Number(s),r=Math.abs(Number(u)||0);return r===0?i:Math.round(i/r)*r}function fBe(s,u,i){const r=Number(s),a=Number(u),c=Number(i);return Math.min(Math.max(r,a),c)}function yBe(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 hBe(...s){const u=s.map(r=>Number(r));return u.length===0?0:u.reduce((r,a)=>r+a,0)/u.length}function mBe(...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 TBe(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 vBe(s,u){const i=Number(s),r=Number(u);return i===0?1/0:(r-i)/i*100}const wr=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 EBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Addition);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=wr(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 bBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Subtraction);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=wr(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 ABe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.Multiplication].inputs.dynamicFactor.id}).map($=>{var G,x;return((G=$.value)==null?void 0:G.valueAsType)??((x=$.value)==null?void 0:x.value)}),C=[m,b,...D].reduce(($,G)=>$*G,1);return{value:F.Success,error:null,result:C}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class gBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Division);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 IBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Remainder);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 RBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(a=>a.contextType===oe.Logic);if(r){const a=r.get(fe.Exponentiation);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=wr(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 wBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Negate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 DBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Absolute);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 CBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Sign);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 OBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Round);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.round(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class _Be extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Floor);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.floor(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class PBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Ceil);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.ceil(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class VBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Trunc);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.trunc(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class NBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.RoundToDecimals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=pBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class xBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.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:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.SnapToStep);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=cBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class $Be extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Clamp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=wr(r),f=fBe(a,c,e);return{value:F.Success,error:null,result:f}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class LBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MapRange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h]=wr(r),m=yBe(a,c,e,f,h);return{value:F.Success,error:null,result:m}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class BBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D],C=hBe(...R);return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class MBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D],C=mBe(...R);return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class GBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D].filter($=>typeof $=="number"&&!Number.isNaN($)),C=R.length?Math.min(...R):1/0;return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class kBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.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)===U.operation[fe.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)===U.operation[fe.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),D=r.filter($=>{var G,x;return((x=(G=$.valueOwner)==null?void 0:G.declaration)==null?void 0:x.id)===U.operation[fe.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,...D].filter($=>typeof $=="number"&&!Number.isNaN($)),C=R.length?Math.max(...R):-1/0;return{value:F.Success,error:null,result:C}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class jBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.SquareRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.sqrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class UBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.CubeRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.cbrt(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class FBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.NthRoot);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=TBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class KBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Exp);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.exp(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class SBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LogNatural);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.log(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class qBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Log10);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(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 ZBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Sin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.sin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class HBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Cos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.cos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class WBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Tan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.tan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class zBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Asin);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.asin(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class JBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Acos);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.acos(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class YBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Atan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Math.atan(Number(a))}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class QBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.Atan2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(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 XBe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.ToRadians);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Number(a)*Math.PI/180}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class eMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.ToDegrees);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=wr(r);return{value:F.Success,error:null,result:Number(a)*180/Math.PI}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class tMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.PercentOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(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 OP extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.PercentageChange);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r),e=vBe(a,c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class iMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LessThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a<c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class rMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MoreThan);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a>c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class nMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.LessThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a<=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class aMe extends xe{constructor(){super(...arguments);w(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:Ve.High,permissions:[Ne.All],contexts:[oe.Logic]});w(this,"module",{init:i=>{const r=i.find(c=>c.contextType===oe.Logic),a=r==null?void 0:r.get(fe.MoreThanOrEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=wr(r);return{value:F.Success,error:null,result:a>=c}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}function sMe(s,u){return function(){return s.apply(u,arguments)}}const{toString:yRi}=Object.prototype,{getPrototypeOf:W$}=Object,{iterator:yw,toStringTag:lMe}=Symbol,hw=(s=>u=>{const i=yRi.call(u);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),gd=s=>(s=s.toLowerCase(),u=>hw(u)===s),mw=s=>u=>typeof u===s,{isArray:I0}=Array,pm=mw("undefined");function Ab(s){return s!==null&&!pm(s)&&s.constructor!==null&&!pm(s.constructor)&&el(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const oMe=gd("ArrayBuffer");function hRi(s){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(s):u=s&&s.buffer&&oMe(s.buffer),u}const mRi=mw("string"),el=mw("function"),dMe=mw("number"),gb=s=>s!==null&&typeof s=="object",TRi=s=>s===!0||s===!1,sI=s=>{if(hw(s)!=="object")return!1;const u=W$(s);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(lMe in s)&&!(yw in s)},vRi=s=>{if(!gb(s)||Ab(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},ERi=gd("Date"),bRi=gd("File"),ARi=s=>!!(s&&typeof s.uri<"u"),gRi=s=>s&&typeof s.getParts<"u",IRi=gd("Blob"),RRi=gd("FileList"),wRi=s=>gb(s)&&el(s.pipe);function DRi(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const hU=DRi(),mU=typeof hU.FormData<"u"?hU.FormData:void 0,CRi=s=>{let u;return s&&(mU&&s instanceof mU||el(s.append)&&((u=hw(s))==="formdata"||u==="object"&&el(s.toString)&&s.toString()==="[object FormData]"))},ORi=gd("URLSearchParams"),[_Ri,PRi,VRi,NRi]=["ReadableStream","Request","Response","Headers"].map(gd),xRi=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ib(s,u,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let r,a;if(typeof s!="object"&&(s=[s]),I0(s))for(r=0,a=s.length;r<a;r++)u.call(null,s[r],r,s);else{if(Ab(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 uMe(s,u){if(Ab(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 ay=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),pMe=s=>!pm(s)&&s!==ay;function _P(){const{caseless:s,skipUndefined:u}=pMe(this)&&this||{},i={},r=(a,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=s&&uMe(i,c)||c;sI(i[e])&&sI(a)?i[e]=_P(i[e],a):sI(a)?i[e]=_P({},a):I0(a)?i[e]=a.slice():(!u||!pm(a))&&(i[e]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&Ib(arguments[a],r);return i}const $Ri=(s,u,i,{allOwnKeys:r}={})=>(Ib(u,(a,c)=>{i&&el(a)?Object.defineProperty(s,c,{value:sMe(a,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,c,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),s),LRi=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),BRi=(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)},MRi=(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&&W$(s)}while(s&&(!i||i(s,u))&&s!==Object.prototype);return u},GRi=(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},kRi=s=>{if(!s)return null;if(I0(s))return s;let u=s.length;if(!dMe(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=s[u];return i},jRi=(s=>u=>s&&u instanceof s)(typeof Uint8Array<"u"&&W$(Uint8Array)),URi=(s,u)=>{const r=(s&&s[yw]).call(s);let a;for(;(a=r.next())&&!a.done;){const c=a.value;u.call(s,c[0],c[1])}},FRi=(s,u)=>{let i;const r=[];for(;(i=s.exec(u))!==null;)r.push(i);return r},KRi=gd("HTMLFormElement"),SRi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,r,a){return r.toUpperCase()+a}),TU=(({hasOwnProperty:s})=>(u,i)=>s.call(u,i))(Object.prototype),qRi=gd("RegExp"),cMe=(s,u)=>{const i=Object.getOwnPropertyDescriptors(s),r={};Ib(i,(a,c)=>{let e;(e=u(a,c,s))!==!1&&(r[c]=e||a)}),Object.defineProperties(s,r)},ZRi=s=>{cMe(s,(u,i)=>{if(el(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const r=s[i];if(el(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+"'")})}})},HRi=(s,u)=>{const i={},r=a=>{a.forEach(c=>{i[c]=!0})};return I0(s)?r(s):r(String(s).split(u)),i},WRi=()=>{},zRi=(s,u)=>s!=null&&Number.isFinite(s=+s)?s:u;function JRi(s){return!!(s&&el(s.append)&&s[lMe]==="FormData"&&s[yw])}const YRi=s=>{const u=new Array(10),i=(r,a)=>{if(gb(r)){if(u.indexOf(r)>=0)return;if(Ab(r))return r;if(!("toJSON"in r)){u[a]=r;const c=I0(r)?[]:{};return Ib(r,(e,f)=>{const h=i(e,a+1);!pm(h)&&(c[f]=h)}),u[a]=void 0,c}}return r};return i(s,0)},QRi=gd("AsyncFunction"),XRi=s=>s&&(gb(s)||el(s))&&el(s.then)&&el(s.catch),fMe=((s,u)=>s?setImmediate:u?((i,r)=>(ay.addEventListener("message",({source:a,data:c})=>{a===ay&&c===i&&r.length&&r.shift()()},!1),a=>{r.push(a),ay.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",el(ay.postMessage)),e1i=typeof queueMicrotask<"u"?queueMicrotask.bind(ay):typeof process<"u"&&process.nextTick||fMe,t1i=s=>s!=null&&el(s[yw]),Je={isArray:I0,isArrayBuffer:oMe,isBuffer:Ab,isFormData:CRi,isArrayBufferView:hRi,isString:mRi,isNumber:dMe,isBoolean:TRi,isObject:gb,isPlainObject:sI,isEmptyObject:vRi,isReadableStream:_Ri,isRequest:PRi,isResponse:VRi,isHeaders:NRi,isUndefined:pm,isDate:ERi,isFile:bRi,isReactNativeBlob:ARi,isReactNative:gRi,isBlob:IRi,isRegExp:qRi,isFunction:el,isStream:wRi,isURLSearchParams:ORi,isTypedArray:jRi,isFileList:RRi,forEach:Ib,merge:_P,extend:$Ri,trim:xRi,stripBOM:LRi,inherits:BRi,toFlatObject:MRi,kindOf:hw,kindOfTest:gd,endsWith:GRi,toArray:kRi,forEachEntry:URi,matchAll:FRi,isHTMLForm:KRi,hasOwnProperty:TU,hasOwnProp:TU,reduceDescriptors:cMe,freezeMethods:ZRi,toObjectSet:HRi,toCamelCase:SRi,noop:WRi,toFiniteNumber:zRi,findKey:uMe,global:ay,isContextDefined:pMe,isSpecCompliantForm:JRi,toJSONObject:YRi,isAsyncFn:QRi,isThenable:XRi,setImmediate:fMe,asap:e1i,isIterable:t1i};class Ms extends Error{static from(u,i,r,a,c,e){const f=new Ms(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:Je.toJSONObject(this.config),code:this.code,status:this.status}}}Ms.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ms.ERR_BAD_OPTION="ERR_BAD_OPTION";Ms.ECONNABORTED="ECONNABORTED";Ms.ETIMEDOUT="ETIMEDOUT";Ms.ERR_NETWORK="ERR_NETWORK";Ms.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ms.ERR_DEPRECATED="ERR_DEPRECATED";Ms.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ms.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ms.ERR_CANCELED="ERR_CANCELED";Ms.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ms.ERR_INVALID_URL="ERR_INVALID_URL";const _r=Ms,i1i=null;function PP(s){return Je.isPlainObject(s)||Je.isArray(s)}function yMe(s){return Je.endsWith(s,"[]")?s.slice(0,-2):s}function j_(s,u,i){return s?s.concat(u).map(function(a,c){return a=yMe(a),!i&&c?"["+a+"]":a}).join(i?".":""):u}function r1i(s){return Je.isArray(s)&&!s.some(PP)}const n1i=Je.toFlatObject(Je,{},null,function(u){return/^is[A-Z]/.test(u)});function Tw(s,u,i){if(!Je.isObject(s))throw new TypeError("target must be an object");u=u||new FormData,i=Je.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,$){return!Je.isUndefined($[C])});const r=i.metaTokens,a=i.visitor||v,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Je.isSpecCompliantForm(u);if(!Je.isFunction(a))throw new TypeError("visitor must be a function");function m(R){if(R===null)return"";if(Je.isDate(R))return R.toISOString();if(Je.isBoolean(R))return R.toString();if(!h&&Je.isBlob(R))throw new _r("Blob is not supported. Use a Buffer instead.");return Je.isArrayBuffer(R)||Je.isTypedArray(R)?h&&typeof Blob=="function"?new Blob([R]):Buffer.from(R):R}function v(R,C,$){let G=R;if(Je.isReactNative(u)&&Je.isReactNativeBlob(R))return u.append(j_($,C,c),m(R)),!1;if(R&&!$&&typeof R=="object"){if(Je.endsWith(C,"{}"))C=r?C:C.slice(0,-2),R=JSON.stringify(R);else if(Je.isArray(R)&&r1i(R)||(Je.isFileList(R)||Je.endsWith(C,"[]"))&&(G=Je.toArray(R)))return C=yMe(C),G.forEach(function(k,X){!(Je.isUndefined(k)||k===null)&&u.append(e===!0?j_([C],X,c):e===null?C:C+"[]",m(k))}),!1}return PP(R)?!0:(u.append(j_($,C,c),m(R)),!1)}const b=[],A=Object.assign(n1i,{defaultVisitor:v,convertValue:m,isVisitable:PP});function D(R,C){if(!Je.isUndefined(R)){if(b.indexOf(R)!==-1)throw Error("Circular reference detected in "+C.join("."));b.push(R),Je.forEach(R,function(G,x){(!(Je.isUndefined(G)||G===null)&&a.call(u,G,Je.isString(x)?x.trim():x,C,A))===!0&&D(G,C?C.concat(x):[x])}),b.pop()}}if(!Je.isObject(s))throw new TypeError("data must be an object");return D(s),u}function vU(s){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return u[r]})}function z$(s,u){this._pairs=[],s&&Tw(s,this,u)}const hMe=z$.prototype;hMe.append=function(u,i){this._pairs.push([u,i])};hMe.toString=function(u){const i=u?function(r){return u.call(this,r,vU)}:vU;return this._pairs.map(function(a){return i(a[0])+"="+i(a[1])},"").join("&")};function a1i(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function mMe(s,u,i){if(!u)return s;const r=i&&i.encode||a1i,a=Je.isFunction(i)?{serialize:i}:i,c=a&&a.serialize;let e;if(c?e=c(u,a):e=Je.isURLSearchParams(u)?u.toString():new z$(u,a).toString(r),e){const f=s.indexOf("#");f!==-1&&(s=s.slice(0,f)),s+=(s.indexOf("?")===-1?"?":"&")+e}return s}class s1i{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){Je.forEach(this.handlers,function(r){r!==null&&u(r)})}}const EU=s1i,J$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},l1i=typeof URLSearchParams<"u"?URLSearchParams:z$,o1i=typeof FormData<"u"?FormData:null,d1i=typeof Blob<"u"?Blob:null,u1i={isBrowser:!0,classes:{URLSearchParams:l1i,FormData:o1i,Blob:d1i},protocols:["http","https","file","blob","url","data"]},Y$=typeof window<"u"&&typeof document<"u",VP=typeof navigator=="object"&&navigator||void 0,p1i=Y$&&(!VP||["ReactNative","NativeScript","NS"].indexOf(VP.product)<0),c1i=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),f1i=Y$&&window.location.href||"http://localhost",y1i=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Y$,hasStandardBrowserEnv:p1i,hasStandardBrowserWebWorkerEnv:c1i,navigator:VP,origin:f1i},Symbol.toStringTag,{value:"Module"})),as={...y1i,...u1i};function h1i(s,u){return Tw(s,new as.classes.URLSearchParams,{visitor:function(i,r,a,c){return as.isNode&&Je.isBuffer(i)?(this.append(r,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function m1i(s){return Je.matchAll(/\w+|\[(\w*)]/g,s).map(u=>u[0]==="[]"?"":u[1]||u[0])}function T1i(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 TMe(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&&Je.isArray(a)?a.length:e,h?(Je.hasOwnProp(a,e)?a[e]=[a[e],r]:a[e]=r,!f):((!a[e]||!Je.isObject(a[e]))&&(a[e]=[]),u(i,r,a[e],c)&&Je.isArray(a[e])&&(a[e]=T1i(a[e])),!f)}if(Je.isFormData(s)&&Je.isFunction(s.entries)){const i={};return Je.forEachEntry(s,(r,a)=>{u(m1i(r),a,i,0)}),i}return null}function v1i(s,u,i){if(Je.isString(s))try{return(u||JSON.parse)(s),Je.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(i||JSON.stringify)(s)}const Q$={transitional:J$,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const r=i.getContentType()||"",a=r.indexOf("application/json")>-1,c=Je.isObject(u);if(c&&Je.isHTMLForm(u)&&(u=new FormData(u)),Je.isFormData(u))return a?JSON.stringify(TMe(u)):u;if(Je.isArrayBuffer(u)||Je.isBuffer(u)||Je.isStream(u)||Je.isFile(u)||Je.isBlob(u)||Je.isReadableStream(u))return u;if(Je.isArrayBufferView(u))return u.buffer;if(Je.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 h1i(u,this.formSerializer).toString();if((f=Je.isFileList(u))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Tw(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||a?(i.setContentType("application/json",!1),v1i(u)):u}],transformResponse:[function(u){const i=this.transitional||Q$.transitional,r=i&&i.forcedJSONParsing,a=this.responseType==="json";if(Je.isResponse(u)||Je.isReadableStream(u))return u;if(u&&Je.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"?_r.from(f,_r.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:as.classes.FormData,Blob:as.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],s=>{Q$.headers[s]={}});const X$=Q$,E1i=Je.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"]),b1i=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]&&E1i[i])&&(i==="set-cookie"?u[i]?u[i].push(r):u[i]=[r]:u[i]=u[i]?u[i]+", "+r:r)}),u},bU=Symbol("internals");function MT(s){return s&&String(s).trim().toLowerCase()}function lI(s){return s===!1||s==null?s:Je.isArray(s)?s.map(lI):String(s)}function A1i(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 g1i=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function U_(s,u,i,r,a){if(Je.isFunction(r))return r.call(this,u,i);if(a&&(u=i),!!Je.isString(u)){if(Je.isString(r))return u.indexOf(r)!==-1;if(Je.isRegExp(r))return r.test(u)}}function I1i(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(u,i,r)=>i.toUpperCase()+r)}function R1i(s,u){const i=Je.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 vw{constructor(u){u&&this.set(u)}set(u,i,r){const a=this;function c(f,h,m){const v=MT(h);if(!v)throw new Error("header name must be a non-empty string");const b=Je.findKey(a,v);(!b||a[b]===void 0||m===!0||m===void 0&&a[b]!==!1)&&(a[b||h]=lI(f))}const e=(f,h)=>Je.forEach(f,(m,v)=>c(m,v,h));if(Je.isPlainObject(u)||u instanceof this.constructor)e(u,i);else if(Je.isString(u)&&(u=u.trim())&&!g1i(u))e(b1i(u),i);else if(Je.isObject(u)&&Je.isIterable(u)){let f={},h,m;for(const v of u){if(!Je.isArray(v))throw TypeError("Object iterator must return a key-value pair");f[m=v[0]]=(h=f[m])?Je.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=MT(u),u){const r=Je.findKey(this,u);if(r){const a=this[r];if(!i)return a;if(i===!0)return A1i(a);if(Je.isFunction(i))return i.call(this,a,r);if(Je.isRegExp(i))return i.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(u,i){if(u=MT(u),u){const r=Je.findKey(this,u);return!!(r&&this[r]!==void 0&&(!i||U_(this,this[r],r,i)))}return!1}delete(u,i){const r=this;let a=!1;function c(e){if(e=MT(e),e){const f=Je.findKey(r,e);f&&(!i||U_(r,r[f],f,i))&&(delete r[f],a=!0)}}return Je.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||U_(this,this[c],c,u,!0))&&(delete this[c],a=!0)}return a}normalize(u){const i=this,r={};return Je.forEach(this,(a,c)=>{const e=Je.findKey(r,c);if(e){i[e]=lI(a),delete i[c];return}const f=u?I1i(c):String(c).trim();f!==c&&delete i[c],i[f]=lI(a),r[f]=!0}),this}concat(...u){return this.constructor.concat(this,...u)}toJSON(u){const i=Object.create(null);return Je.forEach(this,(r,a)=>{r!=null&&r!==!1&&(i[a]=u&&Je.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[bU]=this[bU]={accessors:{}}).accessors,a=this.prototype;function c(e){const f=MT(e);r[f]||(R1i(a,e),r[f]=!0)}return Je.isArray(u)?u.forEach(c):c(u),this}}vw.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(vw.prototype,({value:s},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>s,set(r){this[i]=r}}});Je.freezeMethods(vw);const So=vw;function F_(s,u){const i=this||X$,r=u||i,a=So.from(r.headers);let c=r.data;return Je.forEach(s,function(f){c=f.call(i,c,a.normalize(),u?u.status:void 0)}),a.normalize(),c}function vMe(s){return!!(s&&s.__CANCEL__)}class w1i extends _r{constructor(u,i,r){super(u??"canceled",_r.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}}const Rb=w1i;function EMe(s,u,i){const r=i.config.validateStatus;!i.status||!r||r(i.status)?s(i):u(new _r("Request failed with status code "+i.status,[_r.ERR_BAD_REQUEST,_r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function D1i(s){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return u&&u[1]||""}function C1i(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 D=v&&m-v;return D?Math.round(A*1e3/D):void 0}}function O1i(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 PI=(s,u,i=3)=>{let r=0;const a=C1i(50,250);return O1i(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)},AU=(s,u)=>{const i=s!=null;return[r=>u[0]({lengthComputable:i,total:s,loaded:r}),u[1]]},gU=s=>(...u)=>Je.asap(()=>s(...u)),_1i=as.hasStandardBrowserEnv?((s,u)=>i=>(i=new URL(i,as.origin),s.protocol===i.protocol&&s.host===i.host&&(u||s.port===i.port)))(new URL(as.origin),as.navigator&&/(msie|trident)/i.test(as.navigator.userAgent)):()=>!0,P1i=as.hasStandardBrowserEnv?{write(s,u,i,r,a,c,e){if(typeof document>"u")return;const f=[`${s}=${encodeURIComponent(u)}`];Je.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),Je.isString(r)&&f.push(`path=${r}`),Je.isString(a)&&f.push(`domain=${a}`),c===!0&&f.push("secure"),Je.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 V1i(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function N1i(s,u){return u?s.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):s}function bMe(s,u,i){let r=!V1i(u);return s&&(r||i==!1)?N1i(s,u):u}const IU=s=>s instanceof So?{...s}:s;function cy(s,u){u=u||{};const i={};function r(m,v,b,A){return Je.isPlainObject(m)&&Je.isPlainObject(v)?Je.merge.call({caseless:A},m,v):Je.isPlainObject(v)?Je.merge({},v):Je.isArray(v)?v.slice():v}function a(m,v,b,A){if(Je.isUndefined(v)){if(!Je.isUndefined(m))return r(void 0,m,b,A)}else return r(m,v,b,A)}function c(m,v){if(!Je.isUndefined(v))return r(void 0,v)}function e(m,v){if(Je.isUndefined(v)){if(!Je.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(IU(m),IU(v),b,!0)};return Je.forEach(Object.keys({...s,...u}),function(v){if(v==="__proto__"||v==="constructor"||v==="prototype")return;const b=Je.hasOwnProp(h,v)?h[v]:a,A=b(s[v],u[v],v);Je.isUndefined(A)&&b!==f||(i[v]=A)}),i}const AMe=s=>{const u=cy({},s);let{data:i,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:c,headers:e,auth:f}=u;if(u.headers=e=So.from(e),u.url=mMe(bMe(u.baseURL,u.url,u.allowAbsoluteUrls),s.params,s.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),Je.isFormData(i)){if(as.hasStandardBrowserEnv||as.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(Je.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(as.hasStandardBrowserEnv&&(r&&Je.isFunction(r)&&(r=r(u)),r||r!==!1&&_1i(u.url))){const h=a&&c&&P1i.read(c);h&&e.set(a,h)}return u},x1i=typeof XMLHttpRequest<"u",$1i=x1i&&function(s){return new Promise(function(i,r){const a=AMe(s);let c=a.data;const e=So.from(a.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=a,v,b,A,D,R;function C(){D&&D(),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=So.from("getAllResponseHeaders"in $&&$.getAllResponseHeaders()),te={data:!f||f==="text"||f==="json"?$.responseText:$.response,status:$.status,statusText:$.statusText,headers:k,config:s,request:$};EMe(function(z){i(z),C()},function(z){r(z),C()},te),$=null}"onloadend"in $?$.onloadend=G:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(G)},$.onabort=function(){$&&(r(new _r("Request aborted",_r.ECONNABORTED,s,$)),$=null)},$.onerror=function(X){const te=X&&X.message?X.message:"Network Error",ie=new _r(te,_r.ERR_NETWORK,s,$);ie.event=X||null,r(ie),$=null},$.ontimeout=function(){let X=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const te=a.transitional||J$;a.timeoutErrorMessage&&(X=a.timeoutErrorMessage),r(new _r(X,te.clarifyTimeoutError?_r.ETIMEDOUT:_r.ECONNABORTED,s,$)),$=null},c===void 0&&e.setContentType(null),"setRequestHeader"in $&&Je.forEach(e.toJSON(),function(X,te){$.setRequestHeader(te,X)}),Je.isUndefined(a.withCredentials)||($.withCredentials=!!a.withCredentials),f&&f!=="json"&&($.responseType=a.responseType),m&&([A,R]=PI(m,!0),$.addEventListener("progress",A)),h&&$.upload&&([b,D]=PI(h),$.upload.addEventListener("progress",b),$.upload.addEventListener("loadend",D)),(a.cancelToken||a.signal)&&(v=k=>{$&&(r(!k||k.type?new Rb(null,s,$):k),$.abort(),$=null)},a.cancelToken&&a.cancelToken.subscribe(v),a.signal&&(a.signal.aborted?v():a.signal.addEventListener("abort",v)));const x=D1i(a.url);if(x&&as.protocols.indexOf(x)===-1){r(new _r("Unsupported protocol "+x+":",_r.ERR_BAD_REQUEST,s));return}$.send(c||null)})},L1i=(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 _r?v:new Rb(v instanceof Error?v.message:v))}};let e=u&&setTimeout(()=>{e=null,c(new _r(`timeout of ${u}ms exceeded`,_r.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=()=>Je.asap(f),h}},B1i=L1i,M1i=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},G1i=async function*(s,u){for await(const i of k1i(s))yield*M1i(i,u)},k1i=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()}},RU=(s,u,i,r)=>{const a=G1i(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})},wU=64*1024,{isFunction:Jg}=Je,j1i=(({Request:s,Response:u})=>({Request:s,Response:u}))(Je.global),{ReadableStream:DU,TextEncoder:CU}=Je.global,OU=(s,...u)=>{try{return!!s(...u)}catch{return!1}},U1i=s=>{s=Je.merge.call({skipUndefined:!0},j1i,s);const{fetch:u,Request:i,Response:r}=s,a=u?Jg(u):typeof fetch=="function",c=Jg(i),e=Jg(r);if(!a)return!1;const f=a&&Jg(DU),h=a&&(typeof CU=="function"?(R=>C=>R.encode(C))(new CU):async R=>new Uint8Array(await new i(R).arrayBuffer())),m=c&&f&&OU(()=>{let R=!1;const C=new i(as.origin,{body:new DU,method:"POST",get duplex(){return R=!0,"half"}}).headers.has("Content-Type");return R&&!C}),v=e&&f&&OU(()=>Je.isReadableStream(new r("").body)),b={stream:v&&(R=>R.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(R=>{!b[R]&&(b[R]=(C,$)=>{let G=C&&C[R];if(G)return G.call(C);throw new _r(`Response type '${R}' is not supported`,_r.ERR_NOT_SUPPORT,$)})});const A=async R=>{if(R==null)return 0;if(Je.isBlob(R))return R.size;if(Je.isSpecCompliantForm(R))return(await new i(as.origin,{method:"POST",body:R}).arrayBuffer()).byteLength;if(Je.isArrayBufferView(R)||Je.isArrayBuffer(R))return R.byteLength;if(Je.isURLSearchParams(R)&&(R=R+""),Je.isString(R))return(await h(R)).byteLength},D=async(R,C)=>{const $=Je.toFiniteNumber(R.getContentLength());return $??A(C)};return async R=>{let{url:C,method:$,data:G,signal:x,cancelToken:k,timeout:X,onDownloadProgress:te,onUploadProgress:ie,responseType:z,headers:ee,withCredentials:de="same-origin",fetchOptions:Q}=AMe(R),H=u||fetch;z=z?(z+"").toLowerCase():"text";let ae=B1i([x,k&&k.toAbortSignal()],X),pe=null;const le=ae&&ae.unsubscribe&&(()=>{ae.unsubscribe()});let he;try{if(ie&&m&&$!=="get"&&$!=="head"&&(he=await D(ee,G))!==0){let Be=new i(C,{method:"POST",body:G,duplex:"half"}),Ce;if(Je.isFormData(G)&&(Ce=Be.headers.get("content-type"))&&ee.setContentType(Ce),Be.body){const[qe,Xe]=AU(he,PI(gU(ie)));G=RU(Be.body,wU,qe,Xe)}}Je.isString(de)||(de=de?"include":"omit");const ve=c&&"credentials"in i.prototype,ge={...Q,signal:ae,method:$.toUpperCase(),headers:ee.normalize().toJSON(),body:G,duplex:"half",credentials:ve?de:void 0};pe=c&&new i(C,ge);let Ie=await(c?H(pe,Q):H(C,ge));const Me=v&&(z==="stream"||z==="response");if(v&&(te||Me&&le)){const Be={};["status","statusText","headers"].forEach(Ye=>{Be[Ye]=Ie[Ye]});const Ce=Je.toFiniteNumber(Ie.headers.get("content-length")),[qe,Xe]=te&&AU(Ce,PI(gU(te),!0))||[];Ie=new r(RU(Ie.body,wU,qe,()=>{Xe&&Xe(),le&&le()}),Be)}z=z||"text";let Ge=await b[Je.findKey(b,z)||"text"](Ie,R);return!Me&&le&&le(),await new Promise((Be,Ce)=>{EMe(Be,Ce,{data:Ge,headers:So.from(Ie.headers),status:Ie.status,statusText:Ie.statusText,config:R,request:pe})})}catch(ve){throw le&&le(),ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)?Object.assign(new _r("Network Error",_r.ERR_NETWORK,R,pe,ve&&ve.response),{cause:ve.cause||ve}):_r.from(ve,ve&&ve.code,R,pe,ve&&ve.response)}}},F1i=new Map,gMe=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=F1i;for(;f--;)h=c[f],m=v.get(h),m===void 0&&v.set(h,m=f?new Map:U1i(u)),v=m;return m};gMe();const eL={http:i1i,xhr:$1i,fetch:{get:gMe}};Je.forEach(eL,(s,u)=>{if(s){try{Object.defineProperty(s,"name",{value:u})}catch{}Object.defineProperty(s,"adapterName",{value:u})}});const _U=s=>`- ${s}`,K1i=s=>Je.isFunction(s)||s===null||s===!1;function S1i(s,u){s=Je.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,!K1i(r)&&(a=eL[(f=String(r)).toLowerCase()],a===void 0))throw new _r(`Unknown adapter '${f}'`);if(a&&(Je.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(_U).join(`