@adaas/are 0.0.3 → 0.0.5
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/LICENSE +10 -19
- package/README.md +14 -2
- package/dist/browser/index.d.mts +843 -751
- package/dist/browser/index.mjs +2729 -2481
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/AreInstruction.entity-Ceyy0tbf.d.mts +163 -0
- package/dist/node/AreInstruction.entity-Ceyy0tbf.d.ts +163 -0
- package/dist/node/index.d.mts +37 -1
- package/dist/node/index.d.ts +37 -1
- package/dist/node/index.js +28 -0
- package/dist/node/index.mjs +4 -0
- package/dist/node/lib/AreAttribute/AreAttribute.entity.d.mts +80 -13
- package/dist/node/lib/AreAttribute/AreAttribute.entity.d.ts +80 -13
- package/dist/node/lib/AreCompiler/AreCompiler.component.d.mts +3 -13
- package/dist/node/lib/AreCompiler/AreCompiler.component.d.ts +3 -13
- package/dist/node/lib/AreComponent/Are.context.d.mts +64 -14
- package/dist/node/lib/AreComponent/Are.context.d.ts +64 -14
- package/dist/node/lib/AreEngine/AreEngine.component.d.mts +9 -23
- package/dist/node/lib/AreEngine/AreEngine.component.d.ts +9 -23
- package/dist/node/lib/AreEngine/AreEngine.types.d.mts +9 -25
- package/dist/node/lib/AreEngine/AreEngine.types.d.ts +9 -25
- package/dist/node/lib/AreInstruction/AreInstruction.entity.d.mts +3 -13
- package/dist/node/lib/AreInstruction/AreInstruction.entity.d.ts +3 -13
- package/dist/node/lib/AreInstruction/AreInstruction.types.d.mts +3 -13
- package/dist/node/lib/AreInstruction/AreInstruction.types.d.ts +3 -13
- package/dist/node/lib/AreInstruction/types/AreDeclaration.instruction.d.mts +37 -14
- package/dist/node/lib/AreInstruction/types/AreDeclaration.instruction.d.ts +37 -14
- package/dist/node/lib/AreInstruction/types/AreMutation.instruction.d.mts +29 -14
- package/dist/node/lib/AreInstruction/types/AreMutation.instruction.d.ts +29 -14
- package/dist/node/lib/AreInterpreter/AreInterpreter.component.d.mts +3 -13
- package/dist/node/lib/AreInterpreter/AreInterpreter.component.d.ts +3 -13
- package/dist/node/lib/AreLifecycle/AreLifecycle.component.d.mts +4 -13
- package/dist/node/lib/AreLifecycle/AreLifecycle.component.d.ts +4 -13
- package/dist/node/lib/AreLoader/AreLoader.component.d.mts +2 -13
- package/dist/node/lib/AreLoader/AreLoader.component.d.ts +2 -13
- package/dist/node/lib/AreNode/AreNode.entity.d.mts +197 -13
- package/dist/node/lib/AreNode/AreNode.entity.d.ts +197 -13
- package/dist/node/lib/AreNode/AreNode.types.d.mts +8 -14
- package/dist/node/lib/AreNode/AreNode.types.d.ts +8 -14
- package/dist/node/lib/AreScene/AreScene.context.d.mts +170 -13
- package/dist/node/lib/AreScene/AreScene.context.d.ts +170 -13
- package/dist/node/lib/AreScene/AreScene.types.d.mts +21 -14
- package/dist/node/lib/AreScene/AreScene.types.d.ts +21 -14
- package/dist/node/lib/AreSignals/AreSignals.component.d.mts +3 -12
- package/dist/node/lib/AreSignals/AreSignals.component.d.ts +3 -12
- package/dist/node/lib/AreSignals/AreSignals.context.d.mts +2 -12
- package/dist/node/lib/AreSignals/AreSignals.context.d.ts +2 -12
- package/dist/node/lib/AreSignals/AreSignals.meta.d.mts +1 -3
- package/dist/node/lib/AreSignals/AreSignals.meta.d.ts +1 -3
- package/dist/node/lib/AreSignals/AreSignals.types.d.mts +1 -3
- package/dist/node/lib/AreSignals/AreSignals.types.d.ts +1 -3
- package/dist/node/lib/AreSignals/entities/AreInit.signal.d.mts +1 -2
- package/dist/node/lib/AreSignals/entities/AreInit.signal.d.ts +1 -2
- package/dist/node/lib/AreSignals/entities/AreRoute.signal.d.mts +1 -1
- package/dist/node/lib/AreSignals/entities/AreRoute.signal.d.ts +1 -1
- package/dist/node/lib/AreStore/AreStore.context.d.mts +54 -13
- package/dist/node/lib/AreStore/AreStore.context.d.ts +54 -13
- package/dist/node/lib/AreSyntax/AreSyntax.context.d.mts +10 -12
- package/dist/node/lib/AreSyntax/AreSyntax.context.d.ts +10 -12
- package/dist/node/lib/AreSyntax/AreSyntax.types.d.mts +79 -14
- package/dist/node/lib/AreSyntax/AreSyntax.types.d.ts +79 -14
- package/dist/node/lib/AreTokenizer/AreTokenizer.component.d.mts +4 -14
- package/dist/node/lib/AreTokenizer/AreTokenizer.component.d.ts +4 -14
- package/dist/node/lib/AreTransformer/AreTransformer.component.d.mts +2 -13
- package/dist/node/lib/AreTransformer/AreTransformer.component.d.ts +2 -13
- package/package.json +32 -17
- package/src/index.ts +6 -0
- package/dist/node/Are.context-9Ija_fdC.d.ts +0 -846
- package/dist/node/Are.context-D7w32H1G.d.mts +0 -846
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/AreComponent/Are.constants.ts","../../src/lib/AreInstruction/AreInstruction.constants.ts","../../src/lib/AreInstruction/AreInstruction.entity.ts","../../src/lib/AreInstruction/types/AreDeclaration.instruction.ts","../../src/lib/AreScene/AreScene.error.ts","../../src/lib/AreInstruction/AreInstruction.error.ts","../../src/lib/AreInstruction/types/AreMutation.instruction.ts","../../src/lib/AreScene/AreScene.constants.ts","../../src/lib/AreScene/AreScene.context.ts","../../src/lib/AreAttribute/AreAttribute.constants.ts","../../src/lib/AreAttribute/AreAttribute.entity.ts","../../src/lib/AreNode/AreNode.constants.ts","../../src/lib/AreComponent/Are.context.ts","../../src/lib/AreNode/AreNode.entity.ts","../../src/lib/AreEvent/AreEvent.context.ts","../../src/lib/AreSignals/AreSignals.meta.ts","../../src/lib/AreSignals/AreSignals.context.ts","../../src/lib/AreSignals/AreSignals.component.ts","../../src/lib/AreComponent/Are.meta.ts","../../src/lib/AreComponent/Are.component.ts","../../src/lib/AreSyntax/AreSyntax.context.ts","../../src/lib/AreSyntax/AreSyntax.error.ts","../../src/lib/AreEngine/AreEngine.constants.ts","../../src/lib/AreTokenizer/AreTokenizer.error.ts","../../src/lib/AreTokenizer/AreTokenizer.component.ts","../../src/lib/AreCompiler/AreCompiler.component.ts","../../src/lib/AreCompiler/AreCompiler.error.ts","../../src/lib/AreTransformer/AreTransformer.component.ts","../../src/lib/AreStore/AreStore.constants.ts","../../src/lib/AreStore/AreStore.context.ts","../../src/lib/AreInterpreter/AreInterpreter.component.ts","../../src/lib/AreInterpreter/AreInterpreter.error.ts","../../src/lib/AreLifecycle/AreLifecycle.component.ts","../../src/lib/AreLifecycle/AreLifecycle.error.ts","../../src/lib/AreLoader/AreLoader.component.ts","../../src/lib/AreLoader/AreLoader.error.ts","../../src/lib/AreWatcher/AreWatcher.component.ts","../../src/lib/AreSignals/AreSignal.entity.ts","../../src/lib/AreSignals/entities/AreInit.signal.ts","../../src/lib/AreSignals/entities/AreRoute.signal.ts"],"names":["A_Frame","A_Error","A_Context","A_Entity","A_Scope","A_FormatterHelper","A_ExecutionContext","A_Fragment","A_Feature","A_SignalVector","A_ComponentMeta","A_Component","A_Meta","A_Inject","A_Caller","A_Logger","scene","A_TYPES__EntityFeatures","A_Signal"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,WAAA,GAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvB,YAAA,EAAc,mBAAA;AAAA;AAAA;AAAA;AAAA,EAId,WAAA,EAAa,kBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKb,aAAA,EAAe,oBAAA;AAAA;AAAA;AAAA;AAAA,EAIf,YAAA,EAAc,mBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKd,eAAA,EAAiB,sBAAA;AAAA;AAAA;AAAA;AAAA,EAIjB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA,EAIhB,aAAA,EAAe,oBAAA;AAAA;AAAA;AAAA;AAAA,EAIf,eAAA,EAAiB,sBAAA;AAAA;AAAA;AAAA;AAAA,EAIjB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,UAA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O,KAAA,IAAS,CAAA;AAAA,EACjD;AACJ;ACAO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,SAAA,CAAmB;AAAA,EAE7C,YAAY,IAAA,EAAuB;AAC/B,IAAA,KAAA,CAAM;AAAA,MACF,IAAA,EAAM,IAAI,OAAA,CAAQ,IAAI;AAAA,KACzB,CAAA;AAAA,EACL;AAAA,EAEA,IAAI,KAAA,GAAiB;AACjB,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EAChB;AAAA,EAEA,OAAO,OAAA,GAAgC;AACnC,IAAA,OAAO,IAAI,SAAA,CAAS,QAAA,CAAS,QAAA,CAAS,YAAY,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,QAAQ,KAAA,EAAmC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAM,QAAA,EAAS,CAAE,KAAK,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA;AAAA,EAC3D;AACJ","file":"index.mjs","sourcesContent":["export const AreFeatures = {\n //===================================================================================\n // -----------------------------Node Lifecycle Hooks---------------------------------\n //===================================================================================\n /**\n * Allows to define a custom method for the component's initialization logic. This method is called before the component is initialized and can be used to perform any necessary setup or configuration before the component is rendered. It can also be used to implement custom logic for handling specific features or behaviors of the component during the initialization process.\n */\n onBeforeInit: '_Are_onBeforeInit',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been initialized. This method is called after the component has been initialized and can be used to perform any necessary setup or configuration based on the initial state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-initialization process.\n */\n onAfterInit: '_Are_onAfterInit',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's mounting logic. This method is called before the component is mounted to the DOM and can be used to perform any necessary setup or configuration before the component is rendered. It can also be used to implement custom logic for handling specific features or behaviors of the component during the mounting process.\n */\n onBeforeMount: '_Are_onBeforeMount',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been mounted to the DOM. This method is called after the component has been mounted and can be used to perform any necessary setup or configuration based on the initial state of the component and its presence in the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-mounting process.\n */\n onAfterMount: '_Are_onAfterMount',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's unmounting logic. This method is called before the component is unmounted from the DOM and can be used to perform any necessary cleanup or teardown before the component is removed. It can also be used to implement custom logic for handling specific features or behaviors of the component during the unmounting process.\n */\n onBeforeUnmount: '_Are_onBeforeUnmount',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been unmounted from the DOM. This method is called after the component has been unmounted and can be used to perform any necessary cleanup or teardown based on the final state of the component and its removal from the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-unmounting process.\n */\n onAfterUnmount: '_Are_onAfterUnmount',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's update logic. This method is called whenever the component's state changes and can be used to perform any necessary updates or side effects based on the new state. It can also be used to optimize performance by implementing custom logic for determining when the component should re-render based on specific state changes.\n */\n onBeforeUpdate: '_Are_onBeforeUpdate',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component's state has been updated. This method is called after the component has re-rendered in response to state changes, and can be used to perform any necessary side effects or additional updates based on the new state. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-update process.\n */\n onAfterUpdate: '_Are_onAfterUpdate',\n /**\n * Allows to define a custom method for the component's logic that should be executed before the component is destroyed. This method is called before the component is destroyed and can be used to perform any necessary cleanup or teardown based on the final state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the pre-destruction process.\n */\n onBeforeDestroy: '_Are_onBeforeDestroy',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is destroyed. This method is called after the component has been destroyed and can be used to perform any necessary cleanup or teardown based on the final state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-destruction process.\n */\n onAfterDestroy: '_Are_onAfterDestroy',\n\n //===================================================================================\n // -----------------------------Loading Extension------------------------------------\n //===================================================================================\n onTemplate: '_Are_onTemplate',\n onStyles: '_Are_onStyles',\n onData: '_Are_onData',\n //===================================================================================\n // -----------------------------Runtime Hooks------------------------------------\n //=================================================================================== \n onSignal: '_Are_onSignal',\n} as const;","\n\nexport const AreInstructionFeatures = {\n /**\n * The 'Apply' feature indicates that the instruction has been applied to the scene or component, meaning that its effects have been executed and are now reflected in the state of the scene or component. This status is typically used to track the lifecycle of an instruction, allowing for proper management and potential reversal of changes if needed.\n */\n Apply: '_AreInstruction_Apply',\n /**\n * The 'Update' feature indicates that the instruction has been updated, meaning that its properties or effects have been modified after it was initially applied. This status is important for managing dynamic changes in the scene or component, allowing for adjustments to be made to the instruction's behavior or effects without needing to revert and reapply it entirely.\n */\n Update: '_AreInstruction_Update',\n /**\n * The 'Revert' feature indicates that the instruction has been reverted, meaning that any changes or effects that were applied by the instruction have been undone, and the scene or component has been returned to its previous state before the instruction was applied. This status is crucial for managing the state of the scene or component, especially in cases where an instruction needs to be rolled back due to errors or changes in requirements.\n */\n Revert: '_AreInstruction_Revert'\n} as const\n\n\nexport const AreInstructionDefaultNames = {\n Default: '_Are_DefaultInstruction',\n Declaration: '_Are_DeclarationInstruction',\n Mutation: '_Are_MutationInstruction',\n} as const","\nimport { A_Context, A_Entity, A_Error, A_FormatterHelper, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"./AreInstruction.types\";\nimport { AreInstructionFeatures } from \"./AreInstruction.constants\";\nimport { AreStoreWatchingEntity } from \"@adaas/are/store/AreStore.types\";\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreInstruction',\n description: 'AreInstruction is the base entity for all rendering instructions in the ARE framework. It represents a serializable, reversible operation (such as creating or mutating a DOM element) that can be applied to and tracked within the AreScene, enabling deterministic rendering and undo/redo capabilities.'\n})\nexport class AreInstruction<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends A_Entity<AreInstructionNewProps<T>, S> implements AreStoreWatchingEntity {\n /**\n * The name of the instruction, for example \"CreateElement\", \"AddAttribute\", \"RemoveNode\", etc. This is used to identify the type of the instruction and how to process it. The name should be in PascalCase format, and should be unique across all instruction types. It is recommended to use a prefix that indicates the category of the instruction, for example \"CreateElement\" for instructions that create new elements, \"UpdateAttribute\" for instructions that update attributes, etc.\n */\n protected _name!: string\n /**\n * The payload of the instruction, which can contain any additional information that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene. The payload is optional and can be an empty object if no additional information is needed.\n */\n protected _payload?: T\n /**\n * Group is an optional property that can be used to group instructions together. For example a set of instructions that depend on create CreateElement instruction can be grouped together with the same group name, so if the CreateElement instruction is reverted, all the instructions in the same group will be reverted as well, and so on. This can be useful to manage complex changes that involve multiple instructions. \n * \n * [!] Note, the best option is to use ASEID of the Instruction as a group, so all instructions with the same ASEID will be treated as a single change, and will be applied and reverted together.\n */\n protected _group: string | undefined\n /**\n * The parent instruction that created this instruction. For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, the AddAttribute instruction would have the CreateElement instruction as its parent. This can be used to track the hierarchy of instructions and their dependencies.\n */\n protected _parent: string | undefined\n\n /**\n * A set of properties that influence the behavior of the instruction, for example, for AddTextInstruction, we can interpolation dependent on some key in the store, so we can have a property called \"interpolationKey\" that will be used to track the dependencies of the instruction, and when the value of this key changes in the scope, we can update the instruction accordingly.\n */\n protected _props!: Set<string>\n\n\n /**\n * The name of the instruction, for example \"CreateElement\", \"AddAttribute\", \"RemoveNode\", etc. This is used to identify the type of the instruction and how to process it. The name should be in PascalCase format, and should be unique across all instruction types. It is recommended to use a prefix that indicates the category of the instruction, for example \"CreateElement\" for instructions that create new elements, \"UpdateAttribute\" for instructions that update attributes, etc.\n */\n get name(): string {\n return this._name;\n }\n /**\n * The payload of the instruction, which can contain any additional information that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene. The payload is optional and can be an empty object if no additional information is needed. \n * \n * [!] Note, the payload should be serializable, so it can be stored and transmitted easily. It is recommended to use simple data structures for the payload, such as objects, arrays, strings, numbers, etc., and avoid using complex data types that may not be easily serializable.\n */\n get payload(): T {\n return this._payload || {} as T;\n }\n\n /**\n * Group is an optional property that can be used to group instructions together. For example a set of instructions that depend on create CreateElement instruction can be grouped together with the same group name, so if the CreateElement instruction is reverted, all the instructions in the same group will be reverted as well, and so on. This can be useful to manage complex changes that involve multiple instructions. \n * \n * [!] Note, the best option is to use ASEID of the Instruction as a group, so all instructions with the same ASEID will be treated as a single change, and will be applied and reverted together.\n */\n get group(): string | undefined {\n return this._group;\n }\n /**\n * The parent instruction ASEID that created this instruction. For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, the AddAttribute instruction would have the CreateElement instruction as its parent. This can be used to track the hierarchy of instructions and their dependencies.\n * \n * [!] Note, the parent should be provided as an ASEID string, so it can be easily referenced and tracked across different contexts and times.\n */\n get parent(): string | undefined {\n return this._parent;\n }\n\n get id(): string {\n return this.aseid.id;\n }\n\n get owner(): AreNode {\n return A_Context.scope(this).issuer<AreNode>()!;\n }\n\n\n fromNew(newEntity: AreInstructionNewProps<T>): void {\n\n // TODO: Verify if deduplication ID is needed\n // const identity = newEntity.id || {\n // name: newEntity.name,\n // };\n\n // const id = AreCacheHelper.createHash(identity);\n\n this.aseid = this.generateASEID({\n // shard: newEntity.node.id,\n entity: A_FormatterHelper.toKebabCase(newEntity.name),\n // id: id,\n });\n\n this._name = newEntity.name;\n this._payload = newEntity.payload\n this._group = newEntity.group?.aseid.toString();\n this._parent = newEntity.parent?.aseid.toString();\n }\n\n\n fromUndefined(): void {\n throw new A_Error({\n title: \"Cannot create an instruction without properties\",\n description: \"AreInstruction cannot be created without properties. Please provide the necessary properties to create an instruction.\",\n })\n }\n\n\n // ===============================================================================\n // ----------------------------Instruction Operations ------------------------------\n // ===============================================================================\n\n /**\n * Group this instruction with another instruction. This means that when one of the instructions in the group is applied or reverted, all the instructions in the same group will be applied or reverted together. This can be useful to manage complex changes that involve multiple instructions. \n * \n * For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, we can group them together with the same group name, so if we revert the CreateElement instruction, the AddAttribute instruction will be reverted as well, and so on.\n * \n * @param instruction \n * @returns \n */\n groupWith(instruction: AreInstruction): this {\n this._group = instruction.id;\n return this;\n }\n /**\n * Ungroup this instruction from any group. This means that this instruction will be treated as an independent instruction, and will not be applied or reverted together with any other instructions. This can be useful when you want to separate an instruction from a group, so it can be applied or reverted independently.\n * \n * @returns \n */\n unGroup(): this {\n this._group = undefined;\n return this;\n }\n /**\n * Attach this instruction to a parent instruction. This means that this instruction will be considered as a child of the parent instruction, and can be used to track the hierarchy of instructions and their dependencies. \n * \n * For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, we can attach the AddAttribute instruction to the CreateElement instruction as its parent, so we can track that the AddAttribute instruction is related to the CreateElement instruction.\n * \n * @param parent \n * @returns \n */\n attachTo(parent: AreInstruction): this {\n this._parent = parent.id;\n return this;\n }\n /**\n * Detach this instruction from its parent instruction. This means that this instruction will no longer be considered as a child of the parent instruction, and will not be related to it in any way. This can be useful when you want to separate an instruction from its parent, so it can be treated as an independent instruction.\n * \n * @returns \n */\n detach(): this {\n this._parent = undefined;\n return this;\n }\n\n\n // ===============================================================================\n // ----------------------------Instruction Features ------------------------------\n // ===============================================================================\n /**\n * Apply this instruction to the scene. This means that the changes represented by this instruction will be applied to the scene, and the Host will perform the necessary operations to reflect these changes in the rendered output. \n * \n * For example, if this instruction is a CreateElement instruction, when we apply it, the Host will create a new element in the scene according to the information provided in the payload of the instruction. If this instruction is an AddAttribute instruction, when we apply it, the Host will add the specified attribute to the target element in the scene. The apply method can also accept an optional scope parameter, which can be used to provide additional context or information that may be needed for applying the instruction.\n * \n * @param scope \n */\n apply(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Apply, scope);\n } \n /**\n * Update this instruction in the scene. This means that the changes represented by this instruction will be updated in the scene, and the Host will perform the necessary operations to reflect these changes in the rendered output. This is particularly useful for instructions that have dynamic properties or effects that may change over time, allowing for adjustments to be made to the instruction's behavior or effects without needing to revert and reapply it entirely. The update method can also accept an optional scope parameter, which can be used to provide additional context or information that may be needed for updating the instruction.\n * \n * @param scope \n */\n update(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Update, scope);\n }\n /**\n * Revert this instruction from the scene. This means that the changes represented by this instruction will be reverted from the scene, and the Host will perform the necessary operations to undo these changes in the rendered output.\n * \n * @param scope \n */\n revert(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Revert, scope);\n }\n\n}\n\n\n\n\n\n\n\n\n","import { A_IdentityHelper } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"@adaas/are/instruction/AreInstruction.types\";\nimport { AreInstructionDefaultNames } from \"@adaas/are/instruction/AreInstruction.constants\";\n\n\n/**\n * This is a top-level instruction that represents the creation of a new element in the scene. It contains all the necessary information to create a new element, such as its tag and parent. This instruction can be applied to the scene to create a new element and can be reverted to remove the created element.\n */\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreDeclaration',\n description: 'AreDeclaration is a top-level rendering instruction that represents the creation of a new element in the ARE scene. It carries the target tag name and parent reference needed by the Host to construct the DOM element, and can be applied or reverted to manage element creation and removal deterministically.'\n})\nexport class AreDeclaration<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends AreInstruction<T, S> {\n\n constructor(\n /**\n * Serialized form of the instruction, used for deserialization and reconstruction of the instruction instance. This allows for the instruction to be easily stored, transmitted, and recreated in different contexts or at different times, while maintaining all the necessary information and relationships intact.\n */\n serialized: AreInstructionSerialized,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n name: string,\n /**\n * In case this is a child instruction that is related to a declaration instruction, we can pass the parent declaration instruction to establish the relationship between them. This allows us to manage related instructions together and ensure that they are executed in the correct order in the scene.\n */\n parent: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n payload: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n name?: string,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n payload?: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n param1?: string | S,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n param2?: T | AreDeclaration,\n /**\n * In case this is a child instruction that is related to a declaration instruction, we can pass the parent declaration instruction to establish the relationship between them. This allows us to manage related instructions together and ensure that they are executed in the correct order in the scene.\n */\n param3?: AreDeclaration | T,\n ) {\n if (typeof param1 === 'object' && 'aseid' in param1)\n super(param1);\n else\n super({\n name: param1 || AreInstructionDefaultNames.Default,\n parent: param2 instanceof AreDeclaration ? param2 : undefined,\n group: param2 instanceof AreDeclaration ? param2.group : undefined,\n payload: param2 instanceof AreDeclaration ? (param3 || {}) as T : (param2 || {}) as T,\n // id: [param1, A_IdentityHelper.generateTimeId(), param2 instanceof AreDeclaration ? (param3 || {}) as T : (param2 || {}) as T]\n } as AreInstructionNewProps<T>);\n }\n\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class AreSceneError extends A_Error {\n\n static readonly SceneAlreadyInactive = 'AreSceneError.SceneAlreadyInactive';\n\n static readonly SceneAlreadyActive = 'AreSceneError.SceneAlreadyActive';\n\n static readonly HostInstructionHasConnectedInstructions = 'AreSceneError.HostInstructionHasConnectedInstructions';\n\n static readonly SingleHostInstruction = 'AreSceneError.SingleHostInstruction';\n\n static readonly SceneError = 'AreSceneError.SceneError';\n\n static readonly RootNotFound = 'AreSceneError.RootNotFound';\n\n static readonly UpdateFailed = 'AreSceneError.UpdateFailed';\n\n static readonly MountFailed = 'AreSceneError.MountFailed';\n\n static readonly UnmountFailed = 'AreSceneError.UnmountFailed';\n\n static readonly MountPointNotFound = 'AreSceneError.MountPointNotFound';\n\n static readonly InvalidTemplate = 'AreSceneError.InvalidTemplate';\n\n static readonly RenderFailed = 'AreSceneError.RenderFailed';\n\n}","import { A_Error } from \"@adaas/a-concept\"\n\n\n\nexport class AreInstructionError extends A_Error{\n \n}","import { title } from \"process\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreInstructionDefaultNames } from \"@adaas/are/instruction/AreInstruction.constants\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreInstructionError } from \"@adaas/are/instruction/AreInstruction.error\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"@adaas/are/instruction/AreInstruction.types\";\nimport { AreDeclaration } from \"./AreDeclaration.instruction\";\n\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreMutation',\n description: 'AreMutation is a rendering instruction that represents a reversible change applied to an existing declaration node in the ARE scene — such as updating an attribute, modifying content, or altering child structure. It references a parent AreDeclaration and is grouped with related mutations for coordinated apply and revert operations.'\n})\nexport class AreMutation<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends AreInstruction<T, S> {\n\n get parent(): string {\n return this._parent!;\n }\n\n\n get group(): string {\n return this._group || this.parent;\n }\n\n constructor(\n /**\n * Serialized form of the instruction, used for deserialization and reconstruction of the instruction instance. This allows for the instruction to be easily stored, transmitted, and recreated in different contexts or at different times, while maintaining all the necessary information and relationships intact.\n */\n serialized: S,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host.\n */\n name: string,\n /**\n * Parent instruction for grouping in case of mutations related to a specific declaration. This allows for better organization and management of instructions in the scene, as all mutations related to the same declaration will be executed together.\n */\n parent: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for AddAttribute instruction, the payload can contain the attribute name and value as a payload, so the Host can use this information to add the attribute to the node.\n */\n payload?: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host.\n */\n param1: string | S,\n /**\n * Parent instruction for grouping in case of mutations related to a specific declaration. This allows for better organization and management of instructions in the scene, as all mutations related to the same declaration will be executed together.\n */\n param2?: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for AddAttribute instruction, the payload can contain the attribute name and value as a payload, so the Host can use this information to add the attribute to the node.\n */\n param3?: T,\n ) {\n if (typeof param1 === 'object' && 'aseid' in param1)\n super(param1);\n else\n super({\n name: param1 || AreInstructionDefaultNames.Mutation,\n group: param2,\n parent: param2,\n payload: param3,\n // id: [param1, param3, param2?.group]\n } as AreInstructionNewProps<T>);\n }\n\n\n\n fromNew(newEntity: AreInstructionNewProps<T>): void {\n if (!newEntity.parent)\n throw new AreInstructionError({\n title: \"Mutation instruction must have a parent declaration instruction\",\n description: `Mutation instruction with name ${newEntity.name} must have a parent declaration instruction for grouping and organization purposes. Please provide a parent declaration instruction when creating this mutation instruction.`\n });\n\n super.fromNew(newEntity);\n }\n}","\n\nexport const AreSceneStatuses = {\n Active: 'active',\n Inactive: 'inactive',\n Destroyed: 'destroyed',\n}","import { A_Context, A_Dependency, A_Fragment, A_Scope, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreDeclaration } from \"@adaas/are/instruction/types/AreDeclaration.instruction\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreSceneChanges, AreSceneStatusNames } from \"./AreScene.types\";\nimport { AreSceneError } from \"./AreScene.error\";\nimport { AreMutation } from \"@adaas/are/instruction/types/AreMutation.instruction\";\nimport { AreSceneStatuses } from \"./AreScene.constants\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreScene',\n description: \"Persistent runtime structure that owns the rendering state for a component's lifetime. Maintains two sets — applied (what is currently in the DOM) and planned (what should be). Acts as the single source of truth for all rendering decisions. The Compiler produces it once, the Interpreter reads it on every update.\"\n})\nexport class AreScene extends A_Fragment {\n // -----------------------------------------------------------------------------------\n // -----------------------------------Scene Index-------------------------------------\n // -----------------------------------------------------------------------------------\n protected _groupToInstructionsMap: Map<string, Set<AreInstruction>> = new Map();\n\n /**\n * Plan is a queue of changes that should be applied to render the node\n * \n * It works as FIFO, so the first instruction that should be applied is the first one in the queue, and so on.\n */\n protected _plan: Array<AreInstruction> = [];\n /**\n * State is a list of instructions that are currently applied to the node, \n * so it represents the current state of the node in the scene.\n * \n * It always in a reverse order of the plan, so the last instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n * \n * For example, if we have a node with two instructions in the plan: [Instruction A, Instruction B], and both of them are applied to the node, then the state will be [Instruction B, Instruction A], so when we need to revert the changes, we will revert Instruction B first, and then Instruction A.\n */\n protected _state: Array<AreInstruction> = [];\n\n\n protected _host: AreDeclaration | undefined;\n /**\n * Scene status is used to determine the current lifecycle stage of the scene, which can be 'active', 'inactive' or 'destroyed'. This status can be used to control the behavior of the scene and its instructions, for example, we can prevent applying new instructions to an inactive or destroyed scene, or we can trigger certain actions when the scene becomes active or inactive. The default status of the scene is 'inactive', which means that the scene is not yet rendered and its instructions are not applied, and it will become 'active' when it is mounted and its instructions are applied, and it will become 'destroyed' when it is unmounted and its instructions are reverted.\n */\n protected _status: AreSceneStatusNames = AreSceneStatuses.Active;\n\n\n constructor(\n /**\n * Scene identity will be used to identify mounting point in the parent scene\n */\n id: string | ASEID,\n ) {\n super({ name: id.toString() });\n }\n\n /**\n * Scene ID that corresponds to the root node's ID (part of ASEID) \n */\n get id(): string {\n return this.name;\n }\n /**\n * The scope where scene is registered. This scope is owned by AreNode \n */\n get scope(): A_Scope {\n return A_Context.scope(this);\n }\n /**\n * The owner node of the scene, which is the node that registered the scene in its scope. \n * This is typically the node that is responsible for rendering the scene and managing its lifecycle.\n */\n get owner(): AreNode {\n return this.scope.issuer() as AreNode;\n }\n /**\n * It's a primary declaration instruction that represents the node in the scene, so it should be registered as a host instruction for the scene, and it will be used to keep track of the node in the scene and to manage its lifecycle.\n */\n get host(): AreDeclaration | undefined {\n return this._host;\n }\n /**\n * Scene status is used to determine the current lifecycle stage of the scene, which can be 'active', 'inactive' or 'destroyed'. This status can be used to control the behavior of the scene and its instructions, for example, we can prevent applying new instructions to an inactive or destroyed scene, or we can trigger certain actions when the scene becomes active or inactive. The default status of the scene is 'inactive', which means that the scene is not yet rendered and its instructions are not applied, and it will become 'active' when it is mounted and its instructions are applied, and it will become 'destroyed' when it is unmounted and its instructions are reverted.\n */\n get status(): AreSceneStatusNames {\n return this._status;\n }\n\n get isActive(): boolean {\n return this.status === AreSceneStatuses.Active;\n }\n\n get isInactive(): boolean {\n return this.status === AreSceneStatuses.Inactive;\n }\n\n /**\n * Returns All declaration instructions are registered in the scene scope. Since declaration instructions are the main instructions that represent the structure of the node, we have a separate getter for them to easily access and manage them in the scene.\n */\n get declarations(): AreDeclaration[] {\n return this.scope.resolve<AreDeclaration>(new A_Dependency(AreDeclaration, {\n flat: true,\n pagination: {\n count: -1,\n }\n })) as AreDeclaration[] || [];\n }\n /**\n * Returns All mutation instructions are registered in the scene scope. Mutation instructions are the instructions that represent the changes to be applied to the node, so we have a separate getter for them to easily access and manage them in the scene, especially when we want to apply or revert changes based on the mutations.\n */\n get mutations(): AreMutation[] {\n return this.scope.resolve<AreMutation>(new A_Dependency(AreMutation, {\n flat: true,\n pagination: {\n count: -1,\n }\n })) as AreMutation[] || [];\n }\n /**\n * Returns All instructions are registered in the scene scope. \n */\n get instructions(): AreInstruction[] {\n return this.scope.resolveFlatAll<AreInstruction>(AreInstruction) || [];\n }\n /**\n * Plan is a queue of changes that should be applied to render the node\n * \n * It works as FIFO, so the first instruction that should be applied is the first one in the queue, and so on.\n */\n get planned(): AreInstruction[] {\n return this._plan;\n }\n /**\n * State is a list of instructions that are currently applied to the node, \n * so it represents the current state of the node in the scene.\n * \n * It always in a reverse order of the plan, so the last instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n * \n * For example, if we have a node with two instructions in the plan: [Instruction A, Instruction B], and both of them are applied to the node, then the state will be [Instruction B, Instruction A], so when we need to revert the changes, we will revert Instruction B first, and then Instruction A.\n */\n get applied(): AreInstruction[] {\n return this._state.reverse(); // we reverse the state to have the correct order of instructions, so the first instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n }\n\n /**\n * Should return instructions to be reverted and to be applied. \n * A difference between plan vs state is that plan is what should be applied to the scene, \n * while state is what currently applied to the scene. \n * \n */\n get changes(): AreSceneChanges {\n const toApply = this.planned.filter(i => !this.isApplied(i));\n const toRevert = this.applied.filter(i => !this.isInPlan(i));\n\n return {\n toApply,\n toRevert,\n }\n }\n\n\n //===============================================================================================\n //============================= Scene Primary Methods ===========================================\n //===============================================================================================\n activate(): void {\n this._status = AreSceneStatuses.Active;\n }\n\n deactivate(): void {\n\n this._status = AreSceneStatuses.Inactive;\n }\n /**\n * Each scene has a primary declaration instruction that represents the node in the scene, so it should be registered as a host instruction for the scene, and it will be used to keep track of the node in the scene and to manage its lifecycle. This method allows to set the host instruction for the scene, but it will throw an error if we try to set another host instruction while there is already a host instruction set, so we can ensure that there is only one host instruction for the scene at any given time.\n * \n * @param instruction \n */\n setHost(instruction: AreDeclaration): void {\n if (this.host) {\n const dependentInstructions = this.scope.resolve<AreMutation>(new A_Dependency(AreMutation, {\n flat: true,\n pagination: {\n count: -1,\n },\n query: {\n parent: this.host.aseid.toString(),\n\n }\n })) as Array<AreMutation> || [];\n\n dependentInstructions.forEach(element => {\n element.attachTo(instruction)\n element.groupWith(instruction);\n });\n }\n\n this._host = instruction;\n }\n /**\n * Unsets the current host instruction from the scene. \n * \n * This method should be used when we want to remove the primary declaration instruction that represents the node in the scene, for example, when we want to unmount the node or when we want to replace it with another node. Unsetting the host instruction will allow us to set a new host instruction for the scene if needed.\n */\n removeHost(): void {\n if (this.host)\n throw new AreSceneError({\n title: AreSceneError.HostInstructionHasConnectedInstructions,\n description: `Cannot remove host instruction (${this.host.aseid}) from scene ${this.id} because it has planned instructions in the scene. Please unPlan all instructions related to the host instruction before removing it.`,\n });\n\n this._host = undefined;\n\n }\n\n // ------------------------------------------------------------------------------------------------------------\n // Scene Render Plan Methods\n // ------------------------------------------------------------------------------------------------------------\n /**\n * Method that should register the instruction in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n */\n plan(instruction: AreInstruction) {\n // const registered = this.getPlanned(instruction);\n\n // if (!registered) {\n try {\n this.scope.register(instruction);\n\n } catch (error) {\n\n }\n this._plan.push(instruction);\n\n // We also add the instruction to the group map, so we can easily manage instructions by group, for example, when we want to unPlan all instructions related to a specific host instruction, we can easily find them in the group map and unPlan them.\n if (!this._groupToInstructionsMap.has(instruction.group || 'default')) {\n this._groupToInstructionsMap.set(instruction.group || 'default', new Set());\n }\n this._groupToInstructionsMap.get(instruction.group || 'default')!.add(instruction);\n // }\n }\n\n planBefore(instruction: AreInstruction, beforeInstruction: AreInstruction) {\n const beforeIndex = this._plan.findIndex(i => i.aseid.toString() === beforeInstruction.aseid.toString());\n const instructionIndex = this._plan.findIndex(i => i.aseid.toString() === instruction.aseid.toString());\n\n if (beforeIndex === -1) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${beforeInstruction.aseid} is not in the plan of scene ${this.id}. Cannot plan instruction ${instruction.aseid} before it.`,\n });\n }\n\n if (instructionIndex === -1) {\n\n try {\n this.scope.register(instruction);\n\n } catch (error) {\n\n }\n this._plan.splice(beforeIndex, 0, instruction);\n } else {\n // Instruction is already in the plan, we just need to move it before the beforeInstruction\n this._plan.splice(instructionIndex, 1); // remove from current position\n this._plan.splice(beforeIndex, 0, instruction); // insert before the beforeInstruction\n }\n }\n\n planAfter(instruction: AreInstruction, afterInstruction: AreInstruction) {\n const afterIndex = this._plan.findIndex(i => i.aseid.toString() === afterInstruction.aseid.toString());\n const instructionIndex = this._plan.findIndex(i => i.aseid.toString() === instruction.aseid.toString());\n\n if (afterIndex === -1) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${afterInstruction.aseid} is not in the plan of scene ${this.id}. Cannot plan instruction ${instruction.aseid} after it.`,\n });\n }\n\n if (instructionIndex === -1) {\n this.scope.register(instruction);\n this._plan.splice(afterIndex + 1, 0, instruction);\n } else {\n // Instruction is already in the plan, we just need to move it after the afterInstruction\n this._plan.splice(instructionIndex, 1); // remove from current position\n this._plan.splice(afterIndex + 1, 0, instruction); // insert after the afterInstruction\n }\n }\n\n\n moveBefore(instruction: AreInstruction, beforeInstruction: AreInstruction) {\n if (!this.isInPlan(instruction)) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${instruction.aseid} is not in the plan of scene ${this.id}. Cannot move instruction before ${beforeInstruction.aseid}. Please plan the instruction before moving it.`,\n });\n }\n\n this.planBefore(instruction, beforeInstruction);\n }\n\n moveAfter(instruction: AreInstruction, afterInstruction: AreInstruction) {\n if (!this.isInPlan(instruction)) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${instruction.aseid} is not in the plan of scene ${this.id}. Cannot move instruction after ${afterInstruction.aseid}. Please plan the instruction before moving it.`,\n });\n }\n\n this.planAfter(instruction, afterInstruction);\n }\n\n\n /**\n * Allows to remove instruction from the plan, so it will not be rendered anymore, but it will still be registered in the scene scope, so it can be planned again if needed.\n * \n * @param instruction \n */\n unPlan(\n instruction: AreInstruction\n ) {\n // const registered = this.getPlanned(instruction);\n\n // if (registered) {\n // this.scope.deregister(instruction);\n this._plan = this._plan.filter(i => i.aseid.toString() !== instruction.aseid.toString());\n // }\n\n }\n /**\n * Checks if the instruction is already in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n * @returns \n */\n getPlanned(instruction: AreInstruction): AreInstruction | undefined {\n const found = this._plan.find(i => i.aseid.toString() === instruction.aseid.toString());\n\n return found;\n }\n /**\n * Checks if the instruction is already in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n * @returns \n */\n isInPlan(instruction: AreInstruction): boolean {\n return !!this.getPlanned(instruction);\n }\n\n // -------------------------------------------------------------------------------------------------------------\n // Scene Apply Methods\n // -------------------------------------------------------------------------------------------------------------\n /**\n * Method moves the instruction to state to keep it applied and to be able to revert it later if needed. The instruction should be already registered in the scene scope and planned to be applied, otherwise it will not be applied.\n * \n * @param instruction \n */\n apply(instruction: AreInstruction) {\n if (!this.isApplied(instruction)) {\n this._state.push(instruction);\n }\n }\n /**\n * Method moves the instruction from state to unapply it and to be able to apply it later if needed. The instruction should be already registered in the scene scope and applied, otherwise it will not be unapplied.\n * \n * @param instruction \n */\n unApply(\n instruction: AreInstruction\n ) {\n this._state = this._state.filter(i => i.aseid.toString() !== instruction.aseid.toString());\n }\n /**\n * Checks if the instruction is already in the state, so it is currently applied to the scene.\n * \n * @param instruction \n * @returns \n */\n getApplied(instruction: AreInstruction): AreInstruction | undefined {\n const found = this._state.find(i => i.aseid.toString() === instruction.aseid.toString());\n\n return found;\n }\n /**\n * Checks if the instruction is already in the state, so it is currently applied to the scene.\n * \n * @param instruction \n * @returns \n */\n isApplied(instruction: AreInstruction): boolean {\n return !!this.getApplied(instruction);\n }\n /**\n * Method that should reset the scene to the initial state, so it will clear the plan and state, but it will not deregister the instructions from the scene scope, so they will still be registered in the scene and can be planned and applied again if needed.\n * \n */\n reset() {\n this._plan = [];\n this._state = [];\n }\n}","export const AreAttributeFeatures = {\n /**\n * Initializes the attribute. This method is called when the attribute is first created and should set up any necessary state or perform any initial processing based on the provided content and context. It can also be used to validate the attribute's content and throw errors if it is invalid.\n */\n Init: '_AreAttribute_Init',\n /**\n * Uses to generate all rendering instructions for the attribute. This method is called during the compilation phase of the ARE component and should return an array of instructions that describe how to render the attribute based on its content and context. The instructions can include details such as which DOM properties to set, which events to listen for, and how to update the attribute when the underlying data changes.\n */\n Transform: '_AreAttribute_Transform',\n /**\n * Feature that should convert a directiveAttribute definition into a set of SceneInstructions to be rendered correctly\n */\n Compile: '_AreAttribute_Compile',\n /**\n * Feature that should update the directiveAttribute based on the changes in the store or other dependencies. This method is called during the update phase of the ARE component and should perform any necessary updates to the attribute based on changes in the underlying data or context. This can include tasks such as updating DOM properties, re-evaluating expressions, or modifying event listeners to ensure that the attribute remains in sync with the current state of the application.\n */\n Update: '_AreAttribute_Update',\n /**\n * Feature that should validate the attribute's content and context. This method is called during the validation phase of the ARE component and should check whether the attribute's content is valid based on its expected format, type, or other constraints. If the content is invalid, this method should throw an error with a descriptive message to help developers identify and fix the issue.\n */\n Validate: '_AreAttribute_Validate',\n} as const\n","import { A_Context, A_Entity, A_Feature, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreAttributeFeatures } from \"./AreAttribute.constants\";\nimport { AreAttribute_Init, AreAttribute_Serialized } from \"./AreAttribute.types\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreAttribute',\n description: 'Represents an HTML attribute within the A-Concept Rendering Engine (ARE) framework, encapsulating the attribute\\'s name, raw content, evaluated value, and associated features for initialization, transformation, compilation, updating, and validation.'\n})\nexport class AreAttribute extends A_Entity<AreAttribute_Init, AreAttribute_Serialized> {\n\n /**\n * Property name (e.g. \"label\")\n */\n name!: string;\n /**\n * Full raw attribute (e.g. ' :label=\"buttonLabel\" ')\n */\n raw!: string;\n /**\n * Attribute content (e.g. \"buttonLabel\")\n * Example: For a directive like `v-if=\"condition\"`, the raw value is \"condition\", but the content would be \"condition\" without the quotes, and the value would be the result of evaluating \"condition\" in the current scope.\n */\n content!: string;\n /**\n * The evaluated value of the attribute, which can be different from the raw value depending on the context and type of the attribute. For example, for a directive like `v-if=\"condition\"`, the raw value is \"condition\", but the evaluated value would be the result of evaluating \"condition\" in the current scope.\n */\n value!: any;\n /**\n * The prefix of the attribute, for example for ':label' it would be ':', for 'v-if' it would be 'v-'. This can be used to determine the type of the attribute and how to process it.\n */\n prefix!: string;\n /**\n * The scope where the attribute is defined, which can be used to access other entities and features within the same scope. This is particularly useful for attributes that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.\n */\n get scope() {\n return A_Context.scope(this);\n }\n /**\n * The owner node of the attribute, which is the node that the attribute is attached to. This can be used to access the properties and features of the owner node, as well as to determine the context in which the attribute is being used. For example, if the attribute is attached to a button element, the owner would be that button node, and the attribute could use this information to modify the button's behavior or appearance based on its content and context.\n */\n get owner(): AreNode {\n return this.scope.issuer() as AreNode;\n }\n\n /**\n * Initializes the attribute based on the provided properties. This method is called when a new attribute is created and should set up the attribute's state based on the provided properties. It can also be used to generate a unique ASEID for the attribute based on its name and content, which can be used for caching and identification purposes within the ARE framework.\n * \n * @param newEntity \n */\n fromNew(newEntity: AreAttribute_Init): void {\n // const identity = {\n // name: newEntity.name,\n // prefix: newEntity.prefix,\n // content: newEntity.content,\n // };\n\n // const id = A_UtilsHelper.hash(identity);\n\n this.aseid = this.generateASEID({\n entity: newEntity.name,\n // id: id,\n });\n\n this.name = newEntity.name;\n this.prefix = newEntity.prefix;\n this.raw = newEntity.raw;\n this.content = newEntity.content;\n }\n // =====================================================================================\n // ------------------------------- Attribute Methods ------------------------------\n // =====================================================================================\n /**\n * Creates a clone of the current attribute instance. This method can be used to create a new instance of the attribute with the same properties and state as the original, which can be useful in scenarios where you want to reuse an attribute's configuration or create variations of it without modifying the original instance.\n * \n * @returns \n */\n clone(): this {\n return new (this.constructor as new (init: AreAttribute_Init) => this)({\n name: this.name,\n raw: this.raw,\n content: this.content,\n prefix: this.prefix,\n });\n }\n // =====================================================================================\n // ------------------------------- Attribute Lifecycle ------------------------------\n // =====================================================================================\n /**\n * Initializes the attribute. This method is called when the attribute is first created and should set up any necessary state or perform any initial processing based on the provided content and context. It can also be used to validate the attribute's content and throw errors if it is invalid.\n * \n * @param scope \n */\n init(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Init, scope || this.scope);\n }\n /**\n * Generates all rendering instructions for the attribute. This method is called during the compilation phase of the ARE component and should return an array of instructions that describe how to render the attribute based on its content and context. The instructions can include details such as which DOM properties to set, which events to listen for, and how to update the attribute when the underlying data changes.\n * \n * @param scope \n */\n transform(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Transform, scope || this.scope);\n }\n /**\n * Compiles the attribute. This method should transform attribute details into a set of SceneInstructions. It may also modify attribute value, since this field is editable during runtime.\n * \n * @param scope \n */\n @A_Frame.Method({\n description: \"Compile the attribute. This method should transform attribute details into a set of SceneInstructions. It may also modify attribute value, since this field is editable during runtime.\",\n })\n compile(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Compile, scope || this.scope);\n }\n /**\n * Updates the attribute based on changes in the store or other dependencies. This method is called during the update phase of the ARE component and should perform any necessary updates to the attribute based on changes in the underlying data or context. This can include tasks such as updating DOM properties, re-evaluating expressions, or modifying event listeners to ensure that the attribute remains in sync with the current state of the application.\n * \n * @param scope \n */\n update(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Update, scope || this.scope);\n }\n /**\n * Validates the attribute's content and context. This method is called during the validation phase of the ARE component and should check whether the attribute's content is valid based on its expected format, type, or other constraints. If the content is invalid, this method should throw an error with a descriptive message to help developers identify and fix the issue.\n * \n * @param scope \n */\n validate(scope?: A_Scope): void {\n this.call(AreAttributeFeatures.Validate, scope || this.scope);\n }\n}","\n\nexport const AreNodeFeatures = {\n\n // ==============================================================================\n // Lifecycle features\n // ==============================================================================\n /**\n * Feature that is called to handle before init lifecycle of the element node\n */\n onBeforeInit: '_AreNode_onBeforeInit',\n /**\n * Feature that is called to init the element node\n */\n onInit: '_AreNode_onInit',\n /**\n * \n */\n onAfterInit: '_AreNode_onAfterInit',\n\n\n /**\n * Feature that is called to handle before mount lifecycle of the element node\n */\n onBeforeMount: '_AreNode_onBeforeMount',\n /**\n * Feature that is called to mount the element node\n */\n onMount: '_AreNode_onMount',\n /**\n * Feature that is called to handle after mount lifecycle of the element node\n */\n onAfterMount: '_AreNode_onAfterMount',\n\n\n /**\n * Feature that is called to handle before update lifecycle of the element node\n */\n onBeforeUpdate: '_AreNode_onBeforeUpdate',\n /**\n * Feature that is called to handle update lifecycle of the element node\n */\n onUpdate: '_AreNode_onUpdate',\n /**\n * Feature that is called to handle after update lifecycle of the element node\n */\n onAfterUpdate: '_AreNode_onAfterUpdate',\n\n\n /**\n * Feature that is called to handle before unmount lifecycle of the element node\n */\n onBeforeUnmount: '_AreNode_onBeforeUnmount',\n /**\n * Feature that is called to unmount the element node\n */\n onUnmount: '_AreNode_onUnmount',\n /**\n * Feature that is called to handle after unmount lifecycle of the element node\n */\n onAfterUnmount: '_AreNode_onAfterUnmount',\n\n\n /**\n * Feature that is called to handle before destroy lifecycle of the element node\n */\n onBeforeDestroy: '_AreNode_onBeforeDestroy',\n /**\n * Feature that is called to handle before destroy lifecycle of the element node\n */\n onDestroy: '_AreNode_onDestroy',\n /**\n * Feature that is called to handle after destroy lifecycle of the element node\n */\n onAfterDestroy: '_AreNode_onAfterDestroy',\n\n\n\n //=============================================================================\n // Build features\n // ==============================================================================\n /**\n * Feature that is called to tokenize the element node template and extract its content, attributes, and child nodes. \n */\n onTokenize: '_AreNode_onTokenize',\n /**\n * Feature that is called to transform the element node template, markup, styles, and data into a format that can be used for compilation. This feature is responsible for processing the raw template and extracting the necessary information to create the render plan and instructions for the node.\n */\n onTransform: '_AreNode_onTransform',\n /**\n * Event fired when the element node is interpreted\n */\n onInterpret: '_AreNode_onInterpret',\n /**\n * Feature that is called to compile the element node\n */\n onCompile: '_AreNode_onCompile',\n\n\n\n /**\n * Feature that is called to handle events\n */\n onEmit: '_AreNode_onEmit',\n\n\n} as const;\n\n\n\nexport const AreNodeStatuses = {\n /**\n * Status indicating that the node is pending compilation. When a node is in the pending status, it means that it has been created but has not yet been compiled. During this phase, the node is typically being prepared for compilation, which may involve setting up its template, markup, styles, and any associated data or context. Once the node is ready for compilation, its status will change to \"compiling\".\n */\n Pending: 'pending',\n /**\n * Status indicating that the node is in the process of being compiled. During this status, the node is being analyzed and transformed based on its template, markup, and styles to generate the necessary instructions for rendering and updating the node in the scene.\n */\n Compiling: 'compiling',\n /**\n * Status indicating that the node has been compiled and is ready to be rendered. In this status, the node has generated all the necessary instructions and is prepared to be mounted in the scene.\n */\n Compiled: 'compiled',\n /**\n * Status indicating that the node is currently mounted in the scene. When a node is mounted, it means that it has been rendered and is actively part of the scene's structure and content.\n */\n Mounted: 'mounted',\n /**\n * Status indicating that the node has been unmounted from the scene. When a node is unmounted, it means that it has been removed from the scene's structure and content, and is no longer actively rendered in the scene.\n */\n Unmounted: 'unmounted',\n} as const;","import { A_Context, A_Fragment } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\n\n\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreContext',\n description: 'Context fragment for the A-Concept Rendering Engine (ARE) framework, serving as a foundational component for managing shared state and configurations within the ARE environment. This Context uses to encapsulate global settings, resources, and utilities that can be accessed by various ARE components and entities during the rendering and interaction processes.'\n})\nexport class AreContext extends A_ExecutionContext {\n\n /**\n * The source string represents the original template or input from which the ARE scene is generated. This can be used for debugging, error reporting, or any features that require access to the raw template data. The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n protected _source: string;\n /**\n * The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n protected _roots: Array<AreNode> = [];\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n */\n protected _signalsMap: Map<string, A_SignalVector> = new Map();\n\n protected _performance = new Map<string, number>();\n protected _performanceStart = new Map<string, number>();\n protected _performanceDepth = new Map<string, number>();\n\n /**\n * The global object can be used to store any global data or configurations that need to be accessed across different components and entities within the ARE framework. This can include things like theme settings, user preferences, or any other shared data that is relevant to the entire scene or application. By centralizing this information in the context, it allows for easier management and access to global state without needing to pass it through multiple layers of components or entities.\n */\n get globals() {\n return this.get('globals') || {};\n }\n\n\n constructor(\n /**\n * The source string represents the original template or input from which the ARE scene is generated. This can be used for debugging, error reporting, or any features that require access to the raw template data. The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n source: string = ''\n ) {\n super('AreContext');\n this._source = source;\n }\n /**\n * The scope of the context, which can be used to access other entities and features within the same scope. This is particularly useful for components that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.\n */\n get scope() {\n return A_Context.scope(this);\n }\n /**\n * The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n get roots(): Array<AreNode> {\n return this._roots;\n }\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n */\n get source(): string {\n return this._source;\n }\n\n get performance(): Array<string> {\n const perfObj: Array<string> = [];\n this._performance.forEach((value, key) => {\n perfObj.push(`${key}: ${value} ms`);\n });\n return perfObj;\n }\n\n\n get stats() {\n return [\n `- Total Roots: ${this._roots.length}`,\n `- Total Nodes in Scene: ${this._roots.reduce((acc, root) => acc + this.countNodes(root), 0,)}`,\n `- Total Instructions: ${this._roots.reduce((acc, root) => acc + this.countInstructions(root), 0,)}`,\n ]\n }\n\n protected countInstructions(node: AreNode): number {\n let count = 0; // Count instructions for the current node\n // Assuming each node has a method or property that returns its instructions\n if (node.scene) {\n count += node.scene.instructions.length;\n }\n for (const child of node.children) {\n count += this.countInstructions(child); // Recursively count instructions in child nodes\n }\n return count;\n }\n\n protected countNodes(node: AreNode): number {\n let count = 1; // Count the current node\n for (const child of node.children) {\n count += this.countNodes(child); // Recursively count child nodes\n }\n return count;\n }\n\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param node \n */\n addRoot(node: AreNode) {\n this._roots.push(node);\n this.scope.register(node);\n }\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param node \n */\n removeRoot(node: AreNode) {\n this._roots = this._roots.filter(r => r.aseid.toString() !== node.aseid.toString());\n }\n\n\n\n\n startPerformance(label: string = 'default') {\n const depth = this._performanceDepth.get(label) || 0;\n this._performanceDepth.set(label, depth + 1);\n\n if (depth === 0) {\n this._performanceStart.set(label, Date.now());\n }\n }\n\n endPerformance(label: string) {\n const depth = this._performanceDepth.get(label) || 0;\n\n if (depth <= 1) {\n const startTime = this._performanceStart.get(label) || this._performanceStart.get('default');\n\n if (startTime) {\n const duration = Date.now() - startTime;\n const accumulated = this._performance.get(label) || 0;\n this._performance.set(label, accumulated + duration);\n this._performanceStart.delete(label);\n }\n\n this._performanceDepth.delete(label);\n } else {\n this._performanceDepth.set(label, depth - 1);\n }\n }\n}\n","import { A_Context, A_Entity, A_Error, A_Feature, A_FormatterHelper, A_Scope, A_TypeGuards, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreEvent } from \"@adaas/are/event/AreEvent.context\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { Are } from \"@adaas/are/component/Are.component\";\nimport { AreNodeFeatures, AreNodeStatuses } from \"./AreNode.constants\";\nimport { AreNodeNewProps, AreNodeStatusNames } from \"./AreNode.types\";\nimport { AreSyntaxTokenPayload } from \"@adaas/are/syntax/AreSyntax.types\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreNode',\n description: 'An AreNode entity represents a node within the A-Concept Rendering Engine (ARE) framework. It encapsulates content, markup, and styles, and manages its own scope for nested fragments and entities. AreNodes are responsible for handling events, compiling, rendering, updating, and lifecycle management within the ARE context.'\n})\nexport class AreNode extends A_Entity<AreNodeNewProps> {\n /**\n * The current status of the node, which can be used to track the lifecycle and rendering state of the node within the scene. \n */\n status!: AreNodeStatusNames;\n\n /**\n * The opening string that defines the start of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The opening string can include the tag name, attributes, and other syntax that indicates the beginning of a node.\n */\n protected _opening!: string;\n /**\n * The closing string that defines the end of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The closing string can include the tag name, attributes, and other syntax that indicates the end of a node.\n */\n protected _closing!: string;\n /**\n * The position of the node in the source string, which can be used for error reporting, debugging, and other purposes related to tracking the location of the node within the original source. The position is a character index identifying where the node is defined.\n */\n protected _position!: number;\n /**\n * The payload associated with the node, which can include any additional data or metadata that is extracted during the tokenization process. The payload can be used to store custom information related to the node, such as directive arguments, binding expressions, or any other relevant data that may be needed for processing and rendering the node within the scene.\n */\n protected _payload?: AreSyntaxTokenPayload\n /**\n * Content string defined for the node — the inner content between delimiters.\n * Example: `{{name}}`\n */\n protected _content!: string\n /**\n * Markup string defined for the node\n * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n */\n protected _markup!: string\n /**\n * The scope associated with this node\n * uses to store all nested fragments and entities like other AreNodes and Scene\n */\n protected _scope!: A_Scope\n\n /**\n * Actual node identifier. \n */\n get id(): string {\n return this.aseid.id;\n }\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get type(): string {\n return this.aseid.entity;\n }\n /**\n * Content string defined for the node — the inner content between delimiters.\n * Example: `{{name}}`\n */\n get content(): string {\n return this._content;\n }\n /**\n * Markup string defined for the node\n * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n */\n get markup(): string {\n return this._markup;\n }\n /**\n * The scope associated with this node\n * uses to store all nested fragments and entities like other AreNodes and Scene\n */\n get scope(): A_Scope {\n if (!this._scope) {\n this._scope = A_Context.allocate(this, new A_Scope({ name: `${this.aseid.id}-scope` }));\n }\n\n return this._scope;\n }\n /**\n * The attributes defined for the node, which can include static attributes, binding attributes, directive attributes, and event attributes. These attributes are extracted during tokenization and processed during the compilation phase to generate the corresponding SceneInstructions for rendering and updating the node in the scene.\n */\n get attributes(): AreAttribute[] {\n return this.scope.resolveFlatAll<AreAttribute>(AreAttribute);\n }\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own content, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n /**\n * The parent node of this node, which is the node that registered the current node in its scope. This is typically the node that is responsible for rendering the current node and managing its lifecycle within the scene. The parent node can be used to access shared context, propagate events, and manage interactions between nodes in a hierarchical structure.\n * \n * Example: For a node defined as `<div><span>Child Node</span></div>`, the parent node of the `<span>` element would be the `<div>` element, which is responsible for rendering the `<span>` and managing its lifecycle within the scene.\n */\n get parent(): AreNode | undefined {\n const parentIssuer = this.scope.parent?.issuer();\n\n if (!parentIssuer || !(parentIssuer instanceof AreNode)) return undefined;\n\n return parentIssuer as AreNode | undefined;\n }\n /**\n * The child nodes of this node, which are typically defined in the markup and registered in the scope as child entities. These child nodes can represent nested elements or components within the node and can have their own content, markup, styles, and features. The child nodes are managed within the scope of the parent node and can be accessed and manipulated as needed for rendering, updating, and lifecycle management.\n * \n * Example: For a node defined as `<div><span>Child Node</span></div>`, the child node would be the `<span>` element, which is registered as a child entity in the scope of the parent `<div>` node.\n */\n get children(): (AreNode)[] {\n return this.scope.resolveFlatAll<AreNode>(AreNode) || [];\n }\n /**\n * It returns the scene where the node exists, so it should be the scene of the rootNode, \n * primary parent of this node.\n */\n get scene(): AreScene {\n if (!this._scene)\n this._scene = this.scope.resolve<AreScene>(AreScene)!;\n return this._scene;\n }\n\n\n protected _scene!: AreScene;\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n this.aseid = this.generateASEID({\n id: newEntity.payload?.id,\n entity: newEntity.payload?.entity || 'node',\n scope: newEntity.payload?.scope,\n });\n\n this.status = AreNodeStatuses.Pending;\n this._content = newEntity.content || '';\n this._markup = newEntity.raw || '';\n this._opening = newEntity.opening || '';\n this._closing = newEntity.closing || '';\n this._position = newEntity.position || 0;\n this._payload = newEntity.payload;\n }\n\n\n fromASEID(aseid: string | ASEID): void {\n super.fromASEID(aseid);\n\n this._content = '';\n this._markup = '';\n this.status = AreNodeStatuses.Pending;\n }\n /**\n * Sets the content string for the node — the inner text/markup between the node's\n * opening and closing delimiters. Content is processed by the rendering engine to\n * generate the corresponding SceneInstructions for rendering the node.\n * \n * @param content \n */\n setContent(content: string): void {\n this._content = content;\n }\n /**\n * Sets the markup string for the node, which is the full raw matched string including delimiters. The markup can include HTML-like syntax, custom components, directives, and other features that are processed by the rendering engine to generate the corresponding SceneInstructions for rendering the node.\n * \n * @param markup \n */\n setMarkup(markup: string): void {\n this._markup = markup;\n }\n /**\n * Adds a child node to the current node's scope and ensures the child inherits from this node's scope.\n * \n * @param child - The node to add as a child\n */\n addChild(child: AreNode): void {\n this.scope.register(child);\n\n if (!child.scope.isInheritedFrom(this.scope))\n child.scope.inherit(this.scope);\n }\n /**\n * Removes a child node from the current node's scope. This is typically used when a child node is no longer needed or should be detached from the parent node. The method ensures that the child node is properly deregistered from the scope and any associated resources are cleaned up as necessary.\n * \n * @param node - The child node to be removed from the current node's scope\n */\n removeChild(node: AreNode): void {\n this.scope.deregister(node);\n }\n\n // ============================================================================================\n // Node Lifecycle Methods\n // ============================================================================================\n /**\n * Executes initialization logic for the node, which typically involves setting up the node's scope, registering any necessary entities, and preparing the node for rendering and interaction within the scene. This method is called during the initial phase of the node's lifecycle and is responsible for ensuring that the node is properly initialized before it is compiled and rendered in the scene.\n */\n init(): void {\n\n // const context = this.scope.resolve(AreContext);\n\n // context?.startPerformance('Node Init');\n this.call(AreNodeFeatures.onBeforeInit, this.scope);\n this.call(AreNodeFeatures.onInit, this.scope);\n this.call(AreNodeFeatures.onAfterInit, this.scope);\n // context?.endPerformance('Node Init');\n }\n\n\n /**\n * Loads the node, which typically involves executing any necessary setup or initialization logic to prepare the node for rendering and interaction within the scene. This may include processing the node's content, markup, styles, and features to generate the corresponding SceneInstructions, as well as setting up any event listeners or reactive properties as needed.\n */\n async load(): Promise<any> {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Load');\n\n const res = super.load(this.scope);\n\n context?.endPerformance('Node Load');\n\n return res;\n } catch (error) {\n throw error;\n }\n }\n /**\n * Tokenizes the node content, which typically involves parsing the raw content string to identify the structure, child nodes, attributes, directives, and other features. This process is essential for breaking down the content into its constituent parts and preparing it for further processing during the compilation phase. The tokenization process can involve creating child nodes, extracting attributes and their values, and identifying any directives or bindings that need to be processed during rendering.\n */\n tokenize(): void {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Tokenize');\n this.call(AreNodeFeatures.onTokenize, this.scope);\n context?.endPerformance('Node Tokenize');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Transforms the node, which typically involves executing any necessary logic to reshape the node's structure or content before it is compiled and rendered in the scene. This may include applying any transformations defined by directives, processing any dynamic content or expressions, and performing any other necessary tasks to ensure that the node is properly prepared for compilation and rendering based on its content, markup, styles, and features.\n */\n transform(): void {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Transform');\n\n this.call(AreNodeFeatures.onTransform, this.scope);\n\n context?.endPerformance('Node Transform');\n } catch (error) {\n throw error;\n }\n }\n\n /**\n * Compile the node. This method should transform the node's content, markup, and styles into a set of SceneInstructions that can be executed to render the node in the scene. The compile method is responsible for processing the node's features, attributes, directives, and other properties to generate the necessary instructions for rendering and updating the node in response to changes in state or context.\n * \n * [!] Note: The compile method should ensure that the node's scope is properly inherited from the context scope before processing, and it should handle any errors that may occur during compilation to ensure that the node can be rendered correctly in the scene.\n */\n compile(): void {\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Compile');\n\n this.call(AreNodeFeatures.onCompile, this.scope);\n\n context?.endPerformance('Node Compile');\n } catch (error) {\n throw error;\n }\n }\n /**\n * Mounts the node, which typically involves executing any necessary logic to render the node in the scene and to set up any interactions or behaviors associated with the node. This may include applying the generated SceneInstructions from the compile phase, attaching event listeners, and performing any other necessary tasks to ensure that the node is properly rendered and functional within the scene.\n * \n * [!] Note: The mount method should ensure that the node's scope is properly inherited from the context scope before performing any mounting logic, and it should handle any errors that may occur during mounting to ensure that the node can be rendered correctly in the scene.\n */\n mount(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Mount');\n\n this.call(AreNodeFeatures.onBeforeMount, this.scope);\n this.call(AreNodeFeatures.onMount, this.scope);\n this.call(AreNodeFeatures.onAfterMount, this.scope);\n\n context?.endPerformance('Node Mount');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Interprets the node, which typically involves executing any necessary logic to process the node's features, attributes, directives, and other properties to generate the corresponding SceneInstructions for rendering and updating the node in response to changes in state or context. This method is responsible for ensuring that the node is properly interpreted based on its content, markup, styles, and features to enable dynamic behavior and responsiveness within the scene.\n * \n * [!] Note: The interpret method should NOT go though own child, since it may be used by both mount and update operations!\n */\n interpret(): void {\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Interpret');\n\n this.call(AreNodeFeatures.onInterpret, this.scope);\n\n context?.endPerformance('Node Interpret');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Updates the node, which typically involves executing any necessary logic to update the node's rendering and behavior in response to changes in state, context, or other factors. This may include reapplying SceneInstructions, updating event listeners, and performing any other necessary tasks to ensure that the node remains functional and correctly rendered within the scene as changes occur.\n * \n * [!] Note: The update method should ensure that the node's scope is properly inherited from the context scope before performing any update logic, and it should handle any errors that may occur during updating to ensure that the node can be updated correctly in the scene.\n */\n update(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Update');\n this.call(AreNodeFeatures.onBeforeUpdate, this.scope);\n this.call(AreNodeFeatures.onUpdate, this.scope);\n this.call(AreNodeFeatures.onAfterUpdate, this.scope);\n\n context?.endPerformance('Node Update');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Unmounts the node, which typically involves executing any necessary logic to remove the node from the scene and to clean up any resources associated with the node. This may include reverting any applied SceneInstructions, detaching event listeners, and performing any other necessary tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n * \n * [!] Note: The unmount method should ensure that the node's scope is properly inherited from the context scope before performing any unmounting logic, and it should handle any errors that may occur during unmounting to ensure that the node can be removed correctly from the scene.\n */\n unmount(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Unmount');\n\n this.call(AreNodeFeatures.onBeforeUnmount, this.scope);\n this.call(AreNodeFeatures.onUnmount, this.scope); \n this.call(AreNodeFeatures.onAfterUnmount, this.scope);\n\n context?.endPerformance('Node Unmount');\n\n } catch (error) {\n throw error;\n }\n }\n\n cloneWithScope<T extends AreNode = AreNode>(this: T): T {\n const currentScope = this.scope;\n\n A_Context.deallocate(currentScope);\n\n const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n opening: this._opening,\n closing: this._closing,\n position: this._position,\n payload: this._payload || {},\n content: this._content,\n raw: this._markup,\n });\n\n if (newNode._scope)\n A_Context.deallocate(newNode._scope);\n\n newNode._scope = currentScope;\n\n A_Context.allocate(newNode, currentScope);\n\n this._scope = A_Context.allocate(this);\n\n return newNode as T;\n }\n\n reset(): void {\n for (const child of this.children) {\n this.scope.deregister(child);\n }\n\n for (const attribute of this.attributes) {\n this.scope.deregister(attribute);\n }\n }\n\n clone<T extends AreNode = AreNode>(this: T): T {\n const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n opening: this._opening,\n closing: this._closing,\n position: this._position,\n payload: this._payload || {},\n content: this._content,\n raw: this._markup,\n });\n\n /**\n * Clone all content\n */\n for (const child of this.children) {\n newNode.addChild(child.clone());\n }\n /**\n * Clone all attributes\n */\n for (const attribute of this.attributes) {\n newNode.scope.register(attribute.clone());\n }\n\n return newNode as T;\n }\n\n /**\n * Emits an event or a scope to the node, which can be used to trigger event handlers or to provide additional context for processing within the node. The method can accept either an AreEvent instance or an A_Scope instance, and it will handle the emission accordingly. This allows for flexible communication and interaction within the node's context, enabling dynamic behavior and responsiveness based on events or changes in scope.\n * \n * @param scope - The scope or event to be emitted to the node\n */\n async emit(\n scope: A_Scope,\n )\n async emit(\n event: AreEvent,\n )\n async emit(\n eventOrScope: AreEvent | A_Scope,\n ) {\n this.checkScopeInheritance();\n\n /**\n * isolated event scope to avoid polluting the node scope\n */\n const eventScope = A_TypeGuards.isScopeInstance(eventOrScope)\n ? eventOrScope\n .inherit(this.scope)\n : new A_Scope({\n name: `${eventOrScope.name}-scope`,\n fragments: [eventOrScope]\n })\n .inherit(this.scope)\n\n try {\n await this.call(AreNodeFeatures.onEmit, eventScope)\n\n eventScope.destroy()\n\n } catch (error) {\n eventScope.destroy();\n\n throw error;\n }\n\n }\n\n\n /**\n * Destroys the node, which typically involves executing any necessary cleanup logic to remove the node from the scene and to free up any resources associated with the node. This may include deregistering the node from its scope, removing any event listeners or reactive properties, and performing any other necessary cleanup tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n * \n * [!] Note: The destroy method should ensure that the node's scope is properly inherited from the context scope before performing any cleanup, and it should handle any errors that may occur during destruction to ensure that resources are released correctly.\n */\n async destroy(): Promise<any> {\n this.checkScopeInheritance();\n try {\n\n await super.destroy(this.scope);\n\n this.scope.destroy();\n\n } catch (error) {\n\n this._scope.destroy();\n\n throw error;\n }\n }\n\n\n //============================================================================================\n // Helpers Methods\n //============================================================================================\n /**\n * Method to ensure that the current scope is inherited from the context scope\n * \n * @throws A_Error if the scope is not inherited from the context scope\n */\n protected checkScopeInheritance(): void {\n let attachedScope: A_Scope;\n\n try {\n attachedScope = A_Context.scope(this);\n } catch (error) {\n throw new A_Error({\n title: `A_UI_Node Scope Inheritance Error`,\n description: `The A_UI_Node entity with ASEID '${this.aseid.toString()}' is not bound to any context scope. Please ensure that the entity is created within a valid context.`,\n originalError: error\n });\n }\n }\n}","import { A_Frame } from \"@adaas/a-frame\"\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\"\n\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreEvent',\n description: 'Event context for managing events within the A-Concept Rendering Engine (ARE) framework, encapsulating event data and associated nodes to facilitate event-driven interactions.'\n})\nexport class AreEvent<\n T extends Record<string, any> = Record<string, any>\n> extends A_ExecutionContext<T> {\n\n}","import { A_ComponentMeta, A_TYPES__ComponentMeta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport type { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport type { Are } from \"@adaas/are/component/Are.component\";\n\n\nexport class AreSignalsMeta extends A_ComponentMeta<{\n vectorToComponent: Map<A_SignalVector, A_TYPES__Ctor<Are>>;\n componentToVector: Map<A_TYPES__Ctor<Are>, Set<A_SignalVector>>;\n} & A_TYPES__ComponentMeta> {\n\n\n registerCondition<T extends Are>(component: A_TYPES__Ctor<T>, vector: A_SignalVector) {\n const vectorToComponent = this.get('vectorToComponent') || new Map<A_SignalVector, A_TYPES__Ctor<T>>();\n const componentToVector = this.get('componentToVector') || new Map<A_TYPES__Ctor<T>, Set<A_SignalVector>>();\n\n vectorToComponent.set(vector, component);\n if (!componentToVector.has(component)) {\n componentToVector.set(component, new Set<A_SignalVector>());\n }\n componentToVector.get(component)?.add(vector);\n\n this.set('vectorToComponent', vectorToComponent);\n this.set('componentToVector', componentToVector);\n }\n\n\n findComponentByVector(vector: A_SignalVector): A_TYPES__Ctor<Are> | undefined {\n\n /**\n * 1. try simple lookup\n */\n const vectorToComponent = this.get('vectorToComponent');\n\n if (vectorToComponent) {\n const component = vectorToComponent.get(vector);\n if (component) {\n return component;\n }\n }\n\n /**\n * 2. fallback to checking for matching vectors in the map (handles cases where vector instances differ but are logically equivalent)\n */\n if (vectorToComponent) {\n\n /**\n * 2.1 Priority 1: Full Equivalence - find a component whose registered vector is fully equivalent to the provided vector (i.e., all signals match in type and data).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.equals(registeredVector)) {\n return component;\n }\n }\n /**\n * 2.2 Priority 2: Logical Match - find a component whose registered vector logically matches the provided vector (i.e., all signals match in type and data, but order may differ).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.match(registeredVector)) {\n return component;\n }\n }\n /**\n * 2.3 Priority 3: Inclusion - find a component whose registered vector includes all signals from the provided vector (i.e., the provided vector is a subset of the registered vector).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.includes(registeredVector)) {\n return component;\n }\n }\n }\n\n return undefined;\n }\n\n}","import { A_Context, A_Fragment, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Signal, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { Are } from \"@adaas/are/component/Are.component\";\nimport { AreSignalsContextConfig } from \"./AreSignals.types\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreSignalsMeta } from \"./AreSignals.meta\";\nimport { AreSignals } from \"./AreSignals.component\";\n\n\n\n@A_Frame.Fragment({\n description: 'AreSignalsContext is a fragment that manages the set of root nodes subscribed to the signal bus. It tracks which Are components should receive signal vectors from AreSignals and provides the subscriber registry used during signal dispatch.'\n})\nexport class AreSignalsContext<\n T extends Are = Are\n> extends A_Fragment {\n\n /**\n * Where key is the root ID and the value is an Array of components that participate in conditional compilation.\n */\n protected _componentMap: Map<string, Set<A_TYPES__Ctor<T>>> = new Map();\n\n protected _defaultsMap: Map<string, A_TYPES__Ctor<T>> = new Map();\n\n protected _conditionsMap: Map<string, Array<{\n vector: Array<any>;\n component: A_TYPES__Ctor<T>;\n }>> = new Map();\n\n\n protected _subscribers: Set<AreNode> = new Set();\n\n\n protected signalsMeta() {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n if (!signalsMeta) {\n throw new Error('AreSignalsMeta not found in context. Please ensure that AreSignalsMeta is properly registered in the A-Concept context.');\n }\n return signalsMeta;\n }\n\n subscribe<S extends AreNode>(subscriber: S) {\n this._subscribers.add(subscriber);\n }\n\n unsubscribe<S extends AreNode>(subscriber: S) {\n this._subscribers.delete(subscriber);\n }\n\n get subscribers(): Set<AreNode> {\n return this._subscribers;\n }\n\n constructor(\n /**\n * Where key is the root ID and the value is an Array of components that participate in conditional compilation.\n */\n config?: Partial<AreSignalsContextConfig<T>>\n ) {\n super({ name: 'AreSignalsContext' });\n // Initialize the map with the provided config\n\n const configEntries = config ? Object.entries(config) : [];\n\n for (const [rootId, conf] of configEntries) {\n const def = conf?.default;\n const pool = conf?.pool || [];\n const conditions = conf?.conditions || [];\n\n this._componentMap.set(rootId, new Set(pool));\n\n if (def)\n this._defaultsMap.set(rootId, def);\n\n this._conditionsMap.set(rootId, conditions);\n }\n\n }\n\n\n /**\n * Returns the components associated with the given ID. If no components are found, returns an empty array.\n * \n * @param id The ID of the component group.\n * @returns An array of component constructors.\n */\n getComponentById(id: string): Array<A_TYPES__Ctor<T>> {\n const set = this._componentMap.get(id) || new Set();\n return Array.from(set);\n }\n\n /**\n * Returns the components associated with the root ID of the given node. If no components are found, returns an empty array.\n * \n * @param node The AreNode whose root ID is used to retrieve the components.\n * @returns An array of component constructors.\n */\n getComponentByRoot(node: AreNode): Array<A_TYPES__Ctor<T>> {\n return this.getComponentById(node.id);\n }\n\n /**\n * Adds a new component to the specified root ID. If the root ID does not exist, it will be created.\n * \n * @param rootId The ID of the root component group.\n * @param components An array of component constructors to add.\n */\n extendRoot(rootId: string, components: Array<A_TYPES__Ctor<T>>) {\n if (!this._componentMap.has(rootId)) {\n this._componentMap.set(rootId, new Set());\n }\n const set = this._componentMap.get(rootId)!;\n for (const comp of components) {\n set.add(comp);\n }\n }\n\n /**\n * Whether routing is configured for the given root ID.\n * When false, the root should leave its original template content untouched.\n * \n * @param rootId The id attribute of the <are-root> element.\n */\n hasRoot(rootId: string): boolean {\n return this._componentMap.has(rootId) || this._conditionsMap.has(rootId);\n }\n\n /**\n * Returns the default component associated with the given root ID, if any.\n * \n * @param rootId The ID of the root component group.\n */\n getDefault(rootId: string): A_TYPES__Ctor<T> | undefined {\n return this._defaultsMap.get(rootId);\n }\n\n /**\n * Finds the matching component for the given root ID and incoming signal vector.\n * \n * Matching priorities (mirroring AreSignalsMeta):\n * 1. Full equivalence — vector.equals(conditionVector)\n * 2. Logical match — vector.match(conditionVector)\n * 3. Inclusion — incoming vector contains every signal type from condition, checked with signal.compare()\n * \n * @param rootId The id attribute of the <are-root> element.\n * @param vector The incoming signal vector from the bus.\n */\n findComponentByVector(rootId: string, vector: A_SignalVector): A_TYPES__Ctor<T> | undefined {\n const conditions = this._conditionsMap.get(rootId) || [];\n\n for (const condition of conditions) {\n const conditionVector = new A_SignalVector(condition.vector as A_Signal[]);\n\n // Priority 1: full equivalence\n if (vector.equals(conditionVector as any)) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n for (const condition of conditions) {\n const conditionVector = new A_SignalVector(condition.vector as A_Signal[]);\n\n // Priority 2: logical match (order-independent, same data)\n if (vector.match(conditionVector as any)) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n for (const condition of conditions) {\n // Priority 3: inclusion — every signal type in condition is present in the incoming\n // vector WITH data comparison via signal.compare()\n const allMatch = condition.vector.every((condSignal: A_Signal) => {\n for (const incomingSignal of vector) {\n if(!incomingSignal)\n continue;\n if (\n incomingSignal.constructor === condSignal.constructor &&\n condSignal.compare(incomingSignal)\n ) {\n return true;\n }\n }\n return false;\n });\n\n if (allMatch) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n return undefined;\n }\n\n}\n\n","import { A_Caller, A_Component, A_Feature, A_Inject, A_Meta, A_Scope } from \"@adaas/a-concept\";\nimport { A_SignalBusFeatures, A_SignalState, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreEvent } from \"@adaas/are/event/AreEvent.context\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreSignalsMeta } from \"./AreSignals.meta\";\nimport { AreSignalsContext } from \"./AreSignals.context\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreSignals',\n description: 'AreSignals is the central signal bus component within the ARE framework. It listens for incoming signal vectors and dispatches them to all subscribed root nodes, enabling reactive, event-driven rendering and lifecycle management across the component tree.'\n})\n@A_Meta.Define(AreSignalsMeta)\nexport class AreSignals extends A_Component {\n\n @A_Feature.Extend({\n name: A_SignalBusFeatures.onNext,\n })\n async handleSignalVector(\n @A_Inject(A_SignalVector) vector: A_SignalVector,\n @A_Inject(AreSignalsContext) context: AreSignalsContext,\n @A_Inject(A_SignalState) state: A_SignalState,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n logger?.debug(`Handling Signal Vector with ${context.subscribers.size} root nodes.`, vector);\n\n try {\n for (const root of context.subscribers) {\n\n const callScope = new A_Scope({\n fragments: [new AreEvent(\n AreFeatures.onSignal, {\n vector\n })]\n })\n .import(scope, root.scope);\n\n logger?.debug('Emitting signal for root node:', vector);\n\n await root.emit(callScope);\n\n callScope.destroy();\n }\n } catch (error) {\n logger?.error(error);\n }\n }\n\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Event Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles events triggered on the AreNode\n * \n * @param node \n * @param scope \n * @param event \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onEmit,\n scope: [AreNode]\n })\n async propagateEvent(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreEvent) event: AreEvent,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n let currentNode = node;\n let target = node;\n\n while (currentNode && currentNode.parent) {\n if (currentNode.component) {\n target = currentNode;\n break;\n }\n currentNode = currentNode.parent;\n }\n\n if (target.component)\n await feature.chain(target.component, event.name, scope);\n }\n}","import { A_ComponentMeta, A_TYPES__ComponentMeta } from \"@adaas/a-concept\";\nimport type { A_SignalVector } from \"@adaas/a-utils/a-signal\";\n\n\n\n/**\n * The AreMeta class serves as a metadata container for components within the A-Concept Rendering Engine (ARE) framework. It extends the base A_ComponentMeta class and includes additional properties and features specific to ARE components. The AreMeta class can be used to define and manage metadata for ARE components, such as their template, styles, data, and signal handling logic, allowing for a structured and organized way to manage component behavior and interactions within the ARE environment.\n */\nexport class AreMeta<T extends Record<string, any> = Record<string, any>> extends A_ComponentMeta<T & A_TYPES__ComponentMeta> {\n\n /**\n * Optional property to store a signal vector associated with the component. This can be used to manage and handle signals emitted by the component or other parts of the application, allowing for dynamic interactions and responsive behavior based on changes in the application state or user input.\n */\n vector?: A_SignalVector\n\n}","import { A_Component, A_Context, A_Feature, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Signal, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { AreSignals } from \"@adaas/are/signals/AreSignals.component\";\nimport { AreSignalsMeta } from \"@adaas/are/signals/AreSignals.meta\";\nimport { ArePropDefinition } from \"./Are.types\";\nimport { AreMeta } from \"./Are.meta\";\nimport { AreFeatures } from \"./Are.constants\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'Are',\n description: 'Base component class for A-Concept Rendering Engine (ARE) components. It provides lifecycle decorators and methods for defining templates, styles, and data, facilitating the creation of dynamic and interactive UI components within the ARE framework.'\n})\n@A_Meta.Define(AreMeta)\nexport class Are extends A_Component {\n /**\n * Allows to apply Signal Vector as a condition for rendering the component. The component will be rendered only if at least one of the signals in the vector is active. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param signals \n * @returns \n */\n static Condition(vector: A_SignalVector)\n static Condition(vector: Array<A_Signal>)\n static Condition(signals: Array<A_Signal> | A_SignalVector) {\n return function <TTarget extends A_TYPES__Ctor<Are>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const componentMeta = A_Context.meta<AreMeta>(target);\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n\n let vector: A_SignalVector | undefined;\n\n switch (true) {\n case signals instanceof A_SignalVector:\n vector = signals;\n break;\n case Array.isArray(signals):\n vector = new A_SignalVector(signals);\n break;\n default:\n throw new Error('Invalid input for Are.Condition. Expected an array of A_Signal or an instance of A_SignalVector.');\n }\n\n if (vector) {\n componentMeta.vector = vector;\n signalsMeta.registerCondition(target, vector);\n }\n\n return target;\n };\n }\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get EventHandler() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: propertyKey,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get onBeforeInit() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeInit,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's initialization logic. This method is called after the component is instantiated but before it is rendered, and can be used to set up any necessary state, perform data fetching, or execute any other logic that needs to happen before the component is rendered for the first time.\n */\n static get onAfterInit() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterInit,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's mounting logic. This method is called after the component has been rendered and added to the DOM, and can be used to perform any necessary setup or initialization that requires access to the DOM elements of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the mounting process.\n */\n static get onBeforeMount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeMount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is mounted. This method is called after the component has been rendered and added to the DOM, and can be used to perform any necessary setup or initialization that requires access to the DOM elements of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-mounting process.\n */\n static get onAfterMount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterMount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's unmounting logic. This method is called before the component is removed from the DOM, and can be used to perform any necessary cleanup or teardown, such as removing event listeners, canceling timers, or releasing any resources that were allocated during the component's lifecycle. It can also be used to implement custom logic for handling specific features or behaviors of the component during the unmounting process.\n */\n static get onBeforeUnmount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeUnmount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is unmounted. This method is called after the component has been removed from the DOM, and can be used to perform any necessary cleanup or teardown that needs to happen after the component is no longer in the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-unmounting process.\n */\n static get onAfterUnmount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterUnmount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's update logic. This method is called whenever the component's state changes and can be used to perform any necessary updates or side effects based on the new state. It can also be used to optimize performance by implementing custom logic for determining when the component should re-render based on specific state changes.\n */\n static get onBeforeUpdate() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeUpdate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component's state has been updated. This method is called after the component has re-rendered in response to state changes, and can be used to perform any necessary side effects or additional updates based on the new state. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-update process.\n */\n static get onAfterUpdate() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterUpdate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get Template() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onTemplate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's styles. This method should return a string representing the CSS styles of the component. The styles can include dynamic content and can be processed during rendering to apply the appropriate styles to the component's DOM elements.\n */\n static get Styles() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onStyles,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's data. This method should return an object representing the initial state of the component. The data can include any properties that are needed to manage the component's state and can be reactive, allowing the component to re-render when the data changes.\n */\n static get Data() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onData,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for handling signals emitted by the component or other parts of the application. This method can be used to implement custom logic for responding to specific signals, such as user interactions, state changes, or other events that may affect the component's behavior or appearance. By defining this method, developers can create more dynamic and interactive components that can react to changes in the application state or user input in a flexible and efficient way.\n */\n static get Signal() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onSignal,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n // ==================================================================================\n // ========================= COMPONENT PROPERTIES ===================================\n // ==================================================================================\n /**\n * Props can be used to store any additional data or configuration for the component. They are not reactive by default but can be used in the component's methods and lifecycle hooks to manage state or pass information. Props can be defined as a simple object with key-value pairs, where keys are the prop names and values are the prop values. They can be accessed and modified within the component's methods to influence rendering or behavior based on the component's state or external inputs.\n */\n props: Record<string, ArePropDefinition> = {};\n\n\n // ==================================================================================\n // ========================= COMPONENT METHODS ======================================\n // ==================================================================================\n /**\n * Returns the template string for the component\n * \n * Could be overridden to provide dynamic templates based on component state\n * \n * @returns \n */\n @Are.Template\n template(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n\n /**\n * Returns the styles string for the component\n * \n * Could be overridden to provide dynamic styles based on component state\n * \n * @returns \n */\n @Are.Styles\n styles(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n\n /**\n * Returns the data object for the component\n * \n * Uses as the initial state of the component\n * \n * @returns \n */\n @Are.Data\n data(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n}","import { A_Fragment } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreSyntaxCompiledExpression, AreSyntaxInitOptions, AreSyntaxTokenRules } from \"./AreSyntax.types\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreSyntaxContext',\n description: 'Context that defines the syntax rules and structures for the A-Concept Rendering Engine (ARE). It provides mechanisms for parsing and interpreting templates, attributes, directives, interpolations, and event listeners, enabling dynamic and interactive UI rendering within the ARE framework.'\n})\nexport class AreSyntax extends A_Fragment {\n /**\n * Max allowed length of an expression string to prevent excessively long inputs that could lead to performance issues or abuse.\n */\n private readonly MAX_LENGTH = 500\n /**\n * Max allowed nesting depth of parentheses, brackets, and braces in expressions to prevent excessively complex inputs that could lead to performance issues or abuse. Default is 5 levels of nesting.\n */\n private readonly MAX_DEPTH = 5\n /**\n * List of regex patterns that are blocked in expressions to prevent access to unsafe or sensitive features. This includes patterns for global objects, functions, and syntax that could be used for malicious purposes (e.g. \"eval\", \"Function\", \"fetch\", \"XMLHttpRequest\", \"import\", \"require\", \"document\", \"window\", \"globalThis\", \"global\", \"process\", \"__proto__\", \"constructor\", \"prototype\"). Expressions containing any of these patterns will be rejected during validation.\n */\n private readonly BLOCKED_PATTERNS: RegExp[] = [\n /\\beval\\b/,\n /\\bFunction\\b/,\n /\\bfetch\\b/,\n /\\bXMLHttpRequest\\b/,\n /\\bimport\\b/,\n /\\brequire\\b/,\n /\\bdocument\\b/,\n /\\bwindow\\b/,\n /\\bglobalThis\\b/,\n /\\bglobal\\b/,\n /\\bprocess\\b/,\n /\\b__proto__\\b/,\n /\\bprototype\\b/,\n /\\bconstructor\\b/,\n /\\bObject\\s*\\.\\s*assign\\b/,\n /\\bObject\\s*\\.\\s*defineProperty\\b/,\n /\\bsetTimeout\\b/,\n /\\bsetInterval\\b/,\n /\\blocalStorage\\b/,\n /\\bsessionStorage\\b/,\n /\\bcookie\\b/,\n /\\bWebSocket\\b/,\n /\\bWorker\\b/,\n ]\n /**\n * Set of global identifiers that are blocked in expressions to prevent access to unsafe or sensitive features. This includes global objects and functions that could be used for malicious purposes (e.g. \"eval\", \"Function\", \"fetch\", \"XMLHttpRequest\", \"document\", \"window\", \"globalThis\", \"global\", \"process\", \"setTimeout\", \"setInterval\", \"localStorage\", \"sessionStorage\", \"indexedDB\", \"WebSocket\", \"Worker\"). Accessing any of these identifiers in an expression will be rejected during validation.\n */\n private readonly BLOCKED_GLOBALS = new Set([\n 'eval', 'Function', 'fetch', 'XMLHttpRequest',\n 'document', 'window', 'globalThis', 'global', 'process',\n 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',\n 'localStorage', 'sessionStorage', 'indexedDB',\n 'WebSocket', 'Worker', 'Blob', 'File',\n 'require', 'module', 'exports',\n 'alert', 'confirm', 'prompt',\n ])\n /**\n * Regex pattern that defines the allowed characters in expressions. This pattern allows letters, digits, whitespace, and common operators and punctuation used in JavaScript expressions. Expressions containing characters that do not match this pattern will be rejected during validation to prevent injection of potentially harmful code.\n */\n private readonly ALLOWED_CHARS = /^[\\w\\s\\d\\.\\[\\]()=><|&!+\\-*/%?:,'\"`;~^$]+$/\n /**\n * Simple dot-path identifier pattern (e.g. \"name\", \"user.name\", \"user.profile.name\").\n * Matches strings that consist solely of identifier characters separated by dots.\n */\n private readonly SIMPLE_PATH = /^[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*$/\n /**\n * Compiled expression — a pre-parsed function ready for repeated execution.\n * Created once via compile(), reused on every apply/click.\n */\n\n private readonly _rules: AreSyntaxTokenRules[]\n private readonly _trimWhitespace: boolean\n private readonly _strictMode: boolean\n\n constructor(config?: Partial<AreSyntaxInitOptions>) {\n super({ name: 'AreSyntax' })\n\n this._trimWhitespace = config?.trimWhitespace !== false\n this._strictMode = config?.strictMode !== false\n this._rules = [...(config?.rules ?? [])].sort((a, b) =>\n (b.priority ?? 0) - (a.priority ?? 0)\n )\n }\n /**\n * Get the array of token rules that define the syntax for parsing templates. Each rule specifies how to identify and process a particular type of token (e.g. interpolation, directive, comment) within templates. The rules are checked in order of priority, allowing for flexible and customizable parsing behavior.\n */\n get rules() {\n return this._rules\n }\n /**\n * Indicates whether leading and trailing whitespace should be trimmed from token content. When enabled, any whitespace at the start or end of the content captured by a token will be removed before further processing. This can help prevent issues with unintended spaces affecting rendering or logic, especially in cases like interpolations or directives where extra whitespace may be common. Default is true.\n */\n get trimWhitespace() {\n return this._trimWhitespace\n }\n /**\n * Indicates whether the parser should throw an error when it encounters unclosed tokens. When enabled, if the parser finds an opening delimiter without a corresponding closing delimiter (e.g. an unclosed interpolation or directive), it will throw an error instead of silently ignoring it. This can help catch syntax errors and ensure that templates are well-formed. Default is true.\n */\n get strictMode() {\n return this._strictMode\n }\n\n\n\n /**\n * Compiles an expression string into a reusable executor.\n * Performs validation and Function construction once.\n * Use when the same expression will be evaluated multiple times\n * e.g. event handlers, instructions that re-apply on store changes.\n *\n * @example\n * // compile once at apply() time\n * const compiled = AreCommonHelper.compile('(e) => !!pageTitle ? $testHandler(e, item) : null')\n *\n * // execute on every click — no re-parsing, no re-validation\n * element.addEventListener('click', (e) => {\n * const fn = compiled.execute(store, { $testHandler: handler, item })\n * if (typeof fn === 'function') fn(e)\n * })\n */\n compile(expr: string): AreSyntaxCompiledExpression {\n const trimmed = expr.trim()\n\n // validate once — throws if expression is unsafe or malformed\n this.validate(trimmed)\n\n const isCallable = this.isCallableExpression(trimmed)\n const isSimplePath = this.SIMPLE_PATH.test(trimmed)\n\n // pre-build the Function once — most expensive part\n let compiled: Function | null = null\n\n if (!isSimplePath) {\n try {\n compiled = new Function('scope', `\"use strict\"; with(scope) { return (${trimmed}) }`)\n } catch (e) {\n throw new Error(`Expression syntax error in \"${trimmed}\": ${(e as Error).message}`)\n }\n }\n\n const createSandboxFn = this.createSandbox.bind(this)\n\n return {\n isCallable,\n\n execute(store: AreStore, scope?: Record<string, any>): any {\n // fast path — simple property path, no sandbox needed\n if (isSimplePath) {\n if (scope && trimmed in scope) return scope[trimmed]\n const value = store.get(trimmed)\n if (value !== undefined) return value\n // fall through to sandbox if store didn't resolve it\n }\n\n const sandbox = createSandboxFn(store, scope)\n\n let result: any\n try {\n result = compiled\n ? compiled(sandbox)\n : new Function('scope', `\"use strict\"; with(scope) { return (${trimmed}) }`)(sandbox)\n } catch (e) {\n throw new Error(`Expression evaluation error in \"${trimmed}\": ${(e as Error).message}`)\n }\n\n if (isCallable && typeof result !== 'function') {\n throw new Error(\n `Expression \"${trimmed}\" was expected to be callable — got ${result === null ? 'null' : typeof result}`\n )\n }\n\n return result\n }\n }\n }\n /**\n * Evaluates an expression string against the provided store.\n * Automatically determines whether the result should be callable\n * based on the shape of the expression.\n *\n * Returns the raw value for plain expressions (interpolations, bindings).\n * Returns a bound function for callable expressions (event handlers).\n *\n * @param expr Expression string to evaluate.\n * @param store AreStore used for identifier resolution.\n * @param scope Optional extra bindings checked **before** the store.\n * Useful for injecting event-specific values (`$event`, `element`)\n * or emit wrappers (`$handleClick`).\n *\n * @example\n * // simple value\n * evaluate('user.name', store)\n *\n * // with emit wrapper\n * evaluate('$handleClick($event, user.name)', store, {\n * $event: domEvent,\n * $handleClick: (...args) => node.emit(new AreEvent('handleClick', args)),\n * })\n *\n * // arrow with conditional\n * evaluate('(e) => isValid(user.name) ? $handleClick(e) : null', store, {\n * $handleClick: (...args) => node.emit(new AreEvent('handleClick', args)),\n * })\n */\n evaluate(expr: string, store: AreStore, scope?: Record<string, any>): any {\n const trimmed = expr.trim()\n\n this.validate(trimmed)\n\n /**\n * Fast path: if the expression is a simple property path (e.g. \"name\", \"user.name\"),\n * resolve it directly — first from scope, then from the store — without going\n * through the sandbox/Function constructor.\n */\n if (this.SIMPLE_PATH.test(trimmed)) {\n if (scope && trimmed in scope) return scope[trimmed]\n\n const value = store.get(trimmed)\n if (value !== undefined) return value\n\n /**\n * If the full dot-path didn't resolve, fall back to the sandbox approach\n * in case the store holds a nested object under the first key.\n */\n }\n\n const sandbox = this.createSandbox(store, scope)\n const result = this.execute(trimmed, sandbox)\n\n if (this.isCallableExpression(trimmed)) {\n if (typeof result !== 'function') {\n throw new Error(\n `Expression \"${trimmed}\" was expected to be callable — got ${result === null ? 'null' : typeof result}`\n )\n }\n }\n\n return result\n }\n\n /**\n * Extracts $-prefixed handler names from an expression.\n * These represent event emission targets, not store references.\n *\n * Examples:\n * \"$handleClick\" → Set([\"handleClick\"])\n * \"$handleClick(user.name)\" → Set([\"handleClick\"])\n * \"(e) => isValid(user.name) ? $handleClick(e) : null\" → Set([\"handleClick\"])\n */\n extractEmitHandlers(expr: string): Set<string> {\n const stripped = expr.trim().replace(/'[^']*'|\"[^\"]*\"|`[^`]*`/g, '\"\"')\n const handlers = new Set<string>()\n const pattern = /\\$([a-zA-Z_][\\w$]*)/g\n let match: RegExpExecArray | null\n\n while ((match = pattern.exec(stripped)) !== null) {\n handlers.add(match[1])\n }\n\n return handlers\n }\n\n // ── Classification ────────────────────────────────────────────────────────\n\n private isCallableExpression(expr: string): boolean {\n // arrow function: () => ... or x => ...\n if (/^\\(?[\\w\\s,]*\\)?\\s*=>/.test(expr)) return true\n\n // function keyword: function(...) { }\n if (/^function\\s*\\(/.test(expr)) return true\n\n // plain identifier with no operators — could be a function ref\n // but only if it resolves to a function — we let the guard handle it\n // so we don't classify this as callable upfront\n return false\n }\n\n // ── Validation ────────────────────────────────────────────────────────────\n\n private validate(expr: string): void {\n if (expr.length > this.MAX_LENGTH) {\n throw new Error(\n `Expression exceeds maximum length of ${this.MAX_LENGTH} characters`\n )\n }\n\n for (const pattern of this.BLOCKED_PATTERNS) {\n if (pattern.test(expr)) {\n throw new Error(`Expression contains blocked pattern: ${pattern.source}`)\n }\n }\n\n if (!this.ALLOWED_CHARS.test(expr)) {\n throw new Error(`Expression contains disallowed characters`)\n }\n\n this.checkDepth(expr)\n }\n\n private checkDepth(expr: string): void {\n let depth = 0\n let max = 0\n for (const ch of expr) {\n if (ch === '(' || ch === '[' || ch === '{') { depth++; max = Math.max(max, depth) }\n if (ch === ')' || ch === ']' || ch === '}') depth--\n }\n if (max > this.MAX_DEPTH) {\n throw new Error(`Expression exceeds maximum nesting depth of ${this.MAX_DEPTH}`)\n }\n }\n\n // ── Sandbox ───────────────────────────────────────────────────────────────\n\n private createSandbox(store: AreStore, scope?: Record<string, any>): object {\n return new Proxy({}, {\n has: (_, key) => {\n if (typeof key === 'string' && this.BLOCKED_GLOBALS.has(key)) return false\n return true\n },\n get: (_, key) => {\n if (typeof key !== 'string') return undefined\n\n // Scope bindings take priority over the store\n if (scope && key in scope) return scope[key]\n\n this.assertSafeKey(key)\n\n const value = store.get(key)\n if (typeof value === 'function') return value.bind(store)\n if (value !== null && typeof value === 'object' && value !== undefined) {\n return new Proxy(value as object, this.nestedHandler(key, store))\n }\n return value\n },\n set: () => { throw new Error('Expression scope is read-only') },\n })\n }\n\n private nestedHandler(prefix: string, store: AreStore): ProxyHandler<object> {\n return {\n has: () => true,\n get: (target, key) => {\n if (typeof key !== 'string') return undefined\n this.assertSafeKey(key)\n\n const fullKey = `${prefix}.${key}`\n const value = store.get(fullKey)\n\n if (value === undefined) return (target as any)[key]\n if (typeof value === 'function') return value.bind(store)\n if (value !== null && typeof value === 'object') {\n return new Proxy(value as object, this.nestedHandler(fullKey, store))\n }\n return value\n },\n set: () => { throw new Error('Expression scope is read-only') },\n }\n }\n\n private assertSafeKey(key: string): void {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n throw new Error(`Access to \"${key}\" is not allowed in expressions`)\n }\n if (this.BLOCKED_GLOBALS.has(key)) {\n throw new Error(`Access to \"${key}\" is not allowed in expressions`)\n }\n }\n\n // ── Execution ─────────────────────────────────────────────────────────────\n\n private execute(expr: string, sandbox: object): any {\n let fn: Function\n try {\n fn = new Function('scope', `with(scope) { return (${expr}) }`)\n } catch (e) {\n throw new Error(`Expression syntax error in \"${expr}\": ${(e as Error).message}`)\n }\n\n try {\n return fn(sandbox)\n } catch (e) {\n throw new Error(`Expression evaluation error in \"${expr}\": ${(e as Error).message}`)\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreSyntaxError extends A_Error {\n\n static readonly SyntaxParseError = 'Are Syntax Parse Error';\n static readonly SyntaxNotSupportedError = 'Are Syntax Not Supported Error';\n static readonly MethodNotImplementedError = 'Are Syntax Method Not Implemented Error';\n\n}","\n\nexport const AreEngineFeatures = {\n Load: '_AreEngine_Load',\n Build: '_AreEngine_Build',\n Execute: '_AreEngine_Execute',\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreTokenizerError extends A_Error {\n\n}","import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreSyntaxTokenMatch, AreSyntaxTokenRules } from \"@adaas/are/syntax/AreSyntax.types\";\nimport { AreSyntax } from \"@adaas/are/syntax/AreSyntax.context\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n// import { AreEngine } from \"@adaas/are/engine/AreEngine.component\";\nimport { AreEngineFeatures } from \"@adaas/are/engine/AreEngine.constants\";\nimport { AreTokenizerError } from \"./AreTokenizer.error\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreTokenizer',\n description: 'AreTokenizer is responsible for scanning and tokenizing template source strings using the syntax rules defined in AreSyntax. It converts raw template strings into AreNode instances that represent the structured AST of the template, enabling downstream compilation and rendering within the ARE framework.'\n})\nexport class AreTokenizer extends A_Component {\n\n /**\n * Get the AreSyntax from the current scope. The AreSyntax defines the syntax rules and structures for tokenizing templates. It provides mechanisms for parsing and interpreting templates, attributes, directives, interpolations, and event listeners, enabling dynamic and interactive UI rendering within the ARE framework. If no AreSyntax is found in the scope, an error is thrown indicating that AreTokenizer requires an AreSyntax to function properly.\n */\n protected get config(): AreSyntax {\n const syntax = A_Context.scope(this).resolve(AreSyntax);\n\n if (!syntax) throw new AreTokenizerError({\n title: 'Syntax Context Not Found',\n description: 'AreTokenizer requires an AreSyntax to be present in the same scope. Ensure that an AreSyntax fragment is included in the concept and is accessible from the scope where AreTokenizer is used.'\n });\n\n return syntax\n }\n\n /**\n * Instantiate AreNodes based on the token matches obtained from scanning the source template. This method takes the raw source string from the context, scans it for tokens using the defined syntax rules, and creates corresponding AreNode instances for each matched token. The resulting array of AreNodes represents the structured representation of the template, which can then be used for further processing, such as rendering or applying scene instructions.\n * \n * \n * @param context \n * @returns \n */\n @A_Feature.Extend({\n name: AreEngineFeatures.Load,\n // scope: [AreEngine]\n })\n instantiate<T extends AreNode>(\n @A_Inject(AreContext) context: AreContext,\n ): void {\n context.startPerformance('Tokenizer Instantiate');\n\n const source = context.source;\n\n const nodes = this\n .scan(source, 0, source.length, context)\n .map(match => {\n const rule = this.findRuleForMatch(match)\n if (!rule) throw new Error(`No rule found for match at position ${match.position}`)\n return new (rule.component as typeof AreNode)(match)\n })\n\n for (const node of nodes) {\n context.addRoot(node)\n }\n\n context.endPerformance('Tokenizer Instantiate');\n }\n\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTokenize,\n scope: [AreNode]\n })\n tokenize(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n context.startPerformance(`Tokenize method`);\n\n const source = node.content\n const content = this\n .scan(source, 0, source.length, context)\n .map(match => {\n const rule = this.findRuleForMatch(match)\n if (!rule) throw new Error(`No rule found for match at position ${match.position}`)\n return new (rule.component as typeof AreNode)(match)\n })\n\n logger?.debug('red', `Tokenized node <${node.aseid.toString()}> with content:`, content.length);\n\n context.endPerformance(`Tokenize method`);\n\n context.startPerformance(`Tokenize node Create Children`);\n for (const child of content) {\n node.addChild(child);\n\n context.startPerformance('AreTokenizer.tokenize child init');\n child.init();\n // child.call(AreNodeFeatures.onInit, child.scope);\n\n context.endPerformance('AreTokenizer.tokenize child init');\n }\n\n context.endPerformance(`Tokenize node Create Children`);\n\n\n }\n\n protected scan(source: string, from: number, to: number, context: AreContext): AreSyntaxTokenMatch[] {\n context.startPerformance('Tokenizer Scan');\n\n const tokens: AreSyntaxTokenMatch[] = []\n let index = from\n let hasMatchBefore = false\n\n while (index < to) {\n const match = this.findNextMatch(source, index, to)\n if (!match) {\n const rest = source.slice(index, to)\n /**\n * Trailing text (after the last match). When trimWhitespace is on,\n * discard it if it is whitespace-only — it is edge indentation/newlines.\n */\n const t = this.tryPlainText(rest, index)\n if (t && !(this.config.trimWhitespace && !rest.trim())) tokens.push(t)\n break\n }\n if (match.position > index) {\n const plain = source.slice(index, match.position)\n const t = this.tryPlainText(plain, index)\n if (t) {\n /**\n * When trimWhitespace is on and the text is whitespace-only:\n * - Discard if it is leading text (before the first match)\n * - Preserve (collapse to single space) if it is between two matches\n */\n if (this.config.trimWhitespace && !plain.trim()) {\n if (hasMatchBefore) {\n t.content = ' '\n tokens.push(t)\n }\n // else: leading whitespace — skip\n } else {\n tokens.push(t)\n }\n }\n }\n tokens.push(match)\n hasMatchBefore = true\n index = match.position + match.raw.length\n }\n\n context.endPerformance('Tokenizer Scan');\n\n\n return tokens\n }\n\n protected findNextMatch(source: string, from: number, to: number): AreSyntaxTokenMatch | null {\n let earliest: AreSyntaxTokenMatch | null = null\n for (const rule of this.config.rules) {\n if (!rule.opening && !rule.closing && !rule.pattern && !rule.matcher) continue\n const match = this.matchRule(source, rule, from, to)\n if (!match) continue\n if (!earliest || match.position < earliest.position) earliest = match\n }\n return earliest\n }\n\n protected matchRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n if (rule.matcher) {\n return rule.matcher(source, from, to, (raw, content, position, closing) =>\n this.buildMatch(rule, raw, content, position, closing)\n )\n }\n if (rule.pattern) {\n const slice = source.slice(from, to)\n rule.pattern.lastIndex = 0\n const m = rule.pattern.exec(slice)\n if (!m) return null\n return this.buildMatch(rule, m[0], m[0], from + m.index, '')\n }\n if (!rule.opening || !rule.closing) return null\n if (rule.prefix) return this.matchPrefixedRule(source, rule, from, to)\n return this.matchStandardRule(source, rule, from, to)\n }\n\n protected matchStandardRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n const opening = rule.opening!\n const closing = rule.closing!\n const openPos = source.indexOf(opening, from)\n if (openPos === -1 || openPos >= to) return null\n const contentStart = openPos + opening.length\n\n if (rule.selfClosing) {\n const selfClosePos = source.indexOf(rule.selfClosing, contentStart)\n const normalClosePos = source.indexOf(closing, contentStart)\n if (selfClosePos !== -1 && (normalClosePos === -1 || selfClosePos < normalClosePos)) {\n const closeEnd = selfClosePos + rule.selfClosing.length\n return this.buildMatch(rule, source.slice(openPos, closeEnd), source.slice(contentStart, selfClosePos), openPos, rule.selfClosing)\n }\n }\n\n const closePos = rule.nested !== false\n ? this.findMatchingClose(source, opening, closing, contentStart, to)\n : source.indexOf(closing, contentStart)\n\n if (closePos === -1) {\n if (this.config.strictMode) throw new Error(`Unclosed token '${opening}' at position ${openPos}`)\n return null\n }\n\n return this.buildMatch(rule, source.slice(openPos, closePos + closing.length), source.slice(contentStart, closePos), openPos, closing)\n }\n\n protected matchPrefixedRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n const opening = rule.opening!\n const closing = rule.closing!\n let searchFrom = from\n\n while (searchFrom < to) {\n const openPos = source.indexOf(opening, searchFrom)\n if (openPos === -1 || openPos >= to) return null\n\n const before = source.slice(from, openPos)\n const prefixRe = new RegExp(rule.prefix!.source + '$')\n const prefixM = prefixRe.exec(before)\n\n if (prefixM) {\n const actualStart = openPos - prefixM[0].length\n const contentStart = openPos + opening.length\n const closePos = rule.nested !== false\n ? this.findMatchingClose(source, opening, closing, contentStart, to)\n : source.indexOf(closing, contentStart)\n\n if (closePos === -1) {\n if (this.config.strictMode) throw new Error(`Unclosed token '${opening}' at position ${openPos}`)\n return null\n }\n\n return this.buildMatch(rule, source.slice(actualStart, closePos + closing.length), source.slice(contentStart, closePos), actualStart, closing)\n }\n searchFrom = openPos + 1\n }\n return null\n }\n\n protected findMatchingClose(source: string, opening: string, closing: string, from: number, to: number): number {\n let level = 1\n let index = from\n while (index < to) {\n const nextOpen = source.indexOf(opening, index)\n const nextClose = source.indexOf(closing, index)\n if (nextClose === -1) return -1\n if (nextOpen !== -1 && nextOpen < nextClose) {\n level++\n index = nextOpen + opening.length\n continue\n }\n level--\n if (level === 0) return nextClose\n index = nextClose + closing.length\n }\n return -1\n }\n\n protected buildMatch(rule: AreSyntaxTokenRules, raw: string, content: string, position: number, closingUsed: string): AreSyntaxTokenMatch {\n const trimmed = this.config.trimWhitespace ? content.trim() : content\n const match: AreSyntaxTokenMatch = { raw, content: trimmed, opening: rule.opening ?? '', closing: closingUsed, position, payload: {}, _rule: rule }\n if (rule.extract) match.payload = rule.extract(raw, match)\n return match\n }\n\n protected tryPlainText(raw: string, position: number): AreSyntaxTokenMatch | null {\n if (!raw) return null\n const rule = this.config.rules.find(r => !r.opening && !r.closing && !r.pattern && !r.matcher)\n if (!rule) return null\n const match = this.buildMatch(rule, raw, raw, position, '')\n match._rule = rule\n return match\n }\n\n protected findRuleForMatch(match: AreSyntaxTokenMatch): AreSyntaxTokenRules | undefined {\n // Fast path: the rule that produced this match is already stored\n if (match._rule) return match._rule\n // Fallback: match by opening/closing (for externally constructed AreSyntaxTokenMatch objects)\n return this.config.rules.find(r => (r.opening ?? '') === match.opening && (r.closing ?? '') === match.closing)\n }\n}","import { A_Caller, A_Component, A_Feature, A_Inject, A_TYPES__Entity_Constructor, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { AreAttributeFeatures } from \"@adaas/are/attribute/AreAttribute.constants\";\nimport { AreDeclaration } from \"@adaas/are/instruction/types/AreDeclaration.instruction\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreCompiler',\n description: 'Walks the transformed AreNode tree and emits a Scene. Translates each node, binding, directive and interpolation into a typed instruction. Knows nothing about the DOM or any rendering target — its only concern is producing a complete and ordered set of instructions that fully describes how the tree should be rendered.'\n})\nexport class AreCompiler extends A_Component {\n\n /**\n * Defines a custom method for compiling a node into a set of SceneInstructions. This method is called during the compilation phase of the ARE component and should perform any necessary transformations on the node and its attributes to generate the appropriate instructions for rendering. This can include tasks such as processing directives, evaluating expressions, and generating instructions for dynamic content based on the node's properties and context.\n * \n * @param node \n */\n static Compile<T extends AreNode>(node: A_TYPES__Entity_Constructor<T>)\n /**\n * Defines a custom method for compiling an attribute into a set of SceneInstructions. This method is called during the compilation phase of the ARE component and should perform any necessary transformations on the attribute to generate the appropriate instructions for rendering. This can include tasks such as processing directives, evaluating expressions, and generating instructions for dynamic content based on the attribute's properties and context.\n * \n * @param attribute \n */\n static Compile<T extends AreAttribute>(attribute: A_TYPES__Entity_Constructor<T>)\n static Compile<T extends AreNode | AreAttribute>(param1: A_TYPES__Entity_Constructor<T>) {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: param1.prototype instanceof AreNode\n ? AreNodeFeatures.onCompile\n : AreAttributeFeatures.Compile,\n scope: [param1],\n override: ['compile']\n })(target, propertyKey, descriptor);\n }\n }\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Compile Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n @A_Feature.Extend({\n name: AreNodeFeatures.onCompile,\n scope: [AreNode]\n })\n compile(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n try {\n logger?.debug('cyan', `AreCompiler: compile node <${node.aseid.toString()}>`);\n\n /**\n * 1. Create & register Host Instructions to add it if no other cases presented\n * \n * [!] Note: it can be removed by directives or modified if needed\n */\n const hostInstruction = new AreDeclaration()\n scene.setHost(hostInstruction);\n scene.plan(hostInstruction);\n\n /**\n * 1. Prepare Instructions for attributes and add then to render plan.\n */\n for (let i = 0; i < node.attributes.length; i++) {\n const attribute = node.attributes[i];\n attribute.compile();\n }\n\n /**\n * 2. Compile all nested nodes of the root node. \n */\n if (node.children && node.children.length > 0) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n child.compile();\n }\n }\n\n } catch (error) {\n logger?.error(error)\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreCompilerError extends A_Error {\n\n static readonly RenderError = 'Are Compiler Render Error';\n static readonly CompilationError = 'Are Compiler Compilation Error';\n}","import { A_Caller, A_Component, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\n\n\n\n@A_Frame.Component({\n description: 'Reshapes the AreNode tree before compilation without changing its abstraction level. Responsible for structural rewrites that would complicate the compiler if left unhandled — converting $for nodes into AreGroupNode, extracting AreText and AreInterpolation from raw text, sorting directives via TopologicalSorter, and flagging static nodes.'\n})\nexport class AreTransformer extends A_Component {\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTransform,\n scope: [AreNode]\n })\n transform(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n // const scene = current.scene;\n // if (scene.isInactive)\n // continue;\n\n /**\n * 2. Prepare Instructions for directives and add then to render plan.\n */\n for (let i = 0; i < current.attributes.length; i++) {\n\n const attribute = current.attributes[i];\n attribute.transform();\n }\n \n queue.push(...current.children)\n }\n\n }\n}","\n\n\nexport const AreStoreAreComponentMetaKeys ={\n StoreExtensions: '_AreStore_StoreExtensions',\n} as const","import { A_Context, A_TYPES__ComponentMeta, A_TYPES__Paths, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport type { Are } from \"@adaas/are/component/Are.component\";\nimport type { AreMeta } from \"@adaas/are/component/Are.meta\";\nimport { AreStoreAreComponentMetaKeys } from \"./AreStore.constants\";\nimport { AreStorePathValue, AreStoreWatchingEntity } from \"./AreStore.types\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\nimport { A_UtilsHelper } from \"@adaas/a-utils/helpers\";\n\n\n\n\n@A_Frame.Fragment({\n description: \"Are Store uses to keep AreNode related information for interpolations, runtime data, etc. This object can be injected to manipulate with data at runtime.\",\n})\nexport class AreStore<\n T extends Record<string, any> = Record<string, any>\n> extends A_ExecutionContext<T> {\n\n protected dependencies: Map<string, Set<AreStoreWatchingEntity>> = new Map();\n\n protected _keys: Set<keyof T> = new Set();\n\n\n\n /**\n * Allows to define a pure function that will be executed in the context of the store, so it can access the store's data and methods, but it won't have access to the component's scope or other features. This can be useful for example for defining a function that will update the store's data based on some logic, without having access to the component's scope or other features, so we can keep the store's logic separate from the component's logic.\n */\n static get Function() {\n return <T extends Are>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n // TODO: fix types\n const targetMeta = A_Context.meta<AreMeta<A_TYPES__ComponentMeta>, T>(target.constructor as any) as any;\n\n const originalMethod = descriptor.value;\n\n const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};\n\n allExtensions[propertyKey] = originalMethod;\n\n targetMeta.set(AreStoreAreComponentMetaKeys.StoreExtensions, allExtensions);\n\n return descriptor;\n }\n }\n\n get owner(): AreNode {\n return A_Context.scope(this).issuer() as AreNode;\n }\n\n get parent(): AreStore | undefined {\n return this.owner.parent?.scope.resolve<AreStore>(AreStore);\n }\n\n get context(): AreContext {\n return A_Context.scope(this).resolve(AreContext) as AreContext;\n }\n\n constructor(aseid: ASEID | string) {\n super(aseid.toString());\n }\n\n get watchers(): Set<AreStoreWatchingEntity> {\n return this.context.get('watchers') || new Set();\n }\n\n get keys(): Set<keyof T> {\n return this._keys;\n }\n\n\n watch(instruction: AreStoreWatchingEntity): void {\n const watchers: Set<AreStoreWatchingEntity> = this.context.get('watchers') || new Set();\n watchers.add(instruction);\n this.context.set('watchers', watchers);\n }\n\n unwatch(instruction: AreStoreWatchingEntity): void {\n const watchers: Set<AreStoreWatchingEntity> = this.context.get('watchers') || new Set();\n watchers.delete(instruction);\n this.context.set('watchers', watchers);\n }\n\n set<K extends keyof T>(values: Partial<T>): this\n set<P extends A_TYPES__Paths<T>>(key: P, value: AreStorePathValue<T, P>): this\n set<K extends keyof T, P extends A_TYPES__Paths<T>>(\n param1: K | Partial<T> | P,\n param2?: T[K] | AreStorePathValue<T, P>\n ): this {\n if (typeof param1 === 'string' && param2 !== undefined) {\n this.setAsKeyValue(param1 as P, param2 as AreStorePathValue<T, P>);\n } else if (typeof param1 === 'object') {\n this.setAsObject(param1 as Partial<T>);\n } else {\n throw new Error('Invalid parameters for set method. Expected either (key: string, value: any) or (values: object).');\n }\n\n\n return this;\n }\n\n\n get<K extends keyof T>(key: K): T[K] | undefined {\n const [firstPart, ...pathPart] = String(key).split('.');\n\n if (!this._keys.has(firstPart as keyof T)) {\n return this.parent?.get(key as any);\n }\n\n if (this.watchers.size > 0) {\n const ancestors = this.extractPathSegments(String(key))\n\n for (const ancestor of ancestors) {\n // normalize once at registration — not at lookup\n const normAncestor = this.normalizePath(ancestor)\n\n if (!this.dependencies.has(normAncestor)) {\n this.dependencies.set(normAncestor, new Set())\n }\n\n\n this.watchers.forEach(watcher => this.dependencies.get(normAncestor)!.add(watcher))\n }\n }\n\n const primaryObject = super.get(firstPart);\n\n const value = A_UtilsHelper.getByPath(primaryObject, pathPart.join('.'));\n\n return value as T[K] | undefined;\n }\n\n\n protected setAsObject(values: Partial<T>): this {\n const entires = Object.entries(values);\n\n for (const [key, value] of entires) {\n\n this._keys.add(key as keyof T);\n super.set(key as keyof T, value as T[keyof T]);\n\n // normalize once — dependencies are already stored normalized\n const normChanged = this.normalizePath(String(key))\n const prefix = normChanged + '.'\n\n\n for (const [normRegistered, instructions] of this.dependencies) {\n if (\n normRegistered === normChanged || // exact\n normRegistered.startsWith(prefix) || // descendant\n normChanged.startsWith(normRegistered + '.') // ancestor\n ) {\n this.notify(instructions)\n }\n }\n\n }\n return this;\n }\n\n protected setAsKeyValue<K extends keyof T, P extends A_TYPES__Paths<T>>(\n key: K | P,\n value: T[K] | AreStorePathValue<T, P>\n ): this {\n const [firstPart, ...pathPart] = String(key).split('.');\n\n this._keys.add(firstPart as keyof T);\n\n const primaryObject = super.get(firstPart);\n\n const result = A_UtilsHelper.setBypath(primaryObject, pathPart.join('.'), value);\n\n super.set(firstPart as keyof T, result ? result[firstPart] : value);\n\n // normalize once — dependencies are already stored normalized\n const normChanged = this.normalizePath(String(key))\n const prefix = normChanged + '.'\n\n for (const [normRegistered, instructions] of this.dependencies) {\n if (\n normRegistered === normChanged || // exact\n normRegistered.startsWith(prefix) || // descendant\n normChanged.startsWith(normRegistered + '.') // ancestor\n ) {\n this.notify(instructions)\n }\n }\n\n return this;\n }\n\n\n /**\n * Notifies instructions — immediately or deferred if inside a batch.\n */\n private notify(instructions: Set<AreStoreWatchingEntity>): void {\n for (const instruction of instructions) {\n\n try {\n instruction.update()\n } catch (error) {\n\n }\n // instruction.owner.scene.unApply(instruction);\n }\n }\n /**\n * Removes an instruction from all dependency sets.\n * Called when an instruction is reverted/destroyed.\n */\n unregister(instruction: AreStoreWatchingEntity): void {\n for (const instructions of this.dependencies.values()) {\n instructions.delete(instruction);\n }\n }\n /**\n * Normalizes a path once — reused in both get and set.\n */\n private normalizePath(path: string): string {\n return path.replace(/\\[(\\d+)\\]/g, '.$1')\n }\n\n /**\n * Extracts direct children of the current markup level into typed instances.\n * No tree walking, recursion, or nested parsing — just direct children.\n */\n extractPathSegments(path: string): string[] {\n const normalized = path.replace(/\\[(\\d+)\\]/g, '.$1')\n const parts = normalized.split('.').filter(Boolean)\n const ancestors: string[] = []\n let current = ''\n\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n const isIndex = /^\\d+$/.test(part)\n\n if (i === 0) {\n current = part\n } else if (isIndex) {\n current = `${current}[${part}]`\n } else {\n current = `${current}.${part}`\n }\n\n ancestors.push(current)\n }\n\n return ancestors\n }\n\n /**\n * Method allows to initialize all extensions defined in the component with @AreStore.Function decorator, so we can use them in the store's context. This method should be called in the component's constructor after super() call, so the store will have access to the component's instance and its properties.\n * \n * @param component \n */\n loadExtensions(component: Are) {\n const targetMeta = A_Context.meta<AreMeta<A_TYPES__ComponentMeta>, Are>(component as any) as any;\n\n const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};\n\n this.set(allExtensions);\n }\n\n}\n","import { A_Caller, A_Component, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreInstructionFeatures } from \"@adaas/are/instruction/AreInstruction.constants\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\n\n\n\n@A_Frame.Component({\n description: 'Stateless executor that reads the Scene and translates its instructions into operations on a rendering target. Computes the diff between applied and planned, calls revert on removed instructions and apply on added ones. Owns no state of its own — all state lives in the Scene. Can be swapped for any target implementation (DOMInterpreter, SSRInterpreter, CanvasInterpreter) without touching any other part of the pipeline.'\n})\nexport class AreInterpreter extends A_Component {\n /**\n * Decorator to mark a method as an instruction Apply handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction needs to be applied. The method should contain logic to perform the necessary operations on the rendering target based on the instruction's content and context.\n * \n * @param action \n * @returns \n */\n static Apply(action: string) {\n const name = action + AreInstructionFeatures.Apply\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Decorator to mark a method as an instruction Update handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction has been updated. The method should contain logic to perform the necessary operations on the rendering target to update the effects of the instruction based on its new content and context.\n * \n * @param action \n * @returns \n */\n static Update(action: string) {\n const name = action + AreInstructionFeatures.Update\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Decorator to mark a method as an instruction Revert handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction needs to be reverted. The method should contain logic to perform the necessary operations on the rendering target to undo the effects of the instruction based on its content and context.\n * \n * @param action \n * @returns \n */\n static Revert(action: string) {\n\n const name = action + AreInstructionFeatures.Revert\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * The method responsible for executing the render operation based on the current state of the Scene. It processes the instructions that need to be applied and reverted, ensuring that the rendering target is updated accordingly. The method handles any errors that may occur during the application or reversion of instructions, maintaining the integrity of the rendering process.\n * \n * @param scene \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onInterpret,\n scope: [AreNode]\n })\n interpret(\n @A_Inject(AreScene) scene: AreScene,\n ) {\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n }\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Instruction Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Apply,\n scope: [AreInstruction]\n })\n protected applyInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Apply, scope);\n\n store.unwatch(instruction);\n } catch (error) {\n store.unwatch(instruction);\n throw error;\n }\n\n }\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Update,\n scope: [AreInstruction]\n })\n protected updateInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Update, scope);\n\n store.unwatch(instruction);\n } catch (error) {\n store.unwatch(instruction);\n throw error;\n }\n\n }\n\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Revert,\n scope: [AreInstruction]\n })\n protected revertInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n // store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Revert, scope);\n\n // store.unwatch(instruction);\n } catch (error) {\n // store.unwatch(instruction);\n throw error;\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class AreInterpreterError extends A_Error {\n\n}","import { A_Caller, A_Component, A_Dependency, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { AreAttributeFeatures } from \"@adaas/are/attribute/AreAttribute.constants\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n\n\n@A_Frame.Component({\n description: 'Handles the lifecycle of the AreNode and related entities such as interpolations, directives, attributes, and so on. It provides lifecycle hooks for initialization, mounting, updating, and unmounting of the nodes, allowing to manage the state and behavior of the nodes throughout their lifecycle in a structured and consistent way.'\n})\nexport class AreLifecycle extends A_Component {\n\n\n\n static Init<T extends AreNode>(node: A_TYPES__Entity_Constructor<T>)\n static Init<T extends AreAttribute>(attribute: A_TYPES__Entity_Constructor<T>)\n static Init<T extends AreNode | AreAttribute>(param1: A_TYPES__Entity_Constructor<T>) {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: param1.prototype instanceof AreNode\n ? AreNodeFeatures.onInit\n : AreAttributeFeatures.Init,\n scope: [param1],\n override: ['init']\n })(target, propertyKey, descriptor);\n }\n }\n\n\n /**\n * Handles before init lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeInit,\n before: /.*/,\n scope: [AreNode]\n })\n beforeInit(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Init -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeInit, node.scope);\n }\n /**\n * Initializes the AreNode and prepares it for mounting \n * \n * @param node \n * @param scope \n * @param syntax \n * @param feature \n * @param logger \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onInit,\n scope: [AreNode]\n })\n init(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n context.startPerformance('AreLifecycle.init');\n\n const newNodeScene = new AreScene(node.aseid);\n\n scope.register(newNodeScene);\n\n /**\n * If Node has a custom component Defined\n */\n if (node.component) {\n const newNodeStore = new AreStore(node.aseid);\n scope.register(newNodeStore);\n\n\n newNodeStore.loadExtensions(node.component);\n }\n\n context.endPerformance('AreLifecycle.init');\n }\n /**\n * Handles after init lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterInit,\n after: /.*/,\n scope: [AreNode]\n })\n afterInit(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Init -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterInit, node.scope);\n }\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Mount Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before mount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeMount,\n before: /.*/,\n scope: [AreNode]\n })\n beforeMount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Mount -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeMount, node.scope);\n }\n /**\n * Mount the AreNode into the Host\n * \n * @param scope \n * @param node \n * @param scene \n * @param logger \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onMount,\n scope: [AreNode]\n })\n mount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n /**\n * Node Content\n */\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n\n logger?.debug(`[Mount] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n if (scene.isInactive)\n continue;\n\n // do update work on current\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n\n // /**\n // * 1. We should simply run and render node itself.\n // */\n // node.interpret();\n // /**\n // * 2. Then go through all children of the node and mount the.\n // */\n // for (let i = 0; i < node.children.length; i++) {\n // const child = node.children[i];\n // child.mount();\n // }\n }\n\n /**\n * Handles after mount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterMount,\n after: /.*/,\n scope: [AreNode]\n })\n afterMount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Mount -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterMount, node.scope);\n }\n\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Update Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before update lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n before: /.*/,\n scope: [AreNode]\n })\n beforeUpdate(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Update -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeUpdate, node.scope);\n }\n /**\n * Updates the AreNode in the AreScene\n * \n * @param node \n * @param scene \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n scope: [AreNode]\n })\n update(\n /**\n * Node to be updated\n */\n @A_Inject(A_Caller) node: AreNode,\n\n @A_Inject(AreContext) context: AreContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n\n ...args: any[]\n ) {\n\n logger?.debug(`[Update] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n if (scene.isInactive)\n continue;\n\n // do update work on current\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n\n console.log(' -- Scene Changes -- ');\n console.log('To Apply: ', toApply);\n console.log('To Revert: ', toRevert);\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n console.log('WTF?? ', error);\n\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n\n // /**\n // * 4. Render everything that changed \n // */\n // node.interpret();\n // /**\n // * 5. And finally go though all children of the node and update the. \n // */\n // for (let i = 0; i < node.children.length; i++) {\n // const child = node.children[i];\n // child.update();\n // }\n\n\n }\n /**\n * Handles after update lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n after: /.*/,\n scope: [AreNode]\n })\n afterUpdate(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Update -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterUpdate, node.scope);\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Node Unmount Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before unmount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeUnmount,\n before: /.*/,\n scope: [AreNode]\n })\n beforeUnmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Unmount -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeUnmount, node.scope);\n }\n\n /**\n * Unmounts the AreNode from the Host\n * \n * @param node \n * @param scene \n * @param args \n * \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUnmount,\n scope: [AreNode]\n })\n unmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n\n ...args: any[]\n ) {\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n /**\n * 1. We have to revert all instructions related to this node and remove them from the state \n */\n const applied = [...scene.applied];\n\n for (let i = applied.length - 1; i >= 0; i--) {\n const instruction = applied[i];\n\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n }\n\n /**\n * Handles after unmount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterUnmount,\n after: /.*/,\n scope: [AreNode]\n })\n afterUnmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Unmount -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterUnmount, node.scope);\n }\n\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Node Destroy Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before destroy lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeDestroy,\n before: /.*/,\n scope: [AreNode]\n })\n beforeDestroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Destroy -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeDestroy, node.scope);\n }\n\n /**\n * Destroys the AreNode from the Host\n * \n * @param node \n * @param scene \n * @param args \n * \n */\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.DESTROY,\n scope: [AreNode]\n })\n destroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n\n ...args: any[]\n ) {\n\n }\n\n /**\n * Handles after destroy lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterDestroy,\n after: /.*/,\n scope: [AreNode]\n })\n afterDestroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Destroy -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterDestroy, node.scope);\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreLifecycleError extends A_Error {\n\n static readonly InvalidLifecycleMethod = \"Invalid lifecycle method. Lifecycle method must be one of the following: onBeforeLoad, onLoad, onUpdate, onDestroy.\";\n\n}","import { A_Caller, A_Component, A_Context, A_Dependency, A_Feature, A_FormatterHelper, A_Inject, A_Scope, A_TYPES__ComponentMeta, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n\n@A_Frame.Component({\n description: 'Entry point of the pipeline. Accepts a raw template string and orchestrates the initial processing by delegating to Syntax. Returns a structured AreNode tree ready for transformation. Knows nothing about the template content or grammar rules.'\n})\nexport class AreLoader extends A_Component {\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Load Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Loads the AreNode \n * \n * @param node \n * @param scope \n * @param syntax \n * @param feature \n * @param logger \n * @param args \n */\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [AreNode]\n })\n async load(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n @A_Inject(AreContext) context?: AreContext,\n ...args: any[]\n ) {\n logger?.debug('red', `Loading node <${node.aseid.toString()}> with content:`, scope);\n\n /**\n * If Node has a custom component Defined\n */\n if (node.component) {\n /**\n * Chain all methods to load data from component.\n */\n context?.startPerformance('Total AreFeatures.onData')\n await feature.chain(node.component, AreFeatures.onData, scope);\n context?.endPerformance('Total AreFeatures.onData')\n\n context?.startPerformance('Total AreFeatures.onLoad')\n await feature.chain(node.component, AreFeatures.onStyles, scope);\n context?.endPerformance('Total AreFeatures.onLoad')\n\n context?.startPerformance('Total AreFeatures.onTemplate')\n await feature.chain(node.component, AreFeatures.onTemplate, scope);\n context?.endPerformance('Total AreFeatures.onTemplate')\n } \n // else {\n // logger?.warning(\n // 'Component Not Found',\n // `No component registered for entity: ${node.aseid.entity}. Please ensure that the component is registered in the scope before rendering.`\n // );\n // }\n\n /**\n * 2. Tokenize Node Content\n */\n context?.startPerformance('Tokenization')\n node.tokenize();\n context?.endPerformance('Tokenization')\n\n /**\n * 3. We have to extract node content and create child nodes if content exists, since it can impact the rendering and compilation process, for example if we have some directives that are affecting the structure of the node or its children, we need to have them in place before compilation to ensure that they are properly processed and their instructions are added to the render plan.\n */\n for (let i = 0; i < node.children.length; i++) {\n const childNode = node.children[i];\n\n const res = childNode.load();\n if(res instanceof Promise) {\n await res;\n }\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreLoaderError extends A_Error {\n\n static readonly SyntaxError = 'Are Loader Syntax Error';\n\n static readonly EmptyTemplateError = 'Are Loader Empty Template Error';\n}","import { A_Component } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreWatcher',\n description: 'AreWatcher is a component that observes browser navigation events (history pushState, replaceState, and popstate) and notifies registered handlers when the URL changes, enabling client-side routing and reactive route-based rendering within the ARE framework.'\n})\nexport class AreWatcher extends A_Component {\n\n private readonly handlers: Set<(url: URL) => void> = new Set();\n private current: URL = new URL(window.location.href);\n\n constructor() {\n super();\n this.patchHistory();\n this.attachListeners();\n }\n\n // ── Public ────────────────────────────────────────────────────────────────\n\n onChange(handler: (url: URL) => void): () => void {\n this.handlers.add(handler);\n return () => this.handlers.delete(handler); // returns unsubscribe fn\n }\n\n get url(): URL {\n return this.current;\n }\n\n destroy(): void {\n window.removeEventListener('popstate', this.onPopState);\n window.removeEventListener('hashchange', this.onHashChange);\n window.removeEventListener('urlchange', this.onURLChange);\n this.handlers.clear();\n }\n\n // ── Listeners ─────────────────────────────────────────────────────────────\n\n private onPopState = (): void => {\n this.notify();\n }\n\n private onHashChange = (): void => {\n this.notify();\n }\n\n private onURLChange = (): void => {\n this.notify();\n }\n\n private attachListeners(): void {\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('hashchange', this.onHashChange);\n window.addEventListener('urlchange', this.onURLChange); // custom event from patch\n }\n\n // ── Patch pushState / replaceState ────────────────────────────────────────\n\n private patchHistory(): void {\n const patch = (original: typeof history.pushState) =>\n function (this: History, ...args: Parameters<typeof history.pushState>) {\n original.apply(this, args);\n window.dispatchEvent(new Event('urlchange'));\n };\n\n history.pushState = patch(history.pushState);\n history.replaceState = patch(history.replaceState);\n }\n\n // ── Notify ────────────────────────────────────────────────────────────────\n\n private notify(): void {\n const next = new URL(window.location.href);\n\n if (next.href === this.current.href) return; // no actual change\n\n this.current = next;\n\n for (const handler of this.handlers) {\n handler(this.current);\n }\n }\n}","import { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { A_Frame } from \"@adaas/a-frame\";\n\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreSignal',\n description: 'AreSignal is the base class for all signals used within the ARE framework. It extends A_Signal to provide a typed signal entity that components can subscribe to and emit, enabling reactive communication between ARE components and driving lifecycle and rendering updates.'\n})\nexport class AreSignal<\n _TSignalDataType extends Record<string, any> = Record<string, any>\n> extends A_Signal<_TSignalDataType> {\n\n\n\n}","import { AreSignal } from \"@adaas/are/signals/AreSignal.entity\";\n\nexport class AreInit extends AreSignal {\n static default(): AreInit | undefined {\n return new AreInit({ data: { ready: false } });\n }\n}","import { A_Route } from \"@adaas/a-utils/a-route\";\nimport { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { AreSignal } from \"@adaas/are/signals/AreSignal.entity\";\n\n\n\nexport class AreRoute extends AreSignal<A_Route> {\n\n constructor(path: string | RegExp) {\n super({\n data: new A_Route(path)\n });\n }\n\n get route(): A_Route {\n return this.data;\n }\n\n static default(): AreRoute | undefined {\n return new AreRoute(document.location.pathname || '/');\n }\n\n\n compare(other: A_Signal<A_Route>): boolean {\n return this.route.toRegExp().test(other.data.toString());\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/AreComponent/Are.meta.ts","../../src/lib/AreComponent/Are.constants.ts","../../src/lib/AreComponent/Are.component.ts","../../src/lib/AreComponent/Are.context.ts","../../src/lib/AreNode/AreNode.constants.ts","../../src/lib/AreNode/AreNode.entity.ts","../../src/lib/AreAttribute/AreAttribute.constants.ts","../../src/lib/AreAttribute/AreAttribute.entity.ts","../../src/lib/AreSyntax/AreSyntax.context.ts","../../src/lib/AreSyntax/AreSyntax.error.ts","../../src/lib/AreTokenizer/AreTokenizer.error.ts","../../src/lib/AreTokenizer/AreTokenizer.component.ts","../../src/lib/AreCompiler/AreCompiler.component.ts","../../src/lib/AreCompiler/AreCompiler.error.ts","../../src/lib/AreTransformer/AreTransformer.component.ts","../../src/lib/AreInterpreter/AreInterpreter.component.ts","../../src/lib/AreInterpreter/AreInterpreter.error.ts","../../src/lib/AreStore/AreStore.constants.ts","../../src/lib/AreStore/AreStore.context.ts","../../src/lib/AreEvent/AreEvent.context.ts","../../src/lib/AreScene/AreScene.error.ts","../../src/lib/AreScene/AreScene.constants.ts","../../src/lib/AreScene/AreScene.context.ts","../../src/lib/AreInstruction/AreInstruction.constants.ts","../../src/lib/AreInstruction/AreInstruction.entity.ts","../../src/lib/AreInstruction/AreInstruction.error.ts","../../src/lib/AreInstruction/types/AreDeclaration.instruction.ts","../../src/lib/AreInstruction/types/AreMutation.instruction.ts","../../src/lib/AreLifecycle/AreLifecycle.component.ts","../../src/lib/AreLifecycle/AreLifecycle.error.ts","../../src/lib/AreLoader/AreLoader.component.ts","../../src/lib/AreLoader/AreLoader.error.ts","../../src/lib/AreWatcher/AreWatcher.component.ts","../../src/lib/AreSignals/AreSignal.entity.ts","../../src/lib/AreSignals/AreSignals.meta.ts","../../src/lib/AreSignals/AreSignals.context.ts","../../src/lib/AreSignals/AreSignals.component.ts","../../src/lib/AreSignals/entities/AreInit.signal.ts","../../src/lib/AreSignals/entities/AreRoute.signal.ts","../../src/lib/AreEngine/AreEngine.error.ts","../../src/lib/AreEngine/AreEngine.constants.ts","../../src/lib/AreEngine/AreEngine.component.ts"],"names":["A_Context","A_Frame","AreContext","AreAttribute","A_Entity","A_Fragment","A_Error","A_Component","AreSyntax","A_Feature","AreNodeFeatures","AreNode","AreAttributeFeatures","A_Inject","A_Caller","AreScene","A_Logger","A_Scope","AreStore","A_ExecutionContext","AreDeclaration","AreInstruction","AreInstructionFeatures","A_FormatterHelper","AreInstructionDefaultNames","AreMutation","AreInstructionError","AreFeatures","scene","A_TYPES__EntityFeatures","A_Signal","A_ComponentMeta","AreSignals","A_SignalVector","AreEvent","A_Meta","AreSignal","AreEngineFeatures","AreInit","AreLoader","AreTokenizer","AreCompiler","AreInterpreter","AreLifecycle","AreTransformer","A_Dependency"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAM,OAAA,GAAN,cAA2E,eAAA,CAA4C;AAO9H,CAAA;;;ACfO,IAAM,WAAA,GAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvB,YAAA,EAAc,mBAAA;AAAA;AAAA;AAAA;AAAA,EAId,WAAA,EAAa,kBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKb,aAAA,EAAe,oBAAA;AAAA;AAAA;AAAA;AAAA,EAIf,YAAA,EAAc,mBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKd,eAAA,EAAiB,sBAAA;AAAA;AAAA;AAAA;AAAA,EAIjB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA,EAIhB,aAAA,EAAe,oBAAA;AAAA;AAAA;AAAA;AAAA,EAIf,eAAA,EAAiB,sBAAA;AAAA;AAAA;AAAA;AAAA,EAIjB,cAAA,EAAgB,qBAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,UAAA,EAAY,iBAAA;AAAA,EACZ,QAAA,EAAU,eAAA;AAAA,EACV,MAAA,EAAQ,aAAA;AAAA;AAAA;AAAA;AAAA,EAIR,QAAA,EAAU;AACd;;;AC1CO,IAAM,GAAA,GAAN,cAAkB,WAAA,CAAY;AAAA,EAA9B,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AA+LH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,IAA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ASL,WAAS,CAAA,CAAA;AAAA,EAClB,eAAA,CAAA,CAAA,EAAAK,SAAS+B,gBAAc,CAAA,CAAA;AAAA,EACvB,eAAA,CAAA,CAAA,EAAA/B,SAAS0B,WAAS,CAAA,CAAA;AAAA,EAClB,eAAA,CAAA,CAAA,EAAA1B,SAAS4B,aAAW,CAAA,CAAA;AAAA,EACpB,eAAA,CAAA,CAAA,EAAA5B,SAAS6B,gBAAc,CAAA,CAAA;AAAA,EACvB,eAAA,CAAA,CAAA,EAAA7B,SAAS8B,cAAY,CAAA,CAAA;AAAA,EACrB,eAAA,CAAA,CAAA,EAAA9B,SAASG,QAAQ,CAAA;AAAA,CAAA,EAvLb,SAAA,CA8KH,SAAA,EAAA,QAAA,EAAA,CAAA,CAAA;AAiEI,eAAA,CAAA;AAAA,EAHTf,QAAQ,MAAA,CAAO;AAAA,IACZ,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EA9OQ,SAAA,CA+OC,SAAA,EAAA,SAAA,EAAA,CAAA,CAAA;AA/OD,SAAA,GAAN,eAAA,CAAA;AAAA,EALNA,QAAQ,SAAA,CAAU;AAAA,IACf,SAAA,EAAW,OAAA;AAAA,IACX,IAAA,EAAM,WAAA;AAAA,IACN,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,SAAA,CAAA","file":"index.mjs","sourcesContent":["import { A_ComponentMeta, A_TYPES__ComponentMeta } from \"@adaas/a-concept\";\nimport type { A_SignalVector } from \"@adaas/a-utils/a-signal\";\n\n\n\n/**\n * The AreMeta class serves as a metadata container for components within the A-Concept Rendering Engine (ARE) framework. It extends the base A_ComponentMeta class and includes additional properties and features specific to ARE components. The AreMeta class can be used to define and manage metadata for ARE components, such as their template, styles, data, and signal handling logic, allowing for a structured and organized way to manage component behavior and interactions within the ARE environment.\n */\nexport class AreMeta<T extends Record<string, any> = Record<string, any>> extends A_ComponentMeta<T & A_TYPES__ComponentMeta> {\n\n /**\n * Optional property to store a signal vector associated with the component. This can be used to manage and handle signals emitted by the component or other parts of the application, allowing for dynamic interactions and responsive behavior based on changes in the application state or user input.\n */\n vector?: A_SignalVector\n\n}","export const AreFeatures = {\n //===================================================================================\n // -----------------------------Node Lifecycle Hooks---------------------------------\n //===================================================================================\n /**\n * Allows to define a custom method for the component's initialization logic. This method is called before the component is initialized and can be used to perform any necessary setup or configuration before the component is rendered. It can also be used to implement custom logic for handling specific features or behaviors of the component during the initialization process.\n */\n onBeforeInit: '_Are_onBeforeInit',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been initialized. This method is called after the component has been initialized and can be used to perform any necessary setup or configuration based on the initial state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-initialization process.\n */\n onAfterInit: '_Are_onAfterInit',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's mounting logic. This method is called before the component is mounted to the DOM and can be used to perform any necessary setup or configuration before the component is rendered. It can also be used to implement custom logic for handling specific features or behaviors of the component during the mounting process.\n */\n onBeforeMount: '_Are_onBeforeMount',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been mounted to the DOM. This method is called after the component has been mounted and can be used to perform any necessary setup or configuration based on the initial state of the component and its presence in the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-mounting process.\n */\n onAfterMount: '_Are_onAfterMount',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's unmounting logic. This method is called before the component is unmounted from the DOM and can be used to perform any necessary cleanup or teardown before the component is removed. It can also be used to implement custom logic for handling specific features or behaviors of the component during the unmounting process.\n */\n onBeforeUnmount: '_Are_onBeforeUnmount',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component has been unmounted from the DOM. This method is called after the component has been unmounted and can be used to perform any necessary cleanup or teardown based on the final state of the component and its removal from the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-unmounting process.\n */\n onAfterUnmount: '_Are_onAfterUnmount',\n //------------------------------------------------------------------------------------\n /**\n * Allows to define a custom method for the component's update logic. This method is called whenever the component's state changes and can be used to perform any necessary updates or side effects based on the new state. It can also be used to optimize performance by implementing custom logic for determining when the component should re-render based on specific state changes.\n */\n onBeforeUpdate: '_Are_onBeforeUpdate',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component's state has been updated. This method is called after the component has re-rendered in response to state changes, and can be used to perform any necessary side effects or additional updates based on the new state. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-update process.\n */\n onAfterUpdate: '_Are_onAfterUpdate',\n /**\n * Allows to define a custom method for the component's logic that should be executed before the component is destroyed. This method is called before the component is destroyed and can be used to perform any necessary cleanup or teardown based on the final state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the pre-destruction process.\n */\n onBeforeDestroy: '_Are_onBeforeDestroy',\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is destroyed. This method is called after the component has been destroyed and can be used to perform any necessary cleanup or teardown based on the final state of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-destruction process.\n */\n onAfterDestroy: '_Are_onAfterDestroy',\n\n //===================================================================================\n // -----------------------------Loading Extension------------------------------------\n //===================================================================================\n onTemplate: '_Are_onTemplate',\n onStyles: '_Are_onStyles',\n onData: '_Are_onData',\n //===================================================================================\n // -----------------------------Runtime Hooks------------------------------------\n //=================================================================================== \n onSignal: '_Are_onSignal',\n} as const;","import { A_Component, A_Context, A_Feature, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Signal, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { AreSignals } from \"@adaas/are/signals/AreSignals.component\";\nimport { AreSignalsMeta } from \"@adaas/are/signals/AreSignals.meta\";\nimport { ArePropDefinition } from \"./Are.types\";\nimport { AreMeta } from \"./Are.meta\";\nimport { AreFeatures } from \"./Are.constants\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'Are',\n description: 'Base component class for A-Concept Rendering Engine (ARE) components. It provides lifecycle decorators and methods for defining templates, styles, and data, facilitating the creation of dynamic and interactive UI components within the ARE framework.'\n})\n@A_Meta.Define(AreMeta)\nexport class Are extends A_Component {\n /**\n * Allows to apply Signal Vector as a condition for rendering the component. The component will be rendered only if at least one of the signals in the vector is active. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param signals \n * @returns \n */\n static Condition(vector: A_SignalVector)\n static Condition(vector: Array<A_Signal>)\n static Condition(signals: Array<A_Signal> | A_SignalVector) {\n return function <TTarget extends A_TYPES__Ctor<Are>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const componentMeta = A_Context.meta<AreMeta>(target);\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n\n let vector: A_SignalVector | undefined;\n\n switch (true) {\n case signals instanceof A_SignalVector:\n vector = signals;\n break;\n case Array.isArray(signals):\n vector = new A_SignalVector(signals);\n break;\n default:\n throw new Error('Invalid input for Are.Condition. Expected an array of A_Signal or an instance of A_SignalVector.');\n }\n\n if (vector) {\n componentMeta.vector = vector;\n signalsMeta.registerCondition(target, vector);\n }\n\n return target;\n };\n }\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get EventHandler() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: propertyKey,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get onBeforeInit() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeInit,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's initialization logic. This method is called after the component is instantiated but before it is rendered, and can be used to set up any necessary state, perform data fetching, or execute any other logic that needs to happen before the component is rendered for the first time.\n */\n static get onAfterInit() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterInit,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's mounting logic. This method is called after the component has been rendered and added to the DOM, and can be used to perform any necessary setup or initialization that requires access to the DOM elements of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the mounting process.\n */\n static get onBeforeMount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeMount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is mounted. This method is called after the component has been rendered and added to the DOM, and can be used to perform any necessary setup or initialization that requires access to the DOM elements of the component. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-mounting process.\n */\n static get onAfterMount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterMount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's unmounting logic. This method is called before the component is removed from the DOM, and can be used to perform any necessary cleanup or teardown, such as removing event listeners, canceling timers, or releasing any resources that were allocated during the component's lifecycle. It can also be used to implement custom logic for handling specific features or behaviors of the component during the unmounting process.\n */\n static get onBeforeUnmount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeUnmount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component is unmounted. This method is called after the component has been removed from the DOM, and can be used to perform any necessary cleanup or teardown that needs to happen after the component is no longer in the DOM. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-unmounting process.\n */\n static get onAfterUnmount() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterUnmount,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's update logic. This method is called whenever the component's state changes and can be used to perform any necessary updates or side effects based on the new state. It can also be used to optimize performance by implementing custom logic for determining when the component should re-render based on specific state changes.\n */\n static get onBeforeUpdate() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onBeforeUpdate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's logic that should be executed after the component's state has been updated. This method is called after the component has re-rendered in response to state changes, and can be used to perform any necessary side effects or additional updates based on the new state. It can also be used to implement custom logic for handling specific features or behaviors of the component during the post-update process.\n */\n static get onAfterUpdate() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onAfterUpdate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's template. This method should return a string representing the HTML template of the component. The template can include dynamic content and bindings that will be processed during rendering to create the final DOM structure for the component.\n */\n static get Template() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onTemplate,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's styles. This method should return a string representing the CSS styles of the component. The styles can include dynamic content and can be processed during rendering to apply the appropriate styles to the component's DOM elements.\n */\n static get Styles() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onStyles,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for the component's data. This method should return an object representing the initial state of the component. The data can include any properties that are needed to manage the component's state and can be reactive, allowing the component to re-render when the data changes.\n */\n static get Data() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onData,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Allows to define a custom method for handling signals emitted by the component or other parts of the application. This method can be used to implement custom logic for responding to specific signals, such as user interactions, state changes, or other events that may affect the component's behavior or appearance. By defining this method, developers can create more dynamic and interactive components that can react to changes in the application state or user input in a flexible and efficient way.\n */\n static get Signal() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreFeatures.onSignal,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n // ==================================================================================\n // ========================= COMPONENT PROPERTIES ===================================\n // ==================================================================================\n /**\n * Props can be used to store any additional data or configuration for the component. They are not reactive by default but can be used in the component's methods and lifecycle hooks to manage state or pass information. Props can be defined as a simple object with key-value pairs, where keys are the prop names and values are the prop values. They can be accessed and modified within the component's methods to influence rendering or behavior based on the component's state or external inputs.\n */\n props: Record<string, ArePropDefinition> = {};\n\n\n // ==================================================================================\n // ========================= COMPONENT METHODS ======================================\n // ==================================================================================\n /**\n * Returns the template string for the component\n * \n * Could be overridden to provide dynamic templates based on component state\n * \n * @returns \n */\n @Are.Template\n template(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n\n /**\n * Returns the styles string for the component\n * \n * Could be overridden to provide dynamic styles based on component state\n * \n * @returns \n */\n @Are.Styles\n styles(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n\n /**\n * Returns the data object for the component\n * \n * Uses as the initial state of the component\n * \n * @returns \n */\n @Are.Data\n data(\n ...args: any[]\n ): Promise<void> | void {\n\n }\n}","import { A_Context, A_Fragment } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\n\n\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreContext',\n description: 'Context fragment for the A-Concept Rendering Engine (ARE) framework, serving as a foundational component for managing shared state and configurations within the ARE environment. This Context uses to encapsulate global settings, resources, and utilities that can be accessed by various ARE components and entities during the rendering and interaction processes.'\n})\nexport class AreContext extends A_ExecutionContext {\n\n /**\n * The source string represents the original template or input from which the ARE scene is generated. This can be used for debugging, error reporting, or any features that require access to the raw template data. The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n protected _source: string;\n /**\n * The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n protected _roots: Array<AreNode> = [];\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n */\n protected _signalsMap: Map<string, A_SignalVector> = new Map();\n\n protected _performance = new Map<string, number>();\n protected _performanceStart = new Map<string, number>();\n protected _performanceDepth = new Map<string, number>();\n\n /**\n * The global object can be used to store any global data or configurations that need to be accessed across different components and entities within the ARE framework. This can include things like theme settings, user preferences, or any other shared data that is relevant to the entire scene or application. By centralizing this information in the context, it allows for easier management and access to global state without needing to pass it through multiple layers of components or entities.\n */\n get globals() {\n return this.get('globals') || {};\n }\n\n\n constructor(\n /**\n * The source string represents the original template or input from which the ARE scene is generated. This can be used for debugging, error reporting, or any features that require access to the raw template data. The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n source: string = ''\n ) {\n super('AreContext');\n this._source = source;\n }\n /**\n * The scope of the context, which can be used to access other entities and features within the same scope. This is particularly useful for components that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.\n */\n get scope() {\n return A_Context.scope(this);\n }\n /**\n * The roots array holds references to the root nodes of the ARE scene, allowing for easy access and management of the top-level components in the rendering hierarchy. The signalsMap is a mapping between root nodes and their associated signal vectors, enabling efficient management of reactive updates and interactions within the ARE framework based on changes in the application state or user input.\n */\n get roots(): Array<AreNode> {\n return this._roots;\n }\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n */\n get source(): string {\n return this._source;\n }\n\n get performance(): Array<string> {\n const perfObj: Array<string> = [];\n this._performance.forEach((value, key) => {\n perfObj.push(`${key}: ${value} ms`);\n });\n return perfObj;\n }\n\n\n get stats() {\n return [\n `- Total Roots: ${this._roots.length}`,\n `- Total Nodes in Scene: ${this._roots.reduce((acc, root) => acc + this.countNodes(root), 0,)}`,\n `- Total Instructions: ${this._roots.reduce((acc, root) => acc + this.countInstructions(root), 0,)}`,\n ]\n }\n\n protected countInstructions(node: AreNode): number {\n let count = 0; // Count instructions for the current node\n // Assuming each node has a method or property that returns its instructions\n if (node.scene) {\n count += node.scene.instructions.length;\n }\n for (const child of node.children) {\n count += this.countInstructions(child); // Recursively count instructions in child nodes\n }\n return count;\n }\n\n protected countNodes(node: AreNode): number {\n let count = 1; // Count the current node\n for (const child of node.children) {\n count += this.countNodes(child); // Recursively count child nodes\n }\n return count;\n }\n\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param node \n */\n addRoot(node: AreNode) {\n this._roots.push(node);\n this.scope.register(node);\n }\n /**\n * This property stores a map between root node and conditions that should be met to render particular component inside the root node. This can be used to manage complex rendering logic and to optimize performance by ensuring that components are only rendered when necessary based on the defined conditions.\n * \n * @param node \n */\n removeRoot(node: AreNode) {\n this._roots = this._roots.filter(r => r.aseid.toString() !== node.aseid.toString());\n }\n\n\n\n\n startPerformance(label: string = 'default') {\n const depth = this._performanceDepth.get(label) || 0;\n this._performanceDepth.set(label, depth + 1);\n\n if (depth === 0) {\n this._performanceStart.set(label, Date.now());\n }\n }\n\n endPerformance(label: string) {\n const depth = this._performanceDepth.get(label) || 0;\n\n if (depth <= 1) {\n const startTime = this._performanceStart.get(label) || this._performanceStart.get('default');\n\n if (startTime) {\n const duration = Date.now() - startTime;\n const accumulated = this._performance.get(label) || 0;\n this._performance.set(label, accumulated + duration);\n this._performanceStart.delete(label);\n }\n\n this._performanceDepth.delete(label);\n } else {\n this._performanceDepth.set(label, depth - 1);\n }\n }\n}\n","\n\nexport const AreNodeFeatures = {\n\n // ==============================================================================\n // Lifecycle features\n // ==============================================================================\n /**\n * Feature that is called to handle before init lifecycle of the element node\n */\n onBeforeInit: '_AreNode_onBeforeInit',\n /**\n * Feature that is called to init the element node\n */\n onInit: '_AreNode_onInit',\n /**\n * \n */\n onAfterInit: '_AreNode_onAfterInit',\n\n\n /**\n * Feature that is called to handle before mount lifecycle of the element node\n */\n onBeforeMount: '_AreNode_onBeforeMount',\n /**\n * Feature that is called to mount the element node\n */\n onMount: '_AreNode_onMount',\n /**\n * Feature that is called to handle after mount lifecycle of the element node\n */\n onAfterMount: '_AreNode_onAfterMount',\n\n\n /**\n * Feature that is called to handle before update lifecycle of the element node\n */\n onBeforeUpdate: '_AreNode_onBeforeUpdate',\n /**\n * Feature that is called to handle update lifecycle of the element node\n */\n onUpdate: '_AreNode_onUpdate',\n /**\n * Feature that is called to handle after update lifecycle of the element node\n */\n onAfterUpdate: '_AreNode_onAfterUpdate',\n\n\n /**\n * Feature that is called to handle before unmount lifecycle of the element node\n */\n onBeforeUnmount: '_AreNode_onBeforeUnmount',\n /**\n * Feature that is called to unmount the element node\n */\n onUnmount: '_AreNode_onUnmount',\n /**\n * Feature that is called to handle after unmount lifecycle of the element node\n */\n onAfterUnmount: '_AreNode_onAfterUnmount',\n\n\n /**\n * Feature that is called to handle before destroy lifecycle of the element node\n */\n onBeforeDestroy: '_AreNode_onBeforeDestroy',\n /**\n * Feature that is called to handle before destroy lifecycle of the element node\n */\n onDestroy: '_AreNode_onDestroy',\n /**\n * Feature that is called to handle after destroy lifecycle of the element node\n */\n onAfterDestroy: '_AreNode_onAfterDestroy',\n\n\n\n //=============================================================================\n // Build features\n // ==============================================================================\n /**\n * Feature that is called to tokenize the element node template and extract its content, attributes, and child nodes. \n */\n onTokenize: '_AreNode_onTokenize',\n /**\n * Feature that is called to transform the element node template, markup, styles, and data into a format that can be used for compilation. This feature is responsible for processing the raw template and extracting the necessary information to create the render plan and instructions for the node.\n */\n onTransform: '_AreNode_onTransform',\n /**\n * Event fired when the element node is interpreted\n */\n onInterpret: '_AreNode_onInterpret',\n /**\n * Feature that is called to compile the element node\n */\n onCompile: '_AreNode_onCompile',\n\n\n\n /**\n * Feature that is called to handle events\n */\n onEmit: '_AreNode_onEmit',\n\n\n} as const;\n\n\n\nexport const AreNodeStatuses = {\n /**\n * Status indicating that the node is pending compilation. When a node is in the pending status, it means that it has been created but has not yet been compiled. During this phase, the node is typically being prepared for compilation, which may involve setting up its template, markup, styles, and any associated data or context. Once the node is ready for compilation, its status will change to \"compiling\".\n */\n Pending: 'pending',\n /**\n * Status indicating that the node is in the process of being compiled. During this status, the node is being analyzed and transformed based on its template, markup, and styles to generate the necessary instructions for rendering and updating the node in the scene.\n */\n Compiling: 'compiling',\n /**\n * Status indicating that the node has been compiled and is ready to be rendered. In this status, the node has generated all the necessary instructions and is prepared to be mounted in the scene.\n */\n Compiled: 'compiled',\n /**\n * Status indicating that the node is currently mounted in the scene. When a node is mounted, it means that it has been rendered and is actively part of the scene's structure and content.\n */\n Mounted: 'mounted',\n /**\n * Status indicating that the node has been unmounted from the scene. When a node is unmounted, it means that it has been removed from the scene's structure and content, and is no longer actively rendered in the scene.\n */\n Unmounted: 'unmounted',\n} as const;","import { A_Context, A_Entity, A_Error, A_Feature, A_FormatterHelper, A_Scope, A_TypeGuards, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreEvent } from \"@adaas/are/event/AreEvent.context\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { Are } from \"@adaas/are/component/Are.component\";\nimport { AreNodeFeatures, AreNodeStatuses } from \"./AreNode.constants\";\nimport { AreNodeNewProps, AreNodeStatusNames } from \"./AreNode.types\";\nimport { AreSyntaxTokenPayload } from \"@adaas/are/syntax/AreSyntax.types\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreNode',\n description: 'An AreNode entity represents a node within the A-Concept Rendering Engine (ARE) framework. It encapsulates content, markup, and styles, and manages its own scope for nested fragments and entities. AreNodes are responsible for handling events, compiling, rendering, updating, and lifecycle management within the ARE context.'\n})\nexport class AreNode extends A_Entity<AreNodeNewProps> {\n /**\n * The current status of the node, which can be used to track the lifecycle and rendering state of the node within the scene. \n */\n status!: AreNodeStatusNames;\n\n /**\n * The opening string that defines the start of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The opening string can include the tag name, attributes, and other syntax that indicates the beginning of a node.\n */\n protected _opening!: string;\n /**\n * The closing string that defines the end of a node in the source. This is typically used for parsing and tokenizing the source to identify the structure and content of the node. The closing string can include the tag name, attributes, and other syntax that indicates the end of a node.\n */\n protected _closing!: string;\n /**\n * The position of the node in the source string, which can be used for error reporting, debugging, and other purposes related to tracking the location of the node within the original source. The position is a character index identifying where the node is defined.\n */\n protected _position!: number;\n /**\n * The payload associated with the node, which can include any additional data or metadata that is extracted during the tokenization process. The payload can be used to store custom information related to the node, such as directive arguments, binding expressions, or any other relevant data that may be needed for processing and rendering the node within the scene.\n */\n protected _payload?: AreSyntaxTokenPayload\n /**\n * Content string defined for the node — the inner content between delimiters.\n * Example: `{{name}}`\n */\n protected _content!: string\n /**\n * Markup string defined for the node\n * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n */\n protected _markup!: string\n /**\n * The scope associated with this node\n * uses to store all nested fragments and entities like other AreNodes and Scene\n */\n protected _scope!: A_Scope\n\n /**\n * Actual node identifier. \n */\n get id(): string {\n return this.aseid.id;\n }\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get type(): string {\n return this.aseid.entity;\n }\n /**\n * Content string defined for the node — the inner content between delimiters.\n * Example: `{{name}}`\n */\n get content(): string {\n return this._content;\n }\n /**\n * Markup string defined for the node\n * Example: `<custom-component :prop=\"value\"> <div>Inner Content</div> </custom-component>`\n */\n get markup(): string {\n return this._markup;\n }\n /**\n * The scope associated with this node\n * uses to store all nested fragments and entities like other AreNodes and Scene\n */\n get scope(): A_Scope {\n if (!this._scope) {\n this._scope = A_Context.allocate(this, new A_Scope({ name: `${this.aseid.id}-scope` }));\n }\n\n return this._scope;\n }\n /**\n * The attributes defined for the node, which can include static attributes, binding attributes, directive attributes, and event attributes. These attributes are extracted during tokenization and processed during the compilation phase to generate the corresponding SceneInstructions for rendering and updating the node in the scene.\n */\n get attributes(): AreAttribute[] {\n return this.scope.resolveFlatAll<AreAttribute>(AreAttribute);\n }\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own content, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n /**\n * The parent node of this node, which is the node that registered the current node in its scope. This is typically the node that is responsible for rendering the current node and managing its lifecycle within the scene. The parent node can be used to access shared context, propagate events, and manage interactions between nodes in a hierarchical structure.\n * \n * Example: For a node defined as `<div><span>Child Node</span></div>`, the parent node of the `<span>` element would be the `<div>` element, which is responsible for rendering the `<span>` and managing its lifecycle within the scene.\n */\n get parent(): AreNode | undefined {\n const parentIssuer = this.scope.parent?.issuer();\n\n if (!parentIssuer || !(parentIssuer instanceof AreNode)) return undefined;\n\n return parentIssuer as AreNode | undefined;\n }\n /**\n * The child nodes of this node, which are typically defined in the markup and registered in the scope as child entities. These child nodes can represent nested elements or components within the node and can have their own content, markup, styles, and features. The child nodes are managed within the scope of the parent node and can be accessed and manipulated as needed for rendering, updating, and lifecycle management.\n * \n * Example: For a node defined as `<div><span>Child Node</span></div>`, the child node would be the `<span>` element, which is registered as a child entity in the scope of the parent `<div>` node.\n */\n get children(): (AreNode)[] {\n return this.scope.resolveFlatAll<AreNode>(AreNode) || [];\n }\n /**\n * It returns the scene where the node exists, so it should be the scene of the rootNode, \n * primary parent of this node.\n */\n get scene(): AreScene {\n if (!this._scene)\n this._scene = this.scope.resolve<AreScene>(AreScene)!;\n return this._scene;\n }\n\n\n protected _scene!: AreScene;\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n this.aseid = this.generateASEID({\n id: newEntity.payload?.id,\n entity: newEntity.payload?.entity || 'node',\n scope: newEntity.payload?.scope,\n });\n\n this.status = AreNodeStatuses.Pending;\n this._content = newEntity.content || '';\n this._markup = newEntity.raw || '';\n this._opening = newEntity.opening || '';\n this._closing = newEntity.closing || '';\n this._position = newEntity.position || 0;\n this._payload = newEntity.payload;\n }\n\n\n fromASEID(aseid: string | ASEID): void {\n super.fromASEID(aseid);\n\n this._content = '';\n this._markup = '';\n this.status = AreNodeStatuses.Pending;\n }\n /**\n * Sets the content string for the node — the inner text/markup between the node's\n * opening and closing delimiters. Content is processed by the rendering engine to\n * generate the corresponding SceneInstructions for rendering the node.\n * \n * @param content \n */\n setContent(content: string): void {\n this._content = content;\n }\n /**\n * Sets the markup string for the node, which is the full raw matched string including delimiters. The markup can include HTML-like syntax, custom components, directives, and other features that are processed by the rendering engine to generate the corresponding SceneInstructions for rendering the node.\n * \n * @param markup \n */\n setMarkup(markup: string): void {\n this._markup = markup;\n }\n /**\n * Adds a child node to the current node's scope and ensures the child inherits from this node's scope.\n * \n * @param child - The node to add as a child\n */\n addChild(child: AreNode): void {\n this.scope.register(child);\n\n if (!child.scope.isInheritedFrom(this.scope))\n child.scope.inherit(this.scope);\n }\n /**\n * Removes a child node from the current node's scope. This is typically used when a child node is no longer needed or should be detached from the parent node. The method ensures that the child node is properly deregistered from the scope and any associated resources are cleaned up as necessary.\n * \n * @param node - The child node to be removed from the current node's scope\n */\n removeChild(node: AreNode): void {\n this.scope.deregister(node);\n }\n\n // ============================================================================================\n // Node Lifecycle Methods\n // ============================================================================================\n /**\n * Executes initialization logic for the node, which typically involves setting up the node's scope, registering any necessary entities, and preparing the node for rendering and interaction within the scene. This method is called during the initial phase of the node's lifecycle and is responsible for ensuring that the node is properly initialized before it is compiled and rendered in the scene.\n */\n init(): void {\n\n // const context = this.scope.resolve(AreContext);\n\n // context?.startPerformance('Node Init');\n this.call(AreNodeFeatures.onBeforeInit, this.scope);\n this.call(AreNodeFeatures.onInit, this.scope);\n this.call(AreNodeFeatures.onAfterInit, this.scope);\n // context?.endPerformance('Node Init');\n }\n\n\n /**\n * Loads the node, which typically involves executing any necessary setup or initialization logic to prepare the node for rendering and interaction within the scene. This may include processing the node's content, markup, styles, and features to generate the corresponding SceneInstructions, as well as setting up any event listeners or reactive properties as needed.\n */\n async load(): Promise<any> {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Load');\n\n const res = super.load(this.scope);\n\n context?.endPerformance('Node Load');\n\n return res;\n } catch (error) {\n throw error;\n }\n }\n /**\n * Tokenizes the node content, which typically involves parsing the raw content string to identify the structure, child nodes, attributes, directives, and other features. This process is essential for breaking down the content into its constituent parts and preparing it for further processing during the compilation phase. The tokenization process can involve creating child nodes, extracting attributes and their values, and identifying any directives or bindings that need to be processed during rendering.\n */\n tokenize(): void {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Tokenize');\n this.call(AreNodeFeatures.onTokenize, this.scope);\n context?.endPerformance('Node Tokenize');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Transforms the node, which typically involves executing any necessary logic to reshape the node's structure or content before it is compiled and rendered in the scene. This may include applying any transformations defined by directives, processing any dynamic content or expressions, and performing any other necessary tasks to ensure that the node is properly prepared for compilation and rendering based on its content, markup, styles, and features.\n */\n transform(): void {\n this.checkScopeInheritance();\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Transform');\n\n this.call(AreNodeFeatures.onTransform, this.scope);\n\n context?.endPerformance('Node Transform');\n } catch (error) {\n throw error;\n }\n }\n\n /**\n * Compile the node. This method should transform the node's content, markup, and styles into a set of SceneInstructions that can be executed to render the node in the scene. The compile method is responsible for processing the node's features, attributes, directives, and other properties to generate the necessary instructions for rendering and updating the node in response to changes in state or context.\n * \n * [!] Note: The compile method should ensure that the node's scope is properly inherited from the context scope before processing, and it should handle any errors that may occur during compilation to ensure that the node can be rendered correctly in the scene.\n */\n compile(): void {\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Compile');\n\n this.call(AreNodeFeatures.onCompile, this.scope);\n\n context?.endPerformance('Node Compile');\n } catch (error) {\n throw error;\n }\n }\n /**\n * Mounts the node, which typically involves executing any necessary logic to render the node in the scene and to set up any interactions or behaviors associated with the node. This may include applying the generated SceneInstructions from the compile phase, attaching event listeners, and performing any other necessary tasks to ensure that the node is properly rendered and functional within the scene.\n * \n * [!] Note: The mount method should ensure that the node's scope is properly inherited from the context scope before performing any mounting logic, and it should handle any errors that may occur during mounting to ensure that the node can be rendered correctly in the scene.\n */\n mount(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Mount');\n\n this.call(AreNodeFeatures.onBeforeMount, this.scope);\n this.call(AreNodeFeatures.onMount, this.scope);\n this.call(AreNodeFeatures.onAfterMount, this.scope);\n\n context?.endPerformance('Node Mount');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Interprets the node, which typically involves executing any necessary logic to process the node's features, attributes, directives, and other properties to generate the corresponding SceneInstructions for rendering and updating the node in response to changes in state or context. This method is responsible for ensuring that the node is properly interpreted based on its content, markup, styles, and features to enable dynamic behavior and responsiveness within the scene.\n * \n * [!] Note: The interpret method should NOT go though own child, since it may be used by both mount and update operations!\n */\n interpret(): void {\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Interpret');\n\n this.call(AreNodeFeatures.onInterpret, this.scope);\n\n context?.endPerformance('Node Interpret');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Updates the node, which typically involves executing any necessary logic to update the node's rendering and behavior in response to changes in state, context, or other factors. This may include reapplying SceneInstructions, updating event listeners, and performing any other necessary tasks to ensure that the node remains functional and correctly rendered within the scene as changes occur.\n * \n * [!] Note: The update method should ensure that the node's scope is properly inherited from the context scope before performing any update logic, and it should handle any errors that may occur during updating to ensure that the node can be updated correctly in the scene.\n */\n update(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Update');\n this.call(AreNodeFeatures.onBeforeUpdate, this.scope);\n this.call(AreNodeFeatures.onUpdate, this.scope);\n this.call(AreNodeFeatures.onAfterUpdate, this.scope);\n\n context?.endPerformance('Node Update');\n\n } catch (error) {\n throw error;\n }\n }\n /**\n * Unmounts the node, which typically involves executing any necessary logic to remove the node from the scene and to clean up any resources associated with the node. This may include reverting any applied SceneInstructions, detaching event listeners, and performing any other necessary tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n * \n * [!] Note: The unmount method should ensure that the node's scope is properly inherited from the context scope before performing any unmounting logic, and it should handle any errors that may occur during unmounting to ensure that the node can be removed correctly from the scene.\n */\n unmount(): void {\n\n this.checkScopeInheritance();\n\n try {\n const context = this.scope.resolve(AreContext);\n\n context?.startPerformance('Node Unmount');\n\n this.call(AreNodeFeatures.onBeforeUnmount, this.scope);\n this.call(AreNodeFeatures.onUnmount, this.scope); \n this.call(AreNodeFeatures.onAfterUnmount, this.scope);\n\n context?.endPerformance('Node Unmount');\n\n } catch (error) {\n throw error;\n }\n }\n\n cloneWithScope<T extends AreNode = AreNode>(this: T): T {\n const currentScope = this.scope;\n\n A_Context.deallocate(currentScope);\n\n const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n opening: this._opening,\n closing: this._closing,\n position: this._position,\n payload: this._payload || {},\n content: this._content,\n raw: this._markup,\n });\n\n if (newNode._scope)\n A_Context.deallocate(newNode._scope);\n\n newNode._scope = currentScope;\n\n A_Context.allocate(newNode, currentScope);\n\n this._scope = A_Context.allocate(this);\n\n return newNode as T;\n }\n\n reset(): void {\n for (const child of this.children) {\n this.scope.deregister(child);\n }\n\n for (const attribute of this.attributes) {\n this.scope.deregister(attribute);\n }\n }\n\n clone<T extends AreNode = AreNode>(this: T): T {\n const newNode = new (this.constructor as new (props: AreNodeNewProps) => T)({\n opening: this._opening,\n closing: this._closing,\n position: this._position,\n payload: this._payload || {},\n content: this._content,\n raw: this._markup,\n });\n\n /**\n * Clone all content\n */\n for (const child of this.children) {\n newNode.addChild(child.clone());\n }\n /**\n * Clone all attributes\n */\n for (const attribute of this.attributes) {\n newNode.scope.register(attribute.clone());\n }\n\n return newNode as T;\n }\n\n /**\n * Emits an event or a scope to the node, which can be used to trigger event handlers or to provide additional context for processing within the node. The method can accept either an AreEvent instance or an A_Scope instance, and it will handle the emission accordingly. This allows for flexible communication and interaction within the node's context, enabling dynamic behavior and responsiveness based on events or changes in scope.\n * \n * @param scope - The scope or event to be emitted to the node\n */\n async emit(\n scope: A_Scope,\n )\n async emit(\n event: AreEvent,\n )\n async emit(\n eventOrScope: AreEvent | A_Scope,\n ) {\n this.checkScopeInheritance();\n\n /**\n * isolated event scope to avoid polluting the node scope\n */\n const eventScope = A_TypeGuards.isScopeInstance(eventOrScope)\n ? eventOrScope\n .inherit(this.scope)\n : new A_Scope({\n name: `${eventOrScope.name}-scope`,\n fragments: [eventOrScope]\n })\n .inherit(this.scope)\n\n try {\n await this.call(AreNodeFeatures.onEmit, eventScope)\n\n eventScope.destroy()\n\n } catch (error) {\n eventScope.destroy();\n\n throw error;\n }\n\n }\n\n\n /**\n * Destroys the node, which typically involves executing any necessary cleanup logic to remove the node from the scene and to free up any resources associated with the node. This may include deregistering the node from its scope, removing any event listeners or reactive properties, and performing any other necessary cleanup tasks to ensure that the node is properly removed from the scene and that resources are released as needed.\n * \n * [!] Note: The destroy method should ensure that the node's scope is properly inherited from the context scope before performing any cleanup, and it should handle any errors that may occur during destruction to ensure that resources are released correctly.\n */\n async destroy(): Promise<any> {\n this.checkScopeInheritance();\n try {\n\n await super.destroy(this.scope);\n\n this.scope.destroy();\n\n } catch (error) {\n\n this._scope.destroy();\n\n throw error;\n }\n }\n\n\n //============================================================================================\n // Helpers Methods\n //============================================================================================\n /**\n * Method to ensure that the current scope is inherited from the context scope\n * \n * @throws A_Error if the scope is not inherited from the context scope\n */\n protected checkScopeInheritance(): void {\n let attachedScope: A_Scope;\n\n try {\n attachedScope = A_Context.scope(this);\n } catch (error) {\n throw new A_Error({\n title: `A_UI_Node Scope Inheritance Error`,\n description: `The A_UI_Node entity with ASEID '${this.aseid.toString()}' is not bound to any context scope. Please ensure that the entity is created within a valid context.`,\n originalError: error\n });\n }\n }\n}","export const AreAttributeFeatures = {\n /**\n * Initializes the attribute. This method is called when the attribute is first created and should set up any necessary state or perform any initial processing based on the provided content and context. It can also be used to validate the attribute's content and throw errors if it is invalid.\n */\n Init: '_AreAttribute_Init',\n /**\n * Uses to generate all rendering instructions for the attribute. This method is called during the compilation phase of the ARE component and should return an array of instructions that describe how to render the attribute based on its content and context. The instructions can include details such as which DOM properties to set, which events to listen for, and how to update the attribute when the underlying data changes.\n */\n Transform: '_AreAttribute_Transform',\n /**\n * Feature that should convert a directiveAttribute definition into a set of SceneInstructions to be rendered correctly\n */\n Compile: '_AreAttribute_Compile',\n /**\n * Feature that should update the directiveAttribute based on the changes in the store or other dependencies. This method is called during the update phase of the ARE component and should perform any necessary updates to the attribute based on changes in the underlying data or context. This can include tasks such as updating DOM properties, re-evaluating expressions, or modifying event listeners to ensure that the attribute remains in sync with the current state of the application.\n */\n Update: '_AreAttribute_Update',\n /**\n * Feature that should validate the attribute's content and context. This method is called during the validation phase of the ARE component and should check whether the attribute's content is valid based on its expected format, type, or other constraints. If the content is invalid, this method should throw an error with a descriptive message to help developers identify and fix the issue.\n */\n Validate: '_AreAttribute_Validate',\n} as const\n","import { A_Context, A_Entity, A_Feature, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreAttributeFeatures } from \"./AreAttribute.constants\";\nimport { AreAttribute_Init, AreAttribute_Serialized } from \"./AreAttribute.types\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreAttribute',\n description: 'Represents an HTML attribute within the A-Concept Rendering Engine (ARE) framework, encapsulating the attribute\\'s name, raw content, evaluated value, and associated features for initialization, transformation, compilation, updating, and validation.'\n})\nexport class AreAttribute extends A_Entity<AreAttribute_Init, AreAttribute_Serialized> {\n\n /**\n * Property name (e.g. \"label\")\n */\n name!: string;\n /**\n * Full raw attribute (e.g. ' :label=\"buttonLabel\" ')\n */\n raw!: string;\n /**\n * Attribute content (e.g. \"buttonLabel\")\n * Example: For a directive like `v-if=\"condition\"`, the raw value is \"condition\", but the content would be \"condition\" without the quotes, and the value would be the result of evaluating \"condition\" in the current scope.\n */\n content!: string;\n /**\n * The evaluated value of the attribute, which can be different from the raw value depending on the context and type of the attribute. For example, for a directive like `v-if=\"condition\"`, the raw value is \"condition\", but the evaluated value would be the result of evaluating \"condition\" in the current scope.\n */\n value!: any;\n /**\n * The prefix of the attribute, for example for ':label' it would be ':', for 'v-if' it would be 'v-'. This can be used to determine the type of the attribute and how to process it.\n */\n prefix!: string;\n /**\n * The scope where the attribute is defined, which can be used to access other entities and features within the same scope. This is particularly useful for attributes that need to interact with other parts of the scene or component, as it allows them to access shared data and functionality without needing to pass it explicitly through parameters.\n */\n get scope() {\n return A_Context.scope(this);\n }\n /**\n * The owner node of the attribute, which is the node that the attribute is attached to. This can be used to access the properties and features of the owner node, as well as to determine the context in which the attribute is being used. For example, if the attribute is attached to a button element, the owner would be that button node, and the attribute could use this information to modify the button's behavior or appearance based on its content and context.\n */\n get owner(): AreNode {\n return this.scope.issuer() as AreNode;\n }\n\n /**\n * Initializes the attribute based on the provided properties. This method is called when a new attribute is created and should set up the attribute's state based on the provided properties. It can also be used to generate a unique ASEID for the attribute based on its name and content, which can be used for caching and identification purposes within the ARE framework.\n * \n * @param newEntity \n */\n fromNew(newEntity: AreAttribute_Init): void {\n // const identity = {\n // name: newEntity.name,\n // prefix: newEntity.prefix,\n // content: newEntity.content,\n // };\n\n // const id = A_UtilsHelper.hash(identity);\n\n this.aseid = this.generateASEID({\n entity: newEntity.name,\n // id: id,\n });\n\n this.name = newEntity.name;\n this.prefix = newEntity.prefix;\n this.raw = newEntity.raw;\n this.content = newEntity.content;\n }\n // =====================================================================================\n // ------------------------------- Attribute Methods ------------------------------\n // =====================================================================================\n /**\n * Creates a clone of the current attribute instance. This method can be used to create a new instance of the attribute with the same properties and state as the original, which can be useful in scenarios where you want to reuse an attribute's configuration or create variations of it without modifying the original instance.\n * \n * @returns \n */\n clone(): this {\n return new (this.constructor as new (init: AreAttribute_Init) => this)({\n name: this.name,\n raw: this.raw,\n content: this.content,\n prefix: this.prefix,\n });\n }\n // =====================================================================================\n // ------------------------------- Attribute Lifecycle ------------------------------\n // =====================================================================================\n /**\n * Initializes the attribute. This method is called when the attribute is first created and should set up any necessary state or perform any initial processing based on the provided content and context. It can also be used to validate the attribute's content and throw errors if it is invalid.\n * \n * @param scope \n */\n init(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Init, scope || this.scope);\n }\n /**\n * Generates all rendering instructions for the attribute. This method is called during the compilation phase of the ARE component and should return an array of instructions that describe how to render the attribute based on its content and context. The instructions can include details such as which DOM properties to set, which events to listen for, and how to update the attribute when the underlying data changes.\n * \n * @param scope \n */\n transform(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Transform, scope || this.scope);\n }\n /**\n * Compiles the attribute. This method should transform attribute details into a set of SceneInstructions. It may also modify attribute value, since this field is editable during runtime.\n * \n * @param scope \n */\n @A_Frame.Method({\n description: \"Compile the attribute. This method should transform attribute details into a set of SceneInstructions. It may also modify attribute value, since this field is editable during runtime.\",\n })\n compile(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Compile, scope || this.scope);\n }\n /**\n * Updates the attribute based on changes in the store or other dependencies. This method is called during the update phase of the ARE component and should perform any necessary updates to the attribute based on changes in the underlying data or context. This can include tasks such as updating DOM properties, re-evaluating expressions, or modifying event listeners to ensure that the attribute remains in sync with the current state of the application.\n * \n * @param scope \n */\n update(scope?: A_Scope) {\n this.call(AreAttributeFeatures.Update, scope || this.scope);\n }\n /**\n * Validates the attribute's content and context. This method is called during the validation phase of the ARE component and should check whether the attribute's content is valid based on its expected format, type, or other constraints. If the content is invalid, this method should throw an error with a descriptive message to help developers identify and fix the issue.\n * \n * @param scope \n */\n validate(scope?: A_Scope): void {\n this.call(AreAttributeFeatures.Validate, scope || this.scope);\n }\n}","import { A_Fragment } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreSyntaxCompiledExpression, AreSyntaxInitOptions, AreSyntaxTokenRules } from \"./AreSyntax.types\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreSyntaxContext',\n description: 'Context that defines the syntax rules and structures for the A-Concept Rendering Engine (ARE). It provides mechanisms for parsing and interpreting templates, attributes, directives, interpolations, and event listeners, enabling dynamic and interactive UI rendering within the ARE framework.'\n})\nexport class AreSyntax extends A_Fragment {\n /**\n * Max allowed length of an expression string to prevent excessively long inputs that could lead to performance issues or abuse.\n */\n private readonly MAX_LENGTH = 500\n /**\n * Max allowed nesting depth of parentheses, brackets, and braces in expressions to prevent excessively complex inputs that could lead to performance issues or abuse. Default is 5 levels of nesting.\n */\n private readonly MAX_DEPTH = 5\n /**\n * List of regex patterns that are blocked in expressions to prevent access to unsafe or sensitive features. This includes patterns for global objects, functions, and syntax that could be used for malicious purposes (e.g. \"eval\", \"Function\", \"fetch\", \"XMLHttpRequest\", \"import\", \"require\", \"document\", \"window\", \"globalThis\", \"global\", \"process\", \"__proto__\", \"constructor\", \"prototype\"). Expressions containing any of these patterns will be rejected during validation.\n */\n private readonly BLOCKED_PATTERNS: RegExp[] = [\n /\\beval\\b/,\n /\\bFunction\\b/,\n /\\bfetch\\b/,\n /\\bXMLHttpRequest\\b/,\n /\\bimport\\b/,\n /\\brequire\\b/,\n /\\bdocument\\b/,\n /\\bwindow\\b/,\n /\\bglobalThis\\b/,\n /\\bglobal\\b/,\n /\\bprocess\\b/,\n /\\b__proto__\\b/,\n /\\bprototype\\b/,\n /\\bconstructor\\b/,\n /\\bObject\\s*\\.\\s*assign\\b/,\n /\\bObject\\s*\\.\\s*defineProperty\\b/,\n /\\bsetTimeout\\b/,\n /\\bsetInterval\\b/,\n /\\blocalStorage\\b/,\n /\\bsessionStorage\\b/,\n /\\bcookie\\b/,\n /\\bWebSocket\\b/,\n /\\bWorker\\b/,\n ]\n /**\n * Set of global identifiers that are blocked in expressions to prevent access to unsafe or sensitive features. This includes global objects and functions that could be used for malicious purposes (e.g. \"eval\", \"Function\", \"fetch\", \"XMLHttpRequest\", \"document\", \"window\", \"globalThis\", \"global\", \"process\", \"setTimeout\", \"setInterval\", \"localStorage\", \"sessionStorage\", \"indexedDB\", \"WebSocket\", \"Worker\"). Accessing any of these identifiers in an expression will be rejected during validation.\n */\n private readonly BLOCKED_GLOBALS = new Set([\n 'eval', 'Function', 'fetch', 'XMLHttpRequest',\n 'document', 'window', 'globalThis', 'global', 'process',\n 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',\n 'localStorage', 'sessionStorage', 'indexedDB',\n 'WebSocket', 'Worker', 'Blob', 'File',\n 'require', 'module', 'exports',\n 'alert', 'confirm', 'prompt',\n ])\n /**\n * Regex pattern that defines the allowed characters in expressions. This pattern allows letters, digits, whitespace, and common operators and punctuation used in JavaScript expressions. Expressions containing characters that do not match this pattern will be rejected during validation to prevent injection of potentially harmful code.\n */\n private readonly ALLOWED_CHARS = /^[\\w\\s\\d\\.\\[\\]()=><|&!+\\-*/%?:,'\"`;~^$]+$/\n /**\n * Simple dot-path identifier pattern (e.g. \"name\", \"user.name\", \"user.profile.name\").\n * Matches strings that consist solely of identifier characters separated by dots.\n */\n private readonly SIMPLE_PATH = /^[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*$/\n /**\n * Compiled expression — a pre-parsed function ready for repeated execution.\n * Created once via compile(), reused on every apply/click.\n */\n\n private readonly _rules: AreSyntaxTokenRules[]\n private readonly _trimWhitespace: boolean\n private readonly _strictMode: boolean\n\n constructor(config?: Partial<AreSyntaxInitOptions>) {\n super({ name: 'AreSyntax' })\n\n this._trimWhitespace = config?.trimWhitespace !== false\n this._strictMode = config?.strictMode !== false\n this._rules = [...(config?.rules ?? [])].sort((a, b) =>\n (b.priority ?? 0) - (a.priority ?? 0)\n )\n }\n /**\n * Get the array of token rules that define the syntax for parsing templates. Each rule specifies how to identify and process a particular type of token (e.g. interpolation, directive, comment) within templates. The rules are checked in order of priority, allowing for flexible and customizable parsing behavior.\n */\n get rules() {\n return this._rules\n }\n /**\n * Indicates whether leading and trailing whitespace should be trimmed from token content. When enabled, any whitespace at the start or end of the content captured by a token will be removed before further processing. This can help prevent issues with unintended spaces affecting rendering or logic, especially in cases like interpolations or directives where extra whitespace may be common. Default is true.\n */\n get trimWhitespace() {\n return this._trimWhitespace\n }\n /**\n * Indicates whether the parser should throw an error when it encounters unclosed tokens. When enabled, if the parser finds an opening delimiter without a corresponding closing delimiter (e.g. an unclosed interpolation or directive), it will throw an error instead of silently ignoring it. This can help catch syntax errors and ensure that templates are well-formed. Default is true.\n */\n get strictMode() {\n return this._strictMode\n }\n\n\n\n /**\n * Compiles an expression string into a reusable executor.\n * Performs validation and Function construction once.\n * Use when the same expression will be evaluated multiple times\n * e.g. event handlers, instructions that re-apply on store changes.\n *\n * @example\n * // compile once at apply() time\n * const compiled = AreCommonHelper.compile('(e) => !!pageTitle ? $testHandler(e, item) : null')\n *\n * // execute on every click — no re-parsing, no re-validation\n * element.addEventListener('click', (e) => {\n * const fn = compiled.execute(store, { $testHandler: handler, item })\n * if (typeof fn === 'function') fn(e)\n * })\n */\n compile(expr: string): AreSyntaxCompiledExpression {\n const trimmed = expr.trim()\n\n // validate once — throws if expression is unsafe or malformed\n this.validate(trimmed)\n\n const isCallable = this.isCallableExpression(trimmed)\n const isSimplePath = this.SIMPLE_PATH.test(trimmed)\n\n // pre-build the Function once — most expensive part\n let compiled: Function | null = null\n\n if (!isSimplePath) {\n try {\n compiled = new Function('scope', `\"use strict\"; with(scope) { return (${trimmed}) }`)\n } catch (e) {\n throw new Error(`Expression syntax error in \"${trimmed}\": ${(e as Error).message}`)\n }\n }\n\n const createSandboxFn = this.createSandbox.bind(this)\n\n return {\n isCallable,\n\n execute(store: AreStore, scope?: Record<string, any>): any {\n // fast path — simple property path, no sandbox needed\n if (isSimplePath) {\n if (scope && trimmed in scope) return scope[trimmed]\n const value = store.get(trimmed)\n if (value !== undefined) return value\n // fall through to sandbox if store didn't resolve it\n }\n\n const sandbox = createSandboxFn(store, scope)\n\n let result: any\n try {\n result = compiled\n ? compiled(sandbox)\n : new Function('scope', `\"use strict\"; with(scope) { return (${trimmed}) }`)(sandbox)\n } catch (e) {\n throw new Error(`Expression evaluation error in \"${trimmed}\": ${(e as Error).message}`)\n }\n\n if (isCallable && typeof result !== 'function') {\n throw new Error(\n `Expression \"${trimmed}\" was expected to be callable — got ${result === null ? 'null' : typeof result}`\n )\n }\n\n return result\n }\n }\n }\n /**\n * Evaluates an expression string against the provided store.\n * Automatically determines whether the result should be callable\n * based on the shape of the expression.\n *\n * Returns the raw value for plain expressions (interpolations, bindings).\n * Returns a bound function for callable expressions (event handlers).\n *\n * @param expr Expression string to evaluate.\n * @param store AreStore used for identifier resolution.\n * @param scope Optional extra bindings checked **before** the store.\n * Useful for injecting event-specific values (`$event`, `element`)\n * or emit wrappers (`$handleClick`).\n *\n * @example\n * // simple value\n * evaluate('user.name', store)\n *\n * // with emit wrapper\n * evaluate('$handleClick($event, user.name)', store, {\n * $event: domEvent,\n * $handleClick: (...args) => node.emit(new AreEvent('handleClick', args)),\n * })\n *\n * // arrow with conditional\n * evaluate('(e) => isValid(user.name) ? $handleClick(e) : null', store, {\n * $handleClick: (...args) => node.emit(new AreEvent('handleClick', args)),\n * })\n */\n evaluate(expr: string, store: AreStore, scope?: Record<string, any>): any {\n const trimmed = expr.trim()\n\n this.validate(trimmed)\n\n /**\n * Fast path: if the expression is a simple property path (e.g. \"name\", \"user.name\"),\n * resolve it directly — first from scope, then from the store — without going\n * through the sandbox/Function constructor.\n */\n if (this.SIMPLE_PATH.test(trimmed)) {\n if (scope && trimmed in scope) return scope[trimmed]\n\n const value = store.get(trimmed)\n if (value !== undefined) return value\n\n /**\n * If the full dot-path didn't resolve, fall back to the sandbox approach\n * in case the store holds a nested object under the first key.\n */\n }\n\n const sandbox = this.createSandbox(store, scope)\n const result = this.execute(trimmed, sandbox)\n\n if (this.isCallableExpression(trimmed)) {\n if (typeof result !== 'function') {\n throw new Error(\n `Expression \"${trimmed}\" was expected to be callable — got ${result === null ? 'null' : typeof result}`\n )\n }\n }\n\n return result\n }\n\n /**\n * Extracts $-prefixed handler names from an expression.\n * These represent event emission targets, not store references.\n *\n * Examples:\n * \"$handleClick\" → Set([\"handleClick\"])\n * \"$handleClick(user.name)\" → Set([\"handleClick\"])\n * \"(e) => isValid(user.name) ? $handleClick(e) : null\" → Set([\"handleClick\"])\n */\n extractEmitHandlers(expr: string): Set<string> {\n const stripped = expr.trim().replace(/'[^']*'|\"[^\"]*\"|`[^`]*`/g, '\"\"')\n const handlers = new Set<string>()\n const pattern = /\\$([a-zA-Z_][\\w$]*)/g\n let match: RegExpExecArray | null\n\n while ((match = pattern.exec(stripped)) !== null) {\n handlers.add(match[1])\n }\n\n return handlers\n }\n\n // ── Classification ────────────────────────────────────────────────────────\n\n private isCallableExpression(expr: string): boolean {\n // arrow function: () => ... or x => ...\n if (/^\\(?[\\w\\s,]*\\)?\\s*=>/.test(expr)) return true\n\n // function keyword: function(...) { }\n if (/^function\\s*\\(/.test(expr)) return true\n\n // plain identifier with no operators — could be a function ref\n // but only if it resolves to a function — we let the guard handle it\n // so we don't classify this as callable upfront\n return false\n }\n\n // ── Validation ────────────────────────────────────────────────────────────\n\n private validate(expr: string): void {\n if (expr.length > this.MAX_LENGTH) {\n throw new Error(\n `Expression exceeds maximum length of ${this.MAX_LENGTH} characters`\n )\n }\n\n for (const pattern of this.BLOCKED_PATTERNS) {\n if (pattern.test(expr)) {\n throw new Error(`Expression contains blocked pattern: ${pattern.source}`)\n }\n }\n\n if (!this.ALLOWED_CHARS.test(expr)) {\n throw new Error(`Expression contains disallowed characters`)\n }\n\n this.checkDepth(expr)\n }\n\n private checkDepth(expr: string): void {\n let depth = 0\n let max = 0\n for (const ch of expr) {\n if (ch === '(' || ch === '[' || ch === '{') { depth++; max = Math.max(max, depth) }\n if (ch === ')' || ch === ']' || ch === '}') depth--\n }\n if (max > this.MAX_DEPTH) {\n throw new Error(`Expression exceeds maximum nesting depth of ${this.MAX_DEPTH}`)\n }\n }\n\n // ── Sandbox ───────────────────────────────────────────────────────────────\n\n private createSandbox(store: AreStore, scope?: Record<string, any>): object {\n return new Proxy({}, {\n has: (_, key) => {\n if (typeof key === 'string' && this.BLOCKED_GLOBALS.has(key)) return false\n return true\n },\n get: (_, key) => {\n if (typeof key !== 'string') return undefined\n\n // Scope bindings take priority over the store\n if (scope && key in scope) return scope[key]\n\n this.assertSafeKey(key)\n\n const value = store.get(key)\n if (typeof value === 'function') return value.bind(store)\n if (value !== null && typeof value === 'object' && value !== undefined) {\n return new Proxy(value as object, this.nestedHandler(key, store))\n }\n return value\n },\n set: () => { throw new Error('Expression scope is read-only') },\n })\n }\n\n private nestedHandler(prefix: string, store: AreStore): ProxyHandler<object> {\n return {\n has: () => true,\n get: (target, key) => {\n if (typeof key !== 'string') return undefined\n this.assertSafeKey(key)\n\n const fullKey = `${prefix}.${key}`\n const value = store.get(fullKey)\n\n if (value === undefined) return (target as any)[key]\n if (typeof value === 'function') return value.bind(store)\n if (value !== null && typeof value === 'object') {\n return new Proxy(value as object, this.nestedHandler(fullKey, store))\n }\n return value\n },\n set: () => { throw new Error('Expression scope is read-only') },\n }\n }\n\n private assertSafeKey(key: string): void {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n throw new Error(`Access to \"${key}\" is not allowed in expressions`)\n }\n if (this.BLOCKED_GLOBALS.has(key)) {\n throw new Error(`Access to \"${key}\" is not allowed in expressions`)\n }\n }\n\n // ── Execution ─────────────────────────────────────────────────────────────\n\n private execute(expr: string, sandbox: object): any {\n let fn: Function\n try {\n fn = new Function('scope', `with(scope) { return (${expr}) }`)\n } catch (e) {\n throw new Error(`Expression syntax error in \"${expr}\": ${(e as Error).message}`)\n }\n\n try {\n return fn(sandbox)\n } catch (e) {\n throw new Error(`Expression evaluation error in \"${expr}\": ${(e as Error).message}`)\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreSyntaxError extends A_Error {\n\n static readonly SyntaxParseError = 'Are Syntax Parse Error';\n static readonly SyntaxNotSupportedError = 'Are Syntax Not Supported Error';\n static readonly MethodNotImplementedError = 'Are Syntax Method Not Implemented Error';\n\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreTokenizerError extends A_Error {\n\n}","import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreSyntaxTokenMatch, AreSyntaxTokenRules } from \"@adaas/are/syntax/AreSyntax.types\";\nimport { AreSyntax } from \"@adaas/are/syntax/AreSyntax.context\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n// import { AreEngine } from \"@adaas/are/engine/AreEngine.component\";\nimport { AreEngineFeatures } from \"@adaas/are/engine/AreEngine.constants\";\nimport { AreTokenizerError } from \"./AreTokenizer.error\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreTokenizer',\n description: 'AreTokenizer is responsible for scanning and tokenizing template source strings using the syntax rules defined in AreSyntax. It converts raw template strings into AreNode instances that represent the structured AST of the template, enabling downstream compilation and rendering within the ARE framework.'\n})\nexport class AreTokenizer extends A_Component {\n\n /**\n * Get the AreSyntax from the current scope. The AreSyntax defines the syntax rules and structures for tokenizing templates. It provides mechanisms for parsing and interpreting templates, attributes, directives, interpolations, and event listeners, enabling dynamic and interactive UI rendering within the ARE framework. If no AreSyntax is found in the scope, an error is thrown indicating that AreTokenizer requires an AreSyntax to function properly.\n */\n protected get config(): AreSyntax {\n const syntax = A_Context.scope(this).resolve(AreSyntax);\n\n if (!syntax) throw new AreTokenizerError({\n title: 'Syntax Context Not Found',\n description: 'AreTokenizer requires an AreSyntax to be present in the same scope. Ensure that an AreSyntax fragment is included in the concept and is accessible from the scope where AreTokenizer is used.'\n });\n\n return syntax\n }\n\n /**\n * Instantiate AreNodes based on the token matches obtained from scanning the source template. This method takes the raw source string from the context, scans it for tokens using the defined syntax rules, and creates corresponding AreNode instances for each matched token. The resulting array of AreNodes represents the structured representation of the template, which can then be used for further processing, such as rendering or applying scene instructions.\n * \n * \n * @param context \n * @returns \n */\n @A_Feature.Extend({\n name: AreEngineFeatures.Load,\n // scope: [AreEngine]\n })\n instantiate<T extends AreNode>(\n @A_Inject(AreContext) context: AreContext,\n ): void {\n context.startPerformance('Tokenizer Instantiate');\n\n const source = context.source;\n\n const nodes = this\n .scan(source, 0, source.length, context)\n .map(match => {\n const rule = this.findRuleForMatch(match)\n if (!rule) throw new Error(`No rule found for match at position ${match.position}`)\n return new (rule.component as typeof AreNode)(match)\n })\n\n for (const node of nodes) {\n context.addRoot(node)\n }\n\n context.endPerformance('Tokenizer Instantiate');\n }\n\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTokenize,\n scope: [AreNode]\n })\n tokenize(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n context.startPerformance(`Tokenize method`);\n\n const source = node.content\n const content = this\n .scan(source, 0, source.length, context)\n .map(match => {\n const rule = this.findRuleForMatch(match)\n if (!rule) throw new Error(`No rule found for match at position ${match.position}`)\n return new (rule.component as typeof AreNode)(match)\n })\n\n logger?.debug('red', `Tokenized node <${node.aseid.toString()}> with content:`, content.length);\n\n context.endPerformance(`Tokenize method`);\n\n context.startPerformance(`Tokenize node Create Children`);\n for (const child of content) {\n node.addChild(child);\n\n context.startPerformance('AreTokenizer.tokenize child init');\n child.init();\n // child.call(AreNodeFeatures.onInit, child.scope);\n\n context.endPerformance('AreTokenizer.tokenize child init');\n }\n\n context.endPerformance(`Tokenize node Create Children`);\n\n\n }\n\n protected scan(source: string, from: number, to: number, context: AreContext): AreSyntaxTokenMatch[] {\n context.startPerformance('Tokenizer Scan');\n\n const tokens: AreSyntaxTokenMatch[] = []\n let index = from\n let hasMatchBefore = false\n\n while (index < to) {\n const match = this.findNextMatch(source, index, to)\n if (!match) {\n const rest = source.slice(index, to)\n /**\n * Trailing text (after the last match). When trimWhitespace is on,\n * discard it if it is whitespace-only — it is edge indentation/newlines.\n */\n const t = this.tryPlainText(rest, index)\n if (t && !(this.config.trimWhitespace && !rest.trim())) tokens.push(t)\n break\n }\n if (match.position > index) {\n const plain = source.slice(index, match.position)\n const t = this.tryPlainText(plain, index)\n if (t) {\n /**\n * When trimWhitespace is on and the text is whitespace-only:\n * - Discard if it is leading text (before the first match)\n * - Preserve (collapse to single space) if it is between two matches\n */\n if (this.config.trimWhitespace && !plain.trim()) {\n if (hasMatchBefore) {\n t.content = ' '\n tokens.push(t)\n }\n // else: leading whitespace — skip\n } else {\n tokens.push(t)\n }\n }\n }\n tokens.push(match)\n hasMatchBefore = true\n index = match.position + match.raw.length\n }\n\n context.endPerformance('Tokenizer Scan');\n\n\n return tokens\n }\n\n protected findNextMatch(source: string, from: number, to: number): AreSyntaxTokenMatch | null {\n let earliest: AreSyntaxTokenMatch | null = null\n for (const rule of this.config.rules) {\n if (!rule.opening && !rule.closing && !rule.pattern && !rule.matcher) continue\n const match = this.matchRule(source, rule, from, to)\n if (!match) continue\n if (!earliest || match.position < earliest.position) earliest = match\n }\n return earliest\n }\n\n protected matchRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n if (rule.matcher) {\n return rule.matcher(source, from, to, (raw, content, position, closing) =>\n this.buildMatch(rule, raw, content, position, closing)\n )\n }\n if (rule.pattern) {\n const slice = source.slice(from, to)\n rule.pattern.lastIndex = 0\n const m = rule.pattern.exec(slice)\n if (!m) return null\n return this.buildMatch(rule, m[0], m[0], from + m.index, '')\n }\n if (!rule.opening || !rule.closing) return null\n if (rule.prefix) return this.matchPrefixedRule(source, rule, from, to)\n return this.matchStandardRule(source, rule, from, to)\n }\n\n protected matchStandardRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n const opening = rule.opening!\n const closing = rule.closing!\n const openPos = source.indexOf(opening, from)\n if (openPos === -1 || openPos >= to) return null\n const contentStart = openPos + opening.length\n\n if (rule.selfClosing) {\n const selfClosePos = source.indexOf(rule.selfClosing, contentStart)\n const normalClosePos = source.indexOf(closing, contentStart)\n if (selfClosePos !== -1 && (normalClosePos === -1 || selfClosePos < normalClosePos)) {\n const closeEnd = selfClosePos + rule.selfClosing.length\n return this.buildMatch(rule, source.slice(openPos, closeEnd), source.slice(contentStart, selfClosePos), openPos, rule.selfClosing)\n }\n }\n\n const closePos = rule.nested !== false\n ? this.findMatchingClose(source, opening, closing, contentStart, to)\n : source.indexOf(closing, contentStart)\n\n if (closePos === -1) {\n if (this.config.strictMode) throw new Error(`Unclosed token '${opening}' at position ${openPos}`)\n return null\n }\n\n return this.buildMatch(rule, source.slice(openPos, closePos + closing.length), source.slice(contentStart, closePos), openPos, closing)\n }\n\n protected matchPrefixedRule(source: string, rule: AreSyntaxTokenRules, from: number, to: number): AreSyntaxTokenMatch | null {\n const opening = rule.opening!\n const closing = rule.closing!\n let searchFrom = from\n\n while (searchFrom < to) {\n const openPos = source.indexOf(opening, searchFrom)\n if (openPos === -1 || openPos >= to) return null\n\n const before = source.slice(from, openPos)\n const prefixRe = new RegExp(rule.prefix!.source + '$')\n const prefixM = prefixRe.exec(before)\n\n if (prefixM) {\n const actualStart = openPos - prefixM[0].length\n const contentStart = openPos + opening.length\n const closePos = rule.nested !== false\n ? this.findMatchingClose(source, opening, closing, contentStart, to)\n : source.indexOf(closing, contentStart)\n\n if (closePos === -1) {\n if (this.config.strictMode) throw new Error(`Unclosed token '${opening}' at position ${openPos}`)\n return null\n }\n\n return this.buildMatch(rule, source.slice(actualStart, closePos + closing.length), source.slice(contentStart, closePos), actualStart, closing)\n }\n searchFrom = openPos + 1\n }\n return null\n }\n\n protected findMatchingClose(source: string, opening: string, closing: string, from: number, to: number): number {\n let level = 1\n let index = from\n while (index < to) {\n const nextOpen = source.indexOf(opening, index)\n const nextClose = source.indexOf(closing, index)\n if (nextClose === -1) return -1\n if (nextOpen !== -1 && nextOpen < nextClose) {\n level++\n index = nextOpen + opening.length\n continue\n }\n level--\n if (level === 0) return nextClose\n index = nextClose + closing.length\n }\n return -1\n }\n\n protected buildMatch(rule: AreSyntaxTokenRules, raw: string, content: string, position: number, closingUsed: string): AreSyntaxTokenMatch {\n const trimmed = this.config.trimWhitespace ? content.trim() : content\n const match: AreSyntaxTokenMatch = { raw, content: trimmed, opening: rule.opening ?? '', closing: closingUsed, position, payload: {}, _rule: rule }\n if (rule.extract) match.payload = rule.extract(raw, match)\n return match\n }\n\n protected tryPlainText(raw: string, position: number): AreSyntaxTokenMatch | null {\n if (!raw) return null\n const rule = this.config.rules.find(r => !r.opening && !r.closing && !r.pattern && !r.matcher)\n if (!rule) return null\n const match = this.buildMatch(rule, raw, raw, position, '')\n match._rule = rule\n return match\n }\n\n protected findRuleForMatch(match: AreSyntaxTokenMatch): AreSyntaxTokenRules | undefined {\n // Fast path: the rule that produced this match is already stored\n if (match._rule) return match._rule\n // Fallback: match by opening/closing (for externally constructed AreSyntaxTokenMatch objects)\n return this.config.rules.find(r => (r.opening ?? '') === match.opening && (r.closing ?? '') === match.closing)\n }\n}","import { A_Caller, A_Component, A_Feature, A_Inject, A_TYPES__Entity_Constructor, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { AreAttributeFeatures } from \"@adaas/are/attribute/AreAttribute.constants\";\nimport { AreDeclaration } from \"@adaas/are/instruction/types/AreDeclaration.instruction\";\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreCompiler',\n description: 'Walks the transformed AreNode tree and emits a Scene. Translates each node, binding, directive and interpolation into a typed instruction. Knows nothing about the DOM or any rendering target — its only concern is producing a complete and ordered set of instructions that fully describes how the tree should be rendered.'\n})\nexport class AreCompiler extends A_Component {\n\n /**\n * Defines a custom method for compiling a node into a set of SceneInstructions. This method is called during the compilation phase of the ARE component and should perform any necessary transformations on the node and its attributes to generate the appropriate instructions for rendering. This can include tasks such as processing directives, evaluating expressions, and generating instructions for dynamic content based on the node's properties and context.\n * \n * @param node \n */\n static Compile<T extends AreNode>(node: A_TYPES__Entity_Constructor<T>)\n /**\n * Defines a custom method for compiling an attribute into a set of SceneInstructions. This method is called during the compilation phase of the ARE component and should perform any necessary transformations on the attribute to generate the appropriate instructions for rendering. This can include tasks such as processing directives, evaluating expressions, and generating instructions for dynamic content based on the attribute's properties and context.\n * \n * @param attribute \n */\n static Compile<T extends AreAttribute>(attribute: A_TYPES__Entity_Constructor<T>)\n static Compile<T extends AreNode | AreAttribute>(param1: A_TYPES__Entity_Constructor<T>) {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: param1.prototype instanceof AreNode\n ? AreNodeFeatures.onCompile\n : AreAttributeFeatures.Compile,\n scope: [param1],\n override: ['compile']\n })(target, propertyKey, descriptor);\n }\n }\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Compile Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n @A_Feature.Extend({\n name: AreNodeFeatures.onCompile,\n scope: [AreNode]\n })\n compile(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n try {\n logger?.debug('cyan', `AreCompiler: compile node <${node.aseid.toString()}>`);\n\n /**\n * 1. Create & register Host Instructions to add it if no other cases presented\n * \n * [!] Note: it can be removed by directives or modified if needed\n */\n const hostInstruction = new AreDeclaration()\n scene.setHost(hostInstruction);\n scene.plan(hostInstruction);\n\n /**\n * 1. Prepare Instructions for attributes and add then to render plan.\n */\n for (let i = 0; i < node.attributes.length; i++) {\n const attribute = node.attributes[i];\n attribute.compile();\n }\n\n /**\n * 2. Compile all nested nodes of the root node. \n */\n if (node.children && node.children.length > 0) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n child.compile();\n }\n }\n\n } catch (error) {\n logger?.error(error)\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreCompilerError extends A_Error {\n\n static readonly RenderError = 'Are Compiler Render Error';\n static readonly CompilationError = 'Are Compiler Compilation Error';\n}","import { A_Caller, A_Component, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\n\n\n\n@A_Frame.Component({\n description: 'Reshapes the AreNode tree before compilation without changing its abstraction level. Responsible for structural rewrites that would complicate the compiler if left unhandled — converting $for nodes into AreGroupNode, extracting AreText and AreInterpolation from raw text, sorting directives via TopologicalSorter, and flagging static nodes.'\n})\nexport class AreTransformer extends A_Component {\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTransform,\n scope: [AreNode]\n })\n transform(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n // const scene = current.scene;\n // if (scene.isInactive)\n // continue;\n\n /**\n * 2. Prepare Instructions for directives and add then to render plan.\n */\n for (let i = 0; i < current.attributes.length; i++) {\n\n const attribute = current.attributes[i];\n attribute.transform();\n }\n \n queue.push(...current.children)\n }\n\n }\n}","import { A_Caller, A_Component, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreInstructionFeatures } from \"@adaas/are/instruction/AreInstruction.constants\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\n\n\n\n@A_Frame.Component({\n description: 'Stateless executor that reads the Scene and translates its instructions into operations on a rendering target. Computes the diff between applied and planned, calls revert on removed instructions and apply on added ones. Owns no state of its own — all state lives in the Scene. Can be swapped for any target implementation (DOMInterpreter, SSRInterpreter, CanvasInterpreter) without touching any other part of the pipeline.'\n})\nexport class AreInterpreter extends A_Component {\n /**\n * Decorator to mark a method as an instruction Apply handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction needs to be applied. The method should contain logic to perform the necessary operations on the rendering target based on the instruction's content and context.\n * \n * @param action \n * @returns \n */\n static Apply(action: string) {\n const name = action + AreInstructionFeatures.Apply\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Decorator to mark a method as an instruction Update handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction has been updated. The method should contain logic to perform the necessary operations on the rendering target to update the effects of the instruction based on its new content and context.\n * \n * @param action \n * @returns \n */\n static Update(action: string) {\n const name = action + AreInstructionFeatures.Update\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Decorator to mark a method as an instruction Revert handler for the specific instruction type. The method will be called during the render phase of the ARE component when the corresponding instruction needs to be reverted. The method should contain logic to perform the necessary operations on the rendering target to undo the effects of the instruction based on its content and context.\n * \n * @param action \n * @returns \n */\n static Revert(action: string) {\n\n const name = action + AreInstructionFeatures.Revert\n\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * The method responsible for executing the render operation based on the current state of the Scene. It processes the instructions that need to be applied and reverted, ensuring that the rendering target is updated accordingly. The method handles any errors that may occur during the application or reversion of instructions, maintaining the integrity of the rendering process.\n * \n * @param scene \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onInterpret,\n scope: [AreNode]\n })\n interpret(\n @A_Inject(AreScene) scene: AreScene,\n ) {\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n }\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Instruction Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Apply,\n scope: [AreInstruction]\n })\n protected applyInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Apply, scope);\n\n store.unwatch(instruction);\n } catch (error) {\n store.unwatch(instruction);\n throw error;\n }\n\n }\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Update,\n scope: [AreInstruction]\n })\n protected updateInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Update, scope);\n\n store.unwatch(instruction);\n } catch (error) {\n store.unwatch(instruction);\n throw error;\n }\n\n }\n\n\n @A_Feature.Extend({\n name: AreInstructionFeatures.Revert,\n scope: [AreInstruction]\n })\n protected revertInstruction(\n @A_Inject(A_Caller) instruction: AreInstruction,\n @A_Inject(AreInterpreter) interpreter: AreInterpreter,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n try {\n /**\n * 1. uses to track all calls to Store\n */\n // store.watch(instruction);\n /**\n * So we're looking for any instruction name in the interpreter to be executed.\n */\n feature.chain(interpreter, instruction.name + AreInstructionFeatures.Revert, scope);\n\n // store.unwatch(instruction);\n } catch (error) {\n // store.unwatch(instruction);\n throw error;\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class AreInterpreterError extends A_Error {\n\n}","\n\n\nexport const AreStoreAreComponentMetaKeys ={\n StoreExtensions: '_AreStore_StoreExtensions',\n} as const","import { A_Context, A_TYPES__ComponentMeta, A_TYPES__Paths, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport type { Are } from \"@adaas/are/component/Are.component\";\nimport type { AreMeta } from \"@adaas/are/component/Are.meta\";\nimport { AreStoreAreComponentMetaKeys } from \"./AreStore.constants\";\nimport { AreStorePathValue, AreStoreWatchingEntity } from \"./AreStore.types\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\nimport { A_UtilsHelper } from \"@adaas/a-utils/helpers\";\n\n\n\n\n@A_Frame.Fragment({\n description: \"Are Store uses to keep AreNode related information for interpolations, runtime data, etc. This object can be injected to manipulate with data at runtime.\",\n})\nexport class AreStore<\n T extends Record<string, any> = Record<string, any>\n> extends A_ExecutionContext<T> {\n\n protected dependencies: Map<string, Set<AreStoreWatchingEntity>> = new Map();\n\n protected _keys: Set<keyof T> = new Set();\n\n\n\n /**\n * Allows to define a pure function that will be executed in the context of the store, so it can access the store's data and methods, but it won't have access to the component's scope or other features. This can be useful for example for defining a function that will update the store's data based on some logic, without having access to the component's scope or other features, so we can keep the store's logic separate from the component's logic.\n */\n static get Function() {\n return <T extends Are>(target: T, propertyKey: string, descriptor: PropertyDescriptor) => {\n // TODO: fix types\n const targetMeta = A_Context.meta<AreMeta<A_TYPES__ComponentMeta>, T>(target.constructor as any) as any;\n\n const originalMethod = descriptor.value;\n\n const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};\n\n allExtensions[propertyKey] = originalMethod;\n\n targetMeta.set(AreStoreAreComponentMetaKeys.StoreExtensions, allExtensions);\n\n return descriptor;\n }\n }\n\n get owner(): AreNode {\n return A_Context.scope(this).issuer() as AreNode;\n }\n\n get parent(): AreStore | undefined {\n return this.owner.parent?.scope.resolve<AreStore>(AreStore);\n }\n\n get context(): AreContext {\n return A_Context.scope(this).resolve(AreContext) as AreContext;\n }\n\n constructor(aseid: ASEID | string) {\n super(aseid.toString());\n }\n\n get watchers(): Set<AreStoreWatchingEntity> {\n return this.context.get('watchers') || new Set();\n }\n\n get keys(): Set<keyof T> {\n return this._keys;\n }\n\n\n watch(instruction: AreStoreWatchingEntity): void {\n const watchers: Set<AreStoreWatchingEntity> = this.context.get('watchers') || new Set();\n watchers.add(instruction);\n this.context.set('watchers', watchers);\n }\n\n unwatch(instruction: AreStoreWatchingEntity): void {\n const watchers: Set<AreStoreWatchingEntity> = this.context.get('watchers') || new Set();\n watchers.delete(instruction);\n this.context.set('watchers', watchers);\n }\n\n set<K extends keyof T>(values: Partial<T>): this\n set<P extends A_TYPES__Paths<T>>(key: P, value: AreStorePathValue<T, P>): this\n set<K extends keyof T, P extends A_TYPES__Paths<T>>(\n param1: K | Partial<T> | P,\n param2?: T[K] | AreStorePathValue<T, P>\n ): this {\n if (typeof param1 === 'string' && param2 !== undefined) {\n this.setAsKeyValue(param1 as P, param2 as AreStorePathValue<T, P>);\n } else if (typeof param1 === 'object') {\n this.setAsObject(param1 as Partial<T>);\n } else {\n throw new Error('Invalid parameters for set method. Expected either (key: string, value: any) or (values: object).');\n }\n\n\n return this;\n }\n\n\n get<K extends keyof T>(key: K): T[K] | undefined {\n const [firstPart, ...pathPart] = String(key).split('.');\n\n if (!this._keys.has(firstPart as keyof T)) {\n return this.parent?.get(key as any);\n }\n\n if (this.watchers.size > 0) {\n const ancestors = this.extractPathSegments(String(key))\n\n for (const ancestor of ancestors) {\n // normalize once at registration — not at lookup\n const normAncestor = this.normalizePath(ancestor)\n\n if (!this.dependencies.has(normAncestor)) {\n this.dependencies.set(normAncestor, new Set())\n }\n\n\n this.watchers.forEach(watcher => this.dependencies.get(normAncestor)!.add(watcher))\n }\n }\n\n const primaryObject = super.get(firstPart);\n\n const value = A_UtilsHelper.getByPath(primaryObject, pathPart.join('.'));\n\n return value as T[K] | undefined;\n }\n\n\n protected setAsObject(values: Partial<T>): this {\n const entires = Object.entries(values);\n\n for (const [key, value] of entires) {\n\n this._keys.add(key as keyof T);\n super.set(key as keyof T, value as T[keyof T]);\n\n // normalize once — dependencies are already stored normalized\n const normChanged = this.normalizePath(String(key))\n const prefix = normChanged + '.'\n\n\n for (const [normRegistered, instructions] of this.dependencies) {\n if (\n normRegistered === normChanged || // exact\n normRegistered.startsWith(prefix) || // descendant\n normChanged.startsWith(normRegistered + '.') // ancestor\n ) {\n this.notify(instructions)\n }\n }\n\n }\n return this;\n }\n\n protected setAsKeyValue<K extends keyof T, P extends A_TYPES__Paths<T>>(\n key: K | P,\n value: T[K] | AreStorePathValue<T, P>\n ): this {\n const [firstPart, ...pathPart] = String(key).split('.');\n\n this._keys.add(firstPart as keyof T);\n\n const primaryObject = super.get(firstPart);\n\n const result = A_UtilsHelper.setBypath(primaryObject, pathPart.join('.'), value);\n\n super.set(firstPart as keyof T, result ? result[firstPart] : value);\n\n // normalize once — dependencies are already stored normalized\n const normChanged = this.normalizePath(String(key))\n const prefix = normChanged + '.'\n\n for (const [normRegistered, instructions] of this.dependencies) {\n if (\n normRegistered === normChanged || // exact\n normRegistered.startsWith(prefix) || // descendant\n normChanged.startsWith(normRegistered + '.') // ancestor\n ) {\n this.notify(instructions)\n }\n }\n\n return this;\n }\n\n\n /**\n * Notifies instructions — immediately or deferred if inside a batch.\n */\n private notify(instructions: Set<AreStoreWatchingEntity>): void {\n for (const instruction of instructions) {\n\n try {\n instruction.update()\n } catch (error) {\n\n }\n // instruction.owner.scene.unApply(instruction);\n }\n }\n /**\n * Removes an instruction from all dependency sets.\n * Called when an instruction is reverted/destroyed.\n */\n unregister(instruction: AreStoreWatchingEntity): void {\n for (const instructions of this.dependencies.values()) {\n instructions.delete(instruction);\n }\n }\n /**\n * Normalizes a path once — reused in both get and set.\n */\n private normalizePath(path: string): string {\n return path.replace(/\\[(\\d+)\\]/g, '.$1')\n }\n\n /**\n * Extracts direct children of the current markup level into typed instances.\n * No tree walking, recursion, or nested parsing — just direct children.\n */\n extractPathSegments(path: string): string[] {\n const normalized = path.replace(/\\[(\\d+)\\]/g, '.$1')\n const parts = normalized.split('.').filter(Boolean)\n const ancestors: string[] = []\n let current = ''\n\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i]\n const isIndex = /^\\d+$/.test(part)\n\n if (i === 0) {\n current = part\n } else if (isIndex) {\n current = `${current}[${part}]`\n } else {\n current = `${current}.${part}`\n }\n\n ancestors.push(current)\n }\n\n return ancestors\n }\n\n /**\n * Method allows to initialize all extensions defined in the component with @AreStore.Function decorator, so we can use them in the store's context. This method should be called in the component's constructor after super() call, so the store will have access to the component's instance and its properties.\n * \n * @param component \n */\n loadExtensions(component: Are) {\n const targetMeta = A_Context.meta<AreMeta<A_TYPES__ComponentMeta>, Are>(component as any) as any;\n\n const allExtensions = targetMeta.get(AreStoreAreComponentMetaKeys.StoreExtensions) || {};\n\n this.set(allExtensions);\n }\n\n}\n","import { A_Frame } from \"@adaas/a-frame\"\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\"\n\n\n@A_Frame.Fragment({\n namespace: 'A-ARE',\n name: 'AreEvent',\n description: 'Event context for managing events within the A-Concept Rendering Engine (ARE) framework, encapsulating event data and associated nodes to facilitate event-driven interactions.'\n})\nexport class AreEvent<\n T extends Record<string, any> = Record<string, any>\n> extends A_ExecutionContext<T> {\n\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class AreSceneError extends A_Error {\n\n static readonly SceneAlreadyInactive = 'AreSceneError.SceneAlreadyInactive';\n\n static readonly SceneAlreadyActive = 'AreSceneError.SceneAlreadyActive';\n\n static readonly HostInstructionHasConnectedInstructions = 'AreSceneError.HostInstructionHasConnectedInstructions';\n\n static readonly SingleHostInstruction = 'AreSceneError.SingleHostInstruction';\n\n static readonly SceneError = 'AreSceneError.SceneError';\n\n static readonly RootNotFound = 'AreSceneError.RootNotFound';\n\n static readonly UpdateFailed = 'AreSceneError.UpdateFailed';\n\n static readonly MountFailed = 'AreSceneError.MountFailed';\n\n static readonly UnmountFailed = 'AreSceneError.UnmountFailed';\n\n static readonly MountPointNotFound = 'AreSceneError.MountPointNotFound';\n\n static readonly InvalidTemplate = 'AreSceneError.InvalidTemplate';\n\n static readonly RenderFailed = 'AreSceneError.RenderFailed';\n\n}","\n\nexport const AreSceneStatuses = {\n Active: 'active',\n Inactive: 'inactive',\n Destroyed: 'destroyed',\n}","import { A_Context, A_Dependency, A_Fragment, A_Scope, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreDeclaration } from \"@adaas/are/instruction/types/AreDeclaration.instruction\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreSceneChanges, AreSceneStatusNames } from \"./AreScene.types\";\nimport { AreSceneError } from \"./AreScene.error\";\nimport { AreMutation } from \"@adaas/are/instruction/types/AreMutation.instruction\";\nimport { AreSceneStatuses } from \"./AreScene.constants\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreScene',\n description: \"Persistent runtime structure that owns the rendering state for a component's lifetime. Maintains two sets — applied (what is currently in the DOM) and planned (what should be). Acts as the single source of truth for all rendering decisions. The Compiler produces it once, the Interpreter reads it on every update.\"\n})\nexport class AreScene extends A_Fragment {\n // -----------------------------------------------------------------------------------\n // -----------------------------------Scene Index-------------------------------------\n // -----------------------------------------------------------------------------------\n protected _groupToInstructionsMap: Map<string, Set<AreInstruction>> = new Map();\n\n /**\n * Plan is a queue of changes that should be applied to render the node\n * \n * It works as FIFO, so the first instruction that should be applied is the first one in the queue, and so on.\n */\n protected _plan: Array<AreInstruction> = [];\n /**\n * State is a list of instructions that are currently applied to the node, \n * so it represents the current state of the node in the scene.\n * \n * It always in a reverse order of the plan, so the last instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n * \n * For example, if we have a node with two instructions in the plan: [Instruction A, Instruction B], and both of them are applied to the node, then the state will be [Instruction B, Instruction A], so when we need to revert the changes, we will revert Instruction B first, and then Instruction A.\n */\n protected _state: Array<AreInstruction> = [];\n\n\n protected _host: AreDeclaration | undefined;\n /**\n * Scene status is used to determine the current lifecycle stage of the scene, which can be 'active', 'inactive' or 'destroyed'. This status can be used to control the behavior of the scene and its instructions, for example, we can prevent applying new instructions to an inactive or destroyed scene, or we can trigger certain actions when the scene becomes active or inactive. The default status of the scene is 'inactive', which means that the scene is not yet rendered and its instructions are not applied, and it will become 'active' when it is mounted and its instructions are applied, and it will become 'destroyed' when it is unmounted and its instructions are reverted.\n */\n protected _status: AreSceneStatusNames = AreSceneStatuses.Active;\n\n\n constructor(\n /**\n * Scene identity will be used to identify mounting point in the parent scene\n */\n id: string | ASEID,\n ) {\n super({ name: id.toString() });\n }\n\n /**\n * Scene ID that corresponds to the root node's ID (part of ASEID) \n */\n get id(): string {\n return this.name;\n }\n /**\n * The scope where scene is registered. This scope is owned by AreNode \n */\n get scope(): A_Scope {\n return A_Context.scope(this);\n }\n /**\n * The owner node of the scene, which is the node that registered the scene in its scope. \n * This is typically the node that is responsible for rendering the scene and managing its lifecycle.\n */\n get owner(): AreNode {\n return this.scope.issuer() as AreNode;\n }\n /**\n * It's a primary declaration instruction that represents the node in the scene, so it should be registered as a host instruction for the scene, and it will be used to keep track of the node in the scene and to manage its lifecycle.\n */\n get host(): AreDeclaration | undefined {\n return this._host;\n }\n /**\n * Scene status is used to determine the current lifecycle stage of the scene, which can be 'active', 'inactive' or 'destroyed'. This status can be used to control the behavior of the scene and its instructions, for example, we can prevent applying new instructions to an inactive or destroyed scene, or we can trigger certain actions when the scene becomes active or inactive. The default status of the scene is 'inactive', which means that the scene is not yet rendered and its instructions are not applied, and it will become 'active' when it is mounted and its instructions are applied, and it will become 'destroyed' when it is unmounted and its instructions are reverted.\n */\n get status(): AreSceneStatusNames {\n return this._status;\n }\n\n get isActive(): boolean {\n return this.status === AreSceneStatuses.Active;\n }\n\n get isInactive(): boolean {\n return this.status === AreSceneStatuses.Inactive;\n }\n\n /**\n * Returns All declaration instructions are registered in the scene scope. Since declaration instructions are the main instructions that represent the structure of the node, we have a separate getter for them to easily access and manage them in the scene.\n */\n get declarations(): AreDeclaration[] {\n return this.scope.resolve<AreDeclaration>(new A_Dependency(AreDeclaration, {\n flat: true,\n pagination: {\n count: -1,\n }\n })) as AreDeclaration[] || [];\n }\n /**\n * Returns All mutation instructions are registered in the scene scope. Mutation instructions are the instructions that represent the changes to be applied to the node, so we have a separate getter for them to easily access and manage them in the scene, especially when we want to apply or revert changes based on the mutations.\n */\n get mutations(): AreMutation[] {\n return this.scope.resolve<AreMutation>(new A_Dependency(AreMutation, {\n flat: true,\n pagination: {\n count: -1,\n }\n })) as AreMutation[] || [];\n }\n /**\n * Returns All instructions are registered in the scene scope. \n */\n get instructions(): AreInstruction[] {\n return this.scope.resolveFlatAll<AreInstruction>(AreInstruction) || [];\n }\n /**\n * Plan is a queue of changes that should be applied to render the node\n * \n * It works as FIFO, so the first instruction that should be applied is the first one in the queue, and so on.\n */\n get planned(): AreInstruction[] {\n return this._plan;\n }\n /**\n * State is a list of instructions that are currently applied to the node, \n * so it represents the current state of the node in the scene.\n * \n * It always in a reverse order of the plan, so the last instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n * \n * For example, if we have a node with two instructions in the plan: [Instruction A, Instruction B], and both of them are applied to the node, then the state will be [Instruction B, Instruction A], so when we need to revert the changes, we will revert Instruction B first, and then Instruction A.\n */\n get applied(): AreInstruction[] {\n return this._state.reverse(); // we reverse the state to have the correct order of instructions, so the first instruction in the state is the first one that should be reverted when we need to revert the changes, and so on.\n }\n\n /**\n * Should return instructions to be reverted and to be applied. \n * A difference between plan vs state is that plan is what should be applied to the scene, \n * while state is what currently applied to the scene. \n * \n */\n get changes(): AreSceneChanges {\n const toApply = this.planned.filter(i => !this.isApplied(i));\n const toRevert = this.applied.filter(i => !this.isInPlan(i));\n\n return {\n toApply,\n toRevert,\n }\n }\n\n\n //===============================================================================================\n //============================= Scene Primary Methods ===========================================\n //===============================================================================================\n activate(): void {\n this._status = AreSceneStatuses.Active;\n }\n\n deactivate(): void {\n\n this._status = AreSceneStatuses.Inactive;\n }\n /**\n * Each scene has a primary declaration instruction that represents the node in the scene, so it should be registered as a host instruction for the scene, and it will be used to keep track of the node in the scene and to manage its lifecycle. This method allows to set the host instruction for the scene, but it will throw an error if we try to set another host instruction while there is already a host instruction set, so we can ensure that there is only one host instruction for the scene at any given time.\n * \n * @param instruction \n */\n setHost(instruction: AreDeclaration): void {\n if (this.host) {\n const dependentInstructions = this.scope.resolve<AreMutation>(new A_Dependency(AreMutation, {\n flat: true,\n pagination: {\n count: -1,\n },\n query: {\n parent: this.host.aseid.toString(),\n\n }\n })) as Array<AreMutation> || [];\n\n dependentInstructions.forEach(element => {\n element.attachTo(instruction)\n element.groupWith(instruction);\n });\n }\n\n this._host = instruction;\n }\n /**\n * Unsets the current host instruction from the scene. \n * \n * This method should be used when we want to remove the primary declaration instruction that represents the node in the scene, for example, when we want to unmount the node or when we want to replace it with another node. Unsetting the host instruction will allow us to set a new host instruction for the scene if needed.\n */\n removeHost(): void {\n if (this.host)\n throw new AreSceneError({\n title: AreSceneError.HostInstructionHasConnectedInstructions,\n description: `Cannot remove host instruction (${this.host.aseid}) from scene ${this.id} because it has planned instructions in the scene. Please unPlan all instructions related to the host instruction before removing it.`,\n });\n\n this._host = undefined;\n\n }\n\n // ------------------------------------------------------------------------------------------------------------\n // Scene Render Plan Methods\n // ------------------------------------------------------------------------------------------------------------\n /**\n * Method that should register the instruction in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n */\n plan(instruction: AreInstruction) {\n // const registered = this.getPlanned(instruction);\n\n // if (!registered) {\n try {\n this.scope.register(instruction);\n\n } catch (error) {\n\n }\n this._plan.push(instruction);\n\n // We also add the instruction to the group map, so we can easily manage instructions by group, for example, when we want to unPlan all instructions related to a specific host instruction, we can easily find them in the group map and unPlan them.\n if (!this._groupToInstructionsMap.has(instruction.group || 'default')) {\n this._groupToInstructionsMap.set(instruction.group || 'default', new Set());\n }\n this._groupToInstructionsMap.get(instruction.group || 'default')!.add(instruction);\n // }\n }\n\n planBefore(instruction: AreInstruction, beforeInstruction: AreInstruction) {\n const beforeIndex = this._plan.findIndex(i => i.aseid.toString() === beforeInstruction.aseid.toString());\n const instructionIndex = this._plan.findIndex(i => i.aseid.toString() === instruction.aseid.toString());\n\n if (beforeIndex === -1) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${beforeInstruction.aseid} is not in the plan of scene ${this.id}. Cannot plan instruction ${instruction.aseid} before it.`,\n });\n }\n\n if (instructionIndex === -1) {\n\n try {\n this.scope.register(instruction);\n\n } catch (error) {\n\n }\n this._plan.splice(beforeIndex, 0, instruction);\n } else {\n // Instruction is already in the plan, we just need to move it before the beforeInstruction\n this._plan.splice(instructionIndex, 1); // remove from current position\n this._plan.splice(beforeIndex, 0, instruction); // insert before the beforeInstruction\n }\n }\n\n planAfter(instruction: AreInstruction, afterInstruction: AreInstruction) {\n const afterIndex = this._plan.findIndex(i => i.aseid.toString() === afterInstruction.aseid.toString());\n const instructionIndex = this._plan.findIndex(i => i.aseid.toString() === instruction.aseid.toString());\n\n if (afterIndex === -1) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${afterInstruction.aseid} is not in the plan of scene ${this.id}. Cannot plan instruction ${instruction.aseid} after it.`,\n });\n }\n\n if (instructionIndex === -1) {\n this.scope.register(instruction);\n this._plan.splice(afterIndex + 1, 0, instruction);\n } else {\n // Instruction is already in the plan, we just need to move it after the afterInstruction\n this._plan.splice(instructionIndex, 1); // remove from current position\n this._plan.splice(afterIndex + 1, 0, instruction); // insert after the afterInstruction\n }\n }\n\n\n moveBefore(instruction: AreInstruction, beforeInstruction: AreInstruction) {\n if (!this.isInPlan(instruction)) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${instruction.aseid} is not in the plan of scene ${this.id}. Cannot move instruction before ${beforeInstruction.aseid}. Please plan the instruction before moving it.`,\n });\n }\n\n this.planBefore(instruction, beforeInstruction);\n }\n\n moveAfter(instruction: AreInstruction, afterInstruction: AreInstruction) {\n if (!this.isInPlan(instruction)) {\n throw new AreSceneError({\n title: AreSceneError.SceneError,\n description: `Instruction ${instruction.aseid} is not in the plan of scene ${this.id}. Cannot move instruction after ${afterInstruction.aseid}. Please plan the instruction before moving it.`,\n });\n }\n\n this.planAfter(instruction, afterInstruction);\n }\n\n\n /**\n * Allows to remove instruction from the plan, so it will not be rendered anymore, but it will still be registered in the scene scope, so it can be planned again if needed.\n * \n * @param instruction \n */\n unPlan(\n instruction: AreInstruction\n ) {\n // const registered = this.getPlanned(instruction);\n\n // if (registered) {\n // this.scope.deregister(instruction);\n this._plan = this._plan.filter(i => i.aseid.toString() !== instruction.aseid.toString());\n // }\n\n }\n /**\n * Checks if the instruction is already in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n * @returns \n */\n getPlanned(instruction: AreInstruction): AreInstruction | undefined {\n const found = this._plan.find(i => i.aseid.toString() === instruction.aseid.toString());\n\n return found;\n }\n /**\n * Checks if the instruction is already in the plan, so it will be rendered in the next render cycle.\n * \n * @param instruction \n * @returns \n */\n isInPlan(instruction: AreInstruction): boolean {\n return !!this.getPlanned(instruction);\n }\n\n // -------------------------------------------------------------------------------------------------------------\n // Scene Apply Methods\n // -------------------------------------------------------------------------------------------------------------\n /**\n * Method moves the instruction to state to keep it applied and to be able to revert it later if needed. The instruction should be already registered in the scene scope and planned to be applied, otherwise it will not be applied.\n * \n * @param instruction \n */\n apply(instruction: AreInstruction) {\n if (!this.isApplied(instruction)) {\n this._state.push(instruction);\n }\n }\n /**\n * Method moves the instruction from state to unapply it and to be able to apply it later if needed. The instruction should be already registered in the scene scope and applied, otherwise it will not be unapplied.\n * \n * @param instruction \n */\n unApply(\n instruction: AreInstruction\n ) {\n this._state = this._state.filter(i => i.aseid.toString() !== instruction.aseid.toString());\n }\n /**\n * Checks if the instruction is already in the state, so it is currently applied to the scene.\n * \n * @param instruction \n * @returns \n */\n getApplied(instruction: AreInstruction): AreInstruction | undefined {\n const found = this._state.find(i => i.aseid.toString() === instruction.aseid.toString());\n\n return found;\n }\n /**\n * Checks if the instruction is already in the state, so it is currently applied to the scene.\n * \n * @param instruction \n * @returns \n */\n isApplied(instruction: AreInstruction): boolean {\n return !!this.getApplied(instruction);\n }\n /**\n * Method that should reset the scene to the initial state, so it will clear the plan and state, but it will not deregister the instructions from the scene scope, so they will still be registered in the scene and can be planned and applied again if needed.\n * \n */\n reset() {\n this._plan = [];\n this._state = [];\n }\n}","\n\nexport const AreInstructionFeatures = {\n /**\n * The 'Apply' feature indicates that the instruction has been applied to the scene or component, meaning that its effects have been executed and are now reflected in the state of the scene or component. This status is typically used to track the lifecycle of an instruction, allowing for proper management and potential reversal of changes if needed.\n */\n Apply: '_AreInstruction_Apply',\n /**\n * The 'Update' feature indicates that the instruction has been updated, meaning that its properties or effects have been modified after it was initially applied. This status is important for managing dynamic changes in the scene or component, allowing for adjustments to be made to the instruction's behavior or effects without needing to revert and reapply it entirely.\n */\n Update: '_AreInstruction_Update',\n /**\n * The 'Revert' feature indicates that the instruction has been reverted, meaning that any changes or effects that were applied by the instruction have been undone, and the scene or component has been returned to its previous state before the instruction was applied. This status is crucial for managing the state of the scene or component, especially in cases where an instruction needs to be rolled back due to errors or changes in requirements.\n */\n Revert: '_AreInstruction_Revert'\n} as const\n\n\nexport const AreInstructionDefaultNames = {\n Default: '_Are_DefaultInstruction',\n Declaration: '_Are_DeclarationInstruction',\n Mutation: '_Are_MutationInstruction',\n} as const","\nimport { A_Context, A_Entity, A_Error, A_FormatterHelper, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport type { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"./AreInstruction.types\";\nimport { AreInstructionFeatures } from \"./AreInstruction.constants\";\nimport { AreStoreWatchingEntity } from \"@adaas/are/store/AreStore.types\";\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreInstruction',\n description: 'AreInstruction is the base entity for all rendering instructions in the ARE framework. It represents a serializable, reversible operation (such as creating or mutating a DOM element) that can be applied to and tracked within the AreScene, enabling deterministic rendering and undo/redo capabilities.'\n})\nexport class AreInstruction<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends A_Entity<AreInstructionNewProps<T>, S> implements AreStoreWatchingEntity {\n /**\n * The name of the instruction, for example \"CreateElement\", \"AddAttribute\", \"RemoveNode\", etc. This is used to identify the type of the instruction and how to process it. The name should be in PascalCase format, and should be unique across all instruction types. It is recommended to use a prefix that indicates the category of the instruction, for example \"CreateElement\" for instructions that create new elements, \"UpdateAttribute\" for instructions that update attributes, etc.\n */\n protected _name!: string\n /**\n * The payload of the instruction, which can contain any additional information that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene. The payload is optional and can be an empty object if no additional information is needed.\n */\n protected _payload?: T\n /**\n * Group is an optional property that can be used to group instructions together. For example a set of instructions that depend on create CreateElement instruction can be grouped together with the same group name, so if the CreateElement instruction is reverted, all the instructions in the same group will be reverted as well, and so on. This can be useful to manage complex changes that involve multiple instructions. \n * \n * [!] Note, the best option is to use ASEID of the Instruction as a group, so all instructions with the same ASEID will be treated as a single change, and will be applied and reverted together.\n */\n protected _group: string | undefined\n /**\n * The parent instruction that created this instruction. For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, the AddAttribute instruction would have the CreateElement instruction as its parent. This can be used to track the hierarchy of instructions and their dependencies.\n */\n protected _parent: string | undefined\n\n /**\n * A set of properties that influence the behavior of the instruction, for example, for AddTextInstruction, we can interpolation dependent on some key in the store, so we can have a property called \"interpolationKey\" that will be used to track the dependencies of the instruction, and when the value of this key changes in the scope, we can update the instruction accordingly.\n */\n protected _props!: Set<string>\n\n\n /**\n * The name of the instruction, for example \"CreateElement\", \"AddAttribute\", \"RemoveNode\", etc. This is used to identify the type of the instruction and how to process it. The name should be in PascalCase format, and should be unique across all instruction types. It is recommended to use a prefix that indicates the category of the instruction, for example \"CreateElement\" for instructions that create new elements, \"UpdateAttribute\" for instructions that update attributes, etc.\n */\n get name(): string {\n return this._name;\n }\n /**\n * The payload of the instruction, which can contain any additional information that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene. The payload is optional and can be an empty object if no additional information is needed. \n * \n * [!] Note, the payload should be serializable, so it can be stored and transmitted easily. It is recommended to use simple data structures for the payload, such as objects, arrays, strings, numbers, etc., and avoid using complex data types that may not be easily serializable.\n */\n get payload(): T {\n return this._payload || {} as T;\n }\n\n /**\n * Group is an optional property that can be used to group instructions together. For example a set of instructions that depend on create CreateElement instruction can be grouped together with the same group name, so if the CreateElement instruction is reverted, all the instructions in the same group will be reverted as well, and so on. This can be useful to manage complex changes that involve multiple instructions. \n * \n * [!] Note, the best option is to use ASEID of the Instruction as a group, so all instructions with the same ASEID will be treated as a single change, and will be applied and reverted together.\n */\n get group(): string | undefined {\n return this._group;\n }\n /**\n * The parent instruction ASEID that created this instruction. For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, the AddAttribute instruction would have the CreateElement instruction as its parent. This can be used to track the hierarchy of instructions and their dependencies.\n * \n * [!] Note, the parent should be provided as an ASEID string, so it can be easily referenced and tracked across different contexts and times.\n */\n get parent(): string | undefined {\n return this._parent;\n }\n\n get id(): string {\n return this.aseid.id;\n }\n\n get owner(): AreNode {\n return A_Context.scope(this).issuer<AreNode>()!;\n }\n\n\n fromNew(newEntity: AreInstructionNewProps<T>): void {\n\n // TODO: Verify if deduplication ID is needed\n // const identity = newEntity.id || {\n // name: newEntity.name,\n // };\n\n // const id = AreCacheHelper.createHash(identity);\n\n this.aseid = this.generateASEID({\n // shard: newEntity.node.id,\n entity: A_FormatterHelper.toKebabCase(newEntity.name),\n // id: id,\n });\n\n this._name = newEntity.name;\n this._payload = newEntity.payload\n this._group = newEntity.group?.aseid.toString();\n this._parent = newEntity.parent?.aseid.toString();\n }\n\n\n fromUndefined(): void {\n throw new A_Error({\n title: \"Cannot create an instruction without properties\",\n description: \"AreInstruction cannot be created without properties. Please provide the necessary properties to create an instruction.\",\n })\n }\n\n\n // ===============================================================================\n // ----------------------------Instruction Operations ------------------------------\n // ===============================================================================\n\n /**\n * Group this instruction with another instruction. This means that when one of the instructions in the group is applied or reverted, all the instructions in the same group will be applied or reverted together. This can be useful to manage complex changes that involve multiple instructions. \n * \n * For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, we can group them together with the same group name, so if we revert the CreateElement instruction, the AddAttribute instruction will be reverted as well, and so on.\n * \n * @param instruction \n * @returns \n */\n groupWith(instruction: AreInstruction): this {\n this._group = instruction.id;\n return this;\n }\n /**\n * Ungroup this instruction from any group. This means that this instruction will be treated as an independent instruction, and will not be applied or reverted together with any other instructions. This can be useful when you want to separate an instruction from a group, so it can be applied or reverted independently.\n * \n * @returns \n */\n unGroup(): this {\n this._group = undefined;\n return this;\n }\n /**\n * Attach this instruction to a parent instruction. This means that this instruction will be considered as a child of the parent instruction, and can be used to track the hierarchy of instructions and their dependencies. \n * \n * For example, if we have a CreateElement instruction that creates a new element, and then we have an AddAttribute instruction that adds an attribute to that element, we can attach the AddAttribute instruction to the CreateElement instruction as its parent, so we can track that the AddAttribute instruction is related to the CreateElement instruction.\n * \n * @param parent \n * @returns \n */\n attachTo(parent: AreInstruction): this {\n this._parent = parent.id;\n return this;\n }\n /**\n * Detach this instruction from its parent instruction. This means that this instruction will no longer be considered as a child of the parent instruction, and will not be related to it in any way. This can be useful when you want to separate an instruction from its parent, so it can be treated as an independent instruction.\n * \n * @returns \n */\n detach(): this {\n this._parent = undefined;\n return this;\n }\n\n\n // ===============================================================================\n // ----------------------------Instruction Features ------------------------------\n // ===============================================================================\n /**\n * Apply this instruction to the scene. This means that the changes represented by this instruction will be applied to the scene, and the Host will perform the necessary operations to reflect these changes in the rendered output. \n * \n * For example, if this instruction is a CreateElement instruction, when we apply it, the Host will create a new element in the scene according to the information provided in the payload of the instruction. If this instruction is an AddAttribute instruction, when we apply it, the Host will add the specified attribute to the target element in the scene. The apply method can also accept an optional scope parameter, which can be used to provide additional context or information that may be needed for applying the instruction.\n * \n * @param scope \n */\n apply(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Apply, scope);\n } \n /**\n * Update this instruction in the scene. This means that the changes represented by this instruction will be updated in the scene, and the Host will perform the necessary operations to reflect these changes in the rendered output. This is particularly useful for instructions that have dynamic properties or effects that may change over time, allowing for adjustments to be made to the instruction's behavior or effects without needing to revert and reapply it entirely. The update method can also accept an optional scope parameter, which can be used to provide additional context or information that may be needed for updating the instruction.\n * \n * @param scope \n */\n update(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Update, scope);\n }\n /**\n * Revert this instruction from the scene. This means that the changes represented by this instruction will be reverted from the scene, and the Host will perform the necessary operations to undo these changes in the rendered output.\n * \n * @param scope \n */\n revert(\n scope?: A_Scope\n ): void {\n this.call(AreInstructionFeatures.Revert, scope);\n }\n\n}\n\n\n\n\n\n\n\n\n","import { A_Error } from \"@adaas/a-concept\"\n\n\n\nexport class AreInstructionError extends A_Error{\n \n}","import { A_IdentityHelper } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"@adaas/are/instruction/AreInstruction.types\";\nimport { AreInstructionDefaultNames } from \"@adaas/are/instruction/AreInstruction.constants\";\n\n\n/**\n * This is a top-level instruction that represents the creation of a new element in the scene. It contains all the necessary information to create a new element, such as its tag and parent. This instruction can be applied to the scene to create a new element and can be reverted to remove the created element.\n */\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreDeclaration',\n description: 'AreDeclaration is a top-level rendering instruction that represents the creation of a new element in the ARE scene. It carries the target tag name and parent reference needed by the Host to construct the DOM element, and can be applied or reverted to manage element creation and removal deterministically.'\n})\nexport class AreDeclaration<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends AreInstruction<T, S> {\n\n constructor(\n /**\n * Serialized form of the instruction, used for deserialization and reconstruction of the instruction instance. This allows for the instruction to be easily stored, transmitted, and recreated in different contexts or at different times, while maintaining all the necessary information and relationships intact.\n */\n serialized: AreInstructionSerialized,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n name: string,\n /**\n * In case this is a child instruction that is related to a declaration instruction, we can pass the parent declaration instruction to establish the relationship between them. This allows us to manage related instructions together and ensure that they are executed in the correct order in the scene.\n */\n parent: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n payload: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n name?: string,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n payload?: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host. For example, for CreateElement instruction, the name can be \"createElement\", so the Host can have a method with the same name to handle this instruction.\n */\n param1?: string | S,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for CreateElement instruction, the payload can contain the tag name and parent information, so the Host can use this information to create the element in the correct place in the scene.\n */\n param2?: T | AreDeclaration,\n /**\n * In case this is a child instruction that is related to a declaration instruction, we can pass the parent declaration instruction to establish the relationship between them. This allows us to manage related instructions together and ensure that they are executed in the correct order in the scene.\n */\n param3?: AreDeclaration | T,\n ) {\n if (typeof param1 === 'object' && 'aseid' in param1)\n super(param1);\n else\n super({\n name: param1 || AreInstructionDefaultNames.Default,\n parent: param2 instanceof AreDeclaration ? param2 : undefined,\n group: param2 instanceof AreDeclaration ? param2.group : undefined,\n payload: param2 instanceof AreDeclaration ? (param3 || {}) as T : (param2 || {}) as T,\n // id: [param1, A_IdentityHelper.generateTimeId(), param2 instanceof AreDeclaration ? (param3 || {}) as T : (param2 || {}) as T]\n } as AreInstructionNewProps<T>);\n }\n\n}","import { title } from \"process\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreInstructionDefaultNames } from \"@adaas/are/instruction/AreInstruction.constants\";\nimport { AreInstruction } from \"@adaas/are/instruction/AreInstruction.entity\";\nimport { AreInstructionError } from \"@adaas/are/instruction/AreInstruction.error\";\nimport { AreInstructionNewProps, AreInstructionSerialized } from \"@adaas/are/instruction/AreInstruction.types\";\nimport { AreDeclaration } from \"./AreDeclaration.instruction\";\n\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreMutation',\n description: 'AreMutation is a rendering instruction that represents a reversible change applied to an existing declaration node in the ARE scene — such as updating an attribute, modifying content, or altering child structure. It references a parent AreDeclaration and is grouped with related mutations for coordinated apply and revert operations.'\n})\nexport class AreMutation<\n T extends Record<string, any> = Record<string, any>,\n S extends AreInstructionSerialized<T> = AreInstructionSerialized<T>\n> extends AreInstruction<T, S> {\n\n get parent(): string {\n return this._parent!;\n }\n\n\n get group(): string {\n return this._group || this.parent;\n }\n\n constructor(\n /**\n * Serialized form of the instruction, used for deserialization and reconstruction of the instruction instance. This allows for the instruction to be easily stored, transmitted, and recreated in different contexts or at different times, while maintaining all the necessary information and relationships intact.\n */\n serialized: S,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host.\n */\n name: string,\n /**\n * Parent instruction for grouping in case of mutations related to a specific declaration. This allows for better organization and management of instructions in the scene, as all mutations related to the same declaration will be executed together.\n */\n parent: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for AddAttribute instruction, the payload can contain the attribute name and value as a payload, so the Host can use this information to add the attribute to the node.\n */\n payload?: T,\n )\n constructor(\n /**\n * The name of the operation to be performed in Host.\n */\n param1: string | S,\n /**\n * Parent instruction for grouping in case of mutations related to a specific declaration. This allows for better organization and management of instructions in the scene, as all mutations related to the same declaration will be executed together.\n */\n param2?: AreDeclaration,\n /**\n * A set of additional parameters that may be needed for the rendering purpose. For example, for AddAttribute instruction, the payload can contain the attribute name and value as a payload, so the Host can use this information to add the attribute to the node.\n */\n param3?: T,\n ) {\n if (typeof param1 === 'object' && 'aseid' in param1)\n super(param1);\n else\n super({\n name: param1 || AreInstructionDefaultNames.Mutation,\n group: param2,\n parent: param2,\n payload: param3,\n // id: [param1, param3, param2?.group]\n } as AreInstructionNewProps<T>);\n }\n\n\n\n fromNew(newEntity: AreInstructionNewProps<T>): void {\n if (!newEntity.parent)\n throw new AreInstructionError({\n title: \"Mutation instruction must have a parent declaration instruction\",\n description: `Mutation instruction with name ${newEntity.name} must have a parent declaration instruction for grouping and organization purposes. Please provide a parent declaration instruction when creating this mutation instruction.`\n });\n\n super.fromNew(newEntity);\n }\n}","import { A_Caller, A_Component, A_Dependency, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreScene } from \"@adaas/are/scene/AreScene.context\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreStore } from \"@adaas/are/store/AreStore.context\";\nimport { AreAttribute } from \"@adaas/are/attribute/AreAttribute.entity\";\nimport { AreAttributeFeatures } from \"@adaas/are/attribute/AreAttribute.constants\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n\n\n@A_Frame.Component({\n description: 'Handles the lifecycle of the AreNode and related entities such as interpolations, directives, attributes, and so on. It provides lifecycle hooks for initialization, mounting, updating, and unmounting of the nodes, allowing to manage the state and behavior of the nodes throughout their lifecycle in a structured and consistent way.'\n})\nexport class AreLifecycle extends A_Component {\n\n\n\n static Init<T extends AreNode>(node: A_TYPES__Entity_Constructor<T>)\n static Init<T extends AreAttribute>(attribute: A_TYPES__Entity_Constructor<T>)\n static Init<T extends AreNode | AreAttribute>(param1: A_TYPES__Entity_Constructor<T>) {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: param1.prototype instanceof AreNode\n ? AreNodeFeatures.onInit\n : AreAttributeFeatures.Init,\n scope: [param1],\n override: ['init']\n })(target, propertyKey, descriptor);\n }\n }\n\n\n /**\n * Handles before init lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeInit,\n before: /.*/,\n scope: [AreNode]\n })\n beforeInit(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Init -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeInit, node.scope);\n }\n /**\n * Initializes the AreNode and prepares it for mounting \n * \n * @param node \n * @param scope \n * @param syntax \n * @param feature \n * @param logger \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onInit,\n scope: [AreNode]\n })\n init(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n context.startPerformance('AreLifecycle.init');\n\n const newNodeScene = new AreScene(node.aseid);\n\n scope.register(newNodeScene);\n\n /**\n * If Node has a custom component Defined\n */\n if (node.component) {\n const newNodeStore = new AreStore(node.aseid);\n scope.register(newNodeStore);\n\n\n newNodeStore.loadExtensions(node.component);\n }\n\n context.endPerformance('AreLifecycle.init');\n }\n /**\n * Handles after init lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterInit,\n after: /.*/,\n scope: [AreNode]\n })\n afterInit(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Init -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterInit, node.scope);\n }\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Mount Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before mount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeMount,\n before: /.*/,\n scope: [AreNode]\n })\n beforeMount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Mount -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeMount, node.scope);\n }\n /**\n * Mount the AreNode into the Host\n * \n * @param scope \n * @param node \n * @param scene \n * @param logger \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onMount,\n scope: [AreNode]\n })\n mount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n /**\n * Node Content\n */\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n\n logger?.debug(`[Mount] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n if (scene.isInactive)\n continue;\n\n // do update work on current\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n\n // /**\n // * 1. We should simply run and render node itself.\n // */\n // node.interpret();\n // /**\n // * 2. Then go through all children of the node and mount the.\n // */\n // for (let i = 0; i < node.children.length; i++) {\n // const child = node.children[i];\n // child.mount();\n // }\n }\n\n /**\n * Handles after mount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterMount,\n after: /.*/,\n scope: [AreNode]\n })\n afterMount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Mount -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterMount, node.scope);\n }\n\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Update Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before update lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n before: /.*/,\n scope: [AreNode]\n })\n beforeUpdate(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Update -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeUpdate, node.scope);\n }\n /**\n * Updates the AreNode in the AreScene\n * \n * @param node \n * @param scene \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n scope: [AreNode]\n })\n update(\n /**\n * Node to be updated\n */\n @A_Inject(A_Caller) node: AreNode,\n\n @A_Inject(AreContext) context: AreContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n\n ...args: any[]\n ) {\n\n logger?.debug(`[Update] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n if (scene.isInactive)\n continue;\n\n // do update work on current\n /**\n * 1. First we need to get all changes to be applied and reverted during render operation\n */\n const { toApply, toRevert } = scene.changes\n\n\n console.log(' -- Scene Changes -- ');\n console.log('To Apply: ', toApply);\n console.log('To Revert: ', toRevert);\n /**\n * 2. Then we need to revert all instructions from scene\n */\n for (const instruction of toRevert) {\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n instruction.apply();\n scene.apply(instruction);\n }\n }\n /**\n * 3. Finally we should apply everything that needs to be applied\n */\n for (const instruction of toApply) {\n try {\n /**\n * 3.1. if everything went well then just simply apply and attach to state this instruction\n */\n instruction.apply();\n scene.apply(instruction);\n } catch (error) {\n console.log('WTF?? ', error);\n\n /**\n * 2.2. if any error happened we simply revert the instruction and remove it from the state\n */\n instruction.revert();\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n\n // /**\n // * 4. Render everything that changed \n // */\n // node.interpret();\n // /**\n // * 5. And finally go though all children of the node and update the. \n // */\n // for (let i = 0; i < node.children.length; i++) {\n // const child = node.children[i];\n // child.update();\n // }\n\n\n }\n /**\n * Handles after update lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUpdate,\n after: /.*/,\n scope: [AreNode]\n })\n afterUpdate(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Update -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterUpdate, node.scope);\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Node Unmount Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before unmount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeUnmount,\n before: /.*/,\n scope: [AreNode]\n })\n beforeUnmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Unmount -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeUnmount, node.scope);\n }\n\n /**\n * Unmounts the AreNode from the Host\n * \n * @param node \n * @param scene \n * @param args \n * \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onUnmount,\n scope: [AreNode]\n })\n unmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n\n ...args: any[]\n ) {\n // walk entire tree inside one feature — no recursive feature calls\n const queue = [node]\n while (queue.length > 0) {\n const current = queue.shift()!\n\n const scene = current.scene;\n\n /**\n * 1. We have to revert all instructions related to this node and remove them from the state \n */\n const applied = [...scene.applied];\n\n for (let i = applied.length - 1; i >= 0; i--) {\n const instruction = applied[i];\n\n try {\n instruction.revert();\n scene.unApply(instruction);\n } catch (error) {\n scene.unApply(instruction);\n }\n }\n\n queue.push(...current.children)\n }\n }\n\n /**\n * Handles after unmount lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterUnmount,\n after: /.*/,\n scope: [AreNode]\n })\n afterUnmount(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Unmount -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterUnmount, node.scope);\n }\n\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Node Destroy Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles before destroy lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onBeforeDestroy,\n before: /.*/,\n scope: [AreNode]\n })\n beforeDestroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Destroy -> Before] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onBeforeDestroy, node.scope);\n }\n\n /**\n * Destroys the AreNode from the Host\n * \n * @param node \n * @param scene \n * @param args \n * \n */\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.DESTROY,\n scope: [AreNode]\n })\n destroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreScene) scene: AreScene,\n\n ...args: any[]\n ) {\n\n }\n\n /**\n * Handles after destroy lifecycle of the AreNode\n * \n * @param node \n * @param scope \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onAfterDestroy,\n after: /.*/,\n scope: [AreNode]\n })\n afterDestroy(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n ...args: any[]\n ) {\n const logger = scope.resolve<A_Logger>(A_Logger);\n\n logger?.debug(`[Destroy -> After] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n if (node.component)\n feature.chain(node.component, AreFeatures.onAfterDestroy, node.scope);\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreLifecycleError extends A_Error {\n\n static readonly InvalidLifecycleMethod = \"Invalid lifecycle method. Lifecycle method must be one of the following: onBeforeLoad, onLoad, onUpdate, onDestroy.\";\n\n}","import { A_Caller, A_Component, A_Context, A_Dependency, A_Feature, A_FormatterHelper, A_Inject, A_Scope, A_TYPES__ComponentMeta, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\n\n\n\n@A_Frame.Component({\n description: 'Entry point of the pipeline. Accepts a raw template string and orchestrates the initial processing by delegating to Syntax. Returns a structured AreNode tree ready for transformation. Knows nothing about the template content or grammar rules.'\n})\nexport class AreLoader extends A_Component {\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Load Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Loads the AreNode \n * \n * @param node \n * @param scope \n * @param syntax \n * @param feature \n * @param logger \n * @param args \n */\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [AreNode]\n })\n async load(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n @A_Inject(AreContext) context?: AreContext,\n ...args: any[]\n ) {\n logger?.debug('red', `Loading node <${node.aseid.toString()}> with content:`, scope);\n\n /**\n * If Node has a custom component Defined\n */\n if (node.component) {\n /**\n * Chain all methods to load data from component.\n */\n context?.startPerformance('Total AreFeatures.onData')\n await feature.chain(node.component, AreFeatures.onData, scope);\n context?.endPerformance('Total AreFeatures.onData')\n\n context?.startPerformance('Total AreFeatures.onLoad')\n await feature.chain(node.component, AreFeatures.onStyles, scope);\n context?.endPerformance('Total AreFeatures.onLoad')\n\n context?.startPerformance('Total AreFeatures.onTemplate')\n await feature.chain(node.component, AreFeatures.onTemplate, scope);\n context?.endPerformance('Total AreFeatures.onTemplate')\n } \n // else {\n // logger?.warning(\n // 'Component Not Found',\n // `No component registered for entity: ${node.aseid.entity}. Please ensure that the component is registered in the scope before rendering.`\n // );\n // }\n\n /**\n * 2. Tokenize Node Content\n */\n context?.startPerformance('Tokenization')\n node.tokenize();\n context?.endPerformance('Tokenization')\n\n /**\n * 3. We have to extract node content and create child nodes if content exists, since it can impact the rendering and compilation process, for example if we have some directives that are affecting the structure of the node or its children, we need to have them in place before compilation to ensure that they are properly processed and their instructions are added to the render plan.\n */\n for (let i = 0; i < node.children.length; i++) {\n const childNode = node.children[i];\n\n const res = childNode.load();\n if(res instanceof Promise) {\n await res;\n }\n }\n }\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\n\nexport class AreLoaderError extends A_Error {\n\n static readonly SyntaxError = 'Are Loader Syntax Error';\n\n static readonly EmptyTemplateError = 'Are Loader Empty Template Error';\n}","import { A_Component } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreWatcher',\n description: 'AreWatcher is a component that observes browser navigation events (history pushState, replaceState, and popstate) and notifies registered handlers when the URL changes, enabling client-side routing and reactive route-based rendering within the ARE framework.'\n})\nexport class AreWatcher extends A_Component {\n\n private readonly handlers: Set<(url: URL) => void> = new Set();\n private current: URL = new URL(window.location.href);\n\n constructor() {\n super();\n this.patchHistory();\n this.attachListeners();\n }\n\n // ── Public ────────────────────────────────────────────────────────────────\n\n onChange(handler: (url: URL) => void): () => void {\n this.handlers.add(handler);\n return () => this.handlers.delete(handler); // returns unsubscribe fn\n }\n\n get url(): URL {\n return this.current;\n }\n\n destroy(): void {\n window.removeEventListener('popstate', this.onPopState);\n window.removeEventListener('hashchange', this.onHashChange);\n window.removeEventListener('urlchange', this.onURLChange);\n this.handlers.clear();\n }\n\n // ── Listeners ─────────────────────────────────────────────────────────────\n\n private onPopState = (): void => {\n this.notify();\n }\n\n private onHashChange = (): void => {\n this.notify();\n }\n\n private onURLChange = (): void => {\n this.notify();\n }\n\n private attachListeners(): void {\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('hashchange', this.onHashChange);\n window.addEventListener('urlchange', this.onURLChange); // custom event from patch\n }\n\n // ── Patch pushState / replaceState ────────────────────────────────────────\n\n private patchHistory(): void {\n const patch = (original: typeof history.pushState) =>\n function (this: History, ...args: Parameters<typeof history.pushState>) {\n original.apply(this, args);\n window.dispatchEvent(new Event('urlchange'));\n };\n\n history.pushState = patch(history.pushState);\n history.replaceState = patch(history.replaceState);\n }\n\n // ── Notify ────────────────────────────────────────────────────────────────\n\n private notify(): void {\n const next = new URL(window.location.href);\n\n if (next.href === this.current.href) return; // no actual change\n\n this.current = next;\n\n for (const handler of this.handlers) {\n handler(this.current);\n }\n }\n}","import { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { A_Frame } from \"@adaas/a-frame\";\n\n\n\n@A_Frame.Entity({\n namespace: 'A-ARE',\n name: 'AreSignal',\n description: 'AreSignal is the base class for all signals used within the ARE framework. It extends A_Signal to provide a typed signal entity that components can subscribe to and emit, enabling reactive communication between ARE components and driving lifecycle and rendering updates.'\n})\nexport class AreSignal<\n _TSignalDataType extends Record<string, any> = Record<string, any>\n> extends A_Signal<_TSignalDataType> {\n\n\n\n}","import { A_ComponentMeta, A_TYPES__ComponentMeta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport type { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport type { Are } from \"@adaas/are/component/Are.component\";\n\n\nexport class AreSignalsMeta extends A_ComponentMeta<{\n vectorToComponent: Map<A_SignalVector, A_TYPES__Ctor<Are>>;\n componentToVector: Map<A_TYPES__Ctor<Are>, Set<A_SignalVector>>;\n} & A_TYPES__ComponentMeta> {\n\n\n registerCondition<T extends Are>(component: A_TYPES__Ctor<T>, vector: A_SignalVector) {\n const vectorToComponent = this.get('vectorToComponent') || new Map<A_SignalVector, A_TYPES__Ctor<T>>();\n const componentToVector = this.get('componentToVector') || new Map<A_TYPES__Ctor<T>, Set<A_SignalVector>>();\n\n vectorToComponent.set(vector, component);\n if (!componentToVector.has(component)) {\n componentToVector.set(component, new Set<A_SignalVector>());\n }\n componentToVector.get(component)?.add(vector);\n\n this.set('vectorToComponent', vectorToComponent);\n this.set('componentToVector', componentToVector);\n }\n\n\n findComponentByVector(vector: A_SignalVector): A_TYPES__Ctor<Are> | undefined {\n\n /**\n * 1. try simple lookup\n */\n const vectorToComponent = this.get('vectorToComponent');\n\n if (vectorToComponent) {\n const component = vectorToComponent.get(vector);\n if (component) {\n return component;\n }\n }\n\n /**\n * 2. fallback to checking for matching vectors in the map (handles cases where vector instances differ but are logically equivalent)\n */\n if (vectorToComponent) {\n\n /**\n * 2.1 Priority 1: Full Equivalence - find a component whose registered vector is fully equivalent to the provided vector (i.e., all signals match in type and data).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.equals(registeredVector)) {\n return component;\n }\n }\n /**\n * 2.2 Priority 2: Logical Match - find a component whose registered vector logically matches the provided vector (i.e., all signals match in type and data, but order may differ).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.match(registeredVector)) {\n return component;\n }\n }\n /**\n * 2.3 Priority 3: Inclusion - find a component whose registered vector includes all signals from the provided vector (i.e., the provided vector is a subset of the registered vector).\n */\n for (const [registeredVector, component] of vectorToComponent.entries()) {\n if (vector.includes(registeredVector)) {\n return component;\n }\n }\n }\n\n return undefined;\n }\n\n}","import { A_Context, A_Fragment, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { A_Signal, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { Are } from \"@adaas/are/component/Are.component\";\nimport { AreSignalsContextConfig } from \"./AreSignals.types\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreSignalsMeta } from \"./AreSignals.meta\";\nimport { AreSignals } from \"./AreSignals.component\";\n\n\n\n@A_Frame.Fragment({\n description: 'AreSignalsContext is a fragment that manages the set of root nodes subscribed to the signal bus. It tracks which Are components should receive signal vectors from AreSignals and provides the subscriber registry used during signal dispatch.'\n})\nexport class AreSignalsContext<\n T extends Are = Are\n> extends A_Fragment {\n\n /**\n * Where key is the root ID and the value is an Array of components that participate in conditional compilation.\n */\n protected _componentMap: Map<string, Set<A_TYPES__Ctor<T>>> = new Map();\n\n protected _defaultsMap: Map<string, A_TYPES__Ctor<T>> = new Map();\n\n protected _conditionsMap: Map<string, Array<{\n vector: Array<any>;\n component: A_TYPES__Ctor<T>;\n }>> = new Map();\n\n\n protected _subscribers: Set<AreNode> = new Set();\n\n\n protected signalsMeta() {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n if (!signalsMeta) {\n throw new Error('AreSignalsMeta not found in context. Please ensure that AreSignalsMeta is properly registered in the A-Concept context.');\n }\n return signalsMeta;\n }\n\n subscribe<S extends AreNode>(subscriber: S) {\n this._subscribers.add(subscriber);\n }\n\n unsubscribe<S extends AreNode>(subscriber: S) {\n this._subscribers.delete(subscriber);\n }\n\n get subscribers(): Set<AreNode> {\n return this._subscribers;\n }\n\n constructor(\n /**\n * Where key is the root ID and the value is an Array of components that participate in conditional compilation.\n */\n config?: Partial<AreSignalsContextConfig<T>>\n ) {\n super({ name: 'AreSignalsContext' });\n // Initialize the map with the provided config\n\n const configEntries = config ? Object.entries(config) : [];\n\n for (const [rootId, conf] of configEntries) {\n const def = conf?.default;\n const pool = conf?.pool || [];\n const conditions = conf?.conditions || [];\n\n this._componentMap.set(rootId, new Set(pool));\n\n if (def)\n this._defaultsMap.set(rootId, def);\n\n this._conditionsMap.set(rootId, conditions);\n }\n\n }\n\n\n /**\n * Returns the components associated with the given ID. If no components are found, returns an empty array.\n * \n * @param id The ID of the component group.\n * @returns An array of component constructors.\n */\n getComponentById(id: string): Array<A_TYPES__Ctor<T>> {\n const set = this._componentMap.get(id) || new Set();\n return Array.from(set);\n }\n\n /**\n * Returns the components associated with the root ID of the given node. If no components are found, returns an empty array.\n * \n * @param node The AreNode whose root ID is used to retrieve the components.\n * @returns An array of component constructors.\n */\n getComponentByRoot(node: AreNode): Array<A_TYPES__Ctor<T>> {\n return this.getComponentById(node.id);\n }\n\n /**\n * Adds a new component to the specified root ID. If the root ID does not exist, it will be created.\n * \n * @param rootId The ID of the root component group.\n * @param components An array of component constructors to add.\n */\n extendRoot(rootId: string, components: Array<A_TYPES__Ctor<T>>) {\n if (!this._componentMap.has(rootId)) {\n this._componentMap.set(rootId, new Set());\n }\n const set = this._componentMap.get(rootId)!;\n for (const comp of components) {\n set.add(comp);\n }\n }\n\n /**\n * Whether routing is configured for the given root ID.\n * When false, the root should leave its original template content untouched.\n * \n * @param rootId The id attribute of the <are-root> element.\n */\n hasRoot(rootId: string): boolean {\n return this._componentMap.has(rootId) || this._conditionsMap.has(rootId);\n }\n\n /**\n * Returns the default component associated with the given root ID, if any.\n * \n * @param rootId The ID of the root component group.\n */\n getDefault(rootId: string): A_TYPES__Ctor<T> | undefined {\n return this._defaultsMap.get(rootId);\n }\n\n /**\n * Finds the matching component for the given root ID and incoming signal vector.\n * \n * Matching priorities (mirroring AreSignalsMeta):\n * 1. Full equivalence — vector.equals(conditionVector)\n * 2. Logical match — vector.match(conditionVector)\n * 3. Inclusion — incoming vector contains every signal type from condition, checked with signal.compare()\n * \n * @param rootId The id attribute of the <are-root> element.\n * @param vector The incoming signal vector from the bus.\n */\n findComponentByVector(rootId: string, vector: A_SignalVector): A_TYPES__Ctor<T> | undefined {\n const conditions = this._conditionsMap.get(rootId) || [];\n\n for (const condition of conditions) {\n const conditionVector = new A_SignalVector(condition.vector as A_Signal[]);\n\n // Priority 1: full equivalence\n if (vector.equals(conditionVector as any)) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n for (const condition of conditions) {\n const conditionVector = new A_SignalVector(condition.vector as A_Signal[]);\n\n // Priority 2: logical match (order-independent, same data)\n if (vector.match(conditionVector as any)) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n for (const condition of conditions) {\n // Priority 3: inclusion — every signal type in condition is present in the incoming\n // vector WITH data comparison via signal.compare()\n const allMatch = condition.vector.every((condSignal: A_Signal) => {\n for (const incomingSignal of vector) {\n if(!incomingSignal)\n continue;\n if (\n incomingSignal.constructor === condSignal.constructor &&\n condSignal.compare(incomingSignal)\n ) {\n return true;\n }\n }\n return false;\n });\n\n if (allMatch) {\n return condition.component as A_TYPES__Ctor<T>;\n }\n }\n\n return undefined;\n }\n\n}\n\n","import { A_Caller, A_Component, A_Feature, A_Inject, A_Meta, A_Scope } from \"@adaas/a-concept\";\nimport { A_SignalBusFeatures, A_SignalState, A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\nimport { AreFeatures } from \"@adaas/are/component/Are.constants\";\nimport { AreNode } from \"@adaas/are/node/AreNode.entity\";\nimport { AreNodeFeatures } from \"@adaas/are/node/AreNode.constants\";\nimport { AreEvent } from \"@adaas/are/event/AreEvent.context\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreSignalsMeta } from \"./AreSignals.meta\";\nimport { AreSignalsContext } from \"./AreSignals.context\";\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreSignals',\n description: 'AreSignals is the central signal bus component within the ARE framework. It listens for incoming signal vectors and dispatches them to all subscribed root nodes, enabling reactive, event-driven rendering and lifecycle management across the component tree.'\n})\n@A_Meta.Define(AreSignalsMeta)\nexport class AreSignals extends A_Component {\n\n @A_Feature.Extend({\n name: A_SignalBusFeatures.onNext,\n })\n async handleSignalVector(\n @A_Inject(A_SignalVector) vector: A_SignalVector,\n @A_Inject(AreSignalsContext) context: AreSignalsContext,\n @A_Inject(A_SignalState) state: A_SignalState,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n logger?.debug(`Handling Signal Vector with ${context.subscribers.size} root nodes.`, vector);\n\n try {\n for (const root of context.subscribers) {\n\n const callScope = new A_Scope({\n fragments: [new AreEvent(\n AreFeatures.onSignal, {\n vector\n })]\n })\n .import(scope, root.scope);\n\n logger?.debug('Emitting signal for root node:', vector);\n\n await root.emit(callScope);\n\n callScope.destroy();\n }\n } catch (error) {\n logger?.error(error);\n }\n }\n\n\n\n // -----------------------------------------------------------------------------------------\n // ----------------------------Are-Node Event Section----------------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Handles events triggered on the AreNode\n * \n * @param node \n * @param scope \n * @param event \n * @param scene \n * @param feature \n * @param args \n */\n @A_Feature.Extend({\n name: AreNodeFeatures.onEmit,\n scope: [AreNode]\n })\n async propagateEvent(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreEvent) event: AreEvent,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n let currentNode = node;\n let target = node;\n\n while (currentNode && currentNode.parent) {\n if (currentNode.component) {\n target = currentNode;\n break;\n }\n currentNode = currentNode.parent;\n }\n\n if (target.component)\n await feature.chain(target.component, event.name, scope);\n }\n}","import { AreSignal } from \"@adaas/are/signals/AreSignal.entity\";\n\nexport class AreInit extends AreSignal {\n static default(): AreInit | undefined {\n return new AreInit({ data: { ready: false } });\n }\n}","import { A_Route } from \"@adaas/a-utils/a-route\";\nimport { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { AreSignal } from \"@adaas/are/signals/AreSignal.entity\";\n\n\n\nexport class AreRoute extends AreSignal<A_Route> {\n\n constructor(path: string | RegExp) {\n super({\n data: new A_Route(path)\n });\n }\n\n get route(): A_Route {\n return this.data;\n }\n\n static default(): AreRoute | undefined {\n return new AreRoute(document.location.pathname || '/');\n }\n\n\n compare(other: A_Signal<A_Route>): boolean {\n return this.route.toRegExp().test(other.data.toString());\n }\n}","import { A_Error } from \"@adaas/a-concept\"\n\n\n\nexport class AreEngineError extends A_Error{\n\n\n static readonly MissedRequiredDependency = 'A Required Dependency is missing in AreEngine';\n}","\n\nexport const AreEngineFeatures = {\n Load: '_AreEngine_Load',\n Build: '_AreEngine_Build',\n Execute: '_AreEngine_Execute',\n}","import { A_CommonHelper, A_Component, A_Context, A_Dependency, A_Feature, A_FormatterHelper, A_Inject, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { AreSyntax } from \"@adaas/are/syntax/AreSyntax.context\";\nimport { A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreCompiler } from \"@adaas/are/compiler/AreCompiler.component\";\nimport { AreTransformer } from \"@adaas/are/transformer/AreTransformer.component\";\nimport { AreLoader } from \"@adaas/are/loader/AreLoader.component\";\nimport { AreInterpreter } from \"@adaas/are/interpreter/AreInterpreter.component\";\nimport { AreEngineError } from \"./AreEngine.error\";\nimport { AreLifecycle } from \"@adaas/are/lifecycle/AreLifecycle.component\";\nimport { AreEngineFeatures } from \"./AreEngine.constants\";\nimport { AreContext } from \"@adaas/are/component/Are.context\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreTokenizer } from \"@adaas/are/tokenizer/AreTokenizer.component\";\nimport { AreEngineDependencies } from \"./AreEngine.types\";\nimport { AreSignals } from \"@adaas/are/signals/AreSignals.component\";\nimport { AreInit } from \"@adaas/are/signals/entities/AreInit.signal\";\nimport { A_SignalBus } from \"@adaas/a-utils/a-signal\";\n\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreEngine',\n description: 'Core rendering engine for A-Concept Rendering Engine (ARE), responsible for orchestrating the loading, building, and execution of the rendering process. It manages the lifecycle of root nodes, coordinates the interactions between syntax, transformer, loader, compiler, and interpreter components, and ensures the proper initialization and mounting of the UI application.'\n})\nexport class AreEngine extends A_Component {\n\n /**\n * Feature decorator for the load method, which is responsible for the initial loading phase of the engine. This method is where the engine reads the source template, tokenizes it, and prepares the initial context for building the scene. The decorator allows for extending or overriding the default loading behavior by attaching additional functionality before or after the load process.\n */\n static get Load() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreEngineFeatures.Load,\n scope: [target.constructor],\n override: ['defaultLoad']\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Feature decorator for the build method, which is responsible for constructing the scene based on the loaded context. This method typically involves initializing root nodes, applying transformations, and compiling the scene into a format that can be executed by the interpreter. The decorator allows for customizing the build process by adding additional steps or modifying the existing behavior.\n */\n static get Build() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreEngineFeatures.Build,\n scope: [target.constructor],\n override: ['defaultBuild']\n })(target, propertyKey, descriptor);\n }\n }\n /**\n * Feature decorator for the execute method, which is responsible for the final execution phase of the engine. This method typically involves mounting the root nodes to the DOM and starting the reactive update cycle based on signals and state changes. The decorator allows for customizing the execution process by adding additional steps or modifying the existing behavior.\n */\n static get Execute() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreEngineFeatures.Execute,\n scope: [target.constructor],\n override: ['defaultExecute']\n })(target, propertyKey, descriptor);\n }\n }\n\n\n // ==========================================================================================\n // -----------------------------------ARE Engine Features------------------------------------\n // ==========================================================================================\n\n /**\n * Method to start the engine, which involves loading necessary resources, building the scene, and executing the rendering process. It accepts an optional scope parameter that can be used to provide a custom scope for the engine's operations, allowing for greater flexibility in how dependencies are managed and accessed during the rendering lifecycle.\n * \n * @param scope \n * @returns \n */\n @A_Frame.Method({\n description: 'Method does engine loading, first read of the source and tokenization.'\n })\n async load(scope?: A_Scope) {\n const context = scope?.resolve(AreContext) || A_Context.scope(this).resolve(AreContext);\n\n context?.startPerformance();\n\n await this.call(AreEngineFeatures.Load, scope || A_Context.scope(this));\n }\n\n /**\n * Method responsible for building the scene, which includes initializing root nodes, loading necessary data, applying transformations, and compiling the scene into a format that can be executed by the interpreter.\n * \n * @param context \n * @param logger \n */\n @A_Frame.Method({\n description: 'Method responsible for building the scene, which includes initializing root nodes, loading necessary data, applying transformations, and compiling the scene into a format that can be executed by the interpreter.'\n })\n async build(scope?: A_Scope) {\n const context = scope?.resolve(AreContext) || A_Context.scope(this).resolve(AreContext);\n context?.startPerformance('Build Total');\n\n await this.call(AreEngineFeatures.Build, scope || A_Context.scope(this));\n\n context?.endPerformance('Build Total');\n }\n\n /**\n * Method responsible for executing the rendering process, which involves mounting the root nodes to the DOM and starting the reactive update cycle based on signals and state changes.\n * \n * @param context \n * @param logger \n */\n @A_Frame.Method({\n description: 'Method responsible for executing the rendering process, which involves mounting the root nodes to the DOM and starting the reactive update cycle based on signals and state changes.'\n })\n async execute(scope?: A_Scope) {\n const context = scope?.resolve(AreContext) || A_Context.scope(this).resolve(AreContext);\n\n context?.startPerformance('Execute Total');\n\n await this.call(AreEngineFeatures.Execute, scope || A_Context.scope(this));\n\n context?.endPerformance('Execute Total');\n context?.endPerformance('Total');\n }\n\n // ==========================================================================================\n // ----------------------------ARE Engine Default Methods------------------------------------\n // ==========================================================================================\n @A_Feature.Extend({\n name: AreEngineFeatures.Build,\n before: /.*/\n })\n protected async defaultBuild(\n @A_Dependency.Required()\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n logger?.debug('cyan', 'Starting to build the scene...');\n\n for (const root of context.roots) {\n\n context.startPerformance(`Init root <${root.aseid.id}>`);\n root.init();\n context.endPerformance(`Init root <${root.aseid.id}>`);\n\n context.startPerformance(`Load root <${root.aseid.id}>`);\n await root.load();\n context.endPerformance(`Load root <${root.aseid.id}>`);\n\n context.startPerformance(`Transform root <${root.aseid.id}>`);\n root.transform();\n context.endPerformance(`Transform root <${root.aseid.id}>`);\n\n context.startPerformance(`Compile root <${root.aseid.id}>`);\n root.compile();\n context.endPerformance(`Compile root <${root.aseid.id}>`);\n\n context.endPerformance(`Root <${root.aseid.id}> Total`);\n }\n }\n @A_Feature.Extend({\n name: AreEngineFeatures.Execute,\n before: /.*/\n })\n protected async defaultExecute(\n @A_Dependency.Required()\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_SignalBus) bus?: A_SignalBus,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n logger?.debug('cyan', 'Starting to execute the scene and mount root nodes...');\n\n for (const root of context.roots) {\n\n context.startPerformance(`Mount root <${root.aseid.id}>`);\n\n root.mount();\n\n context.endPerformance(`Mount root <${root.aseid.id}>`);\n }\n\n logger?.debug('cyan', 'Emitting AreInit signal to start the reactive update cycle...');\n\n await bus?.next(new AreInit())\n }\n\n @A_Feature.Extend({\n name: AreEngineFeatures.Load,\n before: /.*/\n })\n async init(\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n this.package(scope);\n }\n\n @A_Feature.Extend({\n name: AreEngineFeatures.Load,\n before: /.*/\n })\n async verify(\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSyntax) syntax?: AreSyntax,\n @A_Inject(AreSyntax) syntaxContext?: AreSyntax,\n @A_Inject(AreTransformer) transformer?: AreTransformer,\n @A_Inject(AreLoader) loader?: AreLoader,\n @A_Inject(AreCompiler) compiler?: AreCompiler,\n @A_Inject(AreInterpreter) interpreter?: AreInterpreter,\n @A_Inject(AreLifecycle) lifecycle?: AreLifecycle,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n if (!syntax)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreSyntax or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n if (!syntaxContext)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreSyntax or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n\n if (!loader)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreLoader or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n if (!transformer)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreTransformer or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n if (!compiler)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreCompiler or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n if (!interpreter)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreInterpreter or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n\n if (!lifecycle)\n throw new AreEngineError({\n title: AreEngineError.MissedRequiredDependency,\n description: `AreLifecycle or its inherited variation is a required dependency for ${this.constructor.name}. Please ensure that it is registered in the container scope before starting the engine.`\n });\n }\n\n\n /**\n * Method to pack all necessary dependencies for the engine. This method is called during the initialization phase of the engine and ensures that all required components are registered in the container scope, allowing for proper dependency injection and management throughout the engine's lifecycle.\n * \n * @param scope \n * @param dependencies \n */\n @A_Frame.Method({\n description: 'Method to pack all necessary dependencies for the engine. This method is called during the initialization phase of the engine and ensures that all required components are registered in the container scope, allowing for proper dependency injection and management throughout the engine\\'s lifecycle.'\n })\n protected package(\n scope: A_Scope,\n dependencies?: Partial<AreEngineDependencies>\n ) {\n const { context, syntax, loader, tokenizer, compiler, transformer, interpreter, lifecycle, signals } = dependencies || {};\n const existedContext = scope.resolveConstructor(AreContext);\n const existedSyntax = scope.resolveConstructor(AreSyntax);\n const existedLoader = scope.resolveConstructor(AreLoader);\n const existedTokenizer = scope.resolveConstructor(AreTokenizer);\n const existedCompiler = scope.resolveConstructor(AreCompiler);\n const existedInterpreter = scope.resolveConstructor(AreInterpreter);\n const existedLifecycle = scope.resolveConstructor(AreLifecycle);\n const existedTransformer = scope.resolveConstructor(AreTransformer);\n const existedSignals = scope.resolveConstructor(AreSignals);\n\n\n this.packDependency(scope, context || AreContext, existedContext);\n this.packDependency(scope, syntax || AreSyntax, existedSyntax);\n this.packDependency(scope, tokenizer || AreTokenizer, existedTokenizer);\n this.packDependency(scope, loader || AreLoader, existedLoader);\n this.packDependency(scope, compiler || AreCompiler, existedCompiler);\n this.packDependency(scope, transformer || AreTransformer, existedTransformer);\n this.packDependency(scope, interpreter || AreInterpreter, existedInterpreter);\n this.packDependency(scope, lifecycle || AreLifecycle, existedLifecycle);\n this.packDependency(scope, signals || AreSignals, existedSignals);\n\n }\n\n protected packDependency<T extends A_TYPES__A_DependencyInjectable>(\n scope: A_Scope,\n dependency: T | A_TYPES__Ctor<T>,\n existed?: A_TYPES__Ctor<T>\n ) {\n const logger = scope.resolve(A_Logger);\n const thisName = A_CommonHelper.getComponentName(this);\n const scopeIssuerName = A_CommonHelper.getComponentName(scope.issuer());\n const dependencyName = A_CommonHelper.getComponentName(dependency);\n\n if (existed) {\n logger?.debug('cyan', `Dependency ${dependencyName} already exists in ${scopeIssuerName} scope. Skipping injection.`);\n\n return existed;\n } else {\n logger?.debug('cyan', `Injecting ${dependencyName} into ${scopeIssuerName} scope for ${thisName}...`);\n scope.register(dependency);\n\n return dependency;\n }\n }\n\n}"]}
|