@adaas/a-concept 0.3.8 → 0.3.9
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/benchmarks/feature-optimize.bench.ts +129 -54
- package/dist/browser/index.d.mts +62 -12
- package/dist/browser/index.mjs +2 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/index.cjs +301 -102
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +62 -12
- package/dist/node/index.d.ts +62 -12
- package/dist/node/index.mjs +301 -102
- package/dist/node/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/lib/A-Context/A-Context.class.ts +214 -41
- package/src/lib/A-Feature/A-Feature.class.ts +34 -31
- package/src/lib/A-Scope/A-Scope.class.ts +143 -72
- package/tests/A-Meta.test.ts +46 -2
- package/tests/A-Scope.test.ts +188 -0
- package/tsconfig.json +1 -0
package/dist/browser/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var U=class{constructor(e={}){this._name=e.name||this.constructor.name;}get name(){return this._name}toJSON(){return {name:this.name}}};var Ne=(o=>(o.INITIALIZED="INITIALIZED",o.PROCESSING="PROCESSING",o.COMPLETED="COMPLETED",o.INTERRUPTED="INTERRUPTED",o.FAILED="FAILED",o))(Ne||{});var g=class{static toUpperSnakeCase(e){return e.trim().replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toUpperCase()}static toCamelCase(e){return e.trim().replace(/[^a-zA-Z0-9]+/g," ").split(" ").filter(Boolean).map((t,r)=>r===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}static toPascalCase(e){return e.trim().replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z0-9]+/g," ").split(" ").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}static toKebabCase(e){return e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g,"-").toLowerCase()}};var V=class{static generateTimeId(e={timestamp:new Date,random:Math.random().toString(36).slice(2,8)}){let t=e.timestamp.getTime().toString(36),r=e.random;return `${t}-${r}`}static parseTimeId(e){let[t,r]=e.split("-");return {timestamp:new Date(parseInt(t,36)),random:r}}static formatWithLeadingZeros(e,t=10){return String(e).padStart(t+1,"0").slice(-t)}static removeLeadingZeros(e){return String(Number(e))}static hashString(e){let t=0,r,n;if(e.length===0)return t.toString();for(r=0;r<e.length;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t.toString()}};var h=class i{static isString(e){return typeof e=="string"||e instanceof String}static isNumber(e){return typeof e=="number"&&isFinite(e)}static isBoolean(e){return typeof e=="boolean"}static isObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static isArray(e){return Array.isArray(e)}static isErrorConstructorType(e){return !!e&&i.isObject(e)&&!(e instanceof Error)&&"title"in e}static isErrorSerializedType(e){return !!e&&i.isObject(e)&&!(e instanceof Error)&&"aseid"in e&&i.isString(e.aseid)}static isScopeInstance(e){return !!e&&typeof e=="object"&&"name"in e&&"aseid"in e}};var O=class O{static isASEID(e){return this.regexp.test(e)}static compare(e,t){if(!e||!t)return false;if(h.isString(e)&&this.isASEID(e)===false)throw new Error(`Invalid ASEID format provided: ${e}`);if(h.isString(t)&&this.isASEID(t)===false)throw new Error(`Invalid ASEID format provided: ${t}`);let r=e instanceof O?e:new O(e),n=t instanceof O?t:new O(t);return r.toString()===n.toString()}constructor(e){this.verifyInput(e),this.getInitializer(e).call(this,e);}get concept(){return this._concept||c.concept}get scope(){return this._scope||c.root.name}get entity(){return this._entity}get id(){return this._id}get version(){return this._version}get shard(){return this._shard}get hash(){return V.hashString(this.toString())}getInitializer(e){switch(true){case h.isString(e):return this.fromString;case h.isObject(e):return this.fromObject;default:throw new Error("Invalid parameters provided to ASEID constructor")}}fromString(e){let[t,r,n]=e.split("@"),[o,a,_]=r.split(":"),d=_.includes(".")?_.split(".")[0]:void 0,l=_.includes(".")?_.split(".")[1]:_;this._concept=t||c.root.name,this._scope=o||c.root.name,this._entity=a,this._id=l,this._version=n,this._shard=d;}fromObject(e){this._concept=e.concept?O.isASEID(e.concept)?new O(e.concept).id:e.concept:c.concept,this._scope=e.scope?h.isNumber(e.scope)?V.formatWithLeadingZeros(e.scope):O.isASEID(e.scope)?new O(e.scope).id:e.scope:c.root.name,this._entity=e.entity,this._id=h.isNumber(e.id)?V.formatWithLeadingZeros(e.id):e.id,this._version=e.version,this._shard=e.shard;}toString(){return `${this.concept}@${this.scope}:${this.entity}:${this.shard?this.shard+"."+this.id:this.id}${this.version?"@"+this.version:""}`}toJSON(){return {concept:this._concept,scope:this._scope,entity:this._entity,id:this._id,version:this._version,shard:this._shard}}verifyInput(e){switch(true){case(h.isString(e)&&!O.isASEID(e)):throw new Error("Invalid ASEID format provided");case(h.isObject(e)&&!e.id):throw new Error("ASEID id is required");case(h.isObject(e)&&!e.entity):throw new Error("ASEID entity is required")}}};O.regexp=new RegExp("^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|\\.|-]+(@v[0-9|\\.]+|@lts)?$");var I=O;var ne={UNEXPECTED_ERROR:"A-Error Unexpected Error",VALIDATION_ERROR:"A-Error Validation Error"},xe="If you see this error please let us know.";var pe=class{static get A_CONCEPT_NAME(){return "a-concept"}static get A_CONCEPT_ROOT_SCOPE(){return "root"}static get A_CONCEPT_ENVIRONMENT(){return "development"}static get A_CONCEPT_RUNTIME_ENVIRONMENT(){return "unknown"}static get A_CONCEPT_ROOT_FOLDER(){return "/app"}static get A_ERROR_DEFAULT_DESCRIPTION(){return "If you see this error please let us know."}static get(e){return this[e]}static set(e,t){this[e]=t;}static getAll(){return {}}static getAllKeys(){return []}};var oe={A_CONCEPT_NAME:"A_CONCEPT_NAME",A_CONCEPT_ROOT_SCOPE:"A_CONCEPT_ROOT_SCOPE",A_CONCEPT_ENVIRONMENT:"A_CONCEPT_ENVIRONMENT",A_CONCEPT_RUNTIME_ENVIRONMENT:"A_CONCEPT_RUNTIME_ENVIRONMENT",A_CONCEPT_ROOT_FOLDER:"A_CONCEPT_ROOT_FOLDER",A_ERROR_DEFAULT_DESCRIPTION:"A_ERROR_DEFAULT_DESCRIPTION"},Ae=[oe.A_CONCEPT_NAME,oe.A_CONCEPT_ROOT_SCOPE,oe.A_CONCEPT_ENVIRONMENT,oe.A_CONCEPT_RUNTIME_ENVIRONMENT,oe.A_CONCEPT_ROOT_FOLDER,oe.A_ERROR_DEFAULT_DESCRIPTION];var k=class extends pe{static get A_CONCEPT_ENVIRONMENT(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ENVIRONMENT||super.A_CONCEPT_ENVIRONMENT}static get A_CONCEPT_RUNTIME_ENVIRONMENT(){return "browser"}static get A_CONCEPT_NAME(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_NAME||super.A_CONCEPT_NAME}static get A_CONCEPT_ROOT_FOLDER(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ROOT_FOLDER||super.A_CONCEPT_ROOT_FOLDER}static get A_CONCEPT_ROOT_SCOPE(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ROOT_SCOPE||super.A_CONCEPT_ROOT_SCOPE}static get A_ERROR_DEFAULT_DESCRIPTION(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_ERROR_DEFAULT_DESCRIPTION||super.A_ERROR_DEFAULT_DESCRIPTION}static get(e){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.[e]||this[e]}static set(e,t){window.__A_CONCEPT_ENVIRONMENT_ENV__||(window.__A_CONCEPT_ENVIRONMENT_ENV__={}),window.__A_CONCEPT_ENVIRONMENT_ENV__[e]=t;}static getAll(){let e={};return window.__A_CONCEPT_ENVIRONMENT_ENV__&&Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(t=>{e[t]=window.__A_CONCEPT_ENVIRONMENT_ENV__[t];}),Ae.forEach(t=>{e[t]=this.get(t);}),e}static getAllKeys(){let e=new Set;return window.__A_CONCEPT_ENVIRONMENT_ENV__&&Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(t=>{e.add(t);}),Ae.forEach(t=>{e.add(t);}),Array.from(e)}};var y=class i extends Error{static get entity(){return g.toKebabCase(this.name)}static get concept(){return c.concept}static get scope(){return c.root.name}constructor(e,t){switch(true){case e instanceof i:return e;case e instanceof Error:super(e.message);break;case h.isErrorSerializedType(e):super(e.message);break;case(h.isErrorConstructorType(e)&&"description"in e):super(`[${e.title}]: ${e.description}`);break;case(h.isErrorConstructorType(e)&&!("description"in e)):super(e.title);break;case(h.isString(e)&&!t):super(e);break;case(h.isString(e)&&!!t):super(`[${e}]: ${t}`);break;default:super("An unknown error occurred.");}this.getInitializer(e,t).call(this,e,t);}get aseid(){return this._aseid}get title(){return this._title}get message(){return super.message}get code(){return this._code||g.toKebabCase(this.title)}get type(){return this.constructor.entity}get link(){return this._link?this._link:new URL(`https://adaas.support/a-concept/errors/${this.aseid.toString()}`).toString()}get scope(){return this._aseid.scope}get description(){return this._description||String(k.A_ERROR_DEFAULT_DESCRIPTION)||xe}get originalError(){return this._originalError}getInitializer(e,t){switch(true){case(h.isString(e)&&!t):return this.fromMessage;case(h.isString(e)&&!!t):return this.fromTitle;case e instanceof Error:return this.fromError;case h.isErrorSerializedType(e):return this.fromJSON;case h.isErrorConstructorType(e):return this.fromConstructor;default:throw new i(ne.VALIDATION_ERROR,"Invalid parameters provided to A_Error constructor")}}fromError(e){this._title=ne.UNEXPECTED_ERROR,this._aseid=new I({concept:this.constructor.concept,scope:this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._originalError=e;}fromMessage(e){this._title=ne.UNEXPECTED_ERROR,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._link=void 0,this._originalError=void 0;}fromJSON(e){this._aseid=new I(e.aseid),super.message=e.message,this._title=e.title,this._code=e.code,this._scope=e.scope,this._description=e.description,this._originalError=e.originalError?new i(e.originalError):void 0,this._link=e.link;}fromTitle(e,t){this.validateTitle(e),this._title=e,this._description=t,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._link=void 0,this._originalError=void 0;}fromConstructor(e){if(this.validateTitle(e.title),this._title=e.title,this._code=e.code,this._scope=e.scope?h.isScopeInstance(e.scope)?e.scope.name:e.scope:void 0,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._description=e.description,this._link=e.link,e.originalError instanceof i){let t=e.originalError;for(;t.originalError instanceof i;)t=t.originalError;this._originalError=t.originalError||t;}else this._originalError=e.originalError;}toJSON(){return {aseid:this.aseid.toString(),title:this.title,code:this.code,type:this.type,message:this.message,link:this.link,scope:this.scope,description:this.description,originalError:this.originalError?.message}}validateTitle(e){if(e.length>60)throw new i(ne.VALIDATION_ERROR,"A-Error title exceeds 60 characters limit.");if(e.length===0)throw new i(ne.VALIDATION_ERROR,"A-Error title cannot be empty.")}};var ee=class extends y{};ee.ValidationError="A-Entity Validation Error";var Fe=(n=>(n.EXTENSIONS="a-component-extensions",n.FEATURES="a-component-features",n.ABSTRACTIONS="a-component-abstractions",n.INJECTIONS="a-component-injections",n))(Fe||{}),ue={SAVE:"_A_Entity__Save",DESTROY:"_A_Entity__Destroy",LOAD:"_A_Entity__Load"};var M=class{static get entity(){return g.toKebabCase(this.name)}static get concept(){return c.concept}static get scope(){return c.root.name}constructor(e){this.getInitializer(e).call(this,e);}get id(){return this.aseid.id}isStringASEID(e){return typeof e=="string"&&I.isASEID(e)}isASEIDInstance(e){return e instanceof I}isSerializedObject(e){return !!e&&typeof e=="object"&&"aseid"in e}isConstructorProps(e){return !!e&&typeof e=="object"&&!("aseid"in e)}getInitializer(e){if(!e)return this.fromUndefined;if(this.isStringASEID(e))return this.fromASEID;if(this.isASEIDInstance(e))return this.fromASEID;if(this.isSerializedObject(e))return this.fromJSON;if(this.isConstructorProps(e))return this.fromNew;throw new ee(ee.ValidationError,"Unable to determine A-Entity constructor initialization method. Please check the provided parameters.")}generateASEID(e){return new I({concept:e?.concept||this.constructor.concept,scope:e?.scope||this.constructor.scope,entity:e?.entity||this.constructor.entity,id:e?.id||V.generateTimeId()})}call(e,t){return new Y({name:e,component:this,scope:t}).process(t)}load(e){return this.call(ue.LOAD,e)}destroy(e){return this.call(ue.DESTROY,e)}save(e){return this.call(ue.SAVE,e)}fromASEID(e){e instanceof I?this.aseid=e:this.aseid=new I(e);}fromUndefined(){this.aseid=this.generateASEID();}fromNew(e){this.aseid=this.generateASEID();}fromJSON(e){this.aseid=new I(e.aseid);}toJSON(){return {aseid:this.aseid.toString()}}toString(){return this.aseid?this.aseid.toString():this.constructor.name}};function me(i){return function(e){return c.setMeta(e,new i),e}}var A=class i{constructor(){this.meta=new Map;}static Define(e){return me(e)}[Symbol.iterator](){let e=this.meta.entries();return {next:()=>e.next()}}from(e){return this.meta=new Map(e.meta),this}clone(){let e=this.constructor,t=new e;return t.meta=new Map(this.meta),t}set(e,t){let r=this.meta.get(e)||Array.isArray(t)?[]:t instanceof Map?new Map:{};this.meta.get(e)||Array.isArray(t)?[...r]:t instanceof Map?new Map(r):{...r};this.meta.set(e,t);}get(e){return this.meta.get(e)}delete(e){return this.meta.delete(e)}size(){return this.meta.size}convertToRegExp(e){if(e instanceof RegExp)return e;this._regExpCache||(this._regExpCache=new Map);let t=this._regExpCache.get(e);return t||(t=new RegExp(e),this._regExpCache.set(e,t)),t}find(e){let t=[];for(let[r,n]of this.meta.entries())this.convertToRegExp(String(r)).test(e)&&t.push([r,n]);return t}findByRegex(e){let t=[];for(let[r,n]of this.meta.entries())e.test(String(r))&&t.push([r,n]);return t}has(e){return this.meta.has(e)}entries(){return this.meta.entries()}clear(){this.meta.clear();}toArray(){return Array.from(this.meta.entries())}recursiveToJSON(e){switch(true){case e instanceof i:return e.toJSON();case e instanceof Map:let t={};for(let[n,o]of e.entries())t[String(n)]=this.recursiveToJSON(o);return t;case Array.isArray(e):return e.map(n=>this.recursiveToJSON(n));case(!!e&&typeof e=="object"):let r={};for(let[n,o]of Object.entries(e))r[n]=this.recursiveToJSON(o);return r;default:return e}}toJSON(){let e={};for(let[t,r]of this.meta.entries())e[String(t)]=this.recursiveToJSON(r);return e}};var G=class extends A{features(){return this.get("a-component-features")?.toArray().map(([,t])=>t)||[]}injections(e){return this.get("a-component-injections")?.get(e)||[]}};var z=class{get name(){return this.config?.name||this.constructor.name}get scope(){return c.scope(this)}constructor(e={}){this.config=e,c.allocate(this,this.config);}async call(e,t){return await new Y({name:e,component:this}).process(t)}};var ve=(n=>(n.FEATURES="a-container-features",n.INJECTIONS="a-container-injections",n.ABSTRACTIONS="a-container-abstractions",n.EXTENSIONS="a-container-extensions",n))(ve||{});var Z=class extends A{injections(e){return this.get("a-container-injections")?.get(e)||[]}features(){return this.get("a-container-features")?.toArray().map(([,t])=>t)||[]}abstractions(e){let t=[],r=this.get("a-container-abstractions"),n=this.get("a-container-injections");return r?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o,a])=>{a.forEach(_=>{let d=n?.get(_.handler)||[];t.push({..._,args:d});});}),t}extensions(e){let t=[];return this.get("a-container-extensions")?.find(e).forEach(([n,o])=>{o.forEach(a=>{t.push({name:a.name,handler:a.handler,behavior:a.behavior,before:a.before||"",after:a.after||"",throwOnError:a.throwOnError||true,override:""});});}),t}};var m=class extends y{fromConstructor(e){super.fromConstructor(e),this.stage=e.stage;}};m.Interruption="Feature Interrupted",m.FeatureInitializationError="Unable to initialize A-Feature",m.FeatureProcessingError="Error occurred during A-Feature processing",m.FeatureDefinitionError="Unable to define A-Feature",m.FeatureExtensionError="Unable to extend A-Feature";var u=class{static resolve(){return new Promise(e=>e())}static isInheritedFrom(e,t){let r=e;for(;r;){if(r===t)return true;r=Object.getPrototypeOf(r);}return false}static getParentClasses(e){let t=Object.getPrototypeOf(typeof e=="function"?e:e.constructor),r=[];for(;t&&t!==Function.prototype;)r.push(t),t=Object.getPrototypeOf(t);return r}static getClassInheritanceChain(e){let t=Object.getPrototypeOf(typeof e=="function"?e:e.constructor),r=typeof e=="function"?[e]:[e.constructor];for(;t&&t!==Function.prototype;)r.push(t),t=Object.getPrototypeOf(t);return r}static getParentClass(e){return Object.getPrototypeOf(e)}static omitProperties(e,t){let r=JSON.parse(JSON.stringify(e));function n(o,a){let _=a[0];a.length===1?delete o[_]:o[_]!==void 0&&typeof o[_]=="object"&&n(o[_],a.slice(1));}return t.forEach(o=>{let a=o.split(".");n(r,a);}),r}static isObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static deepMerge(e,t,r=new Map){if(this.isObject(e)&&this.isObject(t))for(let n in t)this.isObject(t[n])?(e[n]||(e[n]={}),r.has(t[n])?e[n]=r.get(t[n]):(r.set(t[n],{}),this.deepMerge(e[n],t[n],r))):e[n]=t[n];return e}static deepClone(e){if(e==null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(t=>this.deepClone(t));if(typeof e=="function")return e;if(e instanceof Object){let t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=this.deepClone(e[r]));return t}throw new Error("Unable to clone the object. Unsupported type.")}static deepCloneAndMerge(e,t){if(t==null&&e==null)return e;if(e==null&&t)return this.deepClone(t);if(typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(r=>this.deepCloneAndMerge(r,t));if(typeof e=="function")return e;if(e instanceof Object){let r={};for(let n in e)t[n]!==null&&t[n]!==void 0?r[n]=this.deepCloneAndMerge(e[n],t[n]):r[n]=this.deepClone(e[n]);for(let n in t)e[n]!==void 0&&e[n]!==null?r[n]=this.deepCloneAndMerge(e[n],t[n]):r[n]=this.deepClone(t[n]);return r}throw new Error("Unable to clone the object. Unsupported type.")}static getComponentName(e){let t="Unknown",r="Anonymous";if(e==null)return t;if(typeof e=="string")return e||t;if(typeof e=="symbol")try{return e.toString()}catch{return t}if(Array.isArray(e))return e.length===0?t:this.getComponentName(e[0]);if(typeof e=="function"){let n=e;if(n.displayName)return String(n.displayName);if(n.name)return String(n.name);if(n.constructor&&n.constructor.name)return String(n.constructor.name);try{let a=Function.prototype.toString.call(e).match(/^(?:class\s+([A-Za-z0-9_$]+)|function\s+([A-Za-z0-9_$]+)|([A-Za-z0-9_$]+)\s*=>)/);if(a)return a[1]||a[2]||a[3]||r}catch{}return r}if(typeof e=="object"){let n=e;if(n.type)return this.getComponentName(n.type);if(n.displayName)return String(n.displayName);if(n.name)return String(n.name);if(n.constructor&&n.constructor.name&&n.constructor.name!=="Object")return String(n.constructor.name);try{let o=n.toString();if(typeof o=="string"&&o!=="[object Object]")return o}catch{}return r}try{return String(e)}catch{return t}}};var te=class extends Error{};te.CallerInitializationError="Unable to initialize A-Caller";var W=class{constructor(e){this.validateParams(e),this._component=e;}get component(){return this._component}validateParams(e){if(!s.isAllowedForFeatureCall(e))throw new te(`[${te.CallerInitializationError}]: Invalid A-Caller component provided of type: ${typeof e} with value: ${JSON.stringify(e).slice(0,100)}...`)}};var f=class extends y{};f.InvalidDependencyTarget="Invalid Dependency Target",f.InvalidLoadTarget="Invalid Load Target",f.InvalidLoadPath="Invalid Load Path",f.InvalidDefaultTarget="Invalid Default Target",f.ResolutionParametersError="Dependency Resolution Parameters Error";function Ee(...i){return function(e,t,r){let n=u.getComponentName(e);if(!s.isTargetAvailableForInjection(e))throw new f(f.InvalidDefaultTarget,`A-Default cannot be used on the target of type ${typeof e} (${n})`);let o=t?String(t):"constructor",a;switch(true){case(s.isComponentConstructor(e)||s.isComponentInstance(e)):a="a-component-injections";break;case s.isContainerInstance(e):a="a-container-injections";break;case s.isEntityInstance(e):a="a-component-injections";break}let _=c.meta(e).get(a)||new A,d=_.get(o)||[];d[r].resolutionStrategy={create:true,args:i},_.set(o,d),c.meta(e).set(a,_);}}function fe(){return function(i,e,t){let r=u.getComponentName(i);if(!s.isTargetAvailableForInjection(i))throw new f(f.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof i} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(s.isComponentConstructor(i)||s.isComponentInstance(i)):o="a-component-injections";break;case s.isContainerInstance(i):o="a-container-injections";break;case s.isEntityInstance(i):o="a-component-injections";break}let a=c.meta(i).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={flat:true},a.set(n,_),c.meta(i).set(o,a);}}function Te(){return function(i,e,t){let r=u.getComponentName(i);if(!s.isTargetAvailableForInjection(i))throw new f(f.InvalidLoadTarget,`A-Load cannot be used on the target of type ${typeof i} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(s.isComponentConstructor(i)||s.isComponentInstance(i)):o="a-component-injections";break;case s.isContainerInstance(i):o="a-container-injections";break;case s.isEntityInstance(i):o="a-component-injections";break}let a=c.meta(i).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={load:true},a.set(n,_),c.meta(i).set(o,a);}}function Se(i=-1){return function(e,t,r){let n=u.getComponentName(e);if(!s.isTargetAvailableForInjection(e))throw new f(f.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof e} (${n})`);let o=t?String(t):"constructor",a;switch(true){case(s.isComponentConstructor(e)||s.isComponentInstance(e)):a="a-component-injections";break;case s.isContainerInstance(e):a="a-container-injections";break;case s.isEntityInstance(e):a="a-component-injections";break}let _=c.meta(e).get(a)||new A,d=_.get(o)||[];d[r].resolutionStrategy={parent:i},_.set(o,d),c.meta(e).set(a,_);}}function he(){return function(i,e,t){let r=u.getComponentName(i);if(!s.isTargetAvailableForInjection(i))throw new f(f.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof i} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(s.isComponentConstructor(i)||s.isComponentInstance(i)):o="a-component-injections";break;case s.isContainerInstance(i):o="a-container-injections";break;case s.isEntityInstance(i):o="a-component-injections";break}let a=c.meta(i).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={require:true},a.set(n,_),c.meta(i).set(o,a);}}function ye(){return function(i,e,t){let r=u.getComponentName(i);if(!s.isTargetAvailableForInjection(i))throw new f(f.InvalidDependencyTarget,`A-All cannot be used on the target of type ${typeof i} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(s.isComponentConstructor(i)||s.isComponentInstance(i)):o="a-component-injections";break;case s.isContainerInstance(i):o="a-container-injections";break;case s.isEntityInstance(i):o="a-component-injections";break}let a=c.meta(i).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={pagination:{..._[t].resolutionStrategy.pagination,count:-1}},a.set(n,_),c.meta(i).set(o,a);}}function ge(i,e){return function(t,r,n){let o=u.getComponentName(t);if(!s.isTargetAvailableForInjection(t))throw new f(f.InvalidDependencyTarget,`A-All cannot be used on the target of type ${typeof t} (${o})`);let a=r?String(r):"constructor",_;switch(true){case(s.isComponentConstructor(t)||s.isComponentInstance(t)):_="a-component-injections";break;case s.isContainerInstance(t):_="a-container-injections";break;case s.isEntityInstance(t):_="a-component-injections";break}let d=c.meta(t).get(_)||new A,l=d.get(a)||[];l[n].resolutionStrategy={query:{...l[n].resolutionStrategy.query,...i},pagination:{...l[n].resolutionStrategy.pagination,...e}},d.set(a,l),c.meta(t).set(_,d);}}var x=class{constructor(e,t){this._defaultPagination={count:1,from:"start"};this._defaultResolutionStrategy={require:false,load:false,parent:0,flat:false,create:false,args:[],query:{},pagination:this._defaultPagination};this._name=typeof e=="string"?e:u.getComponentName(e),this._target=typeof e=="string"?void 0:e,this.resolutionStrategy=t||{},this.initCheck();}static get Required(){return he}static get Loaded(){return Te}static get Default(){return Ee}static get Parent(){return Se}static get Flat(){return fe}static get All(){return ye}static get Query(){return ge}get flat(){return this._resolutionStrategy.flat}get require(){return this._resolutionStrategy.require}get load(){return this._resolutionStrategy.load}get all(){return this._resolutionStrategy.pagination.count!==1||Object.keys(this._resolutionStrategy.query).length>0}get parent(){return this._resolutionStrategy.parent}get create(){return this._resolutionStrategy.create}get args(){return this._resolutionStrategy.args}get query(){return this._resolutionStrategy.query}get pagination(){return this._resolutionStrategy.pagination}get name(){return this._name}get target(){return this._target}get resolutionStrategy(){return this._resolutionStrategy}set resolutionStrategy(e){this._resolutionStrategy={...this._defaultResolutionStrategy,...this._resolutionStrategy,...e,pagination:{...this._defaultPagination,...(this._resolutionStrategy||{}).pagination,...e.pagination||{}}};}initCheck(){if(!this._resolutionStrategy)throw new f(f.ResolutionParametersError,`Resolution strategy parameters are not provided for dependency: ${this._name}`);return this}toJSON(){return {name:this._name,all:this.all,require:this.require,load:this.load,parent:this.parent,flat:this.flat,create:this.create,args:this.args,query:this.query,pagination:this.pagination}}};var s=class i{static isString(e){return typeof e=="string"||e instanceof String}static isNumber(e){return typeof e=="number"&&isFinite(e)}static isBoolean(e){return typeof e=="boolean"}static isArray(e){return Array.isArray(e)}static isObject(e){return e&&typeof e=="object"&&!Array.isArray(e)}static isFunction(e){return typeof e=="function"}static isUndefined(e){return typeof e>"u"}static isRegExp(e){return e instanceof RegExp}static isContainerConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,z)}static isComponentConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,F)}static isFragmentConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,U)}static isEntityConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,M)}static isScopeConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,v)}static isErrorConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,Error)}static isFeatureConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,Y)}static isCallerConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,W)}static isDependencyConstructor(e){return typeof e=="function"&&u.isInheritedFrom(e,x)}static isDependencyInstance(e){return e instanceof x}static isContainerInstance(e){return e instanceof z}static isComponentInstance(e){return e instanceof F}static isFeatureInstance(e){return e instanceof Y}static isFragmentInstance(e){return e instanceof U}static isEntityInstance(e){return e instanceof M}static isScopeInstance(e){return e instanceof v}static isErrorInstance(e){return e instanceof Error}static isComponentMetaInstance(e){return e instanceof R}static isContainerMetaInstance(e){return e instanceof Z}static isEntityMetaInstance(e){return e instanceof G}static hasASEID(e){return e&&typeof e=="object"&&"aseid"in e&&(i.isEntityInstance(e)||i.isErrorInstance(e))}static isConstructorAllowedForScopeAllocation(e){return i.isContainerConstructor(e)||i.isFeatureConstructor(e)}static isInstanceAllowedForScopeAllocation(e){return i.isContainerInstance(e)||i.isFeatureInstance(e)}static isConstructorAvailableForAbstraction(e){return i.isContainerInstance(e)||i.isComponentInstance(e)}static isTargetAvailableForInjection(e){return i.isComponentConstructor(e)||i.isComponentInstance(e)||i.isContainerInstance(e)||i.isEntityInstance(e)}static isAllowedForFeatureCall(e){return i.isContainerInstance(e)||i.isComponentInstance(e)||i.isEntityInstance(e)}static isAllowedForFeatureDefinition(e){return i.isContainerInstance(e)||i.isComponentInstance(e)||i.isEntityInstance(e)}static isAllowedForFeatureExtension(e){return i.isComponentInstance(e)||i.isContainerInstance(e)||i.isEntityInstance(e)}static isAllowedForAbstractionDefinition(e){return i.isContainerInstance(e)||i.isComponentInstance(e)}static isAllowedForDependencyDefaultCreation(e){return i.isFragmentConstructor(e)||u.isInheritedFrom(e,U)||i.isEntityConstructor(e)||u.isInheritedFrom(e,M)}static isErrorConstructorType(e){return !!e&&i.isObject(e)&&!(e instanceof Error)&&"title"in e}static isErrorSerializedType(e){return !!e&&i.isObject(e)&&!(e instanceof Error)&&"aseid"in e&&I.isASEID(e.aseid)}static isPromiseInstance(e){return e instanceof Promise}};function Ce(i={}){return function(e,t,r){let n=u.getComponentName(e);if(!s.isAllowedForFeatureDefinition(e))throw new m(m.FeatureDefinitionError,`A-Feature cannot be defined on the ${n} level`);let o=c.meta(e.constructor),a;switch(true){case s.isEntityInstance(e):a="a-component-features";break;case s.isContainerInstance(e):a="a-container-features";break;case s.isComponentInstance(e):a="a-component-features";break}let _=o.get(a)||new A,d=i.name||t,l=i.invoke||false;_.set(t,{name:`${e.constructor.name}.${d}`,handler:t,invoke:l,template:i.template&&i.template.length?i.template.map(T=>({...T,before:T.before||"",after:T.after||"",behavior:T.behavior||"sync",throwOnError:true,override:T.override||""})):[]}),c.meta(e.constructor).set(a,_);let S=r.value;return r.value=function(...T){if(l)S.apply(this,T);else return S.apply(this,T);if(typeof this.call=="function"&&l)return this.call(d)},r}}function Pe(i){return function(e,t,r){let n=u.getComponentName(e);if(!s.isAllowedForFeatureExtension(e))throw new m(m.FeatureExtensionError,`A-Feature-Extend cannot be applied on the ${n} level`);let o,a="sync",_="",d="",l="",S=[],T=[],w=true,N;switch(true){case s.isEntityInstance(e):N="a-component-extensions";break;case s.isContainerInstance(e):N="a-container-extensions";break;case s.isComponentInstance(e):N="a-component-extensions";break}switch(true){case s.isRegExp(i):o=i;break;case(!!i&&typeof i=="object"):Array.isArray(i.scope)?S=i.scope:i.scope&&typeof i.scope=="object"&&(Array.isArray(i.scope.include)&&(S=i.scope.include),Array.isArray(i.scope.exclude)&&(T=i.scope.exclude)),o=Oe(i,S,T,t),a=i.behavior||a,w=i.throwOnError!==void 0?i.throwOnError:w,_=s.isArray(i.before)?new RegExp(`^${i.before.join("|").replace(/\./g,"\\.")}$`).source:i.before instanceof RegExp?i.before.source:"",d=s.isArray(i.after)?new RegExp(`^${i.after.join("|").replace(/\./g,"\\.")}$`).source:i.after instanceof RegExp?i.after.source:"",l=s.isArray(i.override)?new RegExp(`^${i.override.join("|").replace(/\./g,"\\.")}$`).source:i.override instanceof RegExp?i.override.source:"";break;default:o=new RegExp(`^.*${t.replace(/\./g,"\\.")}$`);break}let X=c.meta(e).get(N),_e=c.meta(e),$=_e.get(N)?new A().from(_e.get(N)):new A;if(X&&X.size()&&X.has(t)&&X.get(t).invoke)throw new m(m.FeatureExtensionError,`A-Feature-Extend cannot be used on the method "${t}" because it is already defined as a Feature with "invoke" set to true. Please remove the A-Feature-Extend decorator or set "invoke" to false in the A-Feature decorator.`);let Q=[...$.get(o.source)||[]],P=i&&typeof i=="object"&&!s.isRegExp(i)&&i.name||t;for(let[L,q]of $.entries()){let B=q.findIndex(se=>se.handler===t);if(L!==o.source&&B!==-1){let H=String(L).match(/\\\.\s*([^\\.$]+)\$$/);(H?H[1]:null)===P&&(q.splice(B,1),q.length===0?$.delete(L):$.set(L,q));}}let C=Q.findIndex(L=>L.handler===t),ce={name:o.source,handler:t,behavior:a,before:_,after:d,throwOnError:w,override:l};C!==-1?Q[C]=ce:Q.push(ce),$.set(o.source,Q),c.meta(e).set(N,$);}}function Oe(i,e,t,r){let n=e.length?`(${e.map(_=>_.name).join("|")})`:".*",o=t.length?`(?!${t.map(_=>_.name).join("|")})`:"",a=i.scope?`^${o}${n}\\.${i.name||r}$`:`.*\\.${i.name||r}$`;return new RegExp(a)}var Me=(a=>(a.PROCESSING="PROCESSING",a.COMPLETED="COMPLETED",a.FAILED="FAILED",a.SKIPPED="SKIPPED",a.INITIALIZED="INITIALIZED",a.ABORTED="ABORTED",a))(Me||{});var K=class extends y{static get CompileError(){return "Unable to compile A-Stage"}};K.ArgumentsResolutionError="A-Stage Arguments Resolution Error";var ae=class{constructor(e,t){this._status="INITIALIZED";this._feature=e,this._definition=t;}get name(){return this.toString()}get definition(){return this._definition}get status(){return this._status}get feature(){return this._feature}get isProcessed(){return this._status==="COMPLETED"||this._status==="FAILED"||this._status==="SKIPPED"}get error(){return this._error}getStepArgs(e,t){let r=t.dependency.target||e.resolveConstructor(t.dependency.name);return c.meta(r).injections(t.handler).map(n=>{switch(true){case s.isCallerConstructor(n.target):return this._feature.caller.component;case s.isFeatureConstructor(n.target):return this._feature;default:return e.resolve(n)}})}getStepComponent(e,t){let{dependency:r,handler:n}=t,o=e.resolve(r)||this.feature.scope.resolve(r);if(!o)throw new K(K.CompileError,`Unable to resolve component ${r.name} from scope ${e.name}`);if(!o[n])throw new K(K.CompileError,`Handler ${n} not found in ${o.constructor.name}`);return o}callStepHandler(e,t){let r=this.getStepComponent(t,e),n=this.getStepArgs(t,e);return {handler:r[e.handler].bind(r),params:n}}skip(){this._status="SKIPPED";}process(e){let t=s.isScopeInstance(e)?e:this._feature.scope;if(!this.isProcessed){this._status="PROCESSING";let{handler:r,params:n}=this.callStepHandler(this._definition,t),o=r(...n);if(s.isPromiseInstance(o))return new Promise(async(a,_)=>{try{return await o,this.completed(),a()}catch(d){let l=new y(d);return this.failed(l),this._definition.throwOnError?a():_(l)}});this.completed();}}completed(){this._status="COMPLETED";}failed(e){this._error=new y(e),this._status="FAILED";}toJSON(){return {name:this.name,status:this.status}}toString(){return `A-Stage(${this._feature.name}::${this._definition.behavior}@${this._definition.handler})`}};var re=class extends y{};re.CircularDependencyError="A-StepManager Circular Dependency Error";var ie=class{constructor(e){this._uniqueIdMap=new Map;this._isBuilt=false;this.entities=this.prepareSteps(e),this.graph=new Map,this.visited=new Set,this.tempMark=new Set,this.sortedEntities=[],this.assignUniqueIds();}prepareSteps(e){return e.map(t=>({...t,behavior:t.behavior||"sync",before:t.before||"",after:t.after||"",override:t.override||"",throwOnError:false}))}baseID(e){return `${e.dependency.name}.${e.handler}`}ID(e){return this._uniqueIdMap.get(e)||this.baseID(e)}assignUniqueIds(){let e=new Map;for(let r of this.entities){let n=this.baseID(r);e.set(n,(e.get(n)||0)+1);}let t=new Map;for(let r of this.entities){let n=this.baseID(r);if(e.get(n)>1){let o=t.get(n)||0;this._uniqueIdMap.set(r,`${n}#${o}`),t.set(n,o+1);}else this._uniqueIdMap.set(r,n);}}buildGraph(){this._isBuilt||(this._isBuilt=true,this.entities=this.entities.filter((e,t,r)=>!r.some((n,o)=>{if(t===o||!n.override)return false;let a=new RegExp(n.override);return a.test(this.baseID(e))||a.test(e.handler)})),this._uniqueIdMap.clear(),this.assignUniqueIds(),this.entities.forEach(e=>this.graph.set(this.ID(e),new Set)),this.entities.forEach(e=>{let t=this.ID(e);e.before&&this.matchEntities(t,e.before).forEach(n=>{this.graph.has(n)||this.graph.set(n,new Set),this.graph.get(n).add(t);}),e.after&&this.matchEntities(t,e.after).forEach(n=>{this.graph.has(t)||this.graph.set(t,new Set),this.graph.get(t).add(n);});}));}matchEntities(e,t){let r=new RegExp(t);return this.entities.filter(n=>r.test(this.baseID(n))&&this.ID(n)!==e).map(n=>this.ID(n))}visit(e){this.tempMark.has(e)||this.visited.has(e)||(this.tempMark.add(e),(this.graph.get(e)||[]).forEach(t=>this.visit(t)),this.tempMark.delete(e),this.visited.add(e),this.sortedEntities.push(e));}toSortedArray(){return this.buildGraph(),this.entities.forEach(e=>{this.visited.has(this.ID(e))||this.visit(this.ID(e));}),this.sortedEntities}toStages(e){return this.toSortedArray().map(r=>{let n=this.entities.find(o=>this.ID(o)===r);return new ae(e,n)})}};var Y=class i{constructor(e){this._stages=[];this._index=0;this._state="INITIALIZED";this.validateParams(e),this.getInitializer(e).call(this,e);}static get Define(){return Ce}static get Extend(){return Pe}get name(){return this._name}get error(){return this._error}get state(){return this._state}get index(){return this._index}get stage(){return this._current}get caller(){return this._caller}get scope(){return c.scope(this)}get size(){return this._stages.length}get isDone(){return !this.stage||this._index>=this._stages.length}get isProcessed(){return this.state==="COMPLETED"||this.state==="FAILED"||this.state==="INTERRUPTED"}[Symbol.iterator](){return {next:()=>this.isDone?(this._current=void 0,{value:void 0,done:true}):(this._current=this._stages[this._index],this._index++,{value:this._current,done:false})}}validateParams(e){if(!e||typeof e!="object")throw new m(m.FeatureInitializationError,`Invalid A-Feature initialization parameters of type: ${typeof e} with value: ${JSON.stringify(e)?.slice(0,100)}...`)}getInitializer(e){switch(true){case !("template"in e):return this.fromComponent;case "template"in e:return this.fromTemplate;default:throw new m(m.FeatureInitializationError,`Invalid A-Feature initialization parameters of type: ${typeof e} with value: ${JSON.stringify(e)?.slice(0,100)}...`)}}fromTemplate(e){if(!e.template||!Array.isArray(e.template))throw new m(m.FeatureInitializationError,`Invalid A-Feature template provided of type: ${typeof e.template} with value: ${JSON.stringify(e.template)?.slice(0,100)}...`);if(!e.component&&(!e.scope||!(e.scope instanceof v)))throw new m(m.FeatureInitializationError,`Invalid A-Feature scope provided of type: ${typeof e.scope} with value: ${JSON.stringify(e.scope)?.slice(0,100)}...`);this._name=e.name;let t,r=e.scope;try{e.component&&(t=c.scope(e.component));}catch(o){if(!r)throw o}t&&r&&!r.isInheritedFrom(t)&&r.inherit(t),this._caller=new W(e.component||new F),c.allocate(this).inherit(t||r),this._SM=new ie(e.template),this._stages=this._SM.toStages(this),this._current=this._stages[0];}fromComponent(e){if(!e.component||!s.isAllowedForFeatureDefinition(e.component))throw new m(m.FeatureInitializationError,`Invalid A-Feature component provided of type: ${typeof e.component} with value: ${JSON.stringify(e.component)?.slice(0,100)}...`);this._name=e.name;let t,r=e.scope;try{t=c.scope(e.component);}catch(a){if(!r)throw a}t&&r&&!r.isInheritedFrom(t)&&r.inherit(t),this._caller=new W(e.component);let n=c.allocate(this);n.inherit(t||r);let o=c.featureTemplate(this._name,this._caller.component,n);this._SM=new ie(o),this._stages=this._SM.toStages(this),this._current=this._stages[0];}process(e){try{if(this.isProcessed)return;this._state="PROCESSING";let t=Array.from(this);return this.processStagesSequentially(t,e,0)}catch(t){throw this.failed(new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${this.stage?.name||"N/A"}.`,stage:this.stage,originalError:t}))}}processStagesSequentially(e,t,r){for(;r<e.length;){if(this.state==="INTERRUPTED")return;let n=e[r],o;try{o=n.process(t);}catch(a){throw this.createStageError(a,n)}if(s.isPromiseInstance(o))return o.then(()=>{if(this.state!=="INTERRUPTED")return this.processStagesSequentially(e,t,r+1)}).catch(a=>{throw this.createStageError(a,n)});r++;}this.state!=="INTERRUPTED"&&this.completed();}createStageError(e,t){return this.failed(new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${t.name}.`,stage:t,originalError:e})),new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${t.name}.`,stage:t,originalError:e})}next(e){let t=this._stages.indexOf(e);this._index=t+1,this._index>=this._stages.length&&this.completed();}completed(){this.isProcessed||this.state!=="INTERRUPTED"&&(this._state="COMPLETED",this.scope.destroy());}failed(e){return this.isProcessed?this._error:(this._state="FAILED",this._error=e,this.scope.destroy(),this._error)}interrupt(e){if(this.isProcessed)return this._error;switch(this._state="INTERRUPTED",true){case s.isString(e):this._error=new m(m.Interruption,e);break;case s.isErrorInstance(e):this._error=new m({code:m.Interruption,title:e.title||"Feature Interrupted",description:e.description||e.message,stage:this.stage,originalError:e});break;default:this._error=new m(m.Interruption,"Feature was interrupted");break}return this.scope.destroy(),this._error}chain(e,t,r){let n,o;e instanceof i?(n=e,o=t instanceof v?t:void 0):(n=new i({name:t,component:e}),o=r instanceof v?r:void 0);let a=o||this.scope;n._caller=this._caller;let _=n.process(a);return s.isPromiseInstance(_)?_.catch(d=>{throw d}):_}toString(){return `A-Feature(${this.caller.component?.constructor?.name||"Unknown"}::${this.name})`}};var F=class{call(e,t){return new Y({name:e,component:this}).process(t)}};var Ie=(n=>(n.EXTENSIONS="a-component-extensions",n.FEATURES="a-component-features",n.INJECTIONS="a-component-injections",n.ABSTRACTIONS="a-component-abstractions",n))(Ie||{});var R=class extends A{injections(e){return this.get("a-component-injections")?.get(e)||[]}extensions(e){let t=[];return this.get("a-component-extensions")?.find(e).forEach(([n,o])=>{o.forEach(a=>{t.push({name:a.name,handler:a.handler,behavior:a.behavior,before:a.before||"",after:a.after||"",throwOnError:a.throwOnError||true,override:a.override||""});});}),t}features(){return this.get("a-component-features")?.toArray().map(([,t])=>t)||[]}abstractions(e){let t=[],r=this.get("a-component-abstractions"),n=this.get("a-component-injections");return r?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o,a])=>{a.forEach(_=>{let d=n?.get(_.handler)||[];t.push({..._,args:d});});}),t}};var de=class de{constructor(e,t){this.uid=de._nextUid++;this._meta=new A;this._version=0;this._resolveConstructorCache=new Map;this._allowedComponents=new Set;this._allowedErrors=new Set;this._allowedEntities=new Set;this._allowedFragments=new Set;this._components=new Map;this._errors=new Map;this._entities=new Map;this._fragments=new Map;this._imports=new Set;this.getInitializer(e).call(this,e,t);}get name(){return this._name}get meta(){return this._meta}get allowedComponents(){return this._allowedComponents}get allowedEntities(){return this._allowedEntities}get allowedFragments(){return this._allowedFragments}get allowedErrors(){return this._allowedErrors}get version(){return this._version}get entities(){return Array.from(this._entities.values())}get fragments(){return Array.from(this._fragments.values())}get components(){return Array.from(this._components.values())}get errors(){return Array.from(this._errors.values())}get imports(){return Array.from(this._imports.values())}get parent(){return this._parent}bumpVersion(){this._version++,this._resolveConstructorCache.clear();}*parents(){let e=this._parent;for(;e;)yield e,e=e._parent;}parentOffset(e){let t=this;for(;e<=-1&&t;)t=t.parent,e++;return t}getInitializer(e,t){switch(true){case(!e&&!t):return this.defaultInitialized;case !!e:return this.defaultInitialized;default:throw new E(E.ConstructorError,"Invalid parameters provided to A_Scope constructor")}}defaultInitialized(e={},t={}){this._name=e.name||this.constructor.name,this.initComponents(e.components),this.initErrors(e.errors),this.initFragments(e.fragments),this.initEntities(e.entities),this.initMeta(e.meta),t.parent&&(this._parent=t.parent);}initComponents(e){e?.forEach(this.register.bind(this));}initErrors(e){e?.forEach(this.register.bind(this));}initEntities(e){e?.forEach(t=>this.register(t));}initFragments(e){e?.forEach(this.register.bind(this));}initMeta(e){e&&Object.entries(e).forEach(([t,r])=>{this._meta.set(t,r);});}destroy(){this._components.forEach(e=>c.deregister(e)),this._fragments.forEach(e=>c.deregister(e)),this._entities.forEach(e=>c.deregister(e)),this._components.clear(),this._errors.clear(),this._fragments.clear(),this._entities.clear(),this._imports.clear(),this.issuer()&&c.deallocate(this),this.bumpVersion();}get(e){return this._meta.get(e)}set(e,t){this._meta.set(e,t);}issuer(){return c.issuer(this)}inherit(e){if(!e)throw new E(E.InitializationError,"Invalid parent scope provided");if(e===this)throw new E(E.CircularInheritanceError,`Unable to inherit scope ${this.name} from itself`);if(e===this._parent)return this;let t=this.checkCircularInheritance(e);if(t)throw new E(E.CircularInheritanceError,`Circular inheritance detected: ${[...t,e.name].join(" -> ")}`);return this._parent=e,this.bumpVersion(),this}import(...e){return e.forEach(t=>{if(t===this)throw new E(E.CircularImportError,`Unable to import scope ${this.name} into itself`);this._imports.has(t)||(this._imports.add(t),this.bumpVersion());}),this}deimport(...e){return e.forEach(t=>{this._imports.has(t)&&(this._imports.delete(t),this.bumpVersion());}),this}has(e){let t=this.hasFlat(e);if(!t&&this._parent)try{return this._parent.has(e)}catch{return false}return t}hasFlat(e){let t=false;switch(true){case s.isScopeConstructor(e):return true;case s.isString(e):{Array.from(this.allowedComponents).find(_=>_.name===e)&&(t=true),Array.from(this.allowedFragments).find(_=>_.name===e)&&(t=true),Array.from(this.allowedEntities).find(_=>_.name===e)&&(t=true),Array.from(this.allowedErrors).find(_=>_.name===e)&&(t=true);break}case s.isComponentConstructor(e):{t=this.isAllowedComponent(e)||!![...this.allowedComponents].find(r=>u.isInheritedFrom(r,e));break}case s.isEntityConstructor(e):{t=this.isAllowedEntity(e)||!![...this.allowedEntities].find(r=>u.isInheritedFrom(r,e));break}case s.isFragmentConstructor(e):{t=this.isAllowedFragment(e)||!![...this.allowedFragments].find(r=>u.isInheritedFrom(r,e));break}case s.isErrorConstructor(e):{t=this.isAllowedError(e)||!![...this.allowedErrors].find(r=>u.isInheritedFrom(r,e));break}case(this.issuer()&&(this.issuer().constructor===e||u.isInheritedFrom(this.issuer().constructor,e))):{t=true;break}}return t}resolveDependency(e){let t=[],r=this.parentOffset(e.parent)||this;switch(true){case(e.flat&&!e.all):{let l=r.resolveFlatOnce(e.target||e.name);l&&(t=[l]);break}case(e.flat&&e.all):{t=r.resolveFlatAll(e.target||e.name);break}case(!e.flat&&!e.all):{let l=r.resolveOnce(e.target||e.name);l&&(t=[l]);break}case(!e.flat&&e.all):{t=r.resolveAll(e.target||e.name);break}default:t=[];}if(e.create&&!t.length&&s.isAllowedForDependencyDefaultCreation(e.target)){let l=new e.target(...e.args);r.register(l),t.push(l);}if(e.require&&!t.length)throw new E(E.ResolutionError,`Dependency ${e.name} is required but could not be resolved in scope ${r.name}`);e.query.aseid?t=t.filter(l=>s.hasASEID(l)&&I.compare(l.aseid,e.query.aseid)):Object.keys(e.query).length>0&&(t=t.filter(l=>{let S=e.query;return S?Object.entries(S).every(([T,w])=>l[T]===w):true}));let n=e.pagination.count,o=e.pagination.from,a=o==="end"?n===-1?0:Math.max(t.length-n,0):0,_=o==="end"||n===-1?t.length:Math.min(n,t.length),d=t.slice(a,_);return d.length===1&&n!==-1?d[0]:d.length?d:void 0}resolveConstructor(e){switch(true){case s.isComponentConstructor(e):return Array.from(this.allowedComponents).find(n=>u.isInheritedFrom(n,e));case s.isEntityConstructor(e):return Array.from(this.allowedEntities).find(n=>u.isInheritedFrom(n,e));case s.isFragmentConstructor(e):return Array.from(this.allowedFragments).find(n=>u.isInheritedFrom(n,e));case s.isErrorConstructor(e):return Array.from(this.allowedErrors).find(n=>u.isInheritedFrom(n,e))}if(!s.isString(e))throw new E(E.ResolutionError,`Invalid constructor name provided: ${e}`);let t=e;if(this._resolveConstructorCache.has(t)){let n=this._resolveConstructorCache.get(t);return n===null?void 0:n}let r=this._resolveConstructorUncached(e);return this._resolveConstructorCache.set(t,r??null),r}_resolveConstructorUncached(e){let t=Array.from(this.allowedComponents).find(o=>o.name===e||o.name===g.toPascalCase(e));if(t)return t;{let o=Array.from(this.allowedComponents).find(a=>{let _=a;for(;_;){if(_.name===e||_.name===g.toPascalCase(e))return true;_=Object.getPrototypeOf(_);}return false});if(o)return o}let r=Array.from(this.allowedEntities).find(o=>o.name===e||o.name===g.toPascalCase(e)||o.entity===e||o.entity===g.toKebabCase(e));if(r)return r;{let o=Array.from(this.allowedEntities).find(a=>u.isInheritedFrom(a,e));if(o)return o}let n=Array.from(this.allowedFragments).find(o=>o.name===e||o.name===g.toPascalCase(e));if(n)return n;{let o=Array.from(this.allowedFragments).find(a=>u.isInheritedFrom(a,e));if(o)return o}for(let o of this._imports){let a=o.resolveConstructor(e);if(a)return a}if(this._parent)return this._parent.resolveConstructor(e)}resolveAll(e){let t=new Set;this.resolveFlatAll(e).forEach(o=>t.add(o)),this._imports.forEach(o=>{o.has(e)&&o.resolveFlatAll(e).forEach(_=>t.add(_));});let n=this._parent;for(;n&&n.has(e);)n.resolveAll(e).forEach(a=>t.add(a)),n=n._parent;return Array.from(t)}resolveFlatAll(e){let t=[];switch(true){case s.isComponentConstructor(e):{this.allowedComponents.forEach(r=>{if(u.isInheritedFrom(r,e)){let n=this.resolveOnce(r);n&&t.push(n);}});break}case s.isFragmentConstructor(e):{this.allowedFragments.forEach(r=>{if(u.isInheritedFrom(r,e)){let n=this.resolveOnce(r);n&&t.push(n);}});break}case s.isEntityConstructor(e):{this.entities.forEach(r=>{u.isInheritedFrom(r.constructor,e)&&t.push(r);});break}case s.isString(e):{let r=this.resolveConstructor(e);if(!s.isComponentConstructor(r)&&!s.isEntityConstructor(r)&&!s.isFragmentConstructor(r))throw new E(E.ResolutionError,`Unable to resolve all instances for name: ${e} in scope ${this.name} as no matching component, entity or fragment constructor found`);if(r){let n=this.resolveAll(r);n&&t.push(...n);}break}default:throw new E(E.ResolutionError,`Invalid parameter provided to resolveAll method: ${e} in scope ${this.name}`)}return t}resolve(e){let t=s.isDependencyInstance(e)?e:new x(e);return this.resolveDependency(t)}resolveOnce(e){let t=this.resolveFlatOnce(e);if(!t){for(let r of this._imports)if(r.has(e)){let n=r.resolveFlatOnce(e);if(n)return n}}return !t&&this.parent?this.parent.resolveOnce(e):t}resolveFlat(e){return this.resolveFlatOnce(e)}resolveFlatOnce(e){let t,r=u.getComponentName(e);if(!(!e||!this.has(e))){switch(true){case s.isString(e):{t=this.resolveByName(e);break}case s.isConstructorAllowedForScopeAllocation(e):{t=this.resolveIssuer(e);break}case s.isScopeConstructor(e):{t=this.resolveScope(e);break}case s.isEntityConstructor(e):{t=this.resolveEntity(e);break}case s.isFragmentConstructor(e):{t=this.resolveFragment(e);break}case s.isComponentConstructor(e):{t=this.resolveComponent(e);break}case s.isErrorConstructor(e):{t=this.resolveError(e);break}default:throw new E(E.ResolutionError,`Injected Component ${r} not found in the scope`)}return t}}resolveByName(e){let t=Array.from(this.allowedComponents).find(a=>a.name===e||a.name===g.toPascalCase(e));if(t)return this.resolveOnce(t);let r=Array.from(this.allowedEntities).find(a=>a.name===e||a.name===g.toPascalCase(e)||a.entity===e||a.entity===g.toKebabCase(e));if(r)return this.resolveOnce(r);let n=Array.from(this.allowedFragments).find(a=>a.name===e||a.name===g.toPascalCase(e));if(n)return this.resolveOnce(n);let o=Array.from(this.allowedErrors).find(a=>a.name===e||a.name===g.toPascalCase(e)||a.code===e||a.code===g.toKebabCase(e));if(o)return this.resolveOnce(o)}resolveIssuer(e){let t=this.issuer();if(t&&(t.constructor===e||u.isInheritedFrom(t?.constructor,e)))return t}resolveEntity(e){return this.entities.find(t=>t instanceof e)}resolveError(e){return this.errors.find(t=>t instanceof e)}resolveFragment(e){let t=this._fragments.get(e);switch(true){case(t&&this._fragments.has(e)):return t;case(!t&&Array.from(this._allowedFragments).some(r=>u.isInheritedFrom(r,e))):{let r=Array.from(this._allowedFragments).find(n=>u.isInheritedFrom(n,e));return this.resolveFragment(r)}default:return}}resolveScope(e){return this}resolveComponent(e){switch(true){case(this.allowedComponents.has(e)&&this._components.has(e)):return this._components.get(e);case(this.allowedComponents.has(e)&&!this._components.has(e)):{let n=(c.meta(e).get("a-component-injections")?.get("constructor")||[]).map(a=>this.resolve(a)),o=new e(...n);return this.register(o),this._components.get(e)}case(!this.allowedComponents.has(e)&&Array.from(this.allowedComponents).some(t=>u.isInheritedFrom(t,e))):{let t=Array.from(this.allowedComponents).find(r=>u.isInheritedFrom(r,e));return this.resolveComponent(t)}default:return}}register(e){switch(true){case e instanceof F:{this.allowedComponents.has(e.constructor)||this.allowedComponents.add(e.constructor),this._components.set(e.constructor,e),c.register(this,e),this.bumpVersion();break}case(s.isEntityInstance(e)&&!this._entities.has(e.aseid.toString())):{this.allowedEntities.has(e.constructor)||this.allowedEntities.add(e.constructor),this._entities.set(e.aseid.toString(),e),c.register(this,e),this.bumpVersion();break}case s.isFragmentInstance(e):{this.allowedFragments.has(e.constructor)||this.allowedFragments.add(e.constructor),this._fragments.set(e.constructor,e),c.register(this,e),this.bumpVersion();break}case s.isErrorInstance(e):{this.allowedErrors.has(e.constructor)||this.allowedErrors.add(e.constructor),this._errors.set(e.code,e),c.register(this,e),this.bumpVersion();break}case s.isComponentConstructor(e):{this.allowedComponents.has(e)||(this.allowedComponents.add(e),this.bumpVersion());break}case s.isFragmentConstructor(e):{this.allowedFragments.has(e)||(this.allowedFragments.add(e),this.bumpVersion());break}case s.isEntityConstructor(e):{this.allowedEntities.has(e)||(this.allowedEntities.add(e),this.bumpVersion());break}case s.isErrorConstructor(e):{this.allowedErrors.has(e)||(this.allowedErrors.add(e),this.bumpVersion());break}default:if(e instanceof M)throw new E(E.RegistrationError,`Entity with ASEID ${e.aseid.toString()} is already registered in the scope ${this.name}`);if(e instanceof U)throw new E(E.RegistrationError,`Fragment ${e.constructor.name} is already registered in the scope ${this.name}`);{let t=u.getComponentName(e);throw new E(E.RegistrationError,`Cannot register ${t} in the scope ${this.name}`)}}}deregister(e){switch(true){case e instanceof F:{this._components.delete(e.constructor),c.deregister(e);let r=e.constructor;this._components.has(r)||this.allowedComponents.delete(r),this.bumpVersion();break}case s.isEntityInstance(e):{this._entities.delete(e.aseid.toString()),c.deregister(e);let r=e.constructor;Array.from(this._entities.values()).some(o=>o instanceof r)||this.allowedEntities.delete(r),this.bumpVersion();break}case s.isFragmentInstance(e):{this._fragments.delete(e.constructor),c.deregister(e);let r=e.constructor;Array.from(this._fragments.values()).some(o=>o instanceof r)||this.allowedFragments.delete(r),this.bumpVersion();break}case s.isErrorInstance(e):{this._errors.delete(e.code),c.deregister(e);let r=e.constructor;Array.from(this._errors.values()).some(o=>o instanceof r)||this.allowedErrors.delete(r),this.bumpVersion();break}case s.isComponentConstructor(e):{this.allowedComponents.delete(e),this.bumpVersion();break}case s.isFragmentConstructor(e):{this.allowedFragments.delete(e),Array.from(this._fragments.entries()).forEach(([r,n])=>{u.isInheritedFrom(r,e)&&(this._fragments.delete(r),c.deregister(n));}),this.bumpVersion();break}case s.isEntityConstructor(e):{this.allowedEntities.delete(e),Array.from(this._entities.entries()).forEach(([r,n])=>{u.isInheritedFrom(n.constructor,e)&&(this._entities.delete(r),c.deregister(n));}),this.bumpVersion();break}case s.isErrorConstructor(e):{this.allowedErrors.delete(e),Array.from(this._errors.entries()).forEach(([r,n])=>{u.isInheritedFrom(n.constructor,e)&&(this._errors.delete(r),c.deregister(n));}),this.bumpVersion();break}default:let t=u.getComponentName(e);throw new E(E.DeregistrationError,`Cannot deregister ${t} from the scope ${this.name}`)}}toJSON(){return this.fragments.reduce((e,t)=>{let r=t.toJSON();return {...e,[r.name]:r}},{})}isAllowedComponent(e){return s.isComponentConstructor(e)&&this.allowedComponents.has(e)}isAllowedEntity(e){return s.isEntityConstructor(e)&&this.allowedEntities.has(e)}isAllowedFragment(e){return s.isFragmentConstructor(e)&&this.allowedFragments.has(e)}isAllowedError(e){return s.isErrorConstructor(e)&&this.allowedErrors.has(e)}isInheritedFrom(e){let t=this;for(;t;){if(t===e)return true;t=t._parent;}return false}checkCircularInheritance(e){let t=[],r=this._parent;for(;r;){if(t.push(r.name),r===e)return t;r=r._parent;}return false}printInheritanceChain(){let e=[],t=this;for(;t;)e.push(t.name),t=t._parent;console.log(e.join(" -> "));}};de._nextUid=0;var v=de;var E=class extends y{};E.InitializationError="A-Scope Initialization Error",E.ConstructorError="Unable to construct A-Scope instance",E.ResolutionError="A-Scope Resolution Error",E.RegistrationError="A-Scope Registration Error",E.CircularInheritanceError="A-Scope Circular Inheritance Error",E.CircularImportError="A-Scope Circular Import Error",E.DeregistrationError="A-Scope Deregistration Error";var p=class extends y{};p.NotAllowedForScopeAllocationError="Component is not allowed for scope allocation",p.ComponentAlreadyHasScopeAllocatedError="Component already has scope allocated",p.InvalidMetaParameterError="Invalid parameter provided to get meta",p.InvalidScopeParameterError="Invalid parameter provided to get scope",p.ScopeNotFoundError="Scope not found",p.InvalidFeatureParameterError="Invalid parameter provided to get feature",p.InvalidFeatureDefinitionParameterError="Invalid parameter provided to define feature",p.InvalidFeatureTemplateParameterError="Invalid parameter provided to get feature template",p.InvalidFeatureExtensionParameterError="Invalid parameter provided to extend feature",p.InvalidAbstractionParameterError="Invalid parameter provided to get abstraction",p.InvalidAbstractionDefinitionParameterError="Invalid parameter provided to define abstraction",p.InvalidAbstractionTemplateParameterError="Invalid parameter provided to get abstraction template",p.InvalidAbstractionExtensionParameterError="Invalid parameter provided to extend abstraction",p.InvalidInjectionParameterError="Invalid parameter provided to get injections",p.InvalidExtensionParameterError="Invalid parameter provided to get extensions",p.InvalidRegisterParameterError="Invalid parameter provided to register component",p.InvalidComponentParameterError="Invalid component provided",p.ComponentNotRegisteredError="Component not registered in the context",p.InvalidDeregisterParameterError="Invalid parameter provided to deregister component";var D=class D{constructor(){this._registry=new WeakMap;this._scopeIssuers=new WeakMap;this._scopeStorage=new WeakMap;this._metaStorage=new Map;this._metaVersion=0;this._featureExtensionsCache=new Map;this._globals=new Map;let e=String(k.A_CONCEPT_ROOT_SCOPE)||"root";this._root=new v({name:e});}static get concept(){return k.A_CONCEPT_NAME||"a-concept"}static get root(){return this.getInstance()._root}static get environment(){return k.A_CONCEPT_RUNTIME_ENVIRONMENT}static getInstance(){return D._instance||(D._instance=new D),D._instance}static register(e,t){let r=u.getComponentName(t),n=this.getInstance();if(!t)throw new p(p.InvalidRegisterParameterError,"Unable to register component. Component cannot be null or undefined.");if(!e)throw new p(p.InvalidRegisterParameterError,"Unable to register component. Scope cannot be null or undefined.");if(!this.isAllowedToBeRegistered(t))throw new p(p.NotAllowedForScopeAllocationError,`Component ${r} is not allowed for scope allocation.`);return n._scopeStorage.set(t,e),e}static deregister(e){let t=u.getComponentName(e),r=this.getInstance();if(!e)throw new p(p.InvalidDeregisterParameterError,"Unable to deregister component. Component cannot be null or undefined.");if(!r._scopeStorage.has(e))throw new p(p.ComponentNotRegisteredError,`Unable to deregister component. Component ${t} is not registered.`);r._scopeStorage.delete(e);}static allocate(e,t){let r=u.getComponentName(e);if(!this.isAllowedForScopeAllocation(e))throw new p(p.NotAllowedForScopeAllocationError,`Component of type ${r} is not allowed for scope allocation. Only A_Container, A_Feature are allowed.`);let n=this.getInstance();if(n._registry.has(e))throw new p(p.ComponentAlreadyHasScopeAllocatedError,`Component ${r} already has a scope allocated.`);let o=s.isScopeInstance(t)?t:new v(t||{name:r+"-scope"},t);return o.isInheritedFrom(D.root)||o.inherit(D.root),n._registry.set(e,o),n._scopeIssuers.set(o,e),o}static deallocate(e){let t=this.getInstance(),r=s.isScopeInstance(e)?e:t._registry.get(e);if(!r)return;let n=s.isComponentInstance(e)?e:this.issuer(r);n&&t._registry.delete(n),r&&t._scopeIssuers.delete(r);}static meta(e){let t=u.getComponentName(e),r=this.getInstance();if(!e)throw new p(p.InvalidMetaParameterError,"Invalid parameter provided to get meta. Parameter cannot be null or undefined.");if(!(this.isAllowedForMeta(e)||this.isAllowedForMetaConstructor(e)||s.isString(e)||s.isFunction(e)))throw new p(p.InvalidMetaParameterError,`Invalid parameter provided to get meta. Component of type ${t} is not allowed for meta storage. Only A_Container, A_Component and A_Entity are allowed.`);let n,o;switch(true){case s.isContainerInstance(e):{n=e.constructor,o=Z;break}case s.isContainerConstructor(e):{n=e,o=Z;break}case s.isComponentInstance(e):{n=e.constructor,o=R;break}case s.isComponentConstructor(e):{n=e,o=R;break}case s.isEntityInstance(e):{n=e.constructor,o=R;break}case s.isEntityConstructor(e):{n=e,o=G;break}case s.isFragmentInstance(e):{n=e.constructor,o=R;break}case s.isFragmentConstructor(e):{n=e,o=G;break}case typeof e=="string":{let a=Array.from(r._metaStorage).find(([_])=>_.name===e||_.name===g.toKebabCase(e)||_.name===g.toPascalCase(e));if(!(a&&a.length))throw new p(p.InvalidMetaParameterError,`Invalid parameter provided to get meta. Component with name ${e} not found in the meta storage.`);n=a[0],o=R;break}default:{n=e,o=A;break}}if(!r._metaStorage.has(n)){let a,_=n;for(;!a;){let d=Object.getPrototypeOf(_);if(!d)break;a=r._metaStorage.get(d),_=d;}a||(a=new o),r._metaStorage.set(n,a.clone()),r._metaVersion++;}return r._metaStorage.get(n)}static setMeta(e,t){let r=D.getInstance(),n=D.meta(e),o=typeof e=="function"?e:e.constructor;r._metaStorage.set(o,n?t.from(n):t),r._metaVersion++;}static issuer(e){let t=this.getInstance();if(!e)throw new p(p.InvalidComponentParameterError,"Invalid parameter provided to get scope issuer. Parameter cannot be null or undefined.");return t._scopeIssuers.get(e)}static scope(e){let t=e?.constructor?.name||String(e),r=this.getInstance();if(!e)throw new p(p.InvalidScopeParameterError,"Invalid parameter provided to get scope. Parameter cannot be null or undefined.");if(!this.isAllowedForScopeAllocation(e)&&!this.isAllowedToBeRegistered(e))throw new p(p.InvalidScopeParameterError,`Invalid parameter provided to get scope. Component of type ${t} is not allowed for scope allocation.`);switch(true){case this.isAllowedToBeRegistered(e):if(!r._scopeStorage.has(e))throw new p(p.ScopeNotFoundError,`Invalid parameter provided to get scope. Component of type ${t} does not have a scope registered. Make sure to register the component using A_Context.register() method before trying to get the scope.`);return r._scopeStorage.get(e);case this.isAllowedForScopeAllocation(e):if(!r._registry.has(e))throw new p(p.ScopeNotFoundError,`Invalid parameter provided to get scope. Component of type ${t} does not have a scope allocated. Make sure to allocate a scope using A_Context.allocate() method before trying to get the scope.`);return r._registry.get(e);default:throw new p(p.InvalidScopeParameterError,`Invalid parameter provided to get scope. Component of type ${t} is not allowed to be registered.`)}}static featureTemplate(e,t,r=this.scope(t)){if(!t)throw new p(p.InvalidFeatureTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new p(p.InvalidFeatureTemplateParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!s.isAllowedForFeatureDefinition(t))throw new p(p.InvalidFeatureTemplateParameterError,`Unable to get feature template. Component of type ${u.getComponentName(t)} is not allowed for feature definition.`);return [...this.featureDefinition(e,t),...this.featureExtensions(e,t,r)]}static featureExtensions(e,t,r){let n=this.getInstance();if(!t)throw new p(p.InvalidFeatureExtensionParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new p(p.InvalidFeatureExtensionParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!s.isAllowedForFeatureDefinition(t))throw new p(p.InvalidFeatureExtensionParameterError,`Unable to get feature template. Component of type ${u.getComponentName(t)} is not allowed for feature definition.`);let o=typeof t=="function"?t:t.constructor,a=r.parent||r,_=`${String(e)}::${o.name}::s${a.uid}v${a.version}::m${n._metaVersion}`,d=n._featureExtensionsCache.get(_);if(d)return d;let l=u.getClassInheritanceChain(t).filter(P=>P!==F&&P!==z&&P!==M).map(P=>`${P.name}.${e}`),S=new Map,T=new Set,w=new Map,N=new Map,X=P=>{let C=w.get(P);return C===void 0&&(C=u.getComponentName(P),w.set(P,C)),C},_e=P=>{let C=N.get(P);return C||(C=new x(P),N.set(P,C)),C},$=[];for(let[P,C]of n._metaStorage)r.has(P)&&(s.isComponentMetaInstance(C)||s.isContainerMetaInstance(C))&&$.push([P,C]);for(let P of l)for(let[C,ce]of $){T.add(C);let L=ce.extensions(P);for(let q=0;q<L.length;q++){let B=L[q],se=Array.from(T).reverse().find(H=>u.isInheritedFrom(C,H)&&H!==C);if(se&&S.delete(`${X(se)}.${B.handler}`),B.override){let H=new RegExp(B.override);for(let[le,De]of S)(H.test(le)||H.test(De.handler))&&S.delete(le);}S.set(`${X(C)}.${B.handler}`,{dependency:_e(C),...B});}}let Q=n.filterToMostDerived(r,Array.from(S.values()));return n._featureExtensionsCache.size>=D.FEATURE_EXTENSIONS_CACHE_MAX_SIZE&&n._featureExtensionsCache.clear(),n._featureExtensionsCache.set(_,Q),Q}filterToMostDerived(e,t){if(t.length<=1)return t;let r=new Map,n=new Set;for(let _ of t){let d=_.dependency.name;r.has(d)||r.set(d,e.resolveConstructor(d)),n.add(d);}let o=new Set,a=new Map;for(let[_,d]of r)d&&a.set(d,_);for(let[_,d]of r){if(!d)continue;let l=Object.getPrototypeOf(d.prototype);for(;l&&l!==Object.prototype;){let S=l.constructor,T=a.get(S);T&&T!==_&&n.has(T)&&o.add(T),l=Object.getPrototypeOf(l);}}return t.filter(_=>!o.has(_.dependency.name))}static featureDefinition(e,t){let r;if(!e)throw new p(p.InvalidFeatureTemplateParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!t)throw new p(p.InvalidFeatureTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");switch(true){case t instanceof M:r="a-component-features";break;case t instanceof z:r="a-container-features";break;case t instanceof F:r="a-component-features";break;default:throw new p(p.InvalidFeatureTemplateParameterError,`A-Feature cannot be defined on the ${t} level`)}return [...this.meta(t)?.get(r)?.get(e)?.template||[]]}static abstractionTemplate(e,t){let r=u.getComponentName(t);if(!t)throw new p(p.InvalidAbstractionTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new p(p.InvalidAbstractionTemplateParameterError,"Unable to get feature template. Abstraction stage cannot be null or undefined.");if(!s.isAllowedForAbstractionDefinition(t))throw new p(p.InvalidAbstractionTemplateParameterError,`Unable to get feature template. Component of type ${r} is not allowed for feature definition.`);return [...this.abstractionExtensions(e,t)]}static abstractionExtensions(e,t){let r=this.getInstance(),n=u.getComponentName(t);if(!t)throw new p(p.InvalidAbstractionExtensionParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new p(p.InvalidAbstractionExtensionParameterError,"Unable to get feature template. Abstraction stage cannot be null or undefined.");if(!s.isAllowedForAbstractionDefinition(t))throw new p(p.InvalidAbstractionExtensionParameterError,`Unable to get feature template. Component of type ${n} is not allowed for feature definition.`);let o=new Map,a=this.scope(t),_=new Set;for(let[d,l]of r._metaStorage)a.has(d)&&(s.isComponentMetaInstance(l)||s.isContainerMetaInstance(l))&&(_.add(d),l.abstractions(e).forEach(S=>{let T=Array.from(_).reverse().find(w=>u.isInheritedFrom(d,w)&&w!==d);T&&o.delete(`${u.getComponentName(T)}.${S.handler}`),o.set(`${u.getComponentName(d)}.${S.handler}`,{dependency:new x(d),...S});}));return r.filterToMostDerived(a,Array.from(o.values()))}static reset(){let e=D.getInstance();e._registry=new WeakMap,e._featureExtensionsCache.clear(),e._metaVersion++;let t=String(k.A_CONCEPT_ROOT_SCOPE)||"root";e._root=new v({name:t});}static isAllowedForScopeAllocation(e){return s.isContainerInstance(e)||s.isFeatureInstance(e)||s.isEntityInstance(e)}static isAllowedToBeRegistered(e){return s.isEntityInstance(e)||s.isComponentInstance(e)||s.isFragmentInstance(e)||s.isErrorInstance(e)}static isAllowedForMeta(e){return s.isContainerInstance(e)||s.isComponentInstance(e)||s.isEntityInstance(e)}static isAllowedForMetaConstructor(e){return s.isContainerConstructor(e)||s.isComponentConstructor(e)||s.isEntityConstructor(e)}};D.FEATURE_EXTENSIONS_CACHE_MAX_SIZE=1024;var c=D;var J=class extends y{};J.AbstractionExtensionError="Unable to extend abstraction execution";function be(i,e={}){return function(t,r,n){let o=u.getComponentName(t);if(!i)throw new J(J.AbstractionExtensionError,`Abstraction name must be provided to extend abstraction for '${o}'.`);if(!s.isConstructorAvailableForAbstraction(t))throw new J(J.AbstractionExtensionError,`Unable to extend Abstraction '${i}' for '${o}'. Only A-Containers and A-Components can extend Abstractions.`);let a,_=c.meta(t);switch(true){case(s.isContainerConstructor(t)||s.isContainerInstance(t)):a="a-container-abstractions";break;case(s.isComponentConstructor(t)||s.isComponentInstance(t)):a="a-component-abstractions";break}let d=`CONCEPT_ABSTRACTION::${i}`,l=_.get(a)?new A().from(_.get(a)):new A,S=[...l.get(d)||[]],T=S.findIndex(N=>N.handler===r),w={name:d,handler:r,behavior:e.behavior||"sync",throwOnError:e.throwOnError!==void 0?e.throwOnError:true,before:s.isArray(e.before)?new RegExp(`^${e.before.join("|").replace(/\./g,"\\.")}$`).source:e.before instanceof RegExp?e.before.source:"",after:s.isArray(e.after)?new RegExp(`^${e.after.join("|").replace(/\./g,"\\.")}$`).source:e.after instanceof RegExp?e.after.source:"",override:s.isArray(e.override)?new RegExp(`^${e.override.join("|").replace(/\./g,"\\.")}$`).source:e.after instanceof RegExp?e.after.source:""};T!==-1?S[T]=w:S.push(w),l.set(d,S),c.meta(t).set(a,l);}}var b=class{constructor(e){this._features=[];this._index=0;this._name=e.name,this._features=e.containers.map(t=>{let r=c.abstractionTemplate(this._name,t);return new Y({name:this._name,component:t,template:r})}),this._current=this._features[0];}static get Extend(){return be}get name(){return this._name}get feature(){return this._current}get isDone(){return !this.feature||this._index>=this._features.length}[Symbol.iterator](){return {next:()=>this.isDone?(this._current=void 0,{value:void 0,done:true}):(this._current=this._features[this._index],{value:this._current,done:false})}}next(e){if(this._index>=this._features.length)return;let t=this._features.indexOf(e);this._index=t+1;}async process(e){if(!this.isDone)for(let t of this._features)await t.process(e);}};var Re=(_=>(_.Run="run",_.Build="build",_.Publish="publish",_.Deploy="deploy",_.Load="load",_.Start="start",_.Stop="stop",_))(Re||{}),ke=(e=>(e.LIFECYCLE="a-component-extensions",e))(ke||{});var Ye=class{constructor(e){this.props=e;this._name=e.name||c.root.name,e.components&&e.components.length&&e.components.forEach(t=>this.scope.register(t)),e.fragments&&e.fragments.length&&e.fragments.forEach(t=>this.scope.register(t)),e.entities&&e.entities.length&&e.entities.forEach(t=>this.scope.register(t)),this._containers=e.containers||[];}static Load(e){return b.Extend("load",e)}static Publish(e){return b.Extend("publish")}static Deploy(e){return b.Extend("deploy",e)}static Build(e){return b.Extend("build",e)}static Run(e){return b.Extend("run",e)}static Start(e){return b.Extend("start",e)}static Stop(e){return b.Extend("stop",e)}get name(){return c.root.name}get scope(){return c.root}get register(){return this.scope.register.bind(this.scope)}get resolve(){return this.scope.resolve.bind(this.scope)}async load(e){await new b({name:"load",containers:this._containers}).process(e);}async run(e){await new b({name:"run",containers:this._containers}).process(e);}async start(e){await new b({name:"start",containers:this._containers}).process(e);}async stop(e){await new b({name:"stop",containers:this._containers}).process(e);}async build(e){await new b({name:"build",containers:this._containers}).process(e);}async deploy(e){await new b({name:"deploy",containers:this._containers}).process(e);}async publish(e){await new b({name:"publish",containers:this._containers}).process(e);}async call(e,t){return await new Y({name:e,component:t}).process()}};var we=class extends A{constructor(t){super();this.containers=t;}};var j=class extends y{};j.InvalidInjectionTarget="Invalid target for A-Inject decorator",j.MissingInjectionTarget="Missing target for A-Inject decorator";function je(i,e){if(!i)throw new j(j.MissingInjectionTarget,"A-Inject decorator is missing the target to inject");return function(t,r,n){let o=u.getComponentName(t);if(!s.isTargetAvailableForInjection(t))throw new j(j.InvalidInjectionTarget,`A-Inject cannot be used on the target of type ${typeof t} (${o})`);let a=r?String(r):"constructor",_;switch(true){case(s.isComponentConstructor(t)||s.isComponentInstance(t)):_="a-component-injections";break;case s.isContainerInstance(t):_="a-container-injections";break;case s.isEntityInstance(t):_="a-component-injections";break}let d=c.meta(t).get(_)||new A,l=d.get(a)||[];l[n]=i instanceof x?i:new x(i,e),d.set(a,l),c.meta(t).set(_,d);}}
|
|
2
|
-
export{I as ASEID,b as A_Abstraction,
|
|
1
|
+
var L=class{constructor(e={}){this._name=e.name||this.constructor.name;}get name(){return this._name}toJSON(){return {name:this.name}}};var Fe=(o=>(o.INITIALIZED="INITIALIZED",o.PROCESSING="PROCESSING",o.COMPLETED="COMPLETED",o.INTERRUPTED="INTERRUPTED",o.FAILED="FAILED",o))(Fe||{});var h=class{static toUpperSnakeCase(e){return e.trim().replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toUpperCase()}static toCamelCase(e){return e.trim().replace(/[^a-zA-Z0-9]+/g," ").split(" ").filter(Boolean).map((t,r)=>r===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}static toPascalCase(e){return e.trim().replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z0-9]+/g," ").split(" ").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}static toKebabCase(e){return e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g,"-").toLowerCase()}};var V=class{static generateTimeId(e={timestamp:new Date,random:Math.random().toString(36).slice(2,8)}){let t=e.timestamp.getTime().toString(36),r=e.random;return `${t}-${r}`}static parseTimeId(e){let[t,r]=e.split("-");return {timestamp:new Date(parseInt(t,36)),random:r}}static formatWithLeadingZeros(e,t=10){return String(e).padStart(t+1,"0").slice(-t)}static removeLeadingZeros(e){return String(Number(e))}static hashString(e){let t=0,r,n;if(e.length===0)return t.toString();for(r=0;r<e.length;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t.toString()}};var g=class s{static isString(e){return typeof e=="string"||e instanceof String}static isNumber(e){return typeof e=="number"&&isFinite(e)}static isBoolean(e){return typeof e=="boolean"}static isObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static isArray(e){return Array.isArray(e)}static isErrorConstructorType(e){return !!e&&s.isObject(e)&&!(e instanceof Error)&&"title"in e}static isErrorSerializedType(e){return !!e&&s.isObject(e)&&!(e instanceof Error)&&"aseid"in e&&s.isString(e.aseid)}static isScopeInstance(e){return !!e&&typeof e=="object"&&"name"in e&&"aseid"in e}};var O=class O{static isASEID(e){return this.regexp.test(e)}static compare(e,t){if(!e||!t)return false;if(g.isString(e)&&this.isASEID(e)===false)throw new Error(`Invalid ASEID format provided: ${e}`);if(g.isString(t)&&this.isASEID(t)===false)throw new Error(`Invalid ASEID format provided: ${t}`);let r=e instanceof O?e:new O(e),n=t instanceof O?t:new O(t);return r.toString()===n.toString()}constructor(e){this.verifyInput(e),this.getInitializer(e).call(this,e);}get concept(){return this._concept||c.concept}get scope(){return this._scope||c.root.name}get entity(){return this._entity}get id(){return this._id}get version(){return this._version}get shard(){return this._shard}get hash(){return V.hashString(this.toString())}getInitializer(e){switch(true){case g.isString(e):return this.fromString;case g.isObject(e):return this.fromObject;default:throw new Error("Invalid parameters provided to ASEID constructor")}}fromString(e){let[t,r,n]=e.split("@"),[o,a,_]=r.split(":"),p=_.includes(".")?_.split(".")[0]:void 0,l=_.includes(".")?_.split(".")[1]:_;this._concept=t||c.root.name,this._scope=o||c.root.name,this._entity=a,this._id=l,this._version=n,this._shard=p;}fromObject(e){this._concept=e.concept?O.isASEID(e.concept)?new O(e.concept).id:e.concept:c.concept,this._scope=e.scope?g.isNumber(e.scope)?V.formatWithLeadingZeros(e.scope):O.isASEID(e.scope)?new O(e.scope).id:e.scope:c.root.name,this._entity=e.entity,this._id=g.isNumber(e.id)?V.formatWithLeadingZeros(e.id):e.id,this._version=e.version,this._shard=e.shard;}toString(){return `${this.concept}@${this.scope}:${this.entity}:${this.shard?this.shard+"."+this.id:this.id}${this.version?"@"+this.version:""}`}toJSON(){return {concept:this._concept,scope:this._scope,entity:this._entity,id:this._id,version:this._version,shard:this._shard}}verifyInput(e){switch(true){case(g.isString(e)&&!O.isASEID(e)):throw new Error("Invalid ASEID format provided");case(g.isObject(e)&&!e.id):throw new Error("ASEID id is required");case(g.isObject(e)&&!e.entity):throw new Error("ASEID entity is required")}}};O.regexp=new RegExp("^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|\\.|-]+(@v[0-9|\\.]+|@lts)?$");var I=O;var te={UNEXPECTED_ERROR:"A-Error Unexpected Error",VALIDATION_ERROR:"A-Error Validation Error"},Ye="If you see this error please let us know.";var _e=class{static get A_CONCEPT_NAME(){return "a-concept"}static get A_CONCEPT_ROOT_SCOPE(){return "root"}static get A_CONCEPT_ENVIRONMENT(){return "development"}static get A_CONCEPT_RUNTIME_ENVIRONMENT(){return "unknown"}static get A_CONCEPT_ROOT_FOLDER(){return "/app"}static get A_ERROR_DEFAULT_DESCRIPTION(){return "If you see this error please let us know."}static get(e){return this[e]}static set(e,t){this[e]=t;}static getAll(){return {}}static getAllKeys(){return []}};var re={A_CONCEPT_NAME:"A_CONCEPT_NAME",A_CONCEPT_ROOT_SCOPE:"A_CONCEPT_ROOT_SCOPE",A_CONCEPT_ENVIRONMENT:"A_CONCEPT_ENVIRONMENT",A_CONCEPT_RUNTIME_ENVIRONMENT:"A_CONCEPT_RUNTIME_ENVIRONMENT",A_CONCEPT_ROOT_FOLDER:"A_CONCEPT_ROOT_FOLDER",A_ERROR_DEFAULT_DESCRIPTION:"A_ERROR_DEFAULT_DESCRIPTION"},pe=[re.A_CONCEPT_NAME,re.A_CONCEPT_ROOT_SCOPE,re.A_CONCEPT_ENVIRONMENT,re.A_CONCEPT_RUNTIME_ENVIRONMENT,re.A_CONCEPT_ROOT_FOLDER,re.A_ERROR_DEFAULT_DESCRIPTION];var k=class extends _e{static get A_CONCEPT_ENVIRONMENT(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ENVIRONMENT||super.A_CONCEPT_ENVIRONMENT}static get A_CONCEPT_RUNTIME_ENVIRONMENT(){return "browser"}static get A_CONCEPT_NAME(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_NAME||super.A_CONCEPT_NAME}static get A_CONCEPT_ROOT_FOLDER(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ROOT_FOLDER||super.A_CONCEPT_ROOT_FOLDER}static get A_CONCEPT_ROOT_SCOPE(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_CONCEPT_ROOT_SCOPE||super.A_CONCEPT_ROOT_SCOPE}static get A_ERROR_DEFAULT_DESCRIPTION(){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.A_ERROR_DEFAULT_DESCRIPTION||super.A_ERROR_DEFAULT_DESCRIPTION}static get(e){return window.__A_CONCEPT_ENVIRONMENT_ENV__?.[e]||this[e]}static set(e,t){window.__A_CONCEPT_ENVIRONMENT_ENV__||(window.__A_CONCEPT_ENVIRONMENT_ENV__={}),window.__A_CONCEPT_ENVIRONMENT_ENV__[e]=t;}static getAll(){let e={};return window.__A_CONCEPT_ENVIRONMENT_ENV__&&Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(t=>{e[t]=window.__A_CONCEPT_ENVIRONMENT_ENV__[t];}),pe.forEach(t=>{e[t]=this.get(t);}),e}static getAllKeys(){let e=new Set;return window.__A_CONCEPT_ENVIRONMENT_ENV__&&Object.keys(window.__A_CONCEPT_ENVIRONMENT_ENV__).forEach(t=>{e.add(t);}),pe.forEach(t=>{e.add(t);}),Array.from(e)}};var y=class s extends Error{static get entity(){return h.toKebabCase(this.name)}static get concept(){return c.concept}static get scope(){return c.root.name}constructor(e,t){switch(true){case e instanceof s:return e;case e instanceof Error:super(e.message);break;case g.isErrorSerializedType(e):super(e.message);break;case(g.isErrorConstructorType(e)&&"description"in e):super(`[${e.title}]: ${e.description}`);break;case(g.isErrorConstructorType(e)&&!("description"in e)):super(e.title);break;case(g.isString(e)&&!t):super(e);break;case(g.isString(e)&&!!t):super(`[${e}]: ${t}`);break;default:super("An unknown error occurred.");}this.getInitializer(e,t).call(this,e,t);}get aseid(){return this._aseid}get title(){return this._title}get message(){return super.message}get code(){return this._code||h.toKebabCase(this.title)}get type(){return this.constructor.entity}get link(){return this._link?this._link:new URL(`https://adaas.support/a-concept/errors/${this.aseid.toString()}`).toString()}get scope(){return this._aseid.scope}get description(){return this._description||String(k.A_ERROR_DEFAULT_DESCRIPTION)||Ye}get originalError(){return this._originalError}getInitializer(e,t){switch(true){case(g.isString(e)&&!t):return this.fromMessage;case(g.isString(e)&&!!t):return this.fromTitle;case e instanceof Error:return this.fromError;case g.isErrorSerializedType(e):return this.fromJSON;case g.isErrorConstructorType(e):return this.fromConstructor;default:throw new s(te.VALIDATION_ERROR,"Invalid parameters provided to A_Error constructor")}}fromError(e){this._title=te.UNEXPECTED_ERROR,this._aseid=new I({concept:this.constructor.concept,scope:this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._originalError=e;}fromMessage(e){this._title=te.UNEXPECTED_ERROR,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._link=void 0,this._originalError=void 0;}fromJSON(e){this._aseid=new I(e.aseid),super.message=e.message,this._title=e.title,this._code=e.code,this._scope=e.scope,this._description=e.description,this._originalError=e.originalError?new s(e.originalError):void 0,this._link=e.link;}fromTitle(e,t){this.validateTitle(e),this._title=e,this._description=t,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._link=void 0,this._originalError=void 0;}fromConstructor(e){if(this.validateTitle(e.title),this._title=e.title,this._code=e.code,this._scope=e.scope?g.isScopeInstance(e.scope)?e.scope.name:e.scope:void 0,this._aseid=new I({concept:this.constructor.concept,scope:this._scope||this.constructor.scope,entity:this.constructor.entity,id:this.code}),this._description=e.description,this._link=e.link,e.originalError instanceof s){let t=e.originalError;for(;t.originalError instanceof s;)t=t.originalError;this._originalError=t.originalError||t;}else this._originalError=e.originalError;}toJSON(){return {aseid:this.aseid.toString(),title:this.title,code:this.code,type:this.type,message:this.message,link:this.link,scope:this.scope,description:this.description,originalError:this.originalError?.message}}validateTitle(e){if(e.length>60)throw new s(te.VALIDATION_ERROR,"A-Error title exceeds 60 characters limit.");if(e.length===0)throw new s(te.VALIDATION_ERROR,"A-Error title cannot be empty.")}};var X=class extends y{};X.ValidationError="A-Entity Validation Error";var we=(n=>(n.EXTENSIONS="a-component-extensions",n.FEATURES="a-component-features",n.ABSTRACTIONS="a-component-abstractions",n.INJECTIONS="a-component-injections",n))(we||{}),ce={SAVE:"_A_Entity__Save",DESTROY:"_A_Entity__Destroy",LOAD:"_A_Entity__Load"};var M=class{static get entity(){return h.toKebabCase(this.name)}static get concept(){return c.concept}static get scope(){return c.root.name}constructor(e){this.getInitializer(e).call(this,e);}get id(){return this.aseid.id}isStringASEID(e){return typeof e=="string"&&I.isASEID(e)}isASEIDInstance(e){return e instanceof I}isSerializedObject(e){return !!e&&typeof e=="object"&&"aseid"in e}isConstructorProps(e){return !!e&&typeof e=="object"&&!("aseid"in e)}getInitializer(e){if(!e)return this.fromUndefined;if(this.isStringASEID(e))return this.fromASEID;if(this.isASEIDInstance(e))return this.fromASEID;if(this.isSerializedObject(e))return this.fromJSON;if(this.isConstructorProps(e))return this.fromNew;throw new X(X.ValidationError,"Unable to determine A-Entity constructor initialization method. Please check the provided parameters.")}generateASEID(e){return new I({concept:e?.concept||this.constructor.concept,scope:e?.scope||this.constructor.scope,entity:e?.entity||this.constructor.entity,id:e?.id||V.generateTimeId()})}call(e,t){return new Y({name:e,component:this,scope:t}).process(t)}load(e){return this.call(ce.LOAD,e)}destroy(e){return this.call(ce.DESTROY,e)}save(e){return this.call(ce.SAVE,e)}fromASEID(e){e instanceof I?this.aseid=e:this.aseid=new I(e);}fromUndefined(){this.aseid=this.generateASEID();}fromNew(e){this.aseid=this.generateASEID();}fromJSON(e){this.aseid=new I(e.aseid);}toJSON(){return {aseid:this.aseid.toString()}}toString(){return this.aseid?this.aseid.toString():this.constructor.name}};function ue(s){return function(e){return c.setMeta(e,new s),e}}var A=class s{constructor(){this.meta=new Map;}static Define(e){return ue(e)}[Symbol.iterator](){let e=this.meta.entries();return {next:()=>e.next()}}from(e){return this.meta=new Map(e.meta),this}clone(){let e=this.constructor,t=new e;return t.meta=new Map(this.meta),t}set(e,t){let r=this.meta.get(e)||Array.isArray(t)?[]:t instanceof Map?new Map:{};this.meta.get(e)||Array.isArray(t)?[...r]:t instanceof Map?new Map(r):{...r};this.meta.set(e,t);}get(e){return this.meta.get(e)}delete(e){return this.meta.delete(e)}size(){return this.meta.size}convertToRegExp(e){if(e instanceof RegExp)return e;this._regExpCache||(this._regExpCache=new Map);let t=this._regExpCache.get(e);return t||(t=new RegExp(e),this._regExpCache.set(e,t)),t}find(e){let t=[];for(let[r,n]of this.meta.entries())this.convertToRegExp(String(r)).test(e)&&t.push([r,n]);return t}findByRegex(e){let t=[];for(let[r,n]of this.meta.entries())e.test(String(r))&&t.push([r,n]);return t}has(e){return this.meta.has(e)}entries(){return this.meta.entries()}clear(){this.meta.clear();}toArray(){return Array.from(this.meta.entries())}recursiveToJSON(e){switch(true){case e instanceof s:return e.toJSON();case e instanceof Map:let t={};for(let[n,o]of e.entries())t[String(n)]=this.recursiveToJSON(o);return t;case Array.isArray(e):return e.map(n=>this.recursiveToJSON(n));case(!!e&&typeof e=="object"):let r={};for(let[n,o]of Object.entries(e))r[n]=this.recursiveToJSON(o);return r;default:return e}}toJSON(){let e={};for(let[t,r]of this.meta.entries())e[String(t)]=this.recursiveToJSON(r);return e}};var B=class extends A{features(){return this.get("a-component-features")?.toArray().map(([,t])=>t)||[]}injections(e){return this.get("a-component-injections")?.get(e)||[]}};var z=class{get name(){return this.config?.name||this.constructor.name}get scope(){return c.scope(this)}constructor(e={}){this.config=e,c.allocate(this,this.config);}async call(e,t){return await new Y({name:e,component:this}).process(t)}};var xe=(n=>(n.FEATURES="a-container-features",n.INJECTIONS="a-container-injections",n.ABSTRACTIONS="a-container-abstractions",n.EXTENSIONS="a-container-extensions",n))(xe||{});var H=class extends A{injections(e){return this.get("a-container-injections")?.get(e)||[]}features(){return this.get("a-container-features")?.toArray().map(([,t])=>t)||[]}abstractions(e){let t=[],r=this.get("a-container-abstractions"),n=this.get("a-container-injections");return r?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o,a])=>{a.forEach(_=>{let p=n?.get(_.handler)||[];t.push({..._,args:p});});}),t}extensions(e){let t=[];return this.get("a-container-extensions")?.find(e).forEach(([n,o])=>{o.forEach(a=>{t.push({name:a.name,handler:a.handler,behavior:a.behavior,before:a.before||"",after:a.after||"",throwOnError:a.throwOnError||true,override:""});});}),t}};var m=class extends y{fromConstructor(e){super.fromConstructor(e),this.stage=e.stage;}};m.Interruption="Feature Interrupted",m.FeatureInitializationError="Unable to initialize A-Feature",m.FeatureProcessingError="Error occurred during A-Feature processing",m.FeatureDefinitionError="Unable to define A-Feature",m.FeatureExtensionError="Unable to extend A-Feature";var d=class{static resolve(){return new Promise(e=>e())}static isInheritedFrom(e,t){let r=e;for(;r;){if(r===t)return true;r=Object.getPrototypeOf(r);}return false}static getParentClasses(e){let t=Object.getPrototypeOf(typeof e=="function"?e:e.constructor),r=[];for(;t&&t!==Function.prototype;)r.push(t),t=Object.getPrototypeOf(t);return r}static getClassInheritanceChain(e){let t=Object.getPrototypeOf(typeof e=="function"?e:e.constructor),r=typeof e=="function"?[e]:[e.constructor];for(;t&&t!==Function.prototype;)r.push(t),t=Object.getPrototypeOf(t);return r}static getParentClass(e){return Object.getPrototypeOf(e)}static omitProperties(e,t){let r=JSON.parse(JSON.stringify(e));function n(o,a){let _=a[0];a.length===1?delete o[_]:o[_]!==void 0&&typeof o[_]=="object"&&n(o[_],a.slice(1));}return t.forEach(o=>{let a=o.split(".");n(r,a);}),r}static isObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static deepMerge(e,t,r=new Map){if(this.isObject(e)&&this.isObject(t))for(let n in t)this.isObject(t[n])?(e[n]||(e[n]={}),r.has(t[n])?e[n]=r.get(t[n]):(r.set(t[n],{}),this.deepMerge(e[n],t[n],r))):e[n]=t[n];return e}static deepClone(e){if(e==null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(t=>this.deepClone(t));if(typeof e=="function")return e;if(e instanceof Object){let t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=this.deepClone(e[r]));return t}throw new Error("Unable to clone the object. Unsupported type.")}static deepCloneAndMerge(e,t){if(t==null&&e==null)return e;if(e==null&&t)return this.deepClone(t);if(typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(r=>this.deepCloneAndMerge(r,t));if(typeof e=="function")return e;if(e instanceof Object){let r={};for(let n in e)t[n]!==null&&t[n]!==void 0?r[n]=this.deepCloneAndMerge(e[n],t[n]):r[n]=this.deepClone(e[n]);for(let n in t)e[n]!==void 0&&e[n]!==null?r[n]=this.deepCloneAndMerge(e[n],t[n]):r[n]=this.deepClone(t[n]);return r}throw new Error("Unable to clone the object. Unsupported type.")}static getComponentName(e){let t="Unknown",r="Anonymous";if(e==null)return t;if(typeof e=="string")return e||t;if(typeof e=="symbol")try{return e.toString()}catch{return t}if(Array.isArray(e))return e.length===0?t:this.getComponentName(e[0]);if(typeof e=="function"){let n=e;if(n.displayName)return String(n.displayName);if(n.name)return String(n.name);if(n.constructor&&n.constructor.name)return String(n.constructor.name);try{let a=Function.prototype.toString.call(e).match(/^(?:class\s+([A-Za-z0-9_$]+)|function\s+([A-Za-z0-9_$]+)|([A-Za-z0-9_$]+)\s*=>)/);if(a)return a[1]||a[2]||a[3]||r}catch{}return r}if(typeof e=="object"){let n=e;if(n.type)return this.getComponentName(n.type);if(n.displayName)return String(n.displayName);if(n.name)return String(n.name);if(n.constructor&&n.constructor.name&&n.constructor.name!=="Object")return String(n.constructor.name);try{let o=n.toString();if(typeof o=="string"&&o!=="[object Object]")return o}catch{}return r}try{return String(e)}catch{return t}}};var Q=class extends Error{};Q.CallerInitializationError="Unable to initialize A-Caller";var G=class{constructor(e){this.validateParams(e),this._component=e;}get component(){return this._component}validateParams(e){if(!i.isAllowedForFeatureCall(e))throw new Q(`[${Q.CallerInitializationError}]: Invalid A-Caller component provided of type: ${typeof e} with value: ${JSON.stringify(e).slice(0,100)}...`)}};var T=class extends y{};T.InvalidDependencyTarget="Invalid Dependency Target",T.InvalidLoadTarget="Invalid Load Target",T.InvalidLoadPath="Invalid Load Path",T.InvalidDefaultTarget="Invalid Default Target",T.ResolutionParametersError="Dependency Resolution Parameters Error";function de(...s){return function(e,t,r){let n=d.getComponentName(e);if(!i.isTargetAvailableForInjection(e))throw new T(T.InvalidDefaultTarget,`A-Default cannot be used on the target of type ${typeof e} (${n})`);let o=t?String(t):"constructor",a;switch(true){case(i.isComponentConstructor(e)||i.isComponentInstance(e)):a="a-component-injections";break;case i.isContainerInstance(e):a="a-container-injections";break;case i.isEntityInstance(e):a="a-component-injections";break}let _=c.meta(e).get(a)||new A,p=_.get(o)||[];p[r].resolutionStrategy={create:true,args:s},_.set(o,p),c.meta(e).set(a,_);}}function le(){return function(s,e,t){let r=d.getComponentName(s);if(!i.isTargetAvailableForInjection(s))throw new T(T.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof s} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(i.isComponentConstructor(s)||i.isComponentInstance(s)):o="a-component-injections";break;case i.isContainerInstance(s):o="a-container-injections";break;case i.isEntityInstance(s):o="a-component-injections";break}let a=c.meta(s).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={flat:true},a.set(n,_),c.meta(s).set(o,a);}}function Ae(){return function(s,e,t){let r=d.getComponentName(s);if(!i.isTargetAvailableForInjection(s))throw new T(T.InvalidLoadTarget,`A-Load cannot be used on the target of type ${typeof s} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(i.isComponentConstructor(s)||i.isComponentInstance(s)):o="a-component-injections";break;case i.isContainerInstance(s):o="a-container-injections";break;case i.isEntityInstance(s):o="a-component-injections";break}let a=c.meta(s).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={load:true},a.set(n,_),c.meta(s).set(o,a);}}function me(s=-1){return function(e,t,r){let n=d.getComponentName(e);if(!i.isTargetAvailableForInjection(e))throw new T(T.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof e} (${n})`);let o=t?String(t):"constructor",a;switch(true){case(i.isComponentConstructor(e)||i.isComponentInstance(e)):a="a-component-injections";break;case i.isContainerInstance(e):a="a-container-injections";break;case i.isEntityInstance(e):a="a-component-injections";break}let _=c.meta(e).get(a)||new A,p=_.get(o)||[];p[r].resolutionStrategy={parent:s},_.set(o,p),c.meta(e).set(a,_);}}function Ee(){return function(s,e,t){let r=d.getComponentName(s);if(!i.isTargetAvailableForInjection(s))throw new T(T.InvalidDependencyTarget,`A-Dependency cannot be used on the target of type ${typeof s} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(i.isComponentConstructor(s)||i.isComponentInstance(s)):o="a-component-injections";break;case i.isContainerInstance(s):o="a-container-injections";break;case i.isEntityInstance(s):o="a-component-injections";break}let a=c.meta(s).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={require:true},a.set(n,_),c.meta(s).set(o,a);}}function fe(){return function(s,e,t){let r=d.getComponentName(s);if(!i.isTargetAvailableForInjection(s))throw new T(T.InvalidDependencyTarget,`A-All cannot be used on the target of type ${typeof s} (${r})`);let n=e?String(e):"constructor",o;switch(true){case(i.isComponentConstructor(s)||i.isComponentInstance(s)):o="a-component-injections";break;case i.isContainerInstance(s):o="a-container-injections";break;case i.isEntityInstance(s):o="a-component-injections";break}let a=c.meta(s).get(o)||new A,_=a.get(n)||[];_[t].resolutionStrategy={pagination:{..._[t].resolutionStrategy.pagination,count:-1}},a.set(n,_),c.meta(s).set(o,a);}}function Te(s,e){return function(t,r,n){let o=d.getComponentName(t);if(!i.isTargetAvailableForInjection(t))throw new T(T.InvalidDependencyTarget,`A-All cannot be used on the target of type ${typeof t} (${o})`);let a=r?String(r):"constructor",_;switch(true){case(i.isComponentConstructor(t)||i.isComponentInstance(t)):_="a-component-injections";break;case i.isContainerInstance(t):_="a-container-injections";break;case i.isEntityInstance(t):_="a-component-injections";break}let p=c.meta(t).get(_)||new A,l=p.get(a)||[];l[n].resolutionStrategy={query:{...l[n].resolutionStrategy.query,...s},pagination:{...l[n].resolutionStrategy.pagination,...e}},p.set(a,l),c.meta(t).set(_,p);}}var F=class{constructor(e,t){this._defaultPagination={count:1,from:"start"};this._defaultResolutionStrategy={require:false,load:false,parent:0,flat:false,create:false,args:[],query:{},pagination:this._defaultPagination};this._name=typeof e=="string"?e:d.getComponentName(e),this._target=typeof e=="string"?void 0:e,this.resolutionStrategy=t||{},this.initCheck();}static get Required(){return Ee}static get Loaded(){return Ae}static get Default(){return de}static get Parent(){return me}static get Flat(){return le}static get All(){return fe}static get Query(){return Te}get flat(){return this._resolutionStrategy.flat}get require(){return this._resolutionStrategy.require}get load(){return this._resolutionStrategy.load}get all(){return this._resolutionStrategy.pagination.count!==1||Object.keys(this._resolutionStrategy.query).length>0}get parent(){return this._resolutionStrategy.parent}get create(){return this._resolutionStrategy.create}get args(){return this._resolutionStrategy.args}get query(){return this._resolutionStrategy.query}get pagination(){return this._resolutionStrategy.pagination}get name(){return this._name}get target(){return this._target}get resolutionStrategy(){return this._resolutionStrategy}set resolutionStrategy(e){this._resolutionStrategy={...this._defaultResolutionStrategy,...this._resolutionStrategy,...e,pagination:{...this._defaultPagination,...(this._resolutionStrategy||{}).pagination,...e.pagination||{}}};}initCheck(){if(!this._resolutionStrategy)throw new T(T.ResolutionParametersError,`Resolution strategy parameters are not provided for dependency: ${this._name}`);return this}toJSON(){return {name:this._name,all:this.all,require:this.require,load:this.load,parent:this.parent,flat:this.flat,create:this.create,args:this.args,query:this.query,pagination:this.pagination}}};var i=class s{static isString(e){return typeof e=="string"||e instanceof String}static isNumber(e){return typeof e=="number"&&isFinite(e)}static isBoolean(e){return typeof e=="boolean"}static isArray(e){return Array.isArray(e)}static isObject(e){return e&&typeof e=="object"&&!Array.isArray(e)}static isFunction(e){return typeof e=="function"}static isUndefined(e){return typeof e>"u"}static isRegExp(e){return e instanceof RegExp}static isContainerConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,z)}static isComponentConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,D)}static isFragmentConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,L)}static isEntityConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,M)}static isScopeConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,v)}static isErrorConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,Error)}static isFeatureConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,Y)}static isCallerConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,G)}static isDependencyConstructor(e){return typeof e=="function"&&d.isInheritedFrom(e,F)}static isDependencyInstance(e){return e instanceof F}static isContainerInstance(e){return e instanceof z}static isComponentInstance(e){return e instanceof D}static isFeatureInstance(e){return e instanceof Y}static isFragmentInstance(e){return e instanceof L}static isEntityInstance(e){return e instanceof M}static isScopeInstance(e){return e instanceof v}static isErrorInstance(e){return e instanceof Error}static isComponentMetaInstance(e){return e instanceof R}static isContainerMetaInstance(e){return e instanceof H}static isEntityMetaInstance(e){return e instanceof B}static hasASEID(e){return e&&typeof e=="object"&&"aseid"in e&&(s.isEntityInstance(e)||s.isErrorInstance(e))}static isConstructorAllowedForScopeAllocation(e){return s.isContainerConstructor(e)||s.isFeatureConstructor(e)}static isInstanceAllowedForScopeAllocation(e){return s.isContainerInstance(e)||s.isFeatureInstance(e)}static isConstructorAvailableForAbstraction(e){return s.isContainerInstance(e)||s.isComponentInstance(e)}static isTargetAvailableForInjection(e){return s.isComponentConstructor(e)||s.isComponentInstance(e)||s.isContainerInstance(e)||s.isEntityInstance(e)}static isAllowedForFeatureCall(e){return s.isContainerInstance(e)||s.isComponentInstance(e)||s.isEntityInstance(e)}static isAllowedForFeatureDefinition(e){return s.isContainerInstance(e)||s.isComponentInstance(e)||s.isEntityInstance(e)}static isAllowedForFeatureExtension(e){return s.isComponentInstance(e)||s.isContainerInstance(e)||s.isEntityInstance(e)}static isAllowedForAbstractionDefinition(e){return s.isContainerInstance(e)||s.isComponentInstance(e)}static isAllowedForDependencyDefaultCreation(e){return s.isFragmentConstructor(e)||d.isInheritedFrom(e,L)||s.isEntityConstructor(e)||d.isInheritedFrom(e,M)}static isErrorConstructorType(e){return !!e&&s.isObject(e)&&!(e instanceof Error)&&"title"in e}static isErrorSerializedType(e){return !!e&&s.isObject(e)&&!(e instanceof Error)&&"aseid"in e&&I.isASEID(e.aseid)}static isPromiseInstance(e){return e instanceof Promise}};function Se(s={}){return function(e,t,r){let n=d.getComponentName(e);if(!i.isAllowedForFeatureDefinition(e))throw new m(m.FeatureDefinitionError,`A-Feature cannot be defined on the ${n} level`);let o=c.meta(e.constructor),a;switch(true){case i.isEntityInstance(e):a="a-component-features";break;case i.isContainerInstance(e):a="a-container-features";break;case i.isComponentInstance(e):a="a-component-features";break}let _=o.get(a)||new A,p=s.name||t,l=s.invoke||false;_.set(t,{name:`${e.constructor.name}.${p}`,handler:t,invoke:l,template:s.template&&s.template.length?s.template.map(S=>({...S,before:S.before||"",after:S.after||"",behavior:S.behavior||"sync",throwOnError:true,override:S.override||""})):[]}),c.meta(e.constructor).set(a,_);let f=r.value;return r.value=function(...S){if(l)f.apply(this,S);else return f.apply(this,S);if(typeof this.call=="function"&&l)return this.call(p)},r}}function he(s){return function(e,t,r){let n=d.getComponentName(e);if(!i.isAllowedForFeatureExtension(e))throw new m(m.FeatureExtensionError,`A-Feature-Extend cannot be applied on the ${n} level`);let o,a="sync",_="",p="",l="",f=[],S=[],x=true,j;switch(true){case i.isEntityInstance(e):j="a-component-extensions";break;case i.isContainerInstance(e):j="a-container-extensions";break;case i.isComponentInstance(e):j="a-component-extensions";break}switch(true){case i.isRegExp(s):o=s;break;case(!!s&&typeof s=="object"):Array.isArray(s.scope)?f=s.scope:s.scope&&typeof s.scope=="object"&&(Array.isArray(s.scope.include)&&(f=s.scope.include),Array.isArray(s.scope.exclude)&&(S=s.scope.exclude)),o=De(s,f,S,t),a=s.behavior||a,x=s.throwOnError!==void 0?s.throwOnError:x,_=i.isArray(s.before)?new RegExp(`^${s.before.join("|").replace(/\./g,"\\.")}$`).source:s.before instanceof RegExp?s.before.source:"",p=i.isArray(s.after)?new RegExp(`^${s.after.join("|").replace(/\./g,"\\.")}$`).source:s.after instanceof RegExp?s.after.source:"",l=i.isArray(s.override)?new RegExp(`^${s.override.join("|").replace(/\./g,"\\.")}$`).source:s.override instanceof RegExp?s.override.source:"";break;default:o=new RegExp(`^.*${t.replace(/\./g,"\\.")}$`);break}let C=c.meta(e).get(j),P=c.meta(e),J=P.get(j)?new A().from(P.get(j)):new A;if(C&&C.size()&&C.has(t)&&C.get(t).invoke)throw new m(m.FeatureExtensionError,`A-Feature-Extend cannot be used on the method "${t}" because it is already defined as a Feature with "invoke" set to true. Please remove the A-Feature-Extend decorator or set "invoke" to false in the A-Feature decorator.`);let Z=[...J.get(o.source)||[]],oe=s&&typeof s=="object"&&!i.isRegExp(s)&&s.name||t;for(let[N,W]of J.entries()){let ae=W.findIndex(Ie=>Ie.handler===t);if(N!==o.source&&ae!==-1){let be=String(N).match(/\\\.\s*([^\\.$]+)\$$/);(be?be[1]:null)===oe&&(W.splice(ae,1),W.length===0?J.delete(N):J.set(N,W));}}let q=Z.findIndex(N=>N.handler===t),se={name:o.source,handler:t,behavior:a,before:_,after:p,throwOnError:x,override:l};q!==-1?Z[q]=se:Z.push(se),J.set(o.source,Z),c.meta(e).set(j,J);}}function De(s,e,t,r){let n=e.length?`(${e.map(_=>_.name).join("|")})`:".*",o=t.length?`(?!${t.map(_=>_.name).join("|")})`:"",a=s.scope?`^${o}${n}\\.${s.name||r}$`:`.*\\.${s.name||r}$`;return new RegExp(a)}var ve=(a=>(a.PROCESSING="PROCESSING",a.COMPLETED="COMPLETED",a.FAILED="FAILED",a.SKIPPED="SKIPPED",a.INITIALIZED="INITIALIZED",a.ABORTED="ABORTED",a))(ve||{});var U=class extends y{static get CompileError(){return "Unable to compile A-Stage"}};U.ArgumentsResolutionError="A-Stage Arguments Resolution Error";var ie=class{constructor(e,t){this._status="INITIALIZED";this._feature=e,this._definition=t;}get name(){return this.toString()}get definition(){return this._definition}get status(){return this._status}get feature(){return this._feature}get isProcessed(){return this._status==="COMPLETED"||this._status==="FAILED"||this._status==="SKIPPED"}get error(){return this._error}getStepArgs(e,t){let r=t.dependency.target||e.resolveConstructor(t.dependency.name);return c.meta(r).injections(t.handler).map(n=>{switch(true){case i.isCallerConstructor(n.target):return this._feature.caller.component;case i.isFeatureConstructor(n.target):return this._feature;default:return e.resolve(n)}})}getStepComponent(e,t){let{dependency:r,handler:n}=t,o=e.resolve(r)||this.feature.scope.resolve(r);if(!o)throw new U(U.CompileError,`Unable to resolve component ${r.name} from scope ${e.name}`);if(!o[n])throw new U(U.CompileError,`Handler ${n} not found in ${o.constructor.name}`);return o}callStepHandler(e,t){let r=this.getStepComponent(t,e),n=this.getStepArgs(t,e);return {handler:r[e.handler].bind(r),params:n}}skip(){this._status="SKIPPED";}process(e){let t=i.isScopeInstance(e)?e:this._feature.scope;if(!this.isProcessed){this._status="PROCESSING";let{handler:r,params:n}=this.callStepHandler(this._definition,t),o=r(...n);if(i.isPromiseInstance(o))return new Promise(async(a,_)=>{try{return await o,this.completed(),a()}catch(p){let l=new y(p);return this.failed(l),this._definition.throwOnError?a():_(l)}});this.completed();}}completed(){this._status="COMPLETED";}failed(e){this._error=new y(e),this._status="FAILED";}toJSON(){return {name:this.name,status:this.status}}toString(){return `A-Stage(${this._feature.name}::${this._definition.behavior}@${this._definition.handler})`}};var ee=class extends y{};ee.CircularDependencyError="A-StepManager Circular Dependency Error";var ne=class{constructor(e){this._uniqueIdMap=new Map;this._isBuilt=false;this.entities=this.prepareSteps(e),this.graph=new Map,this.visited=new Set,this.tempMark=new Set,this.sortedEntities=[],this.assignUniqueIds();}prepareSteps(e){return e.map(t=>({...t,behavior:t.behavior||"sync",before:t.before||"",after:t.after||"",override:t.override||"",throwOnError:false}))}baseID(e){return `${e.dependency.name}.${e.handler}`}ID(e){return this._uniqueIdMap.get(e)||this.baseID(e)}assignUniqueIds(){let e=new Map;for(let r of this.entities){let n=this.baseID(r);e.set(n,(e.get(n)||0)+1);}let t=new Map;for(let r of this.entities){let n=this.baseID(r);if(e.get(n)>1){let o=t.get(n)||0;this._uniqueIdMap.set(r,`${n}#${o}`),t.set(n,o+1);}else this._uniqueIdMap.set(r,n);}}buildGraph(){this._isBuilt||(this._isBuilt=true,this.entities=this.entities.filter((e,t,r)=>!r.some((n,o)=>{if(t===o||!n.override)return false;let a=new RegExp(n.override);return a.test(this.baseID(e))||a.test(e.handler)})),this._uniqueIdMap.clear(),this.assignUniqueIds(),this.entities.forEach(e=>this.graph.set(this.ID(e),new Set)),this.entities.forEach(e=>{let t=this.ID(e);e.before&&this.matchEntities(t,e.before).forEach(n=>{this.graph.has(n)||this.graph.set(n,new Set),this.graph.get(n).add(t);}),e.after&&this.matchEntities(t,e.after).forEach(n=>{this.graph.has(t)||this.graph.set(t,new Set),this.graph.get(t).add(n);});}));}matchEntities(e,t){let r=new RegExp(t);return this.entities.filter(n=>r.test(this.baseID(n))&&this.ID(n)!==e).map(n=>this.ID(n))}visit(e){this.tempMark.has(e)||this.visited.has(e)||(this.tempMark.add(e),(this.graph.get(e)||[]).forEach(t=>this.visit(t)),this.tempMark.delete(e),this.visited.add(e),this.sortedEntities.push(e));}toSortedArray(){return this.buildGraph(),this.entities.forEach(e=>{this.visited.has(this.ID(e))||this.visit(this.ID(e));}),this.sortedEntities}toStages(e){return this.toSortedArray().map(r=>{let n=this.entities.find(o=>this.ID(o)===r);return new ie(e,n)})}};var Y=class s{constructor(e){this._stages=[];this._index=0;this._state="INITIALIZED";this.validateParams(e),this.getInitializer(e).call(this,e);}static get Define(){return Se}static get Extend(){return he}get name(){return this._name}get error(){return this._error}get state(){return this._state}get index(){return this._index}get stage(){return this._current}get caller(){return this._caller}get scope(){return c.scope(this)}get size(){return this._stages.length}get isDone(){return !this.stage||this._index>=this._stages.length}get isProcessed(){return this.state==="COMPLETED"||this.state==="FAILED"||this.state==="INTERRUPTED"}[Symbol.iterator](){return {next:()=>this.isDone?(this._current=void 0,{value:void 0,done:true}):(this._current=this._stages[this._index],this._index++,{value:this._current,done:false})}}validateParams(e){if(!e||typeof e!="object")throw new m(m.FeatureInitializationError,`Invalid A-Feature initialization parameters of type: ${typeof e} with value: ${JSON.stringify(e)?.slice(0,100)}...`)}getInitializer(e){switch(true){case !("template"in e):return this.fromComponent;case "template"in e:return this.fromTemplate;default:throw new m(m.FeatureInitializationError,`Invalid A-Feature initialization parameters of type: ${typeof e} with value: ${JSON.stringify(e)?.slice(0,100)}...`)}}fromTemplate(e){if(!e.template||!Array.isArray(e.template))throw new m(m.FeatureInitializationError,`Invalid A-Feature template provided of type: ${typeof e.template} with value: ${JSON.stringify(e.template)?.slice(0,100)}...`);if(!e.component&&(!e.scope||!(e.scope instanceof v)))throw new m(m.FeatureInitializationError,`Invalid A-Feature scope provided of type: ${typeof e.scope} with value: ${JSON.stringify(e.scope)?.slice(0,100)}...`);this._name=e.name;let t,r=e.scope;try{e.component&&(t=c.scope(e.component));}catch(o){if(!r)throw o}t&&r&&!r.isInheritedFrom(t)&&r.inherit(t),this._caller=new G(e.component||new D),c.allocate(this).inherit(t||r),this._SM=new ne(e.template),this._stages=this._SM.toStages(this),this._current=this._stages[0];}fromComponent(e){if(!e.component||!i.isAllowedForFeatureDefinition(e.component))throw new m(m.FeatureInitializationError,`Invalid A-Feature component provided of type: ${typeof e.component} with value: ${JSON.stringify(e.component)?.slice(0,100)}...`);this._name=e.name;let t,r=e.scope;try{t=c.scope(e.component);}catch(a){if(!r)throw a}t&&r&&!r.isInheritedFrom(t)&&r.inherit(t),this._caller=new G(e.component);let n=c.allocate(this);n.inherit(t||r);let o=c.featureTemplate(this._name,this._caller.component,n);this._SM=new ne(o),this._stages=this._SM.toStages(this),this._current=this._stages[0];}process(e){try{if(this.isProcessed)return;this._state="PROCESSING";for(let t of this){if(this.state==="INTERRUPTED")return;let r;try{r=t.process(e);}catch(n){throw this.createStageError(n,t)}if(i.isPromiseInstance(r))return r.then(()=>{if(this.state!=="INTERRUPTED")return this.processRemainingStagesAsync(e)}).catch(n=>{throw this.createStageError(n,t)})}this.state!=="INTERRUPTED"&&this.completed();}catch(t){throw this.failed(new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${this.stage?.name||"N/A"}.`,stage:this.stage,originalError:t}))}}async processRemainingStagesAsync(e){for(let t of this){if(this.state==="INTERRUPTED")return;try{let r=t.process(e);i.isPromiseInstance(r)&&await r;}catch(r){throw this.createStageError(r,t)}}this.state!=="INTERRUPTED"&&this.completed();}createStageError(e,t){return this.failed(new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${t.name}.`,stage:t,originalError:e})),new m({title:m.FeatureProcessingError,description:`An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${t.name}.`,stage:t,originalError:e})}next(e){let t=this._stages.indexOf(e);this._index=t+1,this._index>=this._stages.length&&this.completed();}completed(){this.isProcessed||this.state!=="INTERRUPTED"&&(this._state="COMPLETED",this.scope.destroy());}failed(e){return this.isProcessed?this._error:(this._state="FAILED",this._error=e,this.scope.destroy(),this._error)}interrupt(e){if(this.isProcessed)return this._error;switch(this._state="INTERRUPTED",true){case i.isString(e):this._error=new m(m.Interruption,e);break;case i.isErrorInstance(e):this._error=new m({code:m.Interruption,title:e.title||"Feature Interrupted",description:e.description||e.message,stage:this.stage,originalError:e});break;default:this._error=new m(m.Interruption,"Feature was interrupted");break}return this.scope.destroy(),this._error}chain(e,t,r){let n,o;e instanceof s?(n=e,o=t instanceof v?t:void 0):(n=new s({name:t,component:e}),o=r instanceof v?r:void 0);let a=o||this.scope;n._caller=this._caller;let _=n.process(a);return i.isPromiseInstance(_)?_.catch(p=>{throw p}):_}toString(){return `A-Feature(${this.caller.component?.constructor?.name||"Unknown"}::${this.name})`}};var D=class{call(e,t){return new Y({name:e,component:this}).process(t)}};var ge=(n=>(n.EXTENSIONS="a-component-extensions",n.FEATURES="a-component-features",n.INJECTIONS="a-component-injections",n.ABSTRACTIONS="a-component-abstractions",n))(ge||{});var R=class extends A{injections(e){return this.get("a-component-injections")?.get(e)||[]}extensions(e){let t=[];return this.get("a-component-extensions")?.find(e).forEach(([n,o])=>{o.forEach(a=>{t.push({name:a.name,handler:a.handler,behavior:a.behavior,before:a.before||"",after:a.after||"",throwOnError:a.throwOnError||true,override:a.override||""});});}),t}features(){return this.get("a-component-features")?.toArray().map(([,t])=>t)||[]}abstractions(e){let t=[],r=this.get("a-component-abstractions"),n=this.get("a-component-injections");return r?.find(`CONCEPT_ABSTRACTION::${e}`).forEach(([o,a])=>{a.forEach(_=>{let p=n?.get(_.handler)||[];t.push({..._,args:p});});}),t}};var v=class{constructor(e,t){this._meta=new A;this._version=0;this._resolveConstructorCache=new Map;this._cachedFingerprintVersion=-1;this._allowedComponents=new Set;this._allowedErrors=new Set;this._allowedEntities=new Set;this._allowedFragments=new Set;this._components=new Map;this._errors=new Map;this._entities=new Map;this._fragments=new Map;this._imports=new Set;this.getInitializer(e).call(this,e,t);}get name(){return this._name}get meta(){return this._meta}get allowedComponents(){return this._allowedComponents}get allowedEntities(){return this._allowedEntities}get allowedFragments(){return this._allowedFragments}get allowedErrors(){return this._allowedErrors}get version(){return this._version}get fingerprint(){let e=this.aggregateVersion(new Set);return this._cachedFingerprint!==void 0&&this._cachedFingerprintVersion===e?this._cachedFingerprint:(this._cachedFingerprint=this.computeFingerprint(new Set),this._cachedFingerprintVersion=e,this._cachedFingerprint)}get entities(){return Array.from(this._entities.values())}get fragments(){return Array.from(this._fragments.values())}get components(){return Array.from(this._components.values())}get errors(){return Array.from(this._errors.values())}get imports(){return Array.from(this._imports.values())}get parent(){return this._parent}bumpVersion(){this._version++,this._resolveConstructorCache.clear(),this._cachedFingerprint=void 0;}aggregateVersion(e){if(e.has(this))return 0;e.add(this);let t=this._version;this._parent&&(t+=this._parent.aggregateVersion(e));for(let r of this._imports)t+=r.aggregateVersion(e);return t}computeFingerprint(e){if(e.has(this))return "~circular~";e.add(this);let t=[];t.push("P:"+(this._parent?this._parent.computeFingerprint(e):"-"));let r=Array.from(this._allowedComponents).map(f=>d.getComponentName(f.name)).sort();t.push("AC:"+r.join(","));let n=Array.from(this._allowedEntities).map(f=>d.getComponentName(f.name)).sort();t.push("AE:"+n.join(","));let o=Array.from(this._allowedFragments).map(f=>d.getComponentName(f.name)).sort();t.push("AF:"+o.join(","));let a=Array.from(this._allowedErrors).map(f=>d.getComponentName(f.name)).sort();t.push("AR:"+a.join(","));let _=Array.from(this._imports).map(f=>f.computeFingerprint(e)).sort();t.push("I:"+_.join(","));let p=t.join("|"),l=5381;for(let f=0;f<p.length;f++)l=(l<<5)+l+p.charCodeAt(f)|0;return (l>>>0).toString(16)}*parents(){let e=this._parent;for(;e;)yield e,e=e._parent;}parentOffset(e){let t=this;for(;e<=-1&&t;)t=t.parent,e++;return t}getInitializer(e,t){switch(true){case(!e&&!t):return this.defaultInitialized;case !!e:return this.defaultInitialized;default:throw new E(E.ConstructorError,"Invalid parameters provided to A_Scope constructor")}}defaultInitialized(e={},t={}){this._name=e.name||this.constructor.name,this.initComponents(e.components),this.initErrors(e.errors),this.initFragments(e.fragments),this.initEntities(e.entities),this.initMeta(e.meta),t.parent&&(this._parent=t.parent);}initComponents(e){e?.forEach(this.register.bind(this));}initErrors(e){e?.forEach(this.register.bind(this));}initEntities(e){e?.forEach(t=>this.register(t));}initFragments(e){e?.forEach(this.register.bind(this));}initMeta(e){e&&Object.entries(e).forEach(([t,r])=>{this._meta.set(t,r);});}destroy(){this._components.forEach(e=>c.deregister(e)),this._fragments.forEach(e=>c.deregister(e)),this._entities.forEach(e=>c.deregister(e)),this._components.clear(),this._errors.clear(),this._fragments.clear(),this._entities.clear(),this._imports.clear(),this.bumpVersion();}get(e){return this._meta.get(e)}set(e,t){this._meta.set(e,t);}issuer(){return c.issuer(this)}inherit(e){if(!e)throw new E(E.InitializationError,"Invalid parent scope provided");if(e===this)throw new E(E.CircularInheritanceError,`Unable to inherit scope ${this.name} from itself`);if(e===this._parent)return this;let t=this.checkCircularInheritance(e);if(t)throw new E(E.CircularInheritanceError,`Circular inheritance detected: ${[...t,e.name].join(" -> ")}`);return this._parent=e,this.bumpVersion(),this}import(...e){return e.forEach(t=>{if(t===this)throw new E(E.CircularImportError,`Unable to import scope ${this.name} into itself`);this._imports.has(t)||(this._imports.add(t),this.bumpVersion());}),this}deimport(...e){return e.forEach(t=>{this._imports.has(t)&&(this._imports.delete(t),this.bumpVersion());}),this}has(e){let t=this.hasFlat(e);if(!t&&this._parent)try{return this._parent.has(e)}catch{return false}return t}hasFlat(e){let t=false;switch(true){case i.isScopeConstructor(e):return true;case i.isString(e):{Array.from(this.allowedComponents).find(_=>_.name===e)&&(t=true),Array.from(this.allowedFragments).find(_=>_.name===e)&&(t=true),Array.from(this.allowedEntities).find(_=>_.name===e)&&(t=true),Array.from(this.allowedErrors).find(_=>_.name===e)&&(t=true);break}case i.isComponentConstructor(e):{t=this.isAllowedComponent(e)||!!c.findDescendantIn(e,this.allowedComponents);break}case i.isEntityConstructor(e):{t=this.isAllowedEntity(e)||!!c.findDescendantIn(e,this.allowedEntities);break}case i.isFragmentConstructor(e):{t=this.isAllowedFragment(e)||!!c.findDescendantIn(e,this.allowedFragments);break}case i.isErrorConstructor(e):{t=this.isAllowedError(e)||!!c.findDescendantIn(e,this.allowedErrors);break}case(this.issuer()&&(this.issuer().constructor===e||c.isIndexedInheritedFrom(this.issuer().constructor,e))):{t=true;break}}return t}resolveDependency(e){let t=[],r=this.parentOffset(e.parent)||this;switch(true){case(e.flat&&!e.all):{let l=r.resolveFlatOnce(e.target||e.name);l&&(t=[l]);break}case(e.flat&&e.all):{t=r.resolveFlatAll(e.target||e.name);break}case(!e.flat&&!e.all):{let l=r.resolveOnce(e.target||e.name);l&&(t=[l]);break}case(!e.flat&&e.all):{t=r.resolveAll(e.target||e.name);break}default:t=[];}if(e.create&&!t.length&&i.isAllowedForDependencyDefaultCreation(e.target)){let l=new e.target(...e.args);r.register(l),t.push(l);}if(e.require&&!t.length)throw new E(E.ResolutionError,`Dependency ${e.name} is required but could not be resolved in scope ${r.name}`);e.query.aseid?t=t.filter(l=>i.hasASEID(l)&&I.compare(l.aseid,e.query.aseid)):Object.keys(e.query).length>0&&(t=t.filter(l=>{let f=e.query;return f?Object.entries(f).every(([S,x])=>l[S]===x):true}));let n=e.pagination.count,o=e.pagination.from,a=o==="end"?n===-1?0:Math.max(t.length-n,0):0,_=o==="end"||n===-1?t.length:Math.min(n,t.length),p=t.slice(a,_);return p.length===1&&n!==-1?p[0]:p.length?p:void 0}resolveConstructor(e){switch(true){case i.isComponentConstructor(e):return c.findDescendantIn(e,this.allowedComponents);case i.isEntityConstructor(e):return c.findDescendantIn(e,this.allowedEntities);case i.isFragmentConstructor(e):return c.findDescendantIn(e,this.allowedFragments);case i.isErrorConstructor(e):return c.findDescendantIn(e,this.allowedErrors)}if(!i.isString(e))throw new E(E.ResolutionError,`Invalid constructor name provided: ${e}`);let t=e;if(this._resolveConstructorCache.has(t)){let n=this._resolveConstructorCache.get(t);return n===null?void 0:n}let r=this._resolveConstructorUncached(e);return this._resolveConstructorCache.set(t,r??null),r}_resolveConstructorUncached(e){let t=Array.from(this.allowedComponents).find(o=>o.name===e||o.name===h.toPascalCase(e));if(t)return t;{let o=h.toPascalCase(e),a=Array.from(this.allowedComponents).find(_=>{let p=c.getAncestors(_);if(!p)return false;for(let l of p)if(l.name===e||l.name===o)return true;return false});if(a)return a}let r=Array.from(this.allowedEntities).find(o=>o.name===e||o.name===h.toPascalCase(e)||o.entity===e||o.entity===h.toKebabCase(e));if(r)return r;{let o=h.toPascalCase(e),a=Array.from(this.allowedEntities).find(_=>{let p=c.getAncestors(_);if(!p)return false;for(let l of p)if(l.name===e||l.name===o)return true;return false});if(a)return a}let n=Array.from(this.allowedFragments).find(o=>o.name===e||o.name===h.toPascalCase(e));if(n)return n;{let o=h.toPascalCase(e),a=Array.from(this.allowedFragments).find(_=>{let p=c.getAncestors(_);if(!p)return false;for(let l of p)if(l.name===e||l.name===o)return true;return false});if(a)return a}for(let o of this._imports){let a=o.resolveConstructor(e);if(a)return a}if(this._parent)return this._parent.resolveConstructor(e)}resolveAll(e){let t=new Set;this.resolveFlatAll(e).forEach(o=>t.add(o)),this._imports.forEach(o=>{o.has(e)&&o.resolveFlatAll(e).forEach(_=>t.add(_));});let n=this._parent;for(;n&&n.has(e);)n.resolveAll(e).forEach(a=>t.add(a)),n=n._parent;return Array.from(t)}resolveFlatAll(e){let t=[];switch(true){case i.isComponentConstructor(e):{this.allowedComponents.forEach(r=>{if(c.isIndexedInheritedFrom(r,e)){let n=this.resolveOnce(r);n&&t.push(n);}});break}case i.isFragmentConstructor(e):{this.allowedFragments.forEach(r=>{if(c.isIndexedInheritedFrom(r,e)){let n=this.resolveOnce(r);n&&t.push(n);}});break}case i.isEntityConstructor(e):{this.entities.forEach(r=>{c.isIndexedInheritedFrom(r.constructor,e)&&t.push(r);});break}case i.isString(e):{let r=this.resolveConstructor(e);if(!i.isComponentConstructor(r)&&!i.isEntityConstructor(r)&&!i.isFragmentConstructor(r))throw new E(E.ResolutionError,`Unable to resolve all instances for name: ${e} in scope ${this.name} as no matching component, entity or fragment constructor found`);if(r){let n=this.resolveAll(r);n&&t.push(...n);}break}default:throw new E(E.ResolutionError,`Invalid parameter provided to resolveAll method: ${e} in scope ${this.name}`)}return t}resolve(e){let t=i.isDependencyInstance(e)?e:new F(e);return this.resolveDependency(t)}resolveOnce(e){let t=this.resolveFlatOnce(e);if(!t){for(let r of this._imports)if(r.has(e)){let n=r.resolveFlatOnce(e);if(n)return n}}return !t&&this.parent?this.parent.resolveOnce(e):t}resolveFlat(e){return this.resolveFlatOnce(e)}resolveFlatOnce(e){let t,r=d.getComponentName(e);if(!(!e||!this.has(e))){switch(true){case i.isString(e):{t=this.resolveByName(e);break}case i.isConstructorAllowedForScopeAllocation(e):{t=this.resolveIssuer(e);break}case i.isScopeConstructor(e):{t=this.resolveScope(e);break}case i.isEntityConstructor(e):{t=this.resolveEntity(e);break}case i.isFragmentConstructor(e):{t=this.resolveFragment(e);break}case i.isComponentConstructor(e):{t=this.resolveComponent(e);break}case i.isErrorConstructor(e):{t=this.resolveError(e);break}default:throw new E(E.ResolutionError,`Injected Component ${r} not found in the scope`)}return t}}resolveByName(e){let t=Array.from(this.allowedComponents).find(a=>a.name===e||a.name===h.toPascalCase(e));if(t)return this.resolveOnce(t);let r=Array.from(this.allowedEntities).find(a=>a.name===e||a.name===h.toPascalCase(e)||a.entity===e||a.entity===h.toKebabCase(e));if(r)return this.resolveOnce(r);let n=Array.from(this.allowedFragments).find(a=>a.name===e||a.name===h.toPascalCase(e));if(n)return this.resolveOnce(n);let o=Array.from(this.allowedErrors).find(a=>a.name===e||a.name===h.toPascalCase(e)||a.code===e||a.code===h.toKebabCase(e));if(o)return this.resolveOnce(o)}resolveIssuer(e){let t=this.issuer();if(t&&(t.constructor===e||c.isIndexedInheritedFrom(t?.constructor,e)))return t}resolveEntity(e){return this.entities.find(t=>t instanceof e)}resolveError(e){return this.errors.find(t=>t instanceof e)}resolveFragment(e){let t=this._fragments.get(e);switch(true){case(t&&this._fragments.has(e)):return t;case !t:{let r=c.findDescendantIn(e,this._allowedFragments);return r?this.resolveFragment(r):void 0}default:return}}resolveScope(e){return this}resolveComponent(e){switch(true){case(this.allowedComponents.has(e)&&this._components.has(e)):return this._components.get(e);case(this.allowedComponents.has(e)&&!this._components.has(e)):{let n=(c.meta(e).get("a-component-injections")?.get("constructor")||[]).map(a=>this.resolve(a)),o=new e(...n);return this.register(o),this._components.get(e)}case !this.allowedComponents.has(e):{let t=c.findDescendantIn(e,this.allowedComponents);return t?this.resolveComponent(t):void 0}default:return}}register(e){switch(true){case e instanceof D:{this.allowedComponents.has(e.constructor)||this.allowedComponents.add(e.constructor),this._components.set(e.constructor,e),c.indexConstructor(e.constructor),c.register(this,e),this.bumpVersion();break}case(i.isEntityInstance(e)&&!this._entities.has(e.aseid.toString())):{this.allowedEntities.has(e.constructor)||this.allowedEntities.add(e.constructor),this._entities.set(e.aseid.toString(),e),c.indexConstructor(e.constructor),c.register(this,e),this.bumpVersion();break}case i.isFragmentInstance(e):{this.allowedFragments.has(e.constructor)||this.allowedFragments.add(e.constructor),this._fragments.set(e.constructor,e),c.indexConstructor(e.constructor),c.register(this,e),this.bumpVersion();break}case i.isErrorInstance(e):{this.allowedErrors.has(e.constructor)||this.allowedErrors.add(e.constructor),this._errors.set(e.code,e),c.indexConstructor(e.constructor),c.register(this,e),this.bumpVersion();break}case i.isComponentConstructor(e):{this.allowedComponents.has(e)||(this.allowedComponents.add(e),c.indexConstructor(e),this.bumpVersion());break}case i.isFragmentConstructor(e):{this.allowedFragments.has(e)||(this.allowedFragments.add(e),c.indexConstructor(e),this.bumpVersion());break}case i.isEntityConstructor(e):{this.allowedEntities.has(e)||(this.allowedEntities.add(e),c.indexConstructor(e),this.bumpVersion());break}case i.isErrorConstructor(e):{this.allowedErrors.has(e)||(this.allowedErrors.add(e),c.indexConstructor(e),this.bumpVersion());break}default:if(e instanceof M)throw new E(E.RegistrationError,`Entity with ASEID ${e.aseid.toString()} is already registered in the scope ${this.name}`);if(e instanceof L)throw new E(E.RegistrationError,`Fragment ${e.constructor.name} is already registered in the scope ${this.name}`);{let t=d.getComponentName(e);throw new E(E.RegistrationError,`Cannot register ${t} in the scope ${this.name}`)}}}deregister(e){switch(true){case e instanceof D:{this._components.delete(e.constructor),c.deregister(e);let r=e.constructor;this._components.has(r)||this.allowedComponents.delete(r),this.bumpVersion();break}case i.isEntityInstance(e):{this._entities.delete(e.aseid.toString()),c.deregister(e);let r=e.constructor;Array.from(this._entities.values()).some(o=>o instanceof r)||this.allowedEntities.delete(r),this.bumpVersion();break}case i.isFragmentInstance(e):{this._fragments.delete(e.constructor),c.deregister(e);let r=e.constructor;Array.from(this._fragments.values()).some(o=>o instanceof r)||this.allowedFragments.delete(r),this.bumpVersion();break}case i.isErrorInstance(e):{this._errors.delete(e.code),c.deregister(e);let r=e.constructor;Array.from(this._errors.values()).some(o=>o instanceof r)||this.allowedErrors.delete(r),this.bumpVersion();break}case i.isComponentConstructor(e):{this.allowedComponents.delete(e),this.bumpVersion();break}case i.isFragmentConstructor(e):{this.allowedFragments.delete(e),Array.from(this._fragments.entries()).forEach(([r,n])=>{c.isIndexedInheritedFrom(r,e)&&(this._fragments.delete(r),c.deregister(n));}),this.bumpVersion();break}case i.isEntityConstructor(e):{this.allowedEntities.delete(e),Array.from(this._entities.entries()).forEach(([r,n])=>{c.isIndexedInheritedFrom(n.constructor,e)&&(this._entities.delete(r),c.deregister(n));}),this.bumpVersion();break}case i.isErrorConstructor(e):{this.allowedErrors.delete(e),Array.from(this._errors.entries()).forEach(([r,n])=>{c.isIndexedInheritedFrom(n.constructor,e)&&(this._errors.delete(r),c.deregister(n));}),this.bumpVersion();break}default:let t=d.getComponentName(e);throw new E(E.DeregistrationError,`Cannot deregister ${t} from the scope ${this.name}`)}}toJSON(){return this.fragments.reduce((e,t)=>{let r=t.toJSON();return {...e,[r.name]:r}},{})}isAllowedComponent(e){return i.isComponentConstructor(e)&&this.allowedComponents.has(e)}isAllowedEntity(e){return i.isEntityConstructor(e)&&this.allowedEntities.has(e)}isAllowedFragment(e){return i.isFragmentConstructor(e)&&this.allowedFragments.has(e)}isAllowedError(e){return i.isErrorConstructor(e)&&this.allowedErrors.has(e)}isInheritedFrom(e){let t=this;for(;t;){if(t===e)return true;t=t._parent;}return false}checkCircularInheritance(e){let t=[],r=this._parent;for(;r;){if(t.push(r.name),r===e)return t;r=r._parent;}return false}printInheritanceChain(){let e=[],t=this;for(;t;)e.push(t.name),t=t._parent;console.log(e.join(" -> "));}};var E=class extends y{};E.InitializationError="A-Scope Initialization Error",E.ConstructorError="Unable to construct A-Scope instance",E.ResolutionError="A-Scope Resolution Error",E.RegistrationError="A-Scope Registration Error",E.CircularInheritanceError="A-Scope Circular Inheritance Error",E.CircularImportError="A-Scope Circular Import Error",E.DeregistrationError="A-Scope Deregistration Error";var u=class extends y{};u.NotAllowedForScopeAllocationError="Component is not allowed for scope allocation",u.ComponentAlreadyHasScopeAllocatedError="Component already has scope allocated",u.InvalidMetaParameterError="Invalid parameter provided to get meta",u.InvalidScopeParameterError="Invalid parameter provided to get scope",u.ScopeNotFoundError="Scope not found",u.InvalidFeatureParameterError="Invalid parameter provided to get feature",u.InvalidFeatureDefinitionParameterError="Invalid parameter provided to define feature",u.InvalidFeatureTemplateParameterError="Invalid parameter provided to get feature template",u.InvalidFeatureExtensionParameterError="Invalid parameter provided to extend feature",u.InvalidAbstractionParameterError="Invalid parameter provided to get abstraction",u.InvalidAbstractionDefinitionParameterError="Invalid parameter provided to define abstraction",u.InvalidAbstractionTemplateParameterError="Invalid parameter provided to get abstraction template",u.InvalidAbstractionExtensionParameterError="Invalid parameter provided to extend abstraction",u.InvalidInjectionParameterError="Invalid parameter provided to get injections",u.InvalidExtensionParameterError="Invalid parameter provided to get extensions",u.InvalidRegisterParameterError="Invalid parameter provided to register component",u.InvalidComponentParameterError="Invalid component provided",u.ComponentNotRegisteredError="Component not registered in the context",u.InvalidDeregisterParameterError="Invalid parameter provided to deregister component";var w=class w{constructor(){this._registry=new WeakMap;this._scopeIssuers=new WeakMap;this._scopeStorage=new WeakMap;this._metaStorage=new Map;this._metaVersion=0;this._featureCache=new Map;this._ancestors=new Map;this._descendants=new Map;this._globals=new Map;let e=String(k.A_CONCEPT_ROOT_SCOPE)||"root";this._root=new v({name:e});}static get concept(){return k.A_CONCEPT_NAME||"a-concept"}static get root(){return this.getInstance()._root}static get environment(){return k.A_CONCEPT_RUNTIME_ENVIRONMENT}static getInstance(){return w._instance||(w._instance=new w),w._instance}static register(e,t){let r=d.getComponentName(t),n=this.getInstance();if(!t)throw new u(u.InvalidRegisterParameterError,"Unable to register component. Component cannot be null or undefined.");if(!e)throw new u(u.InvalidRegisterParameterError,"Unable to register component. Scope cannot be null or undefined.");if(!this.isAllowedToBeRegistered(t))throw new u(u.NotAllowedForScopeAllocationError,`Component ${r} is not allowed for scope allocation.`);return n._scopeStorage.set(t,e),e}static deregister(e){if(!e)throw new u(u.InvalidDeregisterParameterError,"Unable to deregister component. Component cannot be null or undefined.");if(!this.getInstance()._scopeStorage.delete(e)){let r=d.getComponentName(e);throw new u(u.ComponentNotRegisteredError,`Unable to deregister component. Component ${r} is not registered.`)}}static allocate(e,t){let r=d.getComponentName(e);if(!this.isAllowedForScopeAllocation(e))throw new u(u.NotAllowedForScopeAllocationError,`Component of type ${r} is not allowed for scope allocation. Only A_Container, A_Feature are allowed.`);let n=this.getInstance();if(n._registry.has(e))throw new u(u.ComponentAlreadyHasScopeAllocatedError,`Component ${r} already has a scope allocated.`);let o=i.isScopeInstance(t)?t:new v(t||{name:r+"-scope"},t);return o.isInheritedFrom(w.root)||o.inherit(w.root),n._registry.set(e,o),n._scopeIssuers.set(o,e),o}static deallocate(e){let t=this.getInstance(),r=i.isScopeInstance(e)?e:t._registry.get(e);if(!r)return;let n=i.isComponentInstance(e)?e:this.issuer(r);n&&t._registry.delete(n),r&&t._scopeIssuers.delete(r);}static meta(e){let t=d.getComponentName(e),r=this.getInstance();if(!e)throw new u(u.InvalidMetaParameterError,"Invalid parameter provided to get meta. Parameter cannot be null or undefined.");if(!(this.isAllowedForMeta(e)||this.isAllowedForMetaConstructor(e)||i.isString(e)||i.isFunction(e)))throw new u(u.InvalidMetaParameterError,`Invalid parameter provided to get meta. Component of type ${t} is not allowed for meta storage. Only A_Container, A_Component and A_Entity are allowed.`);let n,o;switch(true){case i.isContainerInstance(e):{n=e.constructor,o=H;break}case i.isContainerConstructor(e):{n=e,o=H;break}case i.isComponentInstance(e):{n=e.constructor,o=R;break}case i.isComponentConstructor(e):{n=e,o=R;break}case i.isEntityInstance(e):{n=e.constructor,o=R;break}case i.isEntityConstructor(e):{n=e,o=B;break}case i.isFragmentInstance(e):{n=e.constructor,o=R;break}case i.isFragmentConstructor(e):{n=e,o=B;break}case typeof e=="string":{let a=Array.from(r._metaStorage).find(([_])=>_.name===e||_.name===h.toKebabCase(e)||_.name===h.toPascalCase(e));if(!(a&&a.length))throw new u(u.InvalidMetaParameterError,`Invalid parameter provided to get meta. Component with name ${e} not found in the meta storage.`);n=a[0],o=R;break}default:{n=e,o=A;break}}if(!r._metaStorage.has(n)){let a,_=n;for(;!a;){let p=Object.getPrototypeOf(_);if(!p)break;a=r._metaStorage.get(p),_=p;}a||(a=new o),r._metaStorage.set(n,a.clone()),r._metaVersion++,this.indexConstructor(n);}return r._metaStorage.get(n)}static setMeta(e,t){let r=w.getInstance(),n=w.meta(e),o=typeof e=="function"?e:e.constructor;r._metaStorage.set(o,n?t.from(n):t),r._metaVersion++;}static issuer(e){let t=this.getInstance();if(!e)throw new u(u.InvalidComponentParameterError,"Invalid parameter provided to get scope issuer. Parameter cannot be null or undefined.");return t._scopeIssuers.get(e)}static scope(e){let t=e?.constructor?.name||String(e),r=this.getInstance();if(!e)throw new u(u.InvalidScopeParameterError,"Invalid parameter provided to get scope. Parameter cannot be null or undefined.");if(!this.isAllowedForScopeAllocation(e)&&!this.isAllowedToBeRegistered(e))throw new u(u.InvalidScopeParameterError,`Invalid parameter provided to get scope. Component of type ${t} is not allowed for scope allocation.`);switch(true){case this.isAllowedToBeRegistered(e):if(!r._scopeStorage.has(e))throw new u(u.ScopeNotFoundError,`Invalid parameter provided to get scope. Component of type ${t} does not have a scope registered. Make sure to register the component using A_Context.register() method before trying to get the scope.`);return r._scopeStorage.get(e);case this.isAllowedForScopeAllocation(e):if(!r._registry.has(e))throw new u(u.ScopeNotFoundError,`Invalid parameter provided to get scope. Component of type ${t} does not have a scope allocated. Make sure to allocate a scope using A_Context.allocate() method before trying to get the scope.`);return r._registry.get(e);default:throw new u(u.InvalidScopeParameterError,`Invalid parameter provided to get scope. Component of type ${t} is not allowed to be registered.`)}}static featureTemplate(e,t,r=this.scope(t)){if(!t)throw new u(u.InvalidFeatureTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new u(u.InvalidFeatureTemplateParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!i.isAllowedForFeatureDefinition(t))throw new u(u.InvalidFeatureTemplateParameterError,`Unable to get feature template. Component of type ${d.getComponentName(t)} is not allowed for feature definition.`);let n=this.getInstance(),o=`${String(e)}::${d.getComponentName(t)}::s${r.fingerprint}::m${n._metaVersion}`,a=n._featureCache.get(o);if(a)return a;let _=[...this.featureDefinition(e,t),...this.featureExtensions(e,t,r)];return n._featureCache.size>=w.FEATURE_EXTENSIONS_CACHE_MAX_SIZE&&n._featureCache.clear(),n._featureCache.set(o,_),_}static featureExtensions(e,t,r){let n=this.getInstance();if(!t)throw new u(u.InvalidFeatureExtensionParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new u(u.InvalidFeatureExtensionParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!i.isAllowedForFeatureDefinition(t))throw new u(u.InvalidFeatureExtensionParameterError,`Unable to get feature template. Component of type ${d.getComponentName(t)} is not allowed for feature definition.`);let o=d.getClassInheritanceChain(t).filter(C=>C!==D&&C!==z&&C!==M).map(C=>`${C.name}.${e}`),a=new Map,_=new Set,p=new Map,l=new Map,f=C=>{let P=p.get(C);return P===void 0&&(P=d.getComponentName(C),p.set(C,P)),P},S=C=>{let P=l.get(C);return P||(P=new F(C),l.set(C,P)),P},x=[];for(let[C,P]of n._metaStorage)r.has(C)&&(i.isComponentMetaInstance(P)||i.isContainerMetaInstance(P))&&x.push([C,P]);for(let C of o)for(let[P,J]of x){_.add(P);let Z=J.extensions(C);for(let oe=0;oe<Z.length;oe++){let q=Z[oe],se=Array.from(_).reverse().find(N=>w.isIndexedInheritedFrom(P,N)&&N!==P);if(se&&a.delete(`${f(se)}.${q.handler}`),q.override){let N=new RegExp(q.override);for(let[W,ae]of a)(N.test(W)||N.test(ae.handler))&&a.delete(W);}a.set(`${f(P)}.${q.handler}`,{dependency:S(P),...q});}}return n.filterToMostDerived(r,Array.from(a.values()))}filterToMostDerived(e,t){if(t.length<=1)return t;let r=new Map,n=new Set;for(let _ of t){let p=_.dependency.name;r.has(p)||r.set(p,e.resolveConstructor(p)),n.add(p);}let o=new Set,a=new Map;for(let[_,p]of r)p&&a.set(p,_);for(let[_,p]of r){if(!p)continue;let l=w.getAncestors(p);if(l)for(let f of l){let S=a.get(f);S&&S!==_&&n.has(S)&&o.add(S);}}return t.filter(_=>!o.has(_.dependency.name))}static featureDefinition(e,t){let r;if(!e)throw new u(u.InvalidFeatureTemplateParameterError,"Unable to get feature template. Feature name cannot be null or undefined.");if(!t)throw new u(u.InvalidFeatureTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");switch(true){case t instanceof M:r="a-component-features";break;case t instanceof z:r="a-container-features";break;case t instanceof D:r="a-component-features";break;default:throw new u(u.InvalidFeatureTemplateParameterError,`A-Feature cannot be defined on the ${t} level`)}return [...this.meta(t)?.get(r)?.get(e)?.template||[]]}static abstractionTemplate(e,t){let r=d.getComponentName(t);if(!t)throw new u(u.InvalidAbstractionTemplateParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new u(u.InvalidAbstractionTemplateParameterError,"Unable to get feature template. Abstraction stage cannot be null or undefined.");if(!i.isAllowedForAbstractionDefinition(t))throw new u(u.InvalidAbstractionTemplateParameterError,`Unable to get feature template. Component of type ${r} is not allowed for feature definition.`);return [...this.abstractionExtensions(e,t)]}static abstractionExtensions(e,t){let r=this.getInstance(),n=d.getComponentName(t);if(!t)throw new u(u.InvalidAbstractionExtensionParameterError,"Unable to get feature template. Component cannot be null or undefined.");if(!e)throw new u(u.InvalidAbstractionExtensionParameterError,"Unable to get feature template. Abstraction stage cannot be null or undefined.");if(!i.isAllowedForAbstractionDefinition(t))throw new u(u.InvalidAbstractionExtensionParameterError,`Unable to get feature template. Component of type ${n} is not allowed for feature definition.`);let o=new Map,a=this.scope(t),_=new Set;for(let[p,l]of r._metaStorage)a.has(p)&&(i.isComponentMetaInstance(l)||i.isContainerMetaInstance(l))&&(_.add(p),l.abstractions(e).forEach(f=>{let S=Array.from(_).reverse().find(x=>w.isIndexedInheritedFrom(p,x)&&x!==p);S&&o.delete(`${d.getComponentName(S)}.${f.handler}`),o.set(`${d.getComponentName(p)}.${f.handler}`,{dependency:new F(p),...f});}));return r.filterToMostDerived(a,Array.from(o.values()))}static reset(){let e=w.getInstance();e._registry=new WeakMap,e._featureCache.clear(),e._ancestors.clear(),e._descendants.clear(),e._metaVersion++;let t=String(k.A_CONCEPT_ROOT_SCOPE)||"root";e._root=new v({name:t});}static indexConstructor(e){let t=this.getInstance();if(t._ancestors.has(e))return;let r=new Set,n=Object.getPrototypeOf(e);for(;n&&n!==Function.prototype&&n!==Object;){r.add(n);let o=t._descendants.get(n);o||(o=new Set,t._descendants.set(n,o)),o.add(e);let a=t._ancestors.get(n);if(a){for(let _ of a){r.add(_);let p=t._descendants.get(_);p||(p=new Set,t._descendants.set(_,p)),p.add(e);}break}n=Object.getPrototypeOf(n);}t._ancestors.set(e,r),t._descendants.has(e)||t._descendants.set(e,new Set);}static isIndexedInheritedFrom(e,t){if(e===t)return true;let n=this.getInstance()._ancestors.get(e);return n?n.has(t):d.isInheritedFrom(e,t)}static findDescendantIn(e,t){let r=t instanceof Set?t.size:t.length;if(t instanceof Set){if(t.has(e))return e}else if(t.includes(e))return e;let n=this.getInstance(),o=n._descendants.get(e),a=o?o.size:0;if(a===0){if(t instanceof Set)for(let _ of t){let p=n._ancestors.get(_);if(p&&p.has(e))return _}else for(let _ of t){let p=n._ancestors.get(_);if(p&&p.has(e))return _}return}if(r<=a)if(t instanceof Set)for(let _ of t){if(_===e)return _;let p=n._ancestors.get(_);if(p&&p.has(e))return _}else for(let _ of t){if(_===e)return _;let p=n._ancestors.get(_);if(p&&p.has(e))return _}else for(let _ of o)if(t instanceof Set){if(t.has(_))return _}else if(t.includes(_))return _}static getAncestors(e){return this.getInstance()._ancestors.get(e)}static isAllowedForScopeAllocation(e){return i.isContainerInstance(e)||i.isFeatureInstance(e)||i.isEntityInstance(e)}static isAllowedToBeRegistered(e){return i.isEntityInstance(e)||i.isComponentInstance(e)||i.isFragmentInstance(e)||i.isErrorInstance(e)}static isAllowedForMeta(e){return i.isContainerInstance(e)||i.isComponentInstance(e)||i.isEntityInstance(e)}static isAllowedForMetaConstructor(e){return i.isContainerConstructor(e)||i.isComponentConstructor(e)||i.isEntityConstructor(e)}};w.FEATURE_EXTENSIONS_CACHE_MAX_SIZE=1024;var c=w;var K=class extends y{};K.AbstractionExtensionError="Unable to extend abstraction execution";function ye(s,e={}){return function(t,r,n){let o=d.getComponentName(t);if(!s)throw new K(K.AbstractionExtensionError,`Abstraction name must be provided to extend abstraction for '${o}'.`);if(!i.isConstructorAvailableForAbstraction(t))throw new K(K.AbstractionExtensionError,`Unable to extend Abstraction '${s}' for '${o}'. Only A-Containers and A-Components can extend Abstractions.`);let a,_=c.meta(t);switch(true){case(i.isContainerConstructor(t)||i.isContainerInstance(t)):a="a-container-abstractions";break;case(i.isComponentConstructor(t)||i.isComponentInstance(t)):a="a-component-abstractions";break}let p=`CONCEPT_ABSTRACTION::${s}`,l=_.get(a)?new A().from(_.get(a)):new A,f=[...l.get(p)||[]],S=f.findIndex(j=>j.handler===r),x={name:p,handler:r,behavior:e.behavior||"sync",throwOnError:e.throwOnError!==void 0?e.throwOnError:true,before:i.isArray(e.before)?new RegExp(`^${e.before.join("|").replace(/\./g,"\\.")}$`).source:e.before instanceof RegExp?e.before.source:"",after:i.isArray(e.after)?new RegExp(`^${e.after.join("|").replace(/\./g,"\\.")}$`).source:e.after instanceof RegExp?e.after.source:"",override:i.isArray(e.override)?new RegExp(`^${e.override.join("|").replace(/\./g,"\\.")}$`).source:e.after instanceof RegExp?e.after.source:""};S!==-1?f[S]=x:f.push(x),l.set(p,f),c.meta(t).set(a,l);}}var b=class{constructor(e){this._features=[];this._index=0;this._name=e.name,this._features=e.containers.map(t=>{let r=c.abstractionTemplate(this._name,t);return new Y({name:this._name,component:t,template:r})}),this._current=this._features[0];}static get Extend(){return ye}get name(){return this._name}get feature(){return this._current}get isDone(){return !this.feature||this._index>=this._features.length}[Symbol.iterator](){return {next:()=>this.isDone?(this._current=void 0,{value:void 0,done:true}):(this._current=this._features[this._index],{value:this._current,done:false})}}next(e){if(this._index>=this._features.length)return;let t=this._features.indexOf(e);this._index=t+1;}async process(e){if(!this.isDone)for(let t of this._features)await t.process(e);}};var Ne=(_=>(_.Run="run",_.Build="build",_.Publish="publish",_.Deploy="deploy",_.Load="load",_.Start="start",_.Stop="stop",_))(Ne||{}),Oe=(e=>(e.LIFECYCLE="a-component-extensions",e))(Oe||{});var Ce=class{constructor(e){this.props=e;this._name=e.name||c.root.name,e.components&&e.components.length&&e.components.forEach(t=>this.scope.register(t)),e.fragments&&e.fragments.length&&e.fragments.forEach(t=>this.scope.register(t)),e.entities&&e.entities.length&&e.entities.forEach(t=>this.scope.register(t)),this._containers=e.containers||[];}static Load(e){return b.Extend("load",e)}static Publish(e){return b.Extend("publish")}static Deploy(e){return b.Extend("deploy",e)}static Build(e){return b.Extend("build",e)}static Run(e){return b.Extend("run",e)}static Start(e){return b.Extend("start",e)}static Stop(e){return b.Extend("stop",e)}get name(){return c.root.name}get scope(){return c.root}get register(){return this.scope.register.bind(this.scope)}get resolve(){return this.scope.resolve.bind(this.scope)}async load(e){await new b({name:"load",containers:this._containers}).process(e);}async run(e){await new b({name:"run",containers:this._containers}).process(e);}async start(e){await new b({name:"start",containers:this._containers}).process(e);}async stop(e){await new b({name:"stop",containers:this._containers}).process(e);}async build(e){await new b({name:"build",containers:this._containers}).process(e);}async deploy(e){await new b({name:"deploy",containers:this._containers}).process(e);}async publish(e){await new b({name:"publish",containers:this._containers}).process(e);}async call(e,t){return await new Y({name:e,component:t}).process()}};var Pe=class extends A{constructor(t){super();this.containers=t;}};var $=class extends y{};$.InvalidInjectionTarget="Invalid target for A-Inject decorator",$.MissingInjectionTarget="Missing target for A-Inject decorator";function Me(s,e){if(!s)throw new $($.MissingInjectionTarget,"A-Inject decorator is missing the target to inject");return function(t,r,n){let o=d.getComponentName(t);if(!i.isTargetAvailableForInjection(t))throw new $($.InvalidInjectionTarget,`A-Inject cannot be used on the target of type ${typeof t} (${o})`);let a=r?String(r):"constructor",_;switch(true){case(i.isComponentConstructor(t)||i.isComponentInstance(t)):_="a-component-injections";break;case i.isContainerInstance(t):_="a-container-injections";break;case i.isEntityInstance(t):_="a-component-injections";break}let p=c.meta(t).get(_)||new A,l=p.get(a)||[];l[n]=s instanceof F?s:new F(s,e),p.set(a,l),c.meta(t).set(_,p);}}
|
|
2
|
+
export{I as ASEID,b as A_Abstraction,K as A_AbstractionError,ye as A_Abstraction_Extend,g as A_BasicTypeGuards,k as A_CONCEPT_ENV,re as A_CONSTANTS__DEFAULT_ENV_VARIABLES,pe as A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY,te as A_CONSTANTS__ERROR_CODES,Ye as A_CONSTANTS__ERROR_DESCRIPTION,G as A_Caller,Q as A_CallerError,d as A_CommonHelper,D as A_Component,R as A_ComponentMeta,Ce as A_Concept,Pe as A_ConceptMeta,z as A_Container,H as A_ContainerMeta,c as A_Context,u as A_ContextError,F as A_Dependency,T as A_DependencyError,fe as A_Dependency_All,de as A_Dependency_Default,le as A_Dependency_Flat,Ae as A_Dependency_Load,me as A_Dependency_Parent,Te as A_Dependency_Query,Ee as A_Dependency_Require,M as A_Entity,X as A_EntityError,B as A_EntityMeta,y as A_Error,Y as A_Feature,m as A_FeatureError,Se as A_Feature_Define,he as A_Feature_Extend,h as A_FormatterHelper,L as A_Fragment,V as A_IdentityHelper,Me as A_Inject,$ as A_InjectError,A as A_Meta,ue as A_MetaDecorator,v as A_Scope,E as A_ScopeError,ie as A_Stage,U as A_StageError,ee as A_StepManagerError,ne as A_StepsManager,ve as A_TYPES__A_Stage_Status,ge as A_TYPES__ComponentMetaKey,Ne as A_TYPES__ConceptAbstractions,Oe as A_TYPES__ConceptMetaKey,xe as A_TYPES__ContainerMetaKey,ce as A_TYPES__EntityFeatures,we as A_TYPES__EntityMetaKey,Fe as A_TYPES__FeatureState,i as A_TypeGuards};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|