@elyx-code/project-logic-tree 0.0.6461 → 0.0.6462
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2036 -2036
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -196,7 +196,7 @@ ${Yn({describe_entity:y.error.id})}`}))),{errors:p,modifiedData:o}}validateGener
|
|
|
196
196
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(u){return u instanceof this?u:new this(u)}static concat(u,...i){const a=new this(u);return i.forEach(o=>a.set(o)),a}static accessor(u){const a=(this[DF]=this[DF]={accessors:{}}).accessors,o=this.prototype;function p(e){const y=Up(e);a[y]||(KEe(o,e),a[y]=!0)}return Te.isArray(u)?u.forEach(p):p(u),this}}Ky.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Te.reduceDescriptors(Ky.prototype,({value:d},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>d,set(a){this[i]=a}}}),Te.freezeMethods(Ky);const Tn=Ky;function vA(d,u){const i=this||yA,a=u||i,o=Tn.from(a.headers);let p=a.data;return Te.forEach(d,function(y){p=y.call(i,p,o.normalize(),u?u.status:void 0)}),o.normalize(),p}function OF(d){return!!(d&&d.__CANCEL__)}function Ld(d,u,i){Ot.call(this,d??"canceled",Ot.ERR_CANCELED,u,i),this.name="CanceledError"}Te.inherits(Ld,Ot,{__CANCEL__:!0});function CF(d,u,i){const a=i.config.validateStatus;!i.status||!a||a(i.status)?d(i):u(new Ot("Request failed with status code "+i.status,[Ot.ERR_BAD_REQUEST,Ot.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function kEe(d){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(d);return u&&u[1]||""}function qEe(d,u){d=d||10;const i=new Array(d),a=new Array(d);let o=0,p=0,e;return u=u!==void 0?u:1e3,function(v){const E=Date.now(),w=a[p];e||(e=E),i[o]=v,a[o]=E;let A=p,P=0;for(;A!==o;)P+=i[A++],A=A%d;if(o=(o+1)%d,o===p&&(p=(p+1)%d),E-e<u)return;const V=w&&E-w;return V?Math.round(P*1e3/V):void 0}}function ZEe(d,u){let i=0,a=1e3/u,o,p;const e=(E,w=Date.now())=>{i=w,o=null,p&&(clearTimeout(p),p=null),d.apply(null,E)};return[(...E)=>{const w=Date.now(),A=w-i;A>=a?e(E,w):(o=E,p||(p=setTimeout(()=>{p=null,e(o)},a-A)))},()=>o&&e(o)]}const ky=(d,u,i=3)=>{let a=0;const o=qEe(50,250);return ZEe(p=>{const e=p.loaded,y=p.lengthComputable?p.total:void 0,v=e-a,E=o(v),w=e<=y;a=e;const A={loaded:e,total:y,progress:y?e/y:void 0,bytes:v,rate:E||void 0,estimated:E&&y&&w?(y-e)/E:void 0,event:p,lengthComputable:y!=null,[u?"download":"upload"]:!0};d(A)},i)},$F=(d,u)=>{const i=d!=null;return[a=>u[0]({lengthComputable:i,total:d,loaded:a}),u[1]]},PF=d=>(...u)=>Te.asap(()=>d(...u)),HEe=Si.hasStandardBrowserEnv?((d,u)=>i=>(i=new URL(i,Si.origin),d.protocol===i.protocol&&d.host===i.host&&(u||d.port===i.port)))(new URL(Si.origin),Si.navigator&&/(msie|trident)/i.test(Si.navigator.userAgent)):()=>!0,WEe=Si.hasStandardBrowserEnv?{write(d,u,i,a,o,p){const e=[d+"="+encodeURIComponent(u)];Te.isNumber(i)&&e.push("expires="+new Date(i).toGMTString()),Te.isString(a)&&e.push("path="+a),Te.isString(o)&&e.push("domain="+o),p===!0&&e.push("secure"),document.cookie=e.join("; ")},read(d){const u=document.cookie.match(new RegExp("(^|;\\s*)("+d+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove(d){this.write(d,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function JEe(d){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(d)}function YEe(d,u){return u?d.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):d}function NF(d,u,i){let a=!JEe(u);return d&&(a||i==!1)?YEe(d,u):u}const VF=d=>d instanceof Tn?{...d}:d;function fl(d,u){u=u||{};const i={};function a(E,w,A,P){return Te.isPlainObject(E)&&Te.isPlainObject(w)?Te.merge.call({caseless:P},E,w):Te.isPlainObject(w)?Te.merge({},w):Te.isArray(w)?w.slice():w}function o(E,w,A,P){if(Te.isUndefined(w)){if(!Te.isUndefined(E))return a(void 0,E,A,P)}else return a(E,w,A,P)}function p(E,w){if(!Te.isUndefined(w))return a(void 0,w)}function e(E,w){if(Te.isUndefined(w)){if(!Te.isUndefined(E))return a(void 0,E)}else return a(void 0,w)}function y(E,w,A){if(A in u)return a(E,w);if(A in d)return a(void 0,E)}const v={url:p,method:p,data:p,baseURL:e,transformRequest:e,transformResponse:e,paramsSerializer:e,timeout:e,timeoutMessage:e,withCredentials:e,withXSRFToken:e,adapter:e,responseType:e,xsrfCookieName:e,xsrfHeaderName:e,onUploadProgress:e,onDownloadProgress:e,decompress:e,maxContentLength:e,maxBodyLength:e,beforeRedirect:e,transport:e,httpAgent:e,httpsAgent:e,cancelToken:e,socketPath:e,responseEncoding:e,validateStatus:y,headers:(E,w,A)=>o(VF(E),VF(w),A,!0)};return Te.forEach(Object.keys(Object.assign({},d,u)),function(w){const A=v[w]||o,P=A(d[w],u[w],w);Te.isUndefined(P)&&A!==y||(i[w]=P)}),i}const LF=d=>{const u=fl({},d);let{data:i,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:p,headers:e,auth:y}=u;u.headers=e=Tn.from(e),u.url=wF(NF(u.baseURL,u.url,u.allowAbsoluteUrls),d.params,d.paramsSerializer),y&&e.set("Authorization","Basic "+btoa((y.username||"")+":"+(y.password?unescape(encodeURIComponent(y.password)):"")));let v;if(Te.isFormData(i)){if(Si.hasStandardBrowserEnv||Si.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if((v=e.getContentType())!==!1){const[E,...w]=v?v.split(";").map(A=>A.trim()).filter(Boolean):[];e.setContentType([E||"multipart/form-data",...w].join("; "))}}if(Si.hasStandardBrowserEnv&&(a&&Te.isFunction(a)&&(a=a(u)),a||a!==!1&&HEe(u.url))){const E=o&&p&&WEe.read(p);E&&e.set(o,E)}return u},zEe=typeof XMLHttpRequest<"u"&&function(d){return new Promise(function(i,a){const o=LF(d);let p=o.data;const e=Tn.from(o.headers).normalize();let{responseType:y,onUploadProgress:v,onDownloadProgress:E}=o,w,A,P,V,U;function F(){V&&V(),U&&U(),o.cancelToken&&o.cancelToken.unsubscribe(w),o.signal&&o.signal.removeEventListener("abort",w)}let K=new XMLHttpRequest;K.open(o.method.toUpperCase(),o.url,!0),K.timeout=o.timeout;function q(){if(!K)return;const W=Tn.from("getAllResponseHeaders"in K&&K.getAllResponseHeaders()),X={data:!y||y==="text"||y==="json"?K.responseText:K.response,status:K.status,statusText:K.statusText,headers:W,config:d,request:K};CF(function(z){i(z),F()},function(z){a(z),F()},X),K=null}"onloadend"in K?K.onloadend=q:K.onreadystatechange=function(){!K||K.readyState!==4||K.status===0&&!(K.responseURL&&K.responseURL.indexOf("file:")===0)||setTimeout(q)},K.onabort=function(){K&&(a(new Ot("Request aborted",Ot.ECONNABORTED,d,K)),K=null)},K.onerror=function(){a(new Ot("Network Error",Ot.ERR_NETWORK,d,K)),K=null},K.ontimeout=function(){let de=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const X=o.transitional||_F;o.timeoutErrorMessage&&(de=o.timeoutErrorMessage),a(new Ot(de,X.clarifyTimeoutError?Ot.ETIMEDOUT:Ot.ECONNABORTED,d,K)),K=null},p===void 0&&e.setContentType(null),"setRequestHeader"in K&&Te.forEach(e.toJSON(),function(de,X){K.setRequestHeader(X,de)}),Te.isUndefined(o.withCredentials)||(K.withCredentials=!!o.withCredentials),y&&y!=="json"&&(K.responseType=o.responseType),E&&([P,U]=ky(E,!0),K.addEventListener("progress",P)),v&&K.upload&&([A,V]=ky(v),K.upload.addEventListener("progress",A),K.upload.addEventListener("loadend",V)),(o.cancelToken||o.signal)&&(w=W=>{K&&(a(!W||W.type?new Ld(null,d,K):W),K.abort(),K=null)},o.cancelToken&&o.cancelToken.subscribe(w),o.signal&&(o.signal.aborted?w():o.signal.addEventListener("abort",w)));const ne=kEe(o.url);if(ne&&Si.protocols.indexOf(ne)===-1){a(new Ot("Unsupported protocol "+ne+":",Ot.ERR_BAD_REQUEST,d));return}K.send(p||null)})},XEe=(d,u)=>{const{length:i}=d=d?d.filter(Boolean):[];if(u||i){let a=new AbortController,o;const p=function(E){if(!o){o=!0,y();const w=E instanceof Error?E:this.reason;a.abort(w instanceof Ot?w:new Ld(w instanceof Error?w.message:w))}};let e=u&&setTimeout(()=>{e=null,p(new Ot(`timeout ${u} of ms exceeded`,Ot.ETIMEDOUT))},u);const y=()=>{d&&(e&&clearTimeout(e),e=null,d.forEach(E=>{E.unsubscribe?E.unsubscribe(p):E.removeEventListener("abort",p)}),d=null)};d.forEach(E=>E.addEventListener("abort",p));const{signal:v}=a;return v.unsubscribe=()=>Te.asap(y),v}},QEe=function*(d,u){let i=d.byteLength;if(!u||i<u){yield d;return}let a=0,o;for(;a<i;)o=a+u,yield d.slice(a,o),a=o},eTe=async function*(d,u){for await(const i of tTe(d))yield*QEe(i,u)},tTe=async function*(d){if(d[Symbol.asyncIterator]){yield*d;return}const u=d.getReader();try{for(;;){const{done:i,value:a}=await u.read();if(i)break;yield a}}finally{await u.cancel()}},MF=(d,u,i,a)=>{const o=eTe(d,u);let p=0,e,y=v=>{e||(e=!0,a&&a(v))};return new ReadableStream({async pull(v){try{const{done:E,value:w}=await o.next();if(E){y(),v.close();return}let A=w.byteLength;if(i){let P=p+=A;i(P)}v.enqueue(new Uint8Array(w))}catch(E){throw y(E),E}},cancel(v){return y(v),o.return()}},{highWaterMark:2})},qy=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",BF=qy&&typeof ReadableStream=="function",rTe=qy&&(typeof TextEncoder=="function"?(d=>u=>d.encode(u))(new TextEncoder):async d=>new Uint8Array(await new Response(d).arrayBuffer())),UF=(d,...u)=>{try{return!!d(...u)}catch{return!1}},iTe=BF&&UF(()=>{let d=!1;const u=new Request(Si.origin,{body:new ReadableStream,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!u}),xF=64*1024,EA=BF&&UF(()=>Te.isReadableStream(new Response("").body)),Zy={stream:EA&&(d=>d.body)};qy&&(d=>{["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!Zy[u]&&(Zy[u]=Te.isFunction(d[u])?i=>i[u]():(i,a)=>{throw new Ot(`Response type '${u}' is not supported`,Ot.ERR_NOT_SUPPORT,a)})})})(new Response);const sTe=async d=>{if(d==null)return 0;if(Te.isBlob(d))return d.size;if(Te.isSpecCompliantForm(d))return(await new Request(Si.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(Te.isArrayBufferView(d)||Te.isArrayBuffer(d))return d.byteLength;if(Te.isURLSearchParams(d)&&(d=d+""),Te.isString(d))return(await rTe(d)).byteLength},nTe=async(d,u)=>{const i=Te.toFiniteNumber(d.getContentLength());return i??sTe(u)},TA={http:_Ee,xhr:zEe,fetch:qy&&(async d=>{let{url:u,method:i,data:a,signal:o,cancelToken:p,timeout:e,onDownloadProgress:y,onUploadProgress:v,responseType:E,headers:w,withCredentials:A="same-origin",fetchOptions:P}=LF(d);E=E?(E+"").toLowerCase():"text";let V=XEe([o,p&&p.toAbortSignal()],e),U;const F=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let K;try{if(v&&iTe&&i!=="get"&&i!=="head"&&(K=await nTe(w,a))!==0){let X=new Request(u,{method:"POST",body:a,duplex:"half"}),ce;if(Te.isFormData(a)&&(ce=X.headers.get("content-type"))&&w.setContentType(ce),X.body){const[z,Y]=$F(K,ky(PF(v)));a=MF(X.body,xF,z,Y)}}Te.isString(A)||(A=A?"include":"omit");const q="credentials"in Request.prototype;U=new Request(u,{...P,signal:V,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:q?A:void 0});let ne=await fetch(U);const W=EA&&(E==="stream"||E==="response");if(EA&&(y||W&&F)){const X={};["status","statusText","headers"].forEach(pe=>{X[pe]=ne[pe]});const ce=Te.toFiniteNumber(ne.headers.get("content-length")),[z,Y]=y&&$F(ce,ky(PF(y),!0))||[];ne=new Response(MF(ne.body,xF,z,()=>{Y&&Y(),F&&F()}),X)}E=E||"text";let de=await Zy[Te.findKey(Zy,E)||"text"](ne,d);return!W&&F&&F(),await new Promise((X,ce)=>{CF(X,ce,{data:de,headers:Tn.from(ne.headers),status:ne.status,statusText:ne.statusText,config:d,request:U})})}catch(q){throw F&&F(),q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new Ot("Network Error",Ot.ERR_NETWORK,d,U),{cause:q.cause||q}):Ot.from(q,q&&q.code,d,U)}})};Te.forEach(TA,(d,u)=>{if(d){try{Object.defineProperty(d,"name",{value:u})}catch{}Object.defineProperty(d,"adapterName",{value:u})}});const jF=d=>`- ${d}`,aTe=d=>Te.isFunction(d)||d===null||d===!1,GF={getAdapter:d=>{d=Te.isArray(d)?d:[d];const{length:u}=d;let i,a;const o={};for(let p=0;p<u;p++){i=d[p];let e;if(a=i,!aTe(i)&&(a=TA[(e=String(i)).toLowerCase()],a===void 0))throw new Ot(`Unknown adapter '${e}'`);if(a)break;o[e||"#"+p]=a}if(!a){const p=Object.entries(o).map(([y,v])=>`adapter ${y} `+(v===!1?"is not supported by the environment":"is not available in the build"));let e=u?p.length>1?`since :
|
|
197
197
|
`+p.map(jF).join(`
|
|
198
198
|
`):" "+jF(p[0]):"as no adapter specified";throw new Ot("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return a},adapters:TA};function IA(d){if(d.cancelToken&&d.cancelToken.throwIfRequested(),d.signal&&d.signal.aborted)throw new Ld(null,d)}function FF(d){return IA(d),d.headers=Tn.from(d.headers),d.data=vA.call(d,d.transformRequest),["post","put","patch"].indexOf(d.method)!==-1&&d.headers.setContentType("application/x-www-form-urlencoded",!1),GF.getAdapter(d.adapter||yA.adapter)(d).then(function(a){return IA(d),a.data=vA.call(d,d.transformResponse,a),a.headers=Tn.from(a.headers),a},function(a){return OF(a)||(IA(d),a&&a.response&&(a.response.data=vA.call(d,d.transformResponse,a.response),a.response.headers=Tn.from(a.response.headers))),Promise.reject(a)})}const SF="1.9.0",Hy={};["object","boolean","number","function","string","symbol"].forEach((d,u)=>{Hy[d]=function(a){return typeof a===d||"a"+(u<1?"n ":" ")+d}});const KF={};Hy.transitional=function(u,i,a){function o(p,e){return"[Axios v"+SF+"] Transitional option '"+p+"'"+e+(a?". "+a:"")}return(p,e,y)=>{if(u===!1)throw new Ot(o(e," has been removed"+(i?" in "+i:"")),Ot.ERR_DEPRECATED);return i&&!KF[e]&&(KF[e]=!0,console.warn(o(e," has been deprecated since v"+i+" and will be removed in the near future"))),u?u(p,e,y):!0}},Hy.spelling=function(u){return(i,a)=>(console.warn(`${a} is likely a misspelling of ${u}`),!0)};function oTe(d,u,i){if(typeof d!="object")throw new Ot("options must be an object",Ot.ERR_BAD_OPTION_VALUE);const a=Object.keys(d);let o=a.length;for(;o-- >0;){const p=a[o],e=u[p];if(e){const y=d[p],v=y===void 0||e(y,p,d);if(v!==!0)throw new Ot("option "+p+" must be "+v,Ot.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Ot("Unknown option "+p,Ot.ERR_BAD_OPTION)}}const Wy={assertOptions:oTe,validators:Hy},Jn=Wy.validators;class Jy{constructor(u){this.defaults=u||{},this.interceptors={request:new RF,response:new RF}}async request(u,i){try{return await this._request(u,i)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const p=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?p&&!String(a.stack).endsWith(p.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
199
|
-
`+p):a.stack=p}catch{}}throw a}}_request(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=fl(this.defaults,i);const{transitional:a,paramsSerializer:o,headers:p}=i;a!==void 0&&Wy.assertOptions(a,{silentJSONParsing:Jn.transitional(Jn.boolean),forcedJSONParsing:Jn.transitional(Jn.boolean),clarifyTimeoutError:Jn.transitional(Jn.boolean)},!1),o!=null&&(Te.isFunction(o)?i.paramsSerializer={serialize:o}:Wy.assertOptions(o,{encode:Jn.function,serialize:Jn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Wy.assertOptions(i,{baseUrl:Jn.spelling("baseURL"),withXsrfToken:Jn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=p&&Te.merge(p.common,p[i.method]);p&&Te.forEach(["delete","get","head","post","put","patch","common"],U=>{delete p[U]}),i.headers=Tn.concat(e,p);const y=[];let v=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(i)===!1||(v=v&&F.synchronous,y.unshift(F.fulfilled,F.rejected))});const E=[];this.interceptors.response.forEach(function(F){E.push(F.fulfilled,F.rejected)});let w,A=0,P;if(!v){const U=[FF.bind(this),void 0];for(U.unshift.apply(U,y),U.push.apply(U,E),P=U.length,w=Promise.resolve(i);A<P;)w=w.then(U[A++],U[A++]);return w}P=y.length;let V=i;for(A=0;A<P;){const U=y[A++],F=y[A++];try{V=U(V)}catch(K){F.call(this,K);break}}try{w=FF.call(this,V)}catch(U){return Promise.reject(U)}for(A=0,P=E.length;A<P;)w=w.then(E[A++],E[A++]);return w}getUri(u){u=fl(this.defaults,u);const i=NF(u.baseURL,u.url,u.allowAbsoluteUrls);return wF(i,u.params,u.paramsSerializer)}}Te.forEach(["delete","get","head","options"],function(u){Jy.prototype[u]=function(i,a){return this.request(fl(a||{},{method:u,url:i,data:(a||{}).data}))}}),Te.forEach(["post","put","patch"],function(u){function i(a){return function(p,e,y){return this.request(fl(y||{},{method:u,headers:a?{"Content-Type":"multipart/form-data"}:{},url:p,data:e}))}}Jy.prototype[u]=i(),Jy.prototype[u+"Form"]=i(!0)});const Yy=Jy;class AA{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(p){i=p});const a=this;this.promise.then(o=>{if(!a._listeners)return;let p=a._listeners.length;for(;p-- >0;)a._listeners[p](o);a._listeners=null}),this.promise.then=o=>{let p;const e=new Promise(y=>{a.subscribe(y),p=y}).then(o);return e.cancel=function(){a.unsubscribe(p)},e},u(function(p,e,y){a.reason||(a.reason=new Ld(p,e,y),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=a=>{u.abort(a)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new AA(function(o){u=o}),cancel:u}}}const lTe=AA;function dTe(d){return function(i){return d.apply(null,i)}}function uTe(d){return Te.isObject(d)&&d.isAxiosError===!0}const bA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bA).forEach(([d,u])=>{bA[u]=d});const cTe=bA;function kF(d){const u=new Yy(d),i=lF(Yy.prototype.request,u);return Te.extend(i,Yy.prototype,u,{allOwnKeys:!0}),Te.extend(i,u,null,{allOwnKeys:!0}),i.create=function(o){return kF(fl(d,o))},i}const ui=kF(yA);ui.Axios=Yy,ui.CanceledError=Ld,ui.CancelToken=lTe,ui.isCancel=OF,ui.VERSION=SF,ui.toFormData=Fy,ui.AxiosError=Ot,ui.Cancel=ui.CanceledError,ui.all=function(u){return Promise.all(u)},ui.spread=dTe,ui.isAxiosError=uTe,ui.mergeConfig=fl,ui.AxiosHeaders=Tn,ui.formToJSON=d=>gF(Te.isHTMLForm(d)?new FormData(d):d),ui.getAdapter=GF.getAdapter,ui.HttpStatusCode=cTe,ui.default=ui;const pTe=ui;class qF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Addition);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const e=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)}).reduce((y,v)=>y+v,0);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class ZF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Subtraction);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o,y=p-e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class HF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Multiplication);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const e=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)}).reduce((y,v)=>y*v,1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class WF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Division);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o;if(e===0)throw new Error("Division by zero is not allowed");const y=p/e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class JF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Remainder);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o;if(e===0)throw new Error("Division by zero is not allowed");const y=p%e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class YF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Exponentiation);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o,y=Math.pow(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class zF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomInteger);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=Mve(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class XF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomFloat);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=sF();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class QF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomHexadecimal);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=nF(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class e6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomBase62);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=aF(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class t6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomBase64);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=Uve(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class r6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomAlphanumeric);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=xve(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class i6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateIdentifier);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=oF(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class s6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomUUIDv4);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=cl();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class n6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{Me.log("Initializing Random Generate Short Identifier Module");const a=i.find(o=>o.contextType===be.Logic);if(a){Me.log("Project state found, setting up operation");const o=a.get(_e.GenerateShortIdentifier);o?(Me.log("Operation found, setting autoexecutable and implementation"),o.autoexecutable=!0,o.implementation=this.module.main):Me.warn("Operation generate-short-identifier not found in project state")}else Me.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,a)=>{try{const o=jve();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class a6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateHexadecimalToken);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=Gve();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class o6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Join);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],y=o.slice(1).join(p);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class l6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT,version:"1.0.0",description:"String split operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Split);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=p.split(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class d6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST,version:"1.0.0",description:"String delete last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.slice(0,-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class u6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST,version:"1.0.0",description:"String delete first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.slice(1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class c6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Reverse);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.split("").reverse().join("");return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class p6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ToLowerCase);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.toLowerCase();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class f6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ToUpperCase);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.toUpperCase();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class h6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const y=p.slice(0,e)+p.slice(e+1);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class y6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.AddIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=p.slice(0,e)+y+p.slice(e);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class m6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.replace(e,y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class v6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.lastIndexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=p.slice(0,v)+p.slice(v).replace(e,y);return{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class E6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=p.slice(0,e)+y+p.slice(e+1);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class T6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_SINGLE_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceSingleMatch);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.replace(e,y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class I6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceAllMatches);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.split(e).join(y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class A6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetIndexItem);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.charAt(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class b6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST,version:"1.0.0",description:"String get first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.charAt(0);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class w6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST,version:"1.0.0",description:"String get last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.charAt(p.length-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class R6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetIndexOf);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.indexOf(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class _6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Append);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p+e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class g6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Prepend);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=e+p;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class D6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Join);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=p.join(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class O6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Split);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.split(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class C6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Reverse);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice().reverse();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class $6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.DeleteLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice(0,-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class P6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.DeleteFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice(1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class N6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.AddIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=[...p.slice(0,e),y,...p.slice(e)];return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class V6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=[...p];return v[e]=y,{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class L6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const v=p.indexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=[...p];return E[v]=y,{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class M6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const v=p.lastIndexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=[...p];return E[v]=y,{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class B6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetIndexItem);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const y=p[e];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class U6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p[0];return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class x6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p[p.length-1];return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class j6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Append);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=[...p,e];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class G6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Prepend);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=[e,...p];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class F6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_PARALLEL,version:"1.0.0",description:"Execution parallel operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Parallel);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(A=>{var P,V;return((P=A.value)==null?void 0:P.valueAsType)||((V=A.value)==null?void 0:V.value)})[0];if(!p)return{value:oe.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(p))return{value:oe.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const y=this.extensionsRegistry.requestContexts(this,[be.Editor])[0],E=p.map(A=>{const P=new In(y.logic,[A],A,null,this.extensionsRegistry);return P.inheritValuesFromContext(y),P}).map(A=>A.execute()),w=await Promise.all(E);return{value:oe.Success,error:null,results:[w]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class S6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SEQUENTIAL,version:"1.0.0",description:"Execution sequential operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Sequential);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p)return{value:oe.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(p))return{value:oe.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const e=[];for(let y=0;y<p.length;y++){const v=p[y],w=this.extensionsRegistry.requestContexts(this,[be.Editor])[0],A=new In(w.logic,[v],v,null,this.extensionsRegistry);A.inheritValuesFromContext(w);const P=await A.execute();e.push(P)}return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class K6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Wait);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(e=>{var y,v;return((y=e.value)==null?void 0:y.valueAsType)||((v=e.value)==null?void 0:v.value)})[0];return typeof p!="number"||p<0?{value:oe.Error,error:"Invalid wait time provided",results:[]}:(await new Promise(e=>setTimeout(e,p)),{value:oe.Success,error:null,results:[]})}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class k6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CREATE_NEW_INSTANCE,version:"1.0.0",description:"Entity create new instance operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(cr.CreateNewInstance);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0];if(!p)return{value:oe.Error,error:"No entity template provided",results:[]};if(!(p instanceof Qn))return{value:oe.Error,error:"Invalid entity template value provided",results:[]};const e=o[1]||{},v=Vi(p).map(w=>w.name);let E=e;if(v.includes(Le.PERSISTED_ENTITY)){const w=p.properties.find(P=>{var V;return((V=P.implements)==null?void 0:V.id)===he["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id});if(!w)return{value:oe.Error,error:"No database property found in entity",results:[]};if(!w.getDefaultValue())return{value:oe.Error,error:"Database property has no database as entity as default value",results:[]}}return{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class q6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(cr.Validate);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)});Me.log("Inputs for entity validation: ",o);const e=JE(o[1]).safeParse(o[0]);return e.success?{value:oe.Success,error:null,results:[o[0]]}:{value:oe.Error,error:e.error.errors,results:[]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class Z6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(yi.HttpRequest);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[3]||{},e={method:o[0],url:o[1],params:o[2],headers:p,data:o[4]};Me.log("Axios request config: ",e);const y=await pTe(e);return{value:oe.Success,error:null,results:[y.status,y.headers,y.data]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class wA extends nA{constructor(u,i,a=i.projectId){super(u,be.Editor),this._editor=i,this.id=a}get ready(){return this._editor.ready}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get branch(){return this._editor.branch}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(u){this._editor.undoableStackValueIndex=u}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}removeValueByOwnerId(u){return this._editor.removeValueByOwnerId(u)}removeValue(u){return this._editor.removeValue(u)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(u,i){return this._editor.initTest(u,i)}removeTest(){return this._editor.removeTest()}async copyEntities(u){return this._editor.copyEntities(u)}resolveInitialChildrenPositions(u,i,a){return this._editor.resolveInitialChildrenPositions(u,i,a)}publish(){return this._editor.publish()}loadActivePublication(u){return this._editor.loadActivePublication(u)}requestActiveDynamicValue(u){return this._editor.requestActiveDynamicValue(u)}}function fTe(d,u){return u instanceof wA?u:new wA(d,u)}function hTe(d){d.register(new iF(d)),d.register(new rF(d)),d.register(new XG(d)),d.register(new eF(d)),d.register(new tF(d)),d.register(new QG(d)),d.register(new qF(d)),d.register(new ZF(d)),d.register(new HF(d)),d.register(new JF(d)),d.register(new WF(d)),d.register(new YF(d)),d.register(new zF(d)),d.register(new XF(d)),d.register(new QF(d)),d.register(new e6(d)),d.register(new t6(d)),d.register(new r6(d)),d.register(new i6(d)),d.register(new s6(d)),d.register(new n6(d)),d.register(new a6(d)),d.register(new o6(d)),d.register(new l6(d)),d.register(new d6(d)),d.register(new u6(d)),d.register(new c6(d)),d.register(new p6(d)),d.register(new f6(d)),d.register(new h6(d)),d.register(new y6(d)),d.register(new m6(d)),d.register(new v6(d)),d.register(new E6(d)),d.register(new T6(d)),d.register(new I6(d)),d.register(new A6(d)),d.register(new b6(d)),d.register(new w6(d)),d.register(new R6(d)),d.register(new _6(d)),d.register(new g6(d)),d.register(new D6(d)),d.register(new O6(d)),d.register(new C6(d)),d.register(new $6(d)),d.register(new P6(d)),d.register(new N6(d)),d.register(new V6(d)),d.register(new L6(d)),d.register(new M6(d)),d.register(new B6(d)),d.register(new U6(d)),d.register(new x6(d)),d.register(new j6(d)),d.register(new G6(d)),d.register(new F6(d)),d.register(new S6(d)),d.register(new K6(d)),d.register(new k6(d)),d.register(new q6(d)),d.register(new Z6(d))}class H6{constructor(u=new Lp){g(this,"extensionsRegistry",new Map);g(this,"initialized",new Set);g(this,"initializedContexts",new Set);g(this,"onResolveEditorContextCallback",()=>null);g(this,"onResolveProjectLogicContextCallback",()=>null);g(this,"onResolveGUIContextCallback",()=>null);g(this,"onResolveCompileContextCallback",()=>null);this.events=u,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(u){this.onResolveEditorContextCallback=u}onResolveProjectLogicContext(u){this.onResolveProjectLogicContextCallback=u}onResolveGUIContext(u){this.onResolveGUIContextCallback=u}onResolveCompileContext(u){this.onResolveCompileContextCallback=u}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((u,i)=>(u.manifest.initPriority||Ye.Normal)-(i.manifest.initPriority||Ye.Normal))}async setup(){hTe(this),Me.log("Initializing extensions without context..."),this.initForReady()}requestContext(u){switch(u){case be.Editor:return this.onResolveEditorContextCallback();case be.Logic:return this.onResolveProjectLogicContextCallback();case be.GUI:return this.onResolveGUIContextCallback();case be.Compile:return this.onResolveCompileContextCallback();default:throw new Error(`Unknown context type: ${u}`)}}requestContexts(u,i=[]){const a=[];i.length===0&&(i=u.manifest.contexts);for(const o of i){const p=this.requestContext(o);p&&a.push(p)}return a}requestModule(u){const i=this.extensionsRegistry.get(u);if(i){if(i.module)return i.module;throw new Error(`Module ${u} is not registered properly.`)}throw new Error(`Unknown module: ${u}`)}register(u){this.extensionsRegistry.set(u.manifest.id,u)}async initAll(){var u,i;for(const a of this.extensionInOrder)if(a.module.init&&!this.initialized.has(a.manifest.id)){const o=a.manifest.contexts.map(p=>this.requestContext(p)).filter(p=>p!==null);o.length&&(await((i=(u=a.module).init)==null?void 0:i.call(u,o)),this.initialized.add(a.manifest.id))}else!a.module.init&&!this.initialized.has(a.manifest.id)&&this.initialized.add(a.manifest.id)}async initForReady(){Me.log("Initializing extensions for ready contexts...");for(const u of this.extensionInOrder)if(u.module.init&&!this.initialized.has(u.manifest.id)){Me.log("Initializing "+u.manifest.id+" extension...");const i=this.requestContexts(u);u.manifest.contexts.every(o=>!!i.find(p=>p.contextType===o))?(await u.module.init(i),this.initialized.add(u.manifest.id)):Me.warn(`Skipping initialization of ${u.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${u.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(o=>o.contextType).join(", ")}`)}else!u.module.init&&!this.initialized.has(u.manifest.id)?(Me.log("Set "+u.manifest.id+" extension as initialized by default..."),this.initialized.add(u.manifest.id)):Me.log(`Skipping initialization of ${u.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const u of[...this.extensionInOrder].reverse())u.module.destroy&&await u.module.destroy();this.events.destroy()}on(u,i){this.events.on(u,i)}emit(u,...i){this.events.emit(u,...i)}off(u,i){this.events.off(u,i)}emitAsync(u,...i){return this.events.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.events.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.events.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.events.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.events.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.events.emitAsyncSequentiallyAllSettled(u,...i)}async contextAvailable(u){if(this.initializedContexts.has(u)){Me.warn(`Context ${u} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(u),u){case be.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case be.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Me.log(`Context ${u} is now available. Initializing extensions for this context...`),await this.initForReady()}}let zy=null;const RA={requestModule:d=>(zy||(zy=new H6,zy.setup()),zy.requestModule(d))},po={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var _A=(d=>(d.FinishedSuccess="finished-success",d.FinishedError="finished-error",d.Running="running",d.Paused="paused",d.Stopped="stopped",d.NotStarted="not-started",d))(_A||{});const W6={...RA};class In extends Lp{constructor(i,a,o,p=null,e=W6){super();g(this,"project");g(this,"entryPoint");g(this,"state","not-started");g(this,"events",new Lp);g(this,"entities",[]);g(this,"parentExecution",null);g(this,"executing",[]);g(this,"executed",[]);g(this,"skipped",[]);g(this,"scheduled",[]);g(this,"localTestValues");g(this,"resolvedValues");g(this,"persistedExecutionResults");g(this,"lastExecutionResults");g(this,"onAddToSkippedListCallback",null);g(this,"onRemoveFromSkippedListCallback",null);g(this,"onAddEntityCallback",null);g(this,"onRemoveEntityCallback",null);this.parentContext=e,this.entities=a,this.entryPoint=o,this.project=i,this.parentExecution=p,this.localTestValues=new gp(N.UUID.uuid(),this.project),this.resolvedValues=new gp(N.UUID.uuid(),this.project),this.persistedExecutionResults=new gp(N.UUID.uuid(),this.project),this.lastExecutionResults=new gp(N.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults}}skip(i){this.hasEntity(i)&&(this.skipped.includes(i)||(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),wi.includes(i.type)&&[...i.successCalls||[],...i.errorCalls||[],...i.calls||[]].forEach(a=>this.skip(a))))}async schedule(i,a,o){if(this.hasExecuted(i))return null;if(Dt.includes(i.type))return this.executeBranch(i,o,a);if(oi.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,o,a);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,a){const o=[];return[...pr,...Dt].includes(a.type)?o.push(...a.inputs):fr.includes(a.type)&&o.push(...a.outputs),o.map(e=>{var v;let y=i.find(E=>E.valueOwner.id===e.id);if(y)return y;if(!y&&Dt.includes(a.type)&&(y=i.find(E=>{var w;return((w=E.valueOwner.declaration)==null?void 0:w.id)===e.id})),y){const E=(v=y.value)==null?void 0:v.clone(null);return E==null||E.setStandaloneParent(e),{...y,valueOwner:e,value:E||null,inheritanceLink:{sources:[y],target:e}}}return un.includes(e.type)?My(e,this.valueResolutionContext):ll(e,this.valueResolutionContext)}).reduce((e,y)=>{const v=vn(y==null?void 0:y.valueOwner,this.project),E=y?[y]:[];return v.forEach(w=>{var V,U,F;if(w.id===(y==null?void 0:y.valueOwner.id))return;const A=dt(w.getDataType(null),w,this.project);A==null||A.metaSync({value:(V=y==null?void 0:y.value)==null?void 0:V.value},null),A==null||A.setValueAsTypeList(((U=y==null?void 0:y.value)==null?void 0:U.valueAsTypeList)||null),A==null||A.setValueAsTypeSingle(((F=y==null?void 0:y.value)==null?void 0:F.valueAsTypeSingle)||null);const P={...y,valueOwner:w,value:A};E.push(P)}),[...e,...E]},[]).sort((e,y)=>e.valueOwner.index-y.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};if(a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),Object.values(Jr).includes(i.declaration.id)){const w=this.parentContext.requestModule(Pd+i.declaration.id).main;w?E=await w(i,a):Me.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{E=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,o,e);const w=i.outputs.map(P=>{var q,ne,W,de;const V=[...P.declaration.getCounterparts(),P.declaration],U=E.results.find(X=>V.some(z=>X.valueOwner.id===(z==null?void 0:z.id))),F=P==null?void 0:P.getDataType(null),K=dt(F,P,o);return F!=null&&F.asType?Array.isArray((q=U==null?void 0:U.value)==null?void 0:q.valueAsType)?K==null||K.setValueAsTypeList((ne=U==null?void 0:U.value)==null?void 0:ne.valueAsTypeList):K==null||K.setValueAsTypeSingle(((W=U==null?void 0:U.value)==null?void 0:W.valueAsType)||null):K==null||K.metaSync({value:(de=U==null?void 0:U.value)==null?void 0:de.value},null),{valueOwner:P,type:Ae.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(E.error){Me.warn("Raw error executing entity: ",E.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,o);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(E.error):V==null||V.metaSync({value:E.error},null),A={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:V}}return{value:E.value,entity:i,error:A,results:w}}return{...E,entity:i}}catch(E){Me.warn("Internal call execution error: ",E);let w=null;if(i.error){const A=(v=i.error)==null?void 0:v.getDataType(null),P=dt(A,i.error,o);A!=null&&A.asType?P==null||P.setValueAsTypeSingle(E):P==null||P.metaSync({value:E},null),w={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:P}}return{value:oe.Error,entity:i,error:w,results:[]}}}static async executeOperation(i,a,o){var p,e;try{let y={value:oe.Success,error:null,results:[]};a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(y=await i.declaration.implementation(i,a));const v=i.outputs.map((w,A)=>{const P=w==null?void 0:w.getDataType(null),V=dt(P,w,o);return P!=null&&P.asType?V==null||V.setValueAsTypeSingle(y.results[A]):V==null||V.metaSync({value:y.results[A]},null),{valueOwner:w,type:Ae.ExecutionResult,inheritanceLink:null,value:V}});let E=null;if(y.error&&i.error){Me.warn("Raw error executing entity: ",y.error);const w=((p=i.error)==null?void 0:p.getDataType(null))||null,A=dt(w,i.error,o);w!=null&&w.asType?A==null||A.setValueAsTypeSingle(y.error):A==null||A.metaSync({value:y.error},null),E={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A}}return{value:y.value,entity:i,error:E,results:v}}catch(y){Me.warn("Operation execution error: ",y);let v=null;if(i.error){const E=(e=i.error)==null?void 0:e.getDataType(null),w=dt(E,i.error,o);E!=null&&E.asType?w==null||w.setValueAsTypeSingle(y):w==null||w.metaSync({value:y},null),v={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:w}}return{value:oe.Error,entity:i,error:v,results:[]}}}async executeSearch(i,a,o){var p;try{let e={value:oe.Success,error:null,results:[]};const y=i.outputs[0];if(!y)return{value:oe.Success,entity:i,error:null,results:[]};let v={value:null,valueOwner:y,type:Ae.ExecutionResult,inheritanceLink:null};const E=await this.parentContext.requestModule(Qe.SEARCH_NODE_IMPLEMENTATION).main(i,a),w=y==null?void 0:y.getDataType(null),A=dt(w,y,o);return A==null||A.metaSync({value:E.data},null),v.value=A,{value:e.value,entity:i,error:null,results:[v]}}catch(e){if(Me.warn(`Search node execution error: ${e}`),!i.error)return{value:oe.Error,entity:i,error:null,results:[]};const y=(p=i.error)==null?void 0:p.getDataType(null),v=dt(y,i.error,o);return v==null||v.metaSync({value:e},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:v},results:[]}}}async executeLoop(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};const w=a.map(K=>{var q,ne;return((q=K==null?void 0:K.value)==null?void 0:q.valueAsType)||((ne=K==null?void 0:K.value)==null?void 0:ne.value)});let A={};i.getUniqueReturnDeclarations().forEach(K=>{const q=i.body.inputs.find(X=>J(X,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(K)),ne=K==null?void 0:K.getDataType(null),W=dt(ne,q,o);ne!=null&&ne.asType?W==null||W.setValueAsTypeList([]):W==null||W.metaSync({value:[]},null),this.lastExecutionResults.writeValue(q,W);const de={value:W,valueOwner:q,type:Ae.ExecutionResult,inheritanceLink:null};A[q.id]=de});let V={value:oe.Success,entity:i.body,error:null,results:[]};switch(i.declaration.id){case he.loop["counted-loop"].id:{const K=w[0];let q=1;for(;q<=K&&q<=50;){const ne=i.body.inputs.map(de=>{if(de===i.currentIterationNumberArgumentDeclaration){const X=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=nl(X),z=this.lastExecutionResults.readValue(de.id);if(z){z.metaSync({value:q},null),this.lastExecutionResults.writeValue(de,z);const ue={value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null};return A[de.id]=ue,ue}const Y={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:q,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ce,standaloneParent:de.toReference()},pe=lr(Y,o);this.lastExecutionResults.writeValue(de,pe);const ee={value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null};return A[de.id]=ee,ee}else return A[de.id]}).filter(de=>!!de),W=await this.executeFullFunctionDeclarationLogic(i.body,ne,e);if(V=W,V.results.forEach(de=>{var Y,pe,ee,ue;if(de.valueOwner.type!==f.ReturnDeclaration)return;const X=i.body.inputs.find(Ie=>J(Ie,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(de.valueOwner)),z=[...((pe=(Y=A==null?void 0:A[X.id])==null?void 0:Y.value)==null?void 0:pe.value)||[],((ee=de==null?void 0:de.value)==null?void 0:ee.value)||null];(ue=A[X.id].value)==null||ue.metaSync({value:z},null),this.lastExecutionResults.writeValue(X,A[X.id].value)}),[oe.Error,oe.Break,oe.Return].includes(W.value))break;q++}break}case he.loop["manual-flow-loop"].id:{let K=1;for(;K<=50;){const q=i.body.inputs.map(W=>{if(W===i.currentIterationNumberArgumentDeclaration){const de=this.lastExecutionResults.readValue(W.id);if(de){de.metaSync({value:K},null),this.lastExecutionResults.writeValue(W,de);const Y={value:de,valueOwner:W,type:Ae.ExecutionResult,inheritanceLink:null};return A[W.id]=Y,Y}const X=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=dt(X,W,o);return ce==null||ce.metaSync({value:K},null),this.lastExecutionResults.writeValue(W,ce),{value:ce,valueOwner:W,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[W.id]}).filter(W=>!!W),ne=await this.executeFullFunctionDeclarationLogic(i.body,q,e);if(V=ne,V.results.forEach(W=>{var z,Y,pe;if(W.valueOwner.type!==f.ReturnDeclaration)return;const de=i.body.inputs.find(ee=>J(ee,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(W.valueOwner)),ce=[...(z=A[de.id].value)==null?void 0:z.value,((Y=W.value)==null?void 0:Y.value)||null];(pe=A[de.id].value)==null||pe.metaSync({value:ce},null),this.lastExecutionResults.writeValue(de,A[de.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ne.value))break;K++}break}case he.loop["list-loop"].id:{const K=w[0];let q=1;const ne=K;for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["object-keys-loop"].id:{const K=w[0];let q=1;const ne=K?Object.keys(K):[];for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["object-values-loop"].id:{const K=w[0];let q=1;const ne=K?Object.values(K):[];for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["string-loop"].id:{const K=w[0];let q=1;const ne=K.split("");for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}}let U=[];i.body.inputs.forEach(K=>{var ne;const q=A[K.id];if(q){const W=(ne=q.value)==null?void 0:ne.clone(null),de=i.outputs.find(X=>X.declaration&&ji.fromLoopOutputDeclarationToBodyArgumentDeclarationName(X.declaration)===J(K,o));if(!de)return;U.push({valueOwner:de,type:Ae.ExecutionResult,inheritanceLink:null,value:W})}}),E={value:[oe.Error,oe.Return].includes(V.value)?V.value:oe.Success,error:null,results:U};let F=null;if(E.error&&i.error){Me.warn("Raw error executing entity: ",E.error);const K=(y=i.error)==null?void 0:y.getDataType(null),q=dt(K||null,i.error,o);K!=null&&K.asType?q==null||q.setValueAsTypeSingle(E.error):q==null||q.metaSync({value:E.error},null),F={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:q}}return{value:E.value,entity:i,error:F,results:E.results}}catch(E){if(Me.warn("Error executing loop: ",E),i.error){const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,o);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(E):A==null||A.metaSync({value:E},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A},results:[]}}else return{value:oe.Error,entity:i,error:null,results:[]}}}async executeFunctionCall(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};E=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,o,e);const w=i.outputs.map(P=>{var q,ne,W,de;const V=[...P.declaration.getCounterparts(),P.declaration],U=E.results.find(X=>V.some(z=>X.valueOwner.id===(z==null?void 0:z.id))),F=P==null?void 0:P.getDataType(null),K=dt(F,P,o);return F!=null&&F.asType?Array.isArray((q=U==null?void 0:U.value)==null?void 0:q.valueAsType)?K==null||K.setValueAsTypeList((ne=U==null?void 0:U.value)==null?void 0:ne.valueAsTypeList):K==null||K.setValueAsTypeSingle(((W=U==null?void 0:U.value)==null?void 0:W.valueAsType)||null):K==null||K.metaSync({value:(de=U==null?void 0:U.value)==null?void 0:de.value},null),{valueOwner:P,type:Ae.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(E.error&&i.error){Me.warn("Raw error executing entity: ",E.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,o);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(E.error):V==null||V.metaSync({value:E.error},null),A={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:V}}return{value:E.value,entity:i,error:A,results:w}}catch(E){if(!i.error)return{value:oe.Error,entity:i,error:null,results:[]};const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,o);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(E):A==null||A.metaSync({value:E},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A},results:[]}}}async executeCondition(i,a){var p,e,y,v,E,w,A,P,V,U,F,K,q,ne,W,de,X,ce,z,Y,pe,ee,ue,Ie,Ue,Pe,Ce,$e,ke,xe,ot,Rt,dr,Ar,Br,Xr,ci,Ts,Bs,wn,Us,pi,Is,Rn,ra,tf,El,rf;let o=!1;switch(i.declaration.id){case ai.Empty:{o=!((e=(p=a[0])==null?void 0:p.value)!=null&&e.value);break}case ai.NotEmpty:{o=!!((v=(y=a[0])==null?void 0:y.value)!=null&&v.value);break}case ut.Equal:{if([ae.String,ae.Number,ae.Boolean,ae.Null,ae.Enum,ae.Date,ae.UUID].includes((w=(E=a[0])==null?void 0:E.value)==null?void 0:w.name)){o=((P=(A=a[0])==null?void 0:A.value)==null?void 0:P.value)===((U=(V=a[1])==null?void 0:V.value)==null?void 0:U.value);break}if(((K=(F=a[0])==null?void 0:F.value)==null?void 0:K.name)===ae.KeyValue||((ne=(q=a[0])==null?void 0:q.value)==null?void 0:ne.name)===ae.Untyped){const ia=(de=(W=a[0])==null?void 0:W.value)==null?void 0:de.value,fi=(ce=(X=a[1])==null?void 0:X.value)==null?void 0:ce.value;o=JSON.stringify(ia)===JSON.stringify(fi);break}break}case ut.NotEqual:{if([ae.String,ae.Number,ae.Boolean,ae.Null,ae.Enum,ae.Date,ae.UUID].includes((Y=(z=a[0])==null?void 0:z.value)==null?void 0:Y.name)){o=((ee=(pe=a[0])==null?void 0:pe.value)==null?void 0:ee.value)!==((Ie=(ue=a[1])==null?void 0:ue.value)==null?void 0:Ie.value);break}if(((Pe=(Ue=a[0])==null?void 0:Ue.value)==null?void 0:Pe.name)===ae.Untyped||(($e=(Ce=a[0])==null?void 0:Ce.value)==null?void 0:$e.name)===ae.KeyValue){const ia=(xe=(ke=a[0])==null?void 0:ke.value)==null?void 0:xe.value,fi=(Rt=(ot=a[1])==null?void 0:ot.value)==null?void 0:Rt.value;o=JSON.stringify(ia)!==JSON.stringify(fi);break}break}case ut.MoreThanOrEqual:{o=((Ar=(dr=a[0])==null?void 0:dr.value)==null?void 0:Ar.value)>=((Xr=(Br=a[1])==null?void 0:Br.value)==null?void 0:Xr.value);break}case ut.MoreThan:{o=((Ts=(ci=a[0])==null?void 0:ci.value)==null?void 0:Ts.value)>((wn=(Bs=a[1])==null?void 0:Bs.value)==null?void 0:wn.value);break}case ut.LessThanOrEqual:{o=((pi=(Us=a[0])==null?void 0:Us.value)==null?void 0:pi.value)<=((Rn=(Is=a[1])==null?void 0:Is.value)==null?void 0:Rn.value);break}case ut.LessThan:{o=((tf=(ra=a[0])==null?void 0:ra.value)==null?void 0:tf.value)<((rf=(El=a[1])==null?void 0:El.value)==null?void 0:rf.value);break}case Kr.And:{o=(await Promise.all(i.andChildrenGroup.map(async fi=>{const Hd=this.mergeExernalValuesWithInternalInputs(a,fi);return(await this.executeCondition(fi,Hd)).value===oe.Success}))).every(fi=>fi);break}case Kr.Or:{o=(await Promise.all(i.orChildrenGroup.map(async fi=>{const Hd=this.mergeExernalValuesWithInternalInputs(a,fi);return(await this.executeCondition(fi,Hd)).value===oe.Success}))).some(fi=>fi);break}}return{value:o?oe.Success:oe.Error,entity:i,error:null,results:[]}}async executeDetachedFullFunctionDeclarationLogic(i,a,o,p={}){const e={...po,...p,onBeforeEntityExecution:(E,w,A)=>{var P;return((P=p==null?void 0:p.onBeforeEntityExecution)==null?void 0:P.call(p,E,w,{...A,detached:!0}))||Promise.resolve()},onEntityExecuted:(E,w,A)=>{var P;return((P=p==null?void 0:p.onEntityExecuted)==null?void 0:P.call(p,E,w,{...A,detached:!0}))||Promise.resolve()}},y=new In(o,[i,...Im(i)],i,this,this.parentContext);return y.inheritValuesFromContext(this),await y.execute(e,a)}async executeFullFunctionDeclarationLogic(i,a,o={}){const p={...po,...o},e=Im(i);e.forEach(A=>{this.addEntity(A)}),e.reduce((A,P)=>fr.includes(P.type)?[...A,...P.outputs]:pr.includes(P.type)&&P.type!==f.Condition?[...A,...P.outputs,...P.inputs]:P.type===f.Condition?[...A,...P.inputs]:A,[]).forEach(A=>{this.lastExecutionResults.removeValue(A.id)});const v=await this.executeBranch(i,p,a),w=i.getUniqueReturnDeclarations().reduce((A,P)=>{const V=v==null?void 0:v.results.find(U=>U.valueOwner.id===P.id);return V?[...A,V]:A},[]);return{...v||{},value:(v==null?void 0:v.value)||oe.Success,entity:i,error:(v==null?void 0:v.error)||null,results:w}}static async executeEntryPointEntity(i,a){return{value:oe.Success,entity:i,error:null,results:a}}static async executeVariable(i,a){return{value:oe.Success,entity:i,error:null,results:[a]}}static async executeReturnStatement(i,a){return{value:i.throws?oe.Error:oe.Return,entity:i,error:null,results:a}}static async executeContinueStatement(i,a){return{value:oe.Continue,entity:i,error:null,results:a}}static async executeBreakStatement(i,a){return{value:oe.Break,entity:i,error:null,results:a}}mergeValues(i,a){const o=[];for(let p=0;p<a.length;p++)i!=null&&i[p]?o.push(i[p]):o.push(a[p]);return o}async executeEntity(i,a=[],o={}){var y,v,E,w,A,P,V,U,F,K,q,ne,W,de,X,ce,z;const p={...po,...o},e={detached:!1};switch(i.type){case f.Condition:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((y=p.onBeforeEntityExecution)==null?void 0:y.call(p,i,Y,e)),this.executeCondition(i,Y)}case f.InternalCall:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((v=p.onBeforeEntityExecution)==null?void 0:v.call(p,i,Y,e)),this.executeInternalCall(i,Y,this.project)}case f.Operation:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((E=p.onBeforeEntityExecution)==null?void 0:E.call(p,i,Y,e)),In.executeOperation(i,Y,this.project)}case f.VariableInstance:case f.VariableDeclaration:{let Y=My(i,this.valueResolutionContext);const pe=Pi(i),ee=pe.getDataType(null);if(ee!=null&&ee.isObject()){let Ue={};if(((w=ee==null?void 0:ee.entity)==null?void 0:w.type)===f.DefinitionEntity&&(Ue={...Ue,...ee.entity.getActiveRawDefaultValue()}),Y!=null&&Y.value)Tr((A=Y==null?void 0:Y.value)==null?void 0:A.value)&&(Ue={...Ue,...(P=Y==null?void 0:Y.value)==null?void 0:P.value}),Y==null||Y.value.metaSync({value:Ue},null);else{const Pe=dt(ee,i,this.project);Pe==null||Pe.metaSync({value:Ue},null),Y={valueOwner:pe,type:Ae.ExecutionResult,inheritanceLink:null,value:Pe}}this.lastExecutionResults.writeValue(pe,Y.value),pe.inputs.forEach(Pe=>{var Ce;if(((Ce=Pe.declaration)==null?void 0:Ce.type)===f.Property&&Pe.declaration.static){const $e=this.lastExecutionResults.readValue(Pe.declaration.id),ke=J(Pe,this.project),xe=Mr(ke);if($e)$e.metaSync({value:Ue[xe]},null),this.lastExecutionResults.writeValue(Pe.declaration,$e);else{const ot=dt(Pe.getDataType(null),Pe,this.project);ot==null||ot.metaSync({value:Ue[xe]},null),this.lastExecutionResults.writeValue(Pe.declaration,ot)}}})}else this.lastExecutionResults.writeValue(pe,Y==null?void 0:Y.value);const ue=[],Ie=(V=Y==null?void 0:Y.value)!=null&&V.value&&Tr((U=Y.value)==null?void 0:U.value)?((F=Y.value)==null?void 0:F.value)||{}:{};return i.outputs.map(Ue=>{const Pe=Mr(J(Ue,this.project)),Ce=Ie[Pe],$e=dt(Ue.getDataType(null),Ue,this.project);$e==null||$e.metaSync({value:Ce},null);const ke={value:$e,valueOwner:Ue,type:Ae.ExecutionResult,inheritanceLink:Y?{sources:[Y],target:i}:null};ue.push(ke)}),Y.type=Ae.ExecutionResult,{value:oe.Success,entity:i,error:null,results:[Y,...ue]}}case f.FunctionCall:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((K=p.onBeforeEntityExecution)==null?void 0:K.call(p,i,Y,e)),this.executeFunctionCall(i,Y,this.project)}case f.FunctionDeclaration:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((q=p.onBeforeEntityExecution)==null?void 0:q.call(p,i,Y,e)),In.executeEntryPointEntity(i,Y)}case f.Search:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((ne=p.onBeforeEntityExecution)==null?void 0:ne.call(p,i,Y,e)),this.executeSearch(i,Y,this.project)}case f.Loop:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((W=p.onBeforeEntityExecution)==null?void 0:W.call(p,i,Y,e)),this.executeLoop(i,Y,this.project,p)}case f.ReturnStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((de=p.onBeforeEntityExecution)==null?void 0:de.call(p,i,Y,e)),In.executeReturnStatement(i,Y)}case f.ContinueStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((X=p.onBeforeEntityExecution)==null?void 0:X.call(p,i,Y,e)),In.executeContinueStatement(i,Y)}case f.BreakStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((ce=p.onBeforeEntityExecution)==null?void 0:ce.call(p,i,Y,e)),In.executeBreakStatement(i,Y)}case f.GlobalEvent:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((z=p.onBeforeEntityExecution)==null?void 0:z.call(p,i,Y,e)),In.executeEntryPointEntity(i,Y)}default:return{value:oe.Error,entity:i,error:null,results:[]}}}storeLastExecutionValues(i){i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),i.results.forEach(a=>{const o=vn(a.valueOwner,this.project);a.value?o.forEach(p=>{this.lastExecutionResults.writeValue(p,a.value)}):o.forEach(p=>{this.lastExecutionResults.removeValue(p.id)})})}async executeBranch(i,a={},o=[]){var E;const p={...po,...a},e={detached:!1};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const v=await this.executeEntity(i,o,p);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(v),await((E=p.onEntityExecuted)==null?void 0:E.call(p,i,v,e)),v.value===oe.Success){const w=(i.successCalls||i.calls||[]).filter(F=>this.hasEntity(F));(i.errorCalls||[]).forEach(F=>{this.skip(F)});let P=[];const V=(await Promise.all(w.map(F=>this.schedule(F,v.results,p)))).filter(F=>!!F),U=V.filter(F=>!!F).find(F=>F.value===oe.Error||F.value===oe.Return||F.value===oe.Break||F.value===oe.Continue);return U||(P=[...P,...V],v)}else if(v.value===oe.Error){const w=(i.errorCalls||[]).filter(F=>this.hasEntity(F));(i.successCalls||i.calls||[]).forEach(F=>{this.skip(F)});let P=[];const V=(await Promise.all(w.map(F=>this.schedule(F,v.results,p)))).filter(F=>!!F),U=V.filter(F=>!!F).find(F=>F.value===oe.Error||F.value===oe.Return||F.value===oe.Break||F.value===oe.Continue);return U||(P=[...P,...V],v)}else{if(v.value===oe.Return)return v;if(v.value===oe.Break)return v;if(v.value===oe.Continue)return v}return v}async execute(i={},a=[]){const o={...po,...i};this.state="running";const p=await this.executeBranch(this.entryPoint,o,a);return this.state="finished-success",p}addEntity(i){var a;this.entities.includes(i)||(this.entities.push(i),(a=this.onAddEntityCallback)==null||a.call(this,i))}addEntities(i){i.forEach(a=>this.addEntity(a))}removeEntity(i){var a;if(i!==this.entryPoint){const o=this.entities.indexOf(i);o>-1&&(this.entities.splice(o,1),(a=this.onRemoveEntityCallback)==null||a.call(this,i))}}hasEntity(i){var p,e,y;if(this.entities.includes(i))return!0;if(((p=i.parent)==null?void 0:p.type)===f.FunctionDeclaration&&((y=(e=i.parent)==null?void 0:e.parent)==null?void 0:y.type)===f.DefinitionEntity)return this.entities.includes(i.parent);const a=mr(i);if(!a)return!1;const o=a.type===f.Loop&&i.parent===a.body?a.body:null;return o?this.entities.includes(o)||this.entities.includes(a):this.entities.includes(a)}removeScheduled(i){const a=this.scheduled.indexOf(i);a>-1&&this.scheduled.splice(a,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const a=this.project.get(i);return a?this.hasEntity(a):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}removeFromExecutingList(i){const a=this.executing.indexOf(i);a>-1&&this.executing.splice(a,1)}removeFromAlreadyExecutedList(i){const a=this.executed.indexOf(i);a>-1&&this.executed.splice(a,1)}removeFromSkippedList(i){var o;const a=this.skipped.indexOf(i);a>-1&&(this.skipped.splice(a,1),(o=this.onRemoveFromSkippedListCallback)==null||o.call(this,i))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var a;this.skipped.includes(i)||(this.skipped.push(i),(a=this.onAddToSkippedListCallback)==null||a.call(this,i))}}function yTe(d){var u,i;if(d.isList)return"list";if(((u=d.entity)==null?void 0:u.type)===f.DefinitionEntity)return"definition-entity";switch((i=d.entity)==null?void 0:i.name){case ae.Number:return"number";case ae.String:return"text";case ae.Boolean:return"boolean";case ae.UUID:return"uuid";case ae.Date:return"date-time";default:return"definition-entity"}}const xp={[f.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[f.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[f.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[f.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[f.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[f.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[f.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[f.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[f.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[f.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[f.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[f.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[f.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[f.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[f.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[f.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[f.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[f.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[f.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[f.ReturnDeclaration]:{singular:"Output definition",plural:"Output definitions",shortSingular:"Output",shortPlural:"Outputs"},[f.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"},[f.DataType]:{singular:"Data type",plural:"Data types",shortSingular:"Data type",shortPlural:"Data types"},[f.LiteralValue]:{singular:"Literal value",plural:"Literal values",shortSingular:"Value",shortPlural:"Values"}};function gA(d){const u=Am(d);if(!u){const a=Kd(d);if(a.includes(Le.HTTP_ENDPOINT))return"HTTP endpoint";if(a.includes(Le.PERSISTED_ENTITY))return"Persisted entity";if(a.includes(Le.CRON_JOB))return"Scheduled execution";if(a.includes(Le.RELATIONAL_DATABASE))return"Relational database"}if(u){let a="Extension of "+J(u,u.project)+" entity",o=Td(a);const p=Kd(d);return p.includes(Le.HTTP_ENDPOINT)?"HTTP endpoint"+(o?", "+o:""):p.includes(Le.PERSISTED_ENTITY)?"Persisted entity"+(o?", "+o:""):p.includes(Le.CRON_JOB)?"Scheduled execution"+(o?", "+o:""):p.includes(Le.RELATIONAL_DATABASE)?"Relational database"+(o?", "+o:""):a}let i="";return d.abstract&&(i="Template "),d.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function J6(d){return d.parent.type===f.DefinitionEntity||d.parent.type===f.InstalledProject?"Internal action of "+J(d.parent,d.project):d.parent.type===f.Loop?"Action repeated on every iteration":"Internal action of entity"}function DA(d){return mb(d)?J6(d):"Custom trigger"}function mTe(d){var u;switch(d.type){case f.DefinitionEntity:return gA(d);case f.FunctionDeclaration:return DA(d)}return(u=xp[d.type])==null?void 0:u.singular}function vTe(d){var u;switch(d.type){case f.DefinitionEntity:return gA(d);case f.FunctionDeclaration:return DA(d)}return(u=xp[d.type])==null?void 0:u.singular}const OA=4e4,Y6=280,ETe=300,CA=65,Md=32,Xy=39,z6=26,X6=49,Qy=44,TTe=35,em=52,$A=10,$a=$A*2,tm=38,rm=90,PA=270,Q6=OA/2+120,e5=OA/2+180;function t5(d){let i=Md+Qy+tm+$A;const a=[...d.inputs];return a.length&&(i+=$a,a.forEach(()=>{i+=z6})),{height:i,width:280}}function r5(d){let i=CA;const a=[];if([f.DefinitionEntity].includes(d.type)){const v=[...d.suggestedProperties||[],...d.properties||[]];v.length&&(i+=$a,v.forEach(E=>{i+=E.static?X6:Xy}))}if([f.DefinitionEntity,f.InstalledProject,f.Loop].includes(d.type)){const v=[...(d==null?void 0:d.suggestedMethods)||[],...d.methods||[],...d.functions||[],...d.body?[d.body]:[]];v.length&&(i+=$a,v.forEach(E=>{const w=t5(E);i+=w.height}))}pr.includes(d.type)?(yt.includes(d.type)?a.push(...(d.usedInputs||[]).flatMap(v=>[v])||[]):a.push(...(d.inputs||[]).flatMap(v=>[v])||[]),d.error&&(i+=em)):[f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)?(a.push(...d.outputs||[]),d.throws&&(i+=em)):d.type===f.Condition&&(a.push(d.inputs[0]),d.inputs[1]&&a.push(d.inputs[1]));const o=a.length;o&&(i+=o*Xy,i+=$a);const p=[];if(d.type===f.FunctionDeclaration||d.type===f.GlobalEvent?p.push(...d.inputs||[]):pr.includes(d.type)&&(yt.includes(d.type)?p.push(...d.usedOutputs||[]):p.push(...d.outputs||[])),yt.includes(d.type)){d.readsValue&&(i+=$a,i+=Qy),d.writesValues.length&&(i+=$a,i+=Qy),d.internalCalls.length&&d.usedInternalCalls.forEach(()=>i+=em+$a);const v=d.getDataType(null);(!v||v.inferred)&&(i+=tm)}const e=p.length;return e&&(i+=e*Xy,i+=$a),[f.DefinitionEntity,f.FunctionDeclaration,f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)&&(i+=tm),{height:i,width:280}}function jp(d){return`${d.split("-").map((a,o)=>o===0?a.charAt(0).toUpperCase()+a.slice(1):a.toLowerCase()).join(" ")}.`}function ITe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case te.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case te.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case te.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case te.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case te.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case te.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case re.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case re.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case te.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case te.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case re.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case te.NoProperties:return"This entity has no properties, so it doesn't do anything";case te.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case te.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case te.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case te.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case te.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case te.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case te.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case te.PropertyImplementsNonAbstact:return"This property implements a non-template property";case te.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case te.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case te.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case te.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case te.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case re.InternalCallDeclarationIsNotFunctionDeclaration:return"This internal call is not an action";case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case re.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case re.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case re.UnreachableEntity:return"This entity is unreachable";case te.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";case te.AbstractEntityImplements:return"This template entity implements a non-template entity";case te.AbstractExtendingNonAbstractEntity:return"This template entity extends a non-template entity";case te.InvalidPropertiesCombination:return"This entity has an invalid combination of properties";case te.ExtendingNonInteractiveEntity:return"This entity extends a non-interactive entity";case te.ExtendsIncompatibleEntities:return"This entity extends incompatible entities";case te.ImplementingNonAbstractEntity:return"This entity implements a non-template entity";case te.ImplementsIncompatibleEntities:return"This entity implements incompatible entities";case te.LackingReturnStatementOnSomeBranches:return"This action is missing a termination on some branches";case te.LastCalledEntityMustBeReturnEntity:return"The last called entity in this action must be a termination node";case te.MissingRequiredValue:return"This action is missing a required value";case te.NoPrimaryKeyProperty:return"This entity has no primary key property";case te.NonAbstractExtendingAbstractEntity:return"This non-template entity extends a template entity";case te.NonStaticExtendingStaticEntity:return"This non-static entity extends a static entity";case te.NonStaticImplementingStaticEntity:return"This non-static entity implements a static entity";case te.StaticExtendingNonStaticEntity:return"This static entity extends a non-static entity";case te.StaticImplementingNonStaticEntity:return"This static entity implements a non-static entity";case te.VariableReadsValueAndInternalCall:return"This variable reads a value while being used to execute internal logic";case te.VariableWritesValuesAndInternalCall:return"This variable writes values while being used to execute internal logic";case re.InternalCallDeclarationNotInParentDatatypeEntity:return"This internal call declaration is not in the parent entity";case re.EmptyName:return"This entity has no name";case re.InvalidObjectStructure:return"This entity has an invalid structure";case re.LoopBodyFunctionOverwrite:return"This loop body action overwrites an action in the template entity with the same name";case re.MethodOverwritesBaseMethodWithSameImplementation:return"This action overwrites a base action with the same implementation";case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"This action overwrites an action in an extended entity with the same implementation";case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"This action overwrites an action in an implemented entity with the same implementation";case re.MissingCaller:return"This action is missing a caller";case re.NameAsResolvedCodeNameNotUniqueInScope:return"This entity has a name that is not unique in the scope of the code it is used in";case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"This entity name can only contain letters, numbers, underscores and spaces";case re.NameMustStartWithLetterOrUnderscore:return"This entity name must start with a letter or an underscore";case re.NoOverlapWithImplementedSignature:return"This action does not overlap with the implemented action signature";case re.PropertyOverwritesBasePropertyWithSameImplementation:return"This property overwrites a base property with the same implementation";case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an extended entity with the same implementation";case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an implemented entity with the same implementation";case re.ReaderWriterIncompatibleDataType:return"This reader/writer has an incompatible data type with the value it is reading/writing";case ta.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case ta.StatusCodeMustBeNumber:return"HTTP status code must be a number, between 100 and 599";case Es.UUIDMustBeString:return`UUID must be a string, eg: "${cl()}"`;case Es.UUIDMustNotContainSpaces:return`UUID must not contain spaces, eg: "${cl()}"`;case Es.UUIDMustBeValidFormat:return`UUID must be in a valid format. Eg: "${cl()}"`;case Ki.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case Ki.StringValueMustNotHaveDashes:return"This value must not contain dashes";case Ki.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return jp(d.code)}}function ATe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case te.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case te.IncorrectEntityImplementation:return"Incorrect implementation";case te.IncorrectMethodImplementation:return"Incorrect action implementation";case te.IncorrectPropertyImplementation:return"Incorrect property implementation";case te.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case te.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case re.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case re.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case te.MissingMethodImplementation:return"Missing action";case te.MissingPropertyImplementation:return"Missing property";case re.NameNotUniqueInScope:return"Duplicate name";case te.NoProperties:return"No properties";case te.NonStaticPropertyInStaticEntity:return"Non-static property";case te.StaticEntityWithNonStaticProperties:return"Non-static properties";case te.ReadingFromIncompatibleType:return"Read from different type";case te.WritingToIncompatibleType:return"Write to different type";case te.ScopeWithoutLogic:return"No logic";case te.NonStaticPropertyImplementsStatic:return"Invalid static property";case te.PropertyImplementsIncompatibleType:return"Incompatible data type";case te.PropertyImplementsNonAbstact:return"Non-template property";case te.StaticPropertyImplementsNonStatic:return"Non-static property";case te.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case te.VariableHasInputsAndInternalCall:return"Bad internal call";case te.VariableHasOutputsAndInternalCall:return"Bad internal call";case te.VariableIsCalledAndHasInternalCall:return"Bad internal call";case re.InternalCallDeclarationIsNotFunctionDeclaration:return"Declaration not an action";case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case re.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case re.InternalCallParentMissingDataType:return"Parent has no data type";case re.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case re.UnreachableEntity:return"Unreachable entity";case te.DisconnectedCallableEntity:return"Disconnected entity";case te.AbstractEntityImplements:return"Abstract entity implements a non-template entity";case te.AbstractExtendingNonAbstractEntity:return"Abstract entity extends a non-template entity";case te.InvalidPropertiesCombination:return"Invalid properties combination";case te.ExtendingNonInteractiveEntity:return"Extending non-interactive entity";case te.ExtendsIncompatibleEntities:return"Extends incompatible entities";case te.ImplementingNonAbstractEntity:return"Implementing non-template entity";case te.ImplementsIncompatibleEntities:return"Implements incompatible entities";case te.LackingReturnStatementOnSomeBranches:return"Missing termination on some branches";case te.LastCalledEntityMustBeReturnEntity:return"Last called entity must be a termination node";case te.MissingRequiredValue:return"Missing required value";case te.NoPrimaryKeyProperty:return"No primary key property";case te.NonAbstractExtendingAbstractEntity:return"Non-template entity extending a template entity";case te.NonStaticExtendingStaticEntity:return"Non-static entity extending a static entity";case te.NonStaticImplementingStaticEntity:return"Non-static entity implementing a static entity";case te.StaticExtendingNonStaticEntity:return"Static entity extending a non-static entity";case te.StaticImplementingNonStaticEntity:return"Static entity implementing a non-static entity";case te.VariableReadsValueAndInternalCall:return"Variable reads value and has internal call";case te.VariableWritesValuesAndInternalCall:return"Variable writes values and has internal call";case re.EmptyName:return"Empty name";case re.InvalidObjectStructure:return"Invalid object structure";case re.LoopBodyFunctionOverwrite:return"Loop body action overwrites action with same name";case re.MethodOverwritesBaseMethodWithSameImplementation:return"Action overwrites base action with same implementation";case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case re.MissingCaller:return"Missing caller";case re.NameAsResolvedCodeNameNotUniqueInScope:return"Name not unique in scope";case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"Name can only contain letters, numbers, underscores and spaces";case re.NameMustStartWithLetterOrUnderscore:return"Name must start with letter or underscore";case re.NoOverlapWithImplementedSignature:return"No overlap with implemented signature";case re.PropertyOverwritesBasePropertyWithSameImplementation:return"Property overwrites base property with same implementation";case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case re.ReaderWriterIncompatibleDataType:return"Reader/writer incompatible data type";case ta.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case ta.StatusCodeMustBeNumber:return"HTTP status code must be a number";case Es.UUIDMustBeString:return"UUID must be a string";case Es.UUIDMustNotContainSpaces:return"UUID must not contain spaces";case Es.UUIDMustBeValidFormat:return"UUID must be in a valid format";case Ki.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case Ki.StringValueMustNotHaveDashes:return"This value must not contain dashes";case Ki.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return jp(d.code)}}function bTe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return`${J(d.entity,d.entity.project)} has non-template actions`;case te.AbstractEntityWithNonAbstractProperties:return`${J(d.entity,d.entity.project)} has non-template properties`;case te.IncorrectEntityImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements template`;case te.IncorrectMethodImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template`;case te.IncorrectPropertyImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template`;case te.AbstractMethodInNonAbstractEntity:return`${J(d.entity,d.entity.project)} can't be a template`;case te.AbstractPropertyInNonAbstractEntity:return`${J(d.entity,d.entity.project)} can't be a template`;case re.MethodOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites action`;case re.PropertyOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites property`;case te.MissingMethodImplementation:return`${J(d.entity,d.entity.project)} is missing action`;case te.MissingPropertyImplementation:return`${J(d.entity,d.entity.project)} is missing property`;case re.NameNotUniqueInScope:return`${J(d.entity,d.entity.project)} name is not unique`;case te.NoProperties:return`${J(d.entity,d.entity.project)} has no properties`;case te.NonStaticPropertyInStaticEntity:return`${J(d.entity,d.entity.project)} has non-static property`;case te.StaticEntityWithNonStaticProperties:return`${J(d.entity,d.entity.project)} has non-static properties`;case te.ReadingFromIncompatibleType:return`${J(d.entity,d.entity.project)} reads from different type`;case te.WritingToIncompatibleType:return`${J(d.entity,d.entity.project)} writes to different type`;case te.ScopeWithoutLogic:return`${J(d.entity,d.entity.project)} has no logic`;case te.NonStaticPropertyImplementsStatic:return`${J(d.entity,d.entity.project)} has invalid static property`;case te.PropertyImplementsIncompatibleType:return`${J(d.entity,d.entity.project)} has incompatible data type`;case te.PropertyImplementsNonAbstact:return`${J(d.entity,d.entity.project)} has non-template property`;case te.StaticPropertyImplementsNonStatic:return`${J(d.entity,d.entity.project)} has non-static property`;case te.VariableCallsOthersAndHasInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableHasInputsAndInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableHasOutputsAndInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableIsCalledAndHasInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case re.InternalCallDeclarationIsNotFunctionDeclaration:return`${J(d.entity,d.entity.project)} has declaration that is not an action`;case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has declaration that is not found in parent`;case re.InternalCallParentDeclarationEntityInvalidType:return`${J(d.entity,d.entity.project)} has invalid parent declaration type`;case re.InternalCallParentMissingDataType:return`${J(d.entity,d.entity.project)}'s parent has no data type`;case re.InternalCallDeclarationNotInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has declaration that is not in parent`;case re.UnreachableEntity:return`${J(d.entity,d.entity.project)} is unreachable`;case te.DisconnectedCallableEntity:return`${J(d.entity,d.entity.project)} is not executed by any entity`;case te.AbstractEntityImplements:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.AbstractExtendingNonAbstractEntity:return`${J(d.entity,d.entity.project)} extends a non-template entity`;case te.InvalidPropertiesCombination:return`${J(d.entity,d.entity.project)} has invalid properties combination`;case te.ExtendingNonInteractiveEntity:return`${J(d.entity,d.entity.project)} extends a non-interactive entity`;case te.ExtendsIncompatibleEntities:return`${J(d.entity,d.entity.project)} extends incompatible entities`;case te.ImplementingNonAbstractEntity:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.ImplementsIncompatibleEntities:return`${J(d.entity,d.entity.project)} implements incompatible entities`;case te.LackingReturnStatementOnSomeBranches:return`${J(d.entity,d.entity.project)} is missing termination on some branches`;case te.LastCalledEntityMustBeReturnEntity:return`${J(d.entity,d.entity.project)}'s last called entity must be a termination node`;case te.MissingRequiredValue:return`${J(d.entity,d.entity.project)} is missing a required value`;case te.NoPrimaryKeyProperty:return`${J(d.entity,d.entity.project)} has no primary key property`;case te.NonAbstractExtendingAbstractEntity:return`${J(d.entity,d.entity.project)} extends a template entity`;case te.NonStaticExtendingStaticEntity:return`${J(d.entity,d.entity.project)} extends a static entity`;case te.NonStaticImplementingStaticEntity:return`${J(d.entity,d.entity.project)} implements a static entity`;case te.StaticExtendingNonStaticEntity:return`${J(d.entity,d.entity.project)} extends a non-static entity`;case te.StaticImplementingNonStaticEntity:return`${J(d.entity,d.entity.project)} implements a non-static entity`;case te.VariableReadsValueAndInternalCall:return`${J(d.entity,d.entity.project)} reads a value and has internal call`;case te.VariableWritesValuesAndInternalCall:return`${J(d.entity,d.entity.project)} writes values and has internal call`;case re.EmptyName:return`${xp[d.entity.type]} has no name`;case re.InvalidObjectStructure:return`${J(d.entity,d.entity.project)} has invalid structure`;case re.LoopBodyFunctionOverwrite:return`${J(d.entity,d.entity.project)}'s loop body action overwrites an action`;case re.MethodOverwritesBaseMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites base action`;case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MissingCaller:return`${J(d.entity,d.entity.project)} is missing a caller`;case re.NameAsResolvedCodeNameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a name not unique in the scope`;case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${J(d.entity,d.entity.project)} name can only contain letters, numbers, underscores and spaces`;case re.NameMustStartWithLetterOrUnderscore:return`${J(d.entity,d.entity.project)} name must start with letter or underscore`;case re.NoOverlapWithImplementedSignature:return`${J(d.entity,d.entity.project)} has no overlap with implemented signature`;case re.PropertyOverwritesBasePropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites base property`;case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.ReaderWriterIncompatibleDataType:return`${J(d.entity,d.entity.project)} has reader/writer with incompatible data type`;case ta.StatusCodeMustBeBetween100And599:return`${J(d.entity,d.entity.project)} HTTP status code must be between 100 and 599`;case ta.StatusCodeMustBeNumber:return`${J(d.entity,d.entity.project)} HTTP status code must be a number`;case Es.UUIDMustBeString:return`${J(d.entity,d.entity.project)} UUID must be a string`;case Es.UUIDMustNotContainSpaces:return`${J(d.entity,d.entity.project)} UUID must not contain spaces`;case Es.UUIDMustBeValidFormat:return`${J(d.entity,d.entity.project)} UUID must be in a valid format`;case Ki.MustBeUniqueAmongSameEntities:return`${J(d.entity,d.entity.project)} value must be unique among the same kind`;case Ki.StringValueMustNotHaveDashes:return`${J(d.entity,d.entity.project)} value must not contain dashes`;case Ki.StringValueMustNotHaveSpaces:return`${J(d.entity,d.entity.project)} value must not contain spaces`;default:return`${J(d.entity,d.entity.project)} Error: ${jp(d.code)}`}}function wTe(d){var u,i,a,o;switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return`${J(d.entity,d.entity.project)} has non-template actions`;case te.AbstractEntityWithNonAbstractProperties:return`${J(d.entity,d.entity.project)} has non-template properties`;case te.IncorrectEntityImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template entity`;case te.IncorrectMethodImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template action it's based on`;case te.IncorrectPropertyImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template property it's based on`;case te.AbstractMethodInNonAbstractEntity:return`${J(d.entity,d.entity.project)} is a template action in a non-template entity`;case te.AbstractPropertyInNonAbstractEntity:return`${J(d.entity,d.entity.project)} is a template property in a non-template entity`;case re.MethodOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites an action in the template entity`;case re.PropertyOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites a property in the template entity`;case te.MissingMethodImplementation:return`${J(d.entity,d.entity.project)} is missing an action implementation from the template entity`;case te.MissingPropertyImplementation:return`${J(d.entity,d.entity.project)} is missing a property implementation from the template entity`;case re.NameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a duplicate name in the same scope`;case te.NoProperties:return`${J(d.entity,d.entity.project)} has no properties, so it doesn't do anything`;case te.NonStaticPropertyInStaticEntity:return`${J(d.entity,d.entity.project)} has a non-static property in a static entity`;case te.StaticEntityWithNonStaticProperties:return`${J(d.entity,d.entity.project)} has non-static properties in a static entity`;case te.ReadingFromIncompatibleType:return`${J(d.entity,d.entity.project)} reads data from a value of a different data type`;case te.WritingToIncompatibleType:return`${J(d.entity,d.entity.project)} writes data to a value of a different data type`;case te.ScopeWithoutLogic:return`${J(d.entity,d.entity.project)} has no logic`;case te.NonStaticPropertyImplementsStatic:return`${J(d.entity,d.entity.project)} has a static property in a non-static entity`;case te.PropertyImplementsIncompatibleType:return`${J(d.entity,d.entity.project)} implements a property of a different data type`;case te.PropertyImplementsNonAbstact:return`${J(d.entity,d.entity.project)} implements a non-template property`;case te.StaticPropertyImplementsNonStatic:return`${J(d.entity,d.entity.project)} has a static property in a non-static entity`;case te.VariableCallsOthersAndHasInternalCall:return`${J(d.entity,d.entity.project)} calls other entities while being used to execute internal logic`;case te.VariableHasInputsAndInternalCall:return`${J(d.entity,d.entity.project)} has inputs while being used to execute internal logic`;case te.VariableHasOutputsAndInternalCall:return`${J(d.entity,d.entity.project)} has outputs while being used to execute internal logic`;case te.VariableIsCalledAndHasInternalCall:return`${J(d.entity,d.entity.project)} is called while being used to execute internal logic`;case re.InternalCallDeclarationIsNotFunctionDeclaration:return`${J(d.entity,d.entity.project)} has a declaration that is not an action`;case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has a declaration that is not found in ${(u=d.entity.parent.getDataType(null))!=null&&u.entity?J((i=d.entity.parent.getDataType(null))==null?void 0:i.entity,d.entity.project):"the variable's data-type entity"}`;case re.InternalCallParentDeclarationEntityInvalidType:return`${J(d.entity,d.entity.project)} is part of a variable whos data-type entity can't have actions`;case re.InternalCallParentMissingDataType:return`${J(d.entity,d.entity.project)} is part of a variable with no data-type entity`;case re.InternalCallDeclarationNotInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has a declaration doesn't belong to ${(a=d.entity.parent.getDataType(null))!=null&&a.entity?J((o=d.entity.parent.getDataType(null))==null?void 0:o.entity,d.entity.project):"the variable's data-type entity"}`;case re.UnreachableEntity:return`${J(d.entity,d.entity.project)} is unreachable`;case te.DisconnectedCallableEntity:return`${J(d.entity,d.entity.project)} is disconnected and won't be executed by anything after publishing`;case te.AbstractEntityImplements:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.AbstractExtendingNonAbstractEntity:return`${J(d.entity,d.entity.project)} extends a non-template entity`;case te.InvalidPropertiesCombination:return`${J(d.entity,d.entity.project)} has an invalid combination of properties`;case te.ExtendingNonInteractiveEntity:return`${J(d.entity,d.entity.project)} extends a non-interactive entity`;case te.ExtendsIncompatibleEntities:return`${J(d.entity,d.entity.project)} extends incompatible entities`;case te.ImplementingNonAbstractEntity:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.ImplementsIncompatibleEntities:return`${J(d.entity,d.entity.project)} implements incompatible entities`;case te.LackingReturnStatementOnSomeBranches:return`${J(d.entity,d.entity.project)} has branches that don't terminate`;case te.LastCalledEntityMustBeReturnEntity:return`${J(d.entity,d.entity.project)} must end with a termination node`;case te.MissingRequiredValue:return`${J(d.entity,d.entity.project)} is missing a required value`;case te.NoPrimaryKeyProperty:return`${J(d.entity,d.entity.project)} has no primary key property`;case te.NonAbstractExtendingAbstractEntity:return`${J(d.entity,d.entity.project)} is a non-template entity extending a template entity`;case te.NonStaticExtendingStaticEntity:return`${J(d.entity,d.entity.project)} is a non-static entity extending a static entity`;case te.NonStaticImplementingStaticEntity:return`${J(d.entity,d.entity.project)} is a non-static entity implementing a static entity`;case te.StaticExtendingNonStaticEntity:return`${J(d.entity,d.entity.project)} is a static entity extending a non-static entity`;case te.StaticImplementingNonStaticEntity:return`${J(d.entity,d.entity.project)} is a static entity implementing a non-static entity`;case te.VariableReadsValueAndInternalCall:return`${J(d.entity,d.entity.project)} reads a value and has an internal call`;case te.VariableWritesValuesAndInternalCall:return`${J(d.entity,d.entity.project)} writes values and has an internal call`;case re.EmptyName:return`${xp[d.entity.type]} has no name`;case re.InvalidObjectStructure:return`${J(d.entity,d.entity.project)} has an invalid structure`;case re.LoopBodyFunctionOverwrite:return`${J(d.entity,d.entity.project)}'s loop body action overwrites`;case re.MethodOverwritesBaseMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites a base action with same implementation`;case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MissingCaller:return`${J(d.entity,d.entity.project)} is missing a caller`;case re.NameAsResolvedCodeNameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a name that is not unique in the scope`;case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${J(d.entity,d.entity.project)} name can only contain letters, numbers, underscores and spaces`;case re.NameMustStartWithLetterOrUnderscore:return`${J(d.entity,d.entity.project)} name must start with letter or underscore`;case re.NoOverlapWithImplementedSignature:return`${J(d.entity,d.entity.project)} has no overlap with implemented signature`;case re.PropertyOverwritesBasePropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites a base property with same implementation`;case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.ReaderWriterIncompatibleDataType:return`${J(d.entity,d.entity.project)} has a reader/writer with incompatible data type`;case ta.StatusCodeMustBeBetween100And599:return`${J(d.entity,d.entity.project)} HTTP status code must be between 100 and 599`;case ta.StatusCodeMustBeNumber:return`${J(d.entity,d.entity.project)} HTTP status code must be a number, between 100 and 599`;case Es.UUIDMustBeString:return`${J(d.entity,d.entity.project)} UUID must be a string, eg: "${cl()}"`;case Es.UUIDMustNotContainSpaces:return`${J(d.entity,d.entity.project)} UUID must not contain spaces, eg: "${cl()}"`;case Es.UUIDMustBeValidFormat:return`${J(d.entity,d.entity.project)} UUID must be in a valid format. Eg: "${cl()}"`;case Ki.MustBeUniqueAmongSameEntities:return`${J(d.entity,d.entity.project)} value must be unique among the same kind`;case Ki.StringValueMustNotHaveDashes:return`${J(d.entity,d.entity.project)} value must not contain dashes`;case Ki.StringValueMustNotHaveSpaces:return`${J(d.entity,d.entity.project)} value must not contain spaces`;default:return`${J(d.entity,d.entity.project)} Error: ${jp(d.code)}`}}var NA=(d=>(d.ValuesAlreadyConnected="values-already-connected",d.CannotReadMoreThanOneValue="cannot-read-more-than-one-value",d.CannotReadValueFromChildren="cannot-read-value-from-children",d.CannotWriteValueToChildren="cannot-write-value-to-children",d.CannotBeCalledByChildren="cannot-be-called-by-children",d.ExecutionsAlreadyConnected="executions-already-connected",d.DataTypesNotCompatible="data-types-not-compatible",d.CannotCallAncestor="cannot-call-ancestor",d.CannotConnectToItself="cannot-connect-to-itself",d.CannotWriteValueToAncestor="cannot-write-value-to-ancestor",d.NotInScope="not-in-scope",d.IsNotValueWrittingEntity="is-not-value-writting-entity",d.IsNotValueReadingEntity="is-not-value-reading-entity",d.ContinueOrBreakStatementCalledFromOutsideLoop="continue-or-break-statement-called-from-outside-loop",d.ElementInLoopBodyCallingOutsideLoop="element-in-loop-body-calling-outside-loop",d.CallerIsInHigherScope="caller-is-in-higher-scope",d.CallerIsInLowerScope="caller-is-in-lower-scope",d.CallIsInHigherScope="call-is-in-higher-scope",d.CallIsInLowerScope="call-is-in-lower-scope",d.OtherIncompatibleScopeReason="other-incompatible-scope-reason",d.SiblingInternalCallAlreadyUsedInParentVariable="sibling-internal-call-already-used-in-parent-variable",d.ErrorOututMapCannotBeConnectedToParentSuccessBranchCallees="error-output-map-cannot-be-connected-to-parent-success-branch-callees",d))(NA||{});const RTe=Object.values(NA);var VA=(d=>(d.NotPartOfOngoingTest="not-part-of-ongoing-test",d.CannotBeAddedToTest="cannot-be-added-to-test",d))(VA||{});const _Te=Object.values(VA);var LA=(d=>(d.Suggestion="suggestion",d.CanvasGloballyDisabled="canvas-globally-disabled",d.CannotInteractWithInputInVariableWithInternalCalls="cannot-interact-with-input-in-variable-with-internal-calls",d.CannotInteractWithOutputInVariableWithInternalCalls="cannot-interact-with-output-in-variable-with-internal-calls",d))(LA||{});const gTe=Object.values(LA);function DTe(d,u){const i=[...d,...u];return Array.from(new Set(i))}function OTe(d,u){const i=[...d,...u],a=Array.from(new Set(i));return{hasChanged:a.length!==d.length,reasons:a}}function CTe(d,u){const i=d.filter(o=>!u.includes(o));return{hasChanged:i.length!==d.length,reasons:i}}function $Te(d,u){return d.find(i=>i.entity.id===u)||null}function i5(d){return d.filter((u,i)=>d.indexOf(u)===i)}class Ai{constructor(u,i,a=null,o){g(this,"ids",[]);g(this,"entity");g(this,"entityCardHeight");g(this,"entityCardWidth");g(this,"index");g(this,"childEntities",[]);g(this,"children",[]);g(this,"parents",[]);g(this,"calculationEntryPoint");g(this,"_onlyEntities",null);g(this,"_changeSet",null);if(this.index=i,this.entity=u,this.calculationEntryPoint=a||this,this===this.calculationEntryPoint&&!o)throw new Error("Change set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(u,i,a){const o=Q6-PA-Y6,p=e5-rm-CA;u.metaSync({x:u.x||o,y:u.y||p},i);const e=new Ai(u,0,null,i);e._onlyEntities=a||[],e.ids=["0"];const y=[];e.next(E=>{y.push(...E)}),Ai.recursivelyAssembleChildrenAreas(y),e.resolveChildrenOverlaps();const v=e.flattenChildEntities();return e._onlyEntities?v.filter(E=>(e._onlyEntities||[]).includes(E)):v}static recursivelyAssembleChildrenAreas(u){const i=[];u.forEach(a=>{a.next(o=>{i.push(...o)})}),i.length>0&&Ai.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(u){this.calculationEntryPoint._changeSet=u}findAreaInChildrenFromEntity(u){if(this.entity===u)return this;const i=this.children.find(o=>o.entity===u);return i||this.children.reduce((o,p)=>o||p.findAreaInChildrenFromEntity(u),null)}findAreaFromEntity(u){if(this.entity===u)return this;const i=this.calculationEntryPoint.children,a=i.find(p=>p.entity===u);return a||i.reduce((p,e)=>p||e.findAreaInChildrenFromEntity(u),null)}addParent(u){if(!this.parents.includes(u)){const i=Ai.resolveIds(u,this.index);this.ids.push(...i),this.parents.push(u)}}static resolveIds(u,i){return u?u.ids.map(a=>`${a}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const u=bn(this.entity,!0);if(this.entity.type===f.Project){const i=[],a=[],o=[];u.forEach(e=>{if(f.DefinitionEntity===e.type){a.push(e);return}else if(Dt.includes(e.type)){o.push(e);return}i.push(e)});const p=i.sort((e,y)=>{const v=!!hm(e,y).length,E=bn(e),w=bn(y);return v?0:E.length&&!w.length?-1:!E.length&&w.length?1:0}).filter(e=>!Eo(e).length);this.childEntities=[...a,...o,...p]}else{const i=[],a=[],o=[],p=[],e=[];wi.includes(this.entity.type)&&ym(this.entity).forEach(E=>{if(yt.includes(E.type)){o.push(E);return}const w=mr(E);i.push(w)}),Nr.includes(this.entity.type)&&a.push(...this.entity.detachedChildren);const y=u.filter(v=>{const E=i.includes(v);return E||o.includes(v)||a.includes(v)?!1:yt.includes(v.type)?(o.push(v),!1):oi.includes(v.type)&&!E?(p.push(v),!1):v.type===f.DefinitionEntity?(e.push(v),!1):!0});i.sort((v,E)=>ml(v,E)?-1:0),p.sort((v,E)=>ml(v,E)?-1:0),o.sort((v,E)=>lb(v,E)?1:lb(E,v)?-1:0),this.childEntities=[...e,...i,...p,...y,...o,...a]}}calculateCardSize(){const u=r5(this.entity);this.entityCardWidth=u.width,this.entityCardHeight=u.height}static getBoundriesOfTwoAreas(u,i){return{top:Math.min(u.top,i.top),left:Math.min(u.left,i.left),bottom:Math.max(u.bottom,i.bottom),right:Math.max(u.right,i.right)}}static getBoundriedOfCombinedAreas(u,i){const a=u.filter(p=>!i.includes(p));return a.reduce((p,e)=>i.includes(e)?p:Ai.getBoundriesOfTwoAreas(p,e.fullBranchArea),a[0].fullBranchArea)}getFullAreaUntilAny(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!u.includes(e)).map(e=>e.getFullAreaUntilAny(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),i)}getFullAreaUntilAreaOrAnyChildren(u){const i=[u,...u.flattenChildren()],a=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),a)}getFullAreaUntil(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(p=>p!==u).map(p=>p.getFullAreaUntil(u)).reduce((p,e)=>Ai.getBoundriesOfTwoAreas(p,e),i)}get fullBranchArea(){const u=this.ownEntityPlusBufferArea;return this.children.map(o=>o.fullBranchArea).reduce((o,p)=>Ai.getBoundriesOfTwoAreas(o,p),u)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const u=this.ownEntityArea;return{top:u.top,left:u.left,bottom:u.bottom+rm,right:u.right+PA}}static filterOutRepeatedAreas(u){return u.filter((i,a)=>u.indexOf(i)===a)}getEarliestId(u,i){const a=u.split("-"),o=i.split("-");return a.length<o.length?u:a.length>o.length?i:a.reduce((e,y,v)=>y<o[v]?u:i,u)}getEarliestLevel(){return this.ids.reduce((a,o)=>this.getEarliestId(a,o),this.ids[0]).split("-").length}countColumns(){let u=0;if(this!==this.calculationEntryPoint)u++;else return u;if(!this.parents.length)return u;const a=this.parents.reduce((o,p)=>p.getEarliestLevel()>o.getEarliestLevel()?p:o,this.parents[0]).countColumns();return u+=a,u}getLatestId(u,i){if(u===i)return u;const a=u.split("-"),o=i.split("-");return a.length<o.length?i:a.length>o.length?u:a.reduce((e,y,v)=>y>o[v]?u:i,u)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((a,o)=>this.getLatestId(a,o),this.ids[0]).split("-").length}smoothPosition(){const u=this.flattenSiblings();if(!u.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(a=>{a!==this.calculationEntryPoint&&a.shiftDownAlone(i)})}else if([...Dt].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=u.filter(a=>!this.parents.includes(a));i.length?i.every(o=>{const p=this.countColumns(),e=o.countColumns();return p>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(u,i){if(u.includes(this))return u;this.move(this.entity,{y:this.entity.y+i});let a=[...u,this];return this.children.forEach(o=>{if(Ai.getEarliestParentInChain(o)!==this)return;const e=$Te(a,o.entity.id);a=Ai.filterOutRepeatedAreas([...a]),e||(a=a.filter(v=>v!==o));const y=o.shiftDownUntilAny(a,i);a.push(...y)}),a}shiftRightUntilAny(u,i){u.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(a=>{const o=Ai.filterOutRepeatedAreas([...this.flattenSiblings(),...u]);Ai.getEarliestParentInChain(a)===this&&a.shiftRightUntilAny(o,i)}))}shiftRight(u){this.move(this.entity,{x:this.entity.x+u}),this.children.forEach(i=>{const o=i.flattenSiblings().filter(p=>p!==i);i.shiftRightUntilAny(o,u)})}shiftDownAlone(u){this.move(this.entity,{y:this.entity.y+u})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const u=this.parents.reduce((o,p)=>{const e=p.ownEntityArea,y=e.top+Md,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(o,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Md;this.shiftDownAlone(a)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const u=this.children.reduce((o,p)=>{const e=p.ownEntityArea,y=e.top+Md,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(o,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Md;return this.shiftDownAlone(a),a}resolveChildrenOverlaps(){const u=this.flattenChildren();let i=[];u.forEach(a=>{const o=a.adjustVerticallyToAvoidOverlaps();i.push(...o)}),u.forEach(a=>{a.smoothPosition()})}static getEarliestParentInChain(u){let i=u.parents[0];return u.parents.length&&(i=u.parents.sort((a,o)=>{if(!a.ids.length)return-1;if(!o.ids.length)return 1;const p=a.ids.sort((y,v)=>y.length<v.length?-1:0),e=o.ids.sort((y,v)=>y.length<v.length?-1:0);return p[0].length-e[0].length})[0]),i}flattenEarlierSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,o)=>{if(u.has(o.entity.id))return a;u.add(o.entity.id);const e=o.children.slice(0,o.children.indexOf(this)).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,o)=>{if(u.has(o.entity.id))return a;u.add(o.entity.id);const e=o.children.filter(y=>y!==this).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenChildren(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a,...a.flattenChildren(u)]),[])}flattenParents(u=new Set){return this.parents.reduce((a,o)=>u.has(o.entity.id)?a:(u.add(o.entity.id),[...a,o,...o.flattenParents(u)]),[])}getAreaIfRendered(u){return this.calculationEntryPoint.flattenChildren().find(o=>o.entity.id===u.id)||null}getLowerSiblings(){const u=this.parents.reduce((i,a)=>{const o=a.children.indexOf(this),p=a.children.slice(o+1);return[...i,...p]},[]);return i5(u)}getLowerAreas(){const u=this.getLowerSiblings(),i=this.parents.reduce((a,o)=>[...a,...o.getLowerAreas()],[]);return i5([...u,...i])}adjustVerticallyToAvoidOverlaps(u=[]){const a=Ai.getEarliestParentInChain(this).children[this.index-1];if(!a)return u;const o=this.flattenEarlierSiblings(),p=this.flattenParents(),e=[...o,...p,a],E=R(e.flatMap(V=>hm(this.entity,V.entity))).filter(V=>V.id!==this.entity.id).map(V=>this.findAreaFromEntity(V)).filter(V=>!!V),w=this.getFullAreaUntilAny(E),A=a.getFullAreaUntilAny(E),P=e.reduce((V,U)=>U===this||U.fullBranchArea.left!==w.left?V:Math.max(V,U.fullBranchArea.bottom),A.bottom);if(w.top<P){const V=P-w.top+rm;return this.shiftDownUntilAny(u,V)}return u}move(u,i){(this.onlyEntities||[]).includes(u)&&u.metaSync(i,this.changeSet)}addChild(u){const i=this.childEntities[u];let a=null;i.x&&i.y?a=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),a||(a=new Ai(i,u,this.calculationEntryPoint));const o=this.ownEntityPlusBufferArea;this.children.includes(a)||(this.children.push(a),a.addParent(this));const p=a.fullBranchArea;if(p.left<o.right){const e=o.right-p.left;a.shiftRight(e)}return a}flattenChildEntities(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a.entity,...a.flattenChildEntities(u)]),[])}next(u){const i=[];this.childEntities.forEach((a,o)=>{const p=this.addChild(o);p&&i.push(p)}),u(i)}}var Gp=(d=>(d.Amazon="amazon",d.Google="google",d.Microsoft="microsoft",d))(Gp||{}),kr=(d=>(d.RelationalDatabase="relational-database",d.CompiledLocalCodebase="compiled-local-codebase",d.CloudHostedCodebase="cloud-hosted-codebase",d.HttpApi="http-api",d.HttpEndpoint="http-endpoint",d.ServerlessFunction="serverless-function",d))(kr||{}),MA=(d=>(d.Post="post",d.Get="get",d.Acknowledgement="acknowledgment",d.Progress="progress",d.Error="error",d.Complete="complete",d))(MA||{}),hl=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.Skipped="skipped",d.AbortedByUser="aborted-by-user",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(hl||{}),BA=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(BA||{}),mt=(d=>(d.ProjectNotFound="project-not-found",d.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",d.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",d.DeploymentCompleted="deployment-completed",d.DeploymentStarted="deployment-started",d.DeploymentFailed="deployment-failed",d.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",d.RequestPayloadValidationFailed="request-payload-validation-failed",d.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",d.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",d.ProjectAlreadyBeingPublished="project-already-being-published",d.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",d.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",d.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",d.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",d.CreatingNewRelationalDatabase="creating-new-relational-database",d.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",d.RelationalDatabaseAlreadyExists="relational-database-already-exists",d.RelationalDatabaseDeletionStarted="relational-database-deletion-started",d.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",d.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",d.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",d.HttpApiDeploymentStarted="http-api-deployment-started",d.HttpApiDeploymentCompleted="http-api-deployment-completed",d.HttpApiDeploymentFailed="http-api-deployment-failed",d.CreatingNewHttpApi="creating-new-http-api",d.HttpApiAlreadyExists="http-api-already-exists",d.HttpApiDeletionStarted="http-api-deletion-started",d.HttpApiDeletionCompleted="http-api-deletion-completed",d.HttpApiDeletionFailed="http-api-deletion-failed",d.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",d.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",d.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",d.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",d.BundlingCodebaseForDownload="bundling-codebase-for-download",d.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",d.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",d.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",d.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",d.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",d.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",d.CodeCompilationStarted="code-compilation-started",d.CodeCompilationCompleted="code-compilation-completed",d.CodeCompilationFailed="code-compilation-failed",d.BundleCodebaseStarted="bundle-codebase-started",d.BundleCodebaseCompleted="bundle-codebase-completed",d.BundleCodebaseFailed="bundle-codebase-failed",d.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",d.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",d.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",d.MigrateRelationalDatabaseStarted="migrate-relational-database-started",d.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",d.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",d))(mt||{}),An=(d=>(d.CodeCompilation="code-compilation",d.RelationalDatabaseDeployment="relational-database-deployment",d.RelationalDatabaseDeletion="relational-database-deletion",d.HttpApiDeployment="http-api-deployment",d.HttpApiDeletion="http-api-deletion",d.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",d.BundleCodebase="bundle-codebase",d.MigrateRelationalDatabase="migrate-relational-database",d.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",d.CodebaseCleanup="codebase-cleanup",d))(An||{});kr.CloudHostedCodebase,kr.HttpApi,kr.RelationalDatabase,kr.CloudHostedCodebase,kr.CloudHostedCodebase,kr.RelationalDatabase,kr.CloudHostedCodebase,kr.CloudHostedCodebase;function s5(d){return`project-${d}-http-api`}function n5(d){return`entity-${d}-database`}class a5{constructor(u,i,a,o,p,e,y,v,E){g(this,"stepType");g(this,"id");g(this,"resourceType");g(this,"index");g(this,"dependency",[]);g(this,"lastEvent",null);g(this,"lasEventTimestamp",null);g(this,"status",hl.Queued);g(this,"publicationRun");g(this,"resource");this.stepType=u,this.id=i,this.resourceType=a,this.status=o,this.dependency=p,this.index=e,this.lasEventTimestamp=y,this.publicationRun=v,this.resource=E}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(u){var i,a;this.status=u.status,this.dependency=u.dependency,this.index=u.index,this.stepType=u.stepType,this.resourceType=u.resourceType,this.lastEvent=u.lastEvent,this.id=u.id,(a=this.resource)==null||a.setDetails((i=u.resource)==null?void 0:i.details)}}var o5=(d=>(d.Ready="ready",d.Provisioning="provisioning",d.Queued="queued",d.ProvisioningFailed="provisioning-failed",d.Deleting="deleting",d.DeletingFailed="deleting-failed",d.Deleted="deleted",d))(o5||{});class UA{constructor(u,i,a){g(this,"provisionedBy");g(this,"publicationRun");g(this,"resourceType");g(this,"provider");g(this,"resourceId");g(this,"details",null);g(this,"name",null);g(this,"status","queued");this.publicationRun=u,this.resourceType=i,this.provider=a}setDetails(u){this.details=u}setStatus(u){this.status=u}setProvisionedBy(u){this.provisionedBy=u}}class xA extends UA{constructor(i,a,o,p){super(i,o,p);g(this,"resourceType");g(this,"owners",new Map);g(this,"details",null);g(this,"status","queued");a.forEach(e=>{this.owners.set(e.id,e)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,a;return this.resourceType===kr.HttpApi?this.resourceId=s5(this.publicationRun.project.id):this.resourceType===kr.RelationalDatabase&&(this.resourceId=n5((a=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:a.id)),this.resourceId}}class jA extends UA{constructor(i,a,o){super(i,a,o);g(this,"resourceType");g(this,"details",null);g(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceType===kr.CompiledLocalCodebase?this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`:this.resourceType===kr.CloudHostedCodebase&&(this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`),this.resourceId}}class PTe{constructor(u,i){g(this,"id");g(this,"projectAutoIncrementPublicationCount");g(this,"projectPublishedSemanticVersion");g(this,"projectVersion");g(this,"projectId");g(this,"cloudProvider");g(this,"triggeredBy");g(this,"createdAt");g(this,"updatedAt");g(this,"status");g(this,"steps",[]);g(this,"editor");g(this,"explicitResources",new Map);g(this,"implicitGlobalResources",new Map);g(this,"finalGlobalEvent",null);g(this,"finalStatus",null);this.id=u.id,this.projectAutoIncrementPublicationCount=u.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=u.projectPublishedSemanticVersion,this.projectVersion=u.projectVersion,this.projectId=u.projectId,this.cloudProvider=u.cloudProvider,this.triggeredBy=u.triggeredBy,this.createdAt=u.createdAt,this.updatedAt=u.updatedAt,this.status=u.status,this.editor=i}get project(){return this.editor.project}getInfraTypes(u){return this.steps.filter(i=>u.includes(i.resourceType))}getStepsTypes(u){return this.steps.filter(i=>u.includes(i.stepType))}toIds(u){return u.map(i=>i.id)}getResourceForEntity(u){const i=Array.from(this.explicitResources.values()).find(a=>a.owners.has(u.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(kr.CompiledLocalCodebase,new jA(this,kr.CompiledLocalCodebase,Gp.Amazon)),this.implicitGlobalResources.set(kr.CloudHostedCodebase,new jA(this,kr.CloudHostedCodebase,Gp.Amazon));const u=this.project.entities.filter(a=>es(a,Le.HTTP_ENDPOINT)),i=this.project.entities.filter(a=>es(a,Le.RELATIONAL_DATABASE));if(i.length&&i.forEach(a=>{const o=new xA(this,[a],kr.RelationalDatabase,Gp.Amazon);this.explicitResources.set(o.resourceId,o)}),u.length){const a=new xA(this,u,kr.HttpApi,Gp.Amazon);this.explicitResources.set(a.resourceId,a)}}setSteps(u,i){u.forEach(a=>{this.addStep(a,i)}),this.editor.events.emit(mt.ProjectPublishRequestAcknowledged,{})}addStep(u,i){const a=u.dependency||[];if(a.length){const p=a.filter(e=>!this.steps.find(y=>y.id===e));if(p.length)throw new Error(`Missing dependencies: ${p.join(", ")}`)}if(!u.resource)throw new Error(`Resource not found for step ${u.stepType} (${u.id})`);if(!this.steps.find(p=>p.id===u.id)){const p=this.implicitGlobalResources.get(u.resourceType)||this.explicitResources.get(u.resource.resourceId),e=new a5(u.stepType,u.id,u.resourceType,u.status,a,u.index,i,this,p);this.steps.push(e)}}onUpdate(u){var i;if(Me.log("onUpdate",u),(i=u.payload)!=null&&i.stepType){const a=this.steps.find(o=>{var p;return o.id===((p=u.payload)==null?void 0:p.id)});a&&L(u.emittedAt).isAfter(L(a.lasEventTimestamp))&&a.update(u.payload)}this.editor.events.emit("publication-updated",{}),u.type===MA.Error?(this.finalStatus=BA.Failed,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-error",u)):u.type===MA.Complete&&(this.finalStatus=BA.Success,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-completed",u))}}function NTe(d){switch(d){case An.CodeCompilation:return"Code generation";case An.RelationalDatabaseDeployment:return"Database creation";case An.HttpApiDeployment:return"HTTP gateway creation";case An.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case An.BundleCodebase:return"Bundle code";case An.MigrateRelationalDatabase:return"Database structure migration";case An.BusinessLogicCodebaseDeployment:return"Update servers with new code";case An.CodebaseCleanup:return"Code cleanup";case An.HttpApiDeletion:return"HTTP gateway deletion";case An.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function VTe(d){switch(d){case mt.DeploymentCompleted:return"Successfully published";case mt.DeploymentStarted:return"Publication started";case mt.DeploymentFailed:return"Publication failed";case mt.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case mt.RequestPayloadValidationFailed:return"Request payload validation failed";case mt.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case mt.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case mt.RelationalDatabaseDeploymentStarted:return"Database creation started";case mt.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case mt.RelationalDatabaseDeploymentFailed:return"Database creation failed";case mt.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case mt.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case mt.RelationalDatabaseAlreadyExists:return"Database already exists";case mt.HttpApiDeploymentStarted:return"HTTP gateway creation started";case mt.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case mt.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case mt.CreatingNewHttpApi:return"Creating new HTTP gateway";case mt.HttpApiAlreadyExists:return"HTTP gateway already exists";case mt.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case mt.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case mt.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case mt.BundlingCodebaseForDownload:return"Bundling code for download";case mt.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case mt.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case mt.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case mt.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case mt.CodeCompilationStarted:return"Code generation started";case mt.CodeCompilationCompleted:return"Code generation completed";case mt.CodeCompilationFailed:return"Code generation failed";case mt.BundleCodebaseStarted:return"Code bundling started";case mt.BundleCodebaseCompleted:return"Code bundling completed";case mt.BundleCodebaseFailed:return"Code bundling failed";case mt.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case mt.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case mt.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case mt.MigrateRelationalDatabaseStarted:return"Database structure migration started";case mt.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case mt.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case mt.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case mt.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case mt.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case mt.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case mt.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case mt.ProjectNotFound:return"Project not found";case mt.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case mt.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case mt.HttpApiDeletionStarted:return"HTTP gateway deletion started";case mt.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case mt.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case mt.RelationalDatabaseDeletionStarted:return"Database deletion started";case mt.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case mt.RelationalDatabaseDeletionFailed:return"Database deletion failed";case mt.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var l5=(d=>(d.NO_LOGIC="NO_LOGIC",d.NO_NAME="NO_NAME",d.NO_CHANGES="NO_CHANGES",d.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",d))(l5||{});function LTe(d){switch(d){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function MTe(d){switch(d){case kr.RelationalDatabase:return"Relational database";case kr.HttpEndpoint:case kr.HttpApi:return"HTTP endpoints";case kr.ServerlessFunction:case kr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function BTe(d){switch(d){case hl.Running:return"In progress";case hl.Failed:return"Failed";case hl.Success:return"Succeeded";case hl.Skipped:return"Skipped";case hl.Queued:default:return"Queued"}}function UTe(d,u){let i=null;const a=[];if(!d.id)i={...d,id:N.UUID.uuid()};else if(!Db(d.id)){const y=N.UUID.uuid();i={...d,id:y},a.push(new ie({id:`${d.id}--${k.InvalidUUIDStringFormat}`,message:`Entity with id "${d.id}" has an invalid UUID string format. The 'id' property must be a valid UUID string.
|
|
199
|
+
`+p):a.stack=p}catch{}}throw a}}_request(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=fl(this.defaults,i);const{transitional:a,paramsSerializer:o,headers:p}=i;a!==void 0&&Wy.assertOptions(a,{silentJSONParsing:Jn.transitional(Jn.boolean),forcedJSONParsing:Jn.transitional(Jn.boolean),clarifyTimeoutError:Jn.transitional(Jn.boolean)},!1),o!=null&&(Te.isFunction(o)?i.paramsSerializer={serialize:o}:Wy.assertOptions(o,{encode:Jn.function,serialize:Jn.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Wy.assertOptions(i,{baseUrl:Jn.spelling("baseURL"),withXsrfToken:Jn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=p&&Te.merge(p.common,p[i.method]);p&&Te.forEach(["delete","get","head","post","put","patch","common"],U=>{delete p[U]}),i.headers=Tn.concat(e,p);const y=[];let v=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(i)===!1||(v=v&&F.synchronous,y.unshift(F.fulfilled,F.rejected))});const E=[];this.interceptors.response.forEach(function(F){E.push(F.fulfilled,F.rejected)});let w,A=0,P;if(!v){const U=[FF.bind(this),void 0];for(U.unshift.apply(U,y),U.push.apply(U,E),P=U.length,w=Promise.resolve(i);A<P;)w=w.then(U[A++],U[A++]);return w}P=y.length;let V=i;for(A=0;A<P;){const U=y[A++],F=y[A++];try{V=U(V)}catch(K){F.call(this,K);break}}try{w=FF.call(this,V)}catch(U){return Promise.reject(U)}for(A=0,P=E.length;A<P;)w=w.then(E[A++],E[A++]);return w}getUri(u){u=fl(this.defaults,u);const i=NF(u.baseURL,u.url,u.allowAbsoluteUrls);return wF(i,u.params,u.paramsSerializer)}}Te.forEach(["delete","get","head","options"],function(u){Jy.prototype[u]=function(i,a){return this.request(fl(a||{},{method:u,url:i,data:(a||{}).data}))}}),Te.forEach(["post","put","patch"],function(u){function i(a){return function(p,e,y){return this.request(fl(y||{},{method:u,headers:a?{"Content-Type":"multipart/form-data"}:{},url:p,data:e}))}}Jy.prototype[u]=i(),Jy.prototype[u+"Form"]=i(!0)});const Yy=Jy;class AA{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(p){i=p});const a=this;this.promise.then(o=>{if(!a._listeners)return;let p=a._listeners.length;for(;p-- >0;)a._listeners[p](o);a._listeners=null}),this.promise.then=o=>{let p;const e=new Promise(y=>{a.subscribe(y),p=y}).then(o);return e.cancel=function(){a.unsubscribe(p)},e},u(function(p,e,y){a.reason||(a.reason=new Ld(p,e,y),i(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=a=>{u.abort(a)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new AA(function(o){u=o}),cancel:u}}}const lTe=AA;function dTe(d){return function(i){return d.apply(null,i)}}function uTe(d){return Te.isObject(d)&&d.isAxiosError===!0}const bA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bA).forEach(([d,u])=>{bA[u]=d});const cTe=bA;function kF(d){const u=new Yy(d),i=lF(Yy.prototype.request,u);return Te.extend(i,Yy.prototype,u,{allOwnKeys:!0}),Te.extend(i,u,null,{allOwnKeys:!0}),i.create=function(o){return kF(fl(d,o))},i}const ui=kF(yA);ui.Axios=Yy,ui.CanceledError=Ld,ui.CancelToken=lTe,ui.isCancel=OF,ui.VERSION=SF,ui.toFormData=Fy,ui.AxiosError=Ot,ui.Cancel=ui.CanceledError,ui.all=function(u){return Promise.all(u)},ui.spread=dTe,ui.isAxiosError=uTe,ui.mergeConfig=fl,ui.AxiosHeaders=Tn,ui.formToJSON=d=>gF(Te.isHTMLForm(d)?new FormData(d):d),ui.getAdapter=GF.getAdapter,ui.HttpStatusCode=cTe,ui.default=ui;const pTe=ui;class qF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Addition);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const e=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)}).reduce((y,v)=>y+v,0);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class ZF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Subtraction);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o,y=p-e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class HF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Multiplication);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const e=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)}).reduce((y,v)=>y*v,1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class WF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Division);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o;if(e===0)throw new Error("Division by zero is not allowed");const y=p/e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class JF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Remainder);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o;if(e===0)throw new Error("Division by zero is not allowed");const y=p%e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class YF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Zt.Exponentiation);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),[p,e]=o,y=Math.pow(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class zF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomInteger);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=Mve(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class XF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomFloat);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=sF();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class QF extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomHexadecimal);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=nF(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class e6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomBase62);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=aF(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class t6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomBase64);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=Uve(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class r6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomAlphanumeric);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0],e=xve(p);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class i6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateIdentifier);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=oF(p,e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class s6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateRandomUUIDv4);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=cl();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class n6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{Me.log("Initializing Random Generate Short Identifier Module");const a=i.find(o=>o.contextType===be.Logic);if(a){Me.log("Project state found, setting up operation");const o=a.get(_e.GenerateShortIdentifier);o?(Me.log("Operation found, setting autoexecutable and implementation"),o.autoexecutable=!0,o.implementation=this.module.main):Me.warn("Operation generate-short-identifier not found in project state")}else Me.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,a)=>{try{const o=jve();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class a6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(_e.GenerateHexadecimalToken);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=Gve();return{value:oe.Success,error:null,results:[o]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class o6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Join);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],y=o.slice(1).join(p);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class l6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT,version:"1.0.0",description:"String split operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Split);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1],y=p.split(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class d6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST,version:"1.0.0",description:"String delete last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.slice(0,-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class u6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST,version:"1.0.0",description:"String delete first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.slice(1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class c6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Reverse);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.split("").reverse().join("");return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class p6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ToLowerCase);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.toLowerCase();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class f6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ToUpperCase);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.toUpperCase();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class h6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.DeleteIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const y=p.slice(0,e)+p.slice(e+1);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class y6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.AddIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=p.slice(0,e)+y+p.slice(e);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class m6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST,version:"1.0.0",description:"String replace first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.replace(e,y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class v6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST,version:"1.0.0",description:"String replace last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.lastIndexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=p.slice(0,v)+p.slice(v).replace(e,y);return{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class E6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=p.slice(0,e)+y+p.slice(e+1);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class T6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_SINGLE_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceSingleMatch);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.replace(e,y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class I6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.ReplaceAllMatches);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const v=p.split(e).join(y);return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class A6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetIndexItem);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.charAt(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class b6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST,version:"1.0.0",description:"String get first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.charAt(0);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class w6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST,version:"1.0.0",description:"String get last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const e=p.charAt(p.length-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class R6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.GetIndexOf);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.indexOf(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class _6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Append);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p+e;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class g6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(Ge.Prepend);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=e+p;return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class D6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Join);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=p.join(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class O6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Split);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No string provided or string is empty",results:[]};const y=p.split(e);return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class C6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Reverse);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice().reverse();return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class $6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST,version:"1.0.0",description:"List delete last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.DeleteLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice(0,-1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class P6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST,version:"1.0.0",description:"List delete first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.DeleteFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p.slice(1);return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class N6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.AddIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=[...p.slice(0,e),y,...p.slice(e)];return{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class V6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceIndex);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(E=>{var w,A;return((w=E.value)==null?void 0:w.valueAsType)||((A=E.value)==null?void 0:A.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const v=[...p];return v[e]=y,{value:oe.Success,error:null,results:[v]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class L6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST,version:"1.0.0",description:"List replace first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const v=p.indexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=[...p];return E[v]=y,{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class M6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST,version:"1.0.0",description:"List replace last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.ReplaceLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0],e=o[1],y=o[2];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const v=p.lastIndexOf(e);if(v===-1)return{value:oe.Success,error:null,results:[p]};const E=[...p];return E[v]=y,{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class B6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetIndexItem);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};if(e<0||e>=p.length)return{value:oe.Error,error:"Index out of bounds",results:[]};const y=p[e];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class U6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetFirst);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p[0];return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class x6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.GetLast);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const e=p[p.length-1];return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class j6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Append);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=[...p,e];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class G6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(qe.Prepend);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[0],e=o[1];if(!p||p.length===0)return{value:oe.Error,error:"No list provided or list is empty",results:[]};const y=[e,...p];return{value:oe.Success,error:null,results:[y]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class F6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_PARALLEL,version:"1.0.0",description:"Execution parallel operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Parallel);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(A=>{var P,V;return((P=A.value)==null?void 0:P.valueAsType)||((V=A.value)==null?void 0:V.value)})[0];if(!p)return{value:oe.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(p))return{value:oe.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const y=this.extensionsRegistry.requestContexts(this,[be.Editor])[0],E=p.map(A=>{const P=new In(y.logic,[A],A,null,this.extensionsRegistry);return P.inheritValuesFromContext(y),P}).map(A=>A.execute()),w=await Promise.all(E);return{value:oe.Success,error:null,results:[w]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class S6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SEQUENTIAL,version:"1.0.0",description:"Execution sequential operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Sequential);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)})[0];if(!p)return{value:oe.Error,error:"No list of action entities provided",results:[]};if(!Array.isArray(p))return{value:oe.Error,error:"Invalid input value. Expected a list of action entities",results:[]};const e=[];for(let y=0;y<p.length;y++){const v=p[y],w=this.extensionsRegistry.requestContexts(this,[be.Editor])[0],A=new In(w.logic,[v],v,null,this.extensionsRegistry);A.inheritValuesFromContext(w);const P=await A.execute();e.push(P)}return{value:oe.Success,error:null,results:[e]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class K6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(tr.Wait);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const p=a.map(e=>{var y,v;return((y=e.value)==null?void 0:y.valueAsType)||((v=e.value)==null?void 0:v.value)})[0];return typeof p!="number"||p<0?{value:oe.Error,error:"Invalid wait time provided",results:[]}:(await new Promise(e=>setTimeout(e,p)),{value:oe.Success,error:null,results:[]})}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class k6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CREATE_NEW_INSTANCE,version:"1.0.0",description:"Entity create new instance operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(cr.CreateNewInstance);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(w=>{var A,P;return((A=w.value)==null?void 0:A.valueAsType)||((P=w.value)==null?void 0:P.value)}),p=o[0];if(!p)return{value:oe.Error,error:"No entity template provided",results:[]};if(!(p instanceof Qn))return{value:oe.Error,error:"Invalid entity template value provided",results:[]};const e=o[1]||{},v=Vi(p).map(w=>w.name);let E=e;if(v.includes(Le.PERSISTED_ENTITY)){const w=p.properties.find(P=>{var V;return((V=P.implements)==null?void 0:V.id)===he["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id});if(!w)return{value:oe.Error,error:"No database property found in entity",results:[]};if(!w.getDefaultValue())return{value:oe.Error,error:"Database property has no database as entity as default value",results:[]}}return{value:oe.Success,error:null,results:[E]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class q6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(cr.Validate);o&&(o.autoexecutable=!0,o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(y=>{var v,E;return((v=y.value)==null?void 0:v.valueAsType)||((E=y.value)==null?void 0:E.value)});Me.log("Inputs for entity validation: ",o);const e=JE(o[1]).safeParse(o[0]);return e.success?{value:oe.Success,error:null,results:[o[0]]}:{value:oe.Error,error:e.error.errors,results:[]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class Z6 extends rt{constructor(){super(...arguments);g(this,"manifest",{id:Qe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Ye.High,permissions:[Xe.All],contexts:[be.Logic]});g(this,"module",{init:i=>{const a=i.find(o=>o.contextType===be.Logic);if(a){const o=a.get(yi.HttpRequest);o&&(o.implementation=this.module.main)}},main:async(i,a)=>{try{const o=a.map(v=>{var E,w;return((E=v.value)==null?void 0:E.valueAsType)||((w=v.value)==null?void 0:w.value)}),p=o[3]||{},e={method:o[0],url:o[1],params:o[2],headers:p,data:o[4]};Me.log("Axios request config: ",e);const y=await pTe(e);return{value:oe.Success,error:null,results:[y.status,y.headers,y.data]}}catch(o){return{value:oe.Error,error:o,results:[]}}}})}}class wA extends nA{constructor(u,i,a=i.projectId){super(u,be.Editor),this._editor=i,this.id=a}get ready(){return this._editor.ready}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get branch(){return this._editor.branch}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(u){this._editor.undoableStackValueIndex=u}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}removeValueByOwnerId(u){return this._editor.removeValueByOwnerId(u)}removeValue(u){return this._editor.removeValue(u)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(u,i){return this._editor.initTest(u,i)}removeTest(){return this._editor.removeTest()}async copyEntities(u){return this._editor.copyEntities(u)}resolveInitialChildrenPositions(u,i,a){return this._editor.resolveInitialChildrenPositions(u,i,a)}publish(){return this._editor.publish()}loadActivePublication(u){return this._editor.loadActivePublication(u)}requestActiveDynamicValue(u){return this._editor.requestActiveDynamicValue(u)}}function fTe(d,u){return u instanceof wA?u:new wA(d,u)}function hTe(d){d.register(new iF(d)),d.register(new rF(d)),d.register(new XG(d)),d.register(new eF(d)),d.register(new tF(d)),d.register(new QG(d)),d.register(new qF(d)),d.register(new ZF(d)),d.register(new HF(d)),d.register(new JF(d)),d.register(new WF(d)),d.register(new YF(d)),d.register(new zF(d)),d.register(new XF(d)),d.register(new QF(d)),d.register(new e6(d)),d.register(new t6(d)),d.register(new r6(d)),d.register(new i6(d)),d.register(new s6(d)),d.register(new n6(d)),d.register(new a6(d)),d.register(new o6(d)),d.register(new l6(d)),d.register(new d6(d)),d.register(new u6(d)),d.register(new c6(d)),d.register(new p6(d)),d.register(new f6(d)),d.register(new h6(d)),d.register(new y6(d)),d.register(new m6(d)),d.register(new v6(d)),d.register(new E6(d)),d.register(new T6(d)),d.register(new I6(d)),d.register(new A6(d)),d.register(new b6(d)),d.register(new w6(d)),d.register(new R6(d)),d.register(new _6(d)),d.register(new g6(d)),d.register(new D6(d)),d.register(new O6(d)),d.register(new C6(d)),d.register(new $6(d)),d.register(new P6(d)),d.register(new N6(d)),d.register(new V6(d)),d.register(new L6(d)),d.register(new M6(d)),d.register(new B6(d)),d.register(new U6(d)),d.register(new x6(d)),d.register(new j6(d)),d.register(new G6(d)),d.register(new F6(d)),d.register(new S6(d)),d.register(new K6(d)),d.register(new k6(d)),d.register(new q6(d)),d.register(new Z6(d))}class H6{constructor(u=new Lp){g(this,"extensionsRegistry",new Map);g(this,"initialized",new Set);g(this,"initializedContexts",new Set);g(this,"onResolveEditorContextCallback",()=>null);g(this,"onResolveProjectLogicContextCallback",()=>null);g(this,"onResolveGUIContextCallback",()=>null);g(this,"onResolveCompileContextCallback",()=>null);this.events=u,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(u){this.onResolveEditorContextCallback=u}onResolveProjectLogicContext(u){this.onResolveProjectLogicContextCallback=u}onResolveGUIContext(u){this.onResolveGUIContextCallback=u}onResolveCompileContext(u){this.onResolveCompileContextCallback=u}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((u,i)=>(u.manifest.initPriority||Ye.Normal)-(i.manifest.initPriority||Ye.Normal))}async setup(){hTe(this),Me.log("Initializing extensions without context..."),this.initForReady()}requestContext(u){switch(u){case be.Editor:return this.onResolveEditorContextCallback();case be.Logic:return this.onResolveProjectLogicContextCallback();case be.GUI:return this.onResolveGUIContextCallback();case be.Compile:return this.onResolveCompileContextCallback();default:throw new Error(`Unknown context type: ${u}`)}}requestContexts(u,i=[]){const a=[];i.length===0&&(i=u.manifest.contexts);for(const o of i){const p=this.requestContext(o);p&&a.push(p)}return a}requestModule(u){const i=this.extensionsRegistry.get(u);if(i){if(i.module)return i.module;throw new Error(`Module ${u} is not registered properly.`)}throw new Error(`Unknown module: ${u}`)}register(u){this.extensionsRegistry.set(u.manifest.id,u)}async initAll(){var u,i;for(const a of this.extensionInOrder)if(a.module.init&&!this.initialized.has(a.manifest.id)){const o=a.manifest.contexts.map(p=>this.requestContext(p)).filter(p=>p!==null);o.length&&(await((i=(u=a.module).init)==null?void 0:i.call(u,o)),this.initialized.add(a.manifest.id))}else!a.module.init&&!this.initialized.has(a.manifest.id)&&this.initialized.add(a.manifest.id)}async initForReady(){Me.log("Initializing extensions for ready contexts...");for(const u of this.extensionInOrder)if(u.module.init&&!this.initialized.has(u.manifest.id)){Me.log("Initializing "+u.manifest.id+" extension...");const i=this.requestContexts(u);u.manifest.contexts.every(o=>!!i.find(p=>p.contextType===o))?(await u.module.init(i),this.initialized.add(u.manifest.id)):Me.warn(`Skipping initialization of ${u.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${u.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(o=>o.contextType).join(", ")}`)}else!u.module.init&&!this.initialized.has(u.manifest.id)?(Me.log("Set "+u.manifest.id+" extension as initialized by default..."),this.initialized.add(u.manifest.id)):Me.log(`Skipping initialization of ${u.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const u of[...this.extensionInOrder].reverse())u.module.destroy&&await u.module.destroy();this.events.destroy()}on(u,i){this.events.on(u,i)}emit(u,...i){this.events.emit(u,...i)}off(u,i){this.events.off(u,i)}emitAsync(u,...i){return this.events.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.events.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.events.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.events.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.events.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.events.emitAsyncSequentiallyAllSettled(u,...i)}async contextAvailable(u){if(this.initializedContexts.has(u)){Me.warn(`Context ${u} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(u),u){case be.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case be.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Me.log(`Context ${u} is now available. Initializing extensions for this context...`),await this.initForReady()}}let zy=null;const RA={requestModule:d=>(zy||(zy=new H6,zy.setup()),zy.requestModule(d))},po={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var _A=(d=>(d.FinishedSuccess="finished-success",d.FinishedError="finished-error",d.Running="running",d.Paused="paused",d.Stopped="stopped",d.NotStarted="not-started",d))(_A||{});const W6={...RA};class In extends Lp{constructor(i,a,o,p=null,e=W6){super();g(this,"project");g(this,"entryPoint");g(this,"state","not-started");g(this,"events",new Lp);g(this,"entities",[]);g(this,"parentExecution",null);g(this,"executing",[]);g(this,"executed",[]);g(this,"skipped",[]);g(this,"scheduled",[]);g(this,"localTestValues");g(this,"resolvedValues");g(this,"persistedExecutionResults");g(this,"lastExecutionResults");g(this,"onAddToSkippedListCallback",null);g(this,"onRemoveFromSkippedListCallback",null);g(this,"onAddEntityCallback",null);g(this,"onRemoveEntityCallback",null);this.parentContext=e,this.entities=a,this.entryPoint=o,this.project=i,this.parentExecution=p,this.localTestValues=new gp(N.UUID.uuid(),this.project),this.resolvedValues=new gp(N.UUID.uuid(),this.project),this.persistedExecutionResults=new gp(N.UUID.uuid(),this.project),this.lastExecutionResults=new gp(N.UUID.uuid(),this.project)}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults}}skip(i){this.hasEntity(i)&&(this.skipped.includes(i)||(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),wi.includes(i.type)&&[...i.successCalls||[],...i.errorCalls||[],...i.calls||[]].forEach(a=>this.skip(a))))}async schedule(i,a,o){if(this.hasExecuted(i))return null;if(Dt.includes(i.type))return this.executeBranch(i,o,a);if(oi.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,o,a);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,a){const o=[];return[...pr,...Dt].includes(a.type)?o.push(...a.inputs):fr.includes(a.type)&&o.push(...a.outputs),o.map(e=>{var v;let y=i.find(E=>E.valueOwner.id===e.id);if(y)return y;if(!y&&Dt.includes(a.type)&&(y=i.find(E=>{var w;return((w=E.valueOwner.declaration)==null?void 0:w.id)===e.id})),y){const E=(v=y.value)==null?void 0:v.clone(null);return E==null||E.setStandaloneParent(e),{...y,valueOwner:e,value:E||null,inheritanceLink:{sources:[y],target:e}}}return un.includes(e.type)?My(e,this.valueResolutionContext):ll(e,this.valueResolutionContext)}).reduce((e,y)=>{const v=vn(y==null?void 0:y.valueOwner,this.project),E=y?[y]:[];return v.forEach(w=>{var V,U,F;if(w.id===(y==null?void 0:y.valueOwner.id))return;const A=dt(w.getDataType(null),w,this.project);A==null||A.metaSync({value:(V=y==null?void 0:y.value)==null?void 0:V.value},null),A==null||A.setValueAsTypeList(((U=y==null?void 0:y.value)==null?void 0:U.valueAsTypeList)||null),A==null||A.setValueAsTypeSingle(((F=y==null?void 0:y.value)==null?void 0:F.valueAsTypeSingle)||null);const P={...y,valueOwner:w,value:A};E.push(P)}),[...e,...E]},[]).sort((e,y)=>e.valueOwner.index-y.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};if(a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),Object.values(Jr).includes(i.declaration.id)){const w=this.parentContext.requestModule(Pd+i.declaration.id).main;w?E=await w(i,a):Me.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{E=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,o,e);const w=i.outputs.map(P=>{var q,ne,W,de;const V=[...P.declaration.getCounterparts(),P.declaration],U=E.results.find(X=>V.some(z=>X.valueOwner.id===(z==null?void 0:z.id))),F=P==null?void 0:P.getDataType(null),K=dt(F,P,o);return F!=null&&F.asType?Array.isArray((q=U==null?void 0:U.value)==null?void 0:q.valueAsType)?K==null||K.setValueAsTypeList((ne=U==null?void 0:U.value)==null?void 0:ne.valueAsTypeList):K==null||K.setValueAsTypeSingle(((W=U==null?void 0:U.value)==null?void 0:W.valueAsType)||null):K==null||K.metaSync({value:(de=U==null?void 0:U.value)==null?void 0:de.value},null),{valueOwner:P,type:Ae.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(E.error){Me.warn("Raw error executing entity: ",E.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,o);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(E.error):V==null||V.metaSync({value:E.error},null),A={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:V}}return{value:E.value,entity:i,error:A,results:w}}return{...E,entity:i}}catch(E){Me.warn("Internal call execution error: ",E);let w=null;if(i.error){const A=(v=i.error)==null?void 0:v.getDataType(null),P=dt(A,i.error,o);A!=null&&A.asType?P==null||P.setValueAsTypeSingle(E):P==null||P.metaSync({value:E},null),w={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:P}}return{value:oe.Error,entity:i,error:w,results:[]}}}static async executeOperation(i,a,o){var p,e;try{let y={value:oe.Success,error:null,results:[]};a.sort((w,A)=>w.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(y=await i.declaration.implementation(i,a));const v=i.outputs.map((w,A)=>{const P=w==null?void 0:w.getDataType(null),V=dt(P,w,o);return P!=null&&P.asType?V==null||V.setValueAsTypeSingle(y.results[A]):V==null||V.metaSync({value:y.results[A]},null),{valueOwner:w,type:Ae.ExecutionResult,inheritanceLink:null,value:V}});let E=null;if(y.error&&i.error){Me.warn("Raw error executing entity: ",y.error);const w=((p=i.error)==null?void 0:p.getDataType(null))||null,A=dt(w,i.error,o);w!=null&&w.asType?A==null||A.setValueAsTypeSingle(y.error):A==null||A.metaSync({value:y.error},null),E={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A}}return{value:y.value,entity:i,error:E,results:v}}catch(y){Me.warn("Operation execution error: ",y);let v=null;if(i.error){const E=(e=i.error)==null?void 0:e.getDataType(null),w=dt(E,i.error,o);E!=null&&E.asType?w==null||w.setValueAsTypeSingle(y):w==null||w.metaSync({value:y},null),v={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:w}}return{value:oe.Error,entity:i,error:v,results:[]}}}async executeSearch(i,a,o){var p;try{let e={value:oe.Success,error:null,results:[]};const y=i.outputs[0];if(!y)return{value:oe.Success,entity:i,error:null,results:[]};let v={value:null,valueOwner:y,type:Ae.ExecutionResult,inheritanceLink:null};const E=await this.parentContext.requestModule(Qe.SEARCH_NODE_IMPLEMENTATION).main(i,a),w=y==null?void 0:y.getDataType(null),A=dt(w,y,o);return A==null||A.metaSync({value:E.data},null),v.value=A,{value:e.value,entity:i,error:null,results:[v]}}catch(e){if(Me.warn(`Search node execution error: ${e}`),!i.error)return{value:oe.Error,entity:i,error:null,results:[]};const y=(p=i.error)==null?void 0:p.getDataType(null),v=dt(y,i.error,o);return v==null||v.metaSync({value:e},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:v},results:[]}}}async executeLoop(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};const w=a.map(K=>{var q,ne;return((q=K==null?void 0:K.value)==null?void 0:q.valueAsType)||((ne=K==null?void 0:K.value)==null?void 0:ne.value)});let A={};i.getUniqueReturnDeclarations().forEach(K=>{const q=i.body.inputs.find(X=>J(X,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(K)),ne=K==null?void 0:K.getDataType(null),W=dt(ne,q,o);ne!=null&&ne.asType?W==null||W.setValueAsTypeList([]):W==null||W.metaSync({value:[]},null),this.lastExecutionResults.writeValue(q,W);const de={value:W,valueOwner:q,type:Ae.ExecutionResult,inheritanceLink:null};A[q.id]=de});let V={value:oe.Success,entity:i.body,error:null,results:[]};switch(i.declaration.id){case he.loop["counted-loop"].id:{const K=w[0];let q=1;for(;q<=K&&q<=50;){const ne=i.body.inputs.map(de=>{if(de===i.currentIterationNumberArgumentDeclaration){const X=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=nl(X),z=this.lastExecutionResults.readValue(de.id);if(z){z.metaSync({value:q},null),this.lastExecutionResults.writeValue(de,z);const ue={value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null};return A[de.id]=ue,ue}const Y={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:q,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ce,standaloneParent:de.toReference()},pe=lr(Y,o);this.lastExecutionResults.writeValue(de,pe);const ee={value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null};return A[de.id]=ee,ee}else return A[de.id]}).filter(de=>!!de),W=await this.executeFullFunctionDeclarationLogic(i.body,ne,e);if(V=W,V.results.forEach(de=>{var Y,pe,ee,ue;if(de.valueOwner.type!==f.ReturnDeclaration)return;const X=i.body.inputs.find(Ie=>J(Ie,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(de.valueOwner)),z=[...((pe=(Y=A==null?void 0:A[X.id])==null?void 0:Y.value)==null?void 0:pe.value)||[],((ee=de==null?void 0:de.value)==null?void 0:ee.value)||null];(ue=A[X.id].value)==null||ue.metaSync({value:z},null),this.lastExecutionResults.writeValue(X,A[X.id].value)}),[oe.Error,oe.Break,oe.Return].includes(W.value))break;q++}break}case he.loop["manual-flow-loop"].id:{let K=1;for(;K<=50;){const q=i.body.inputs.map(W=>{if(W===i.currentIterationNumberArgumentDeclaration){const de=this.lastExecutionResults.readValue(W.id);if(de){de.metaSync({value:K},null),this.lastExecutionResults.writeValue(W,de);const Y={value:de,valueOwner:W,type:Ae.ExecutionResult,inheritanceLink:null};return A[W.id]=Y,Y}const X=i.currentIterationNumberArgumentDeclaration.getDataType(null),ce=dt(X,W,o);return ce==null||ce.metaSync({value:K},null),this.lastExecutionResults.writeValue(W,ce),{value:ce,valueOwner:W,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[W.id]}).filter(W=>!!W),ne=await this.executeFullFunctionDeclarationLogic(i.body,q,e);if(V=ne,V.results.forEach(W=>{var z,Y,pe;if(W.valueOwner.type!==f.ReturnDeclaration)return;const de=i.body.inputs.find(ee=>J(ee,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(W.valueOwner)),ce=[...(z=A[de.id].value)==null?void 0:z.value,((Y=W.value)==null?void 0:Y.value)||null];(pe=A[de.id].value)==null||pe.metaSync({value:ce},null),this.lastExecutionResults.writeValue(de,A[de.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ne.value))break;K++}break}case he.loop["list-loop"].id:{const K=w[0];let q=1;const ne=K;for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["object-keys-loop"].id:{const K=w[0];let q=1;const ne=K?Object.keys(K):[];for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["object-values-loop"].id:{const K=w[0];let q=1;const ne=K?Object.values(K):[];for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}case he.loop["string-loop"].id:{const K=w[0];let q=1;const ne=K.split("");for(let W=0;W<ne.length;W++){const de=ne[W],X=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const Y=this.lastExecutionResults.readValue(z.id);if(Y)return Y.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,Y),{value:Y,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const pe=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=dt(pe,z,o);return ee==null||ee.metaSync({value:q},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:i.currentIterationNumberArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const Y=i.currentValueArgumentDeclaration.getDataType(null),pe=nl(Y),ee=this.lastExecutionResults.readValue(z.id);if(ee)return ee.metaSync({value:de},null),this.lastExecutionResults.writeValue(z,ee),{value:ee,valueOwner:z,type:Ae.ExecutionResult,inheritanceLink:null};const ue={id:N.UUID.uuid(),type:f.LiteralValue,autogeneration:null,version:N.UUID.uuid(),createdAt:new Date().toISOString(),author:N.sessionAuthor,deleted:!1,previousVersion:null,value:de,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:pe,standaloneParent:z.toReference()},Ie=lr(ue,o);return this.lastExecutionResults.writeValue(z,Ie),{value:Ie,valueOwner:i.currentValueArgumentDeclaration,type:Ae.ExecutionResult,inheritanceLink:null}}else return A[z.id]}).filter(z=>!!z),ce=await this.executeFullFunctionDeclarationLogic(i.body,X,e);if(V=ce,V.results.forEach(z=>{var ue,Ie,Ue;if(z.valueOwner.type!==f.ReturnDeclaration)return;const Y=i.body.inputs.find(Pe=>J(Pe,o)===ji.fromReturnDeclarationToBodyArgumentDeclarationName(z.valueOwner)),ee=[...(ue=A[Y.id].value)==null?void 0:ue.value,((Ie=z.value)==null?void 0:Ie.value)||null];(Ue=A[Y.id].value)==null||Ue.metaSync({value:ee},null),this.lastExecutionResults.writeValue(Y,A[Y.id].value)}),[oe.Error,oe.Break,oe.Return].includes(ce.value))break;q++}break}}let U=[];i.body.inputs.forEach(K=>{var ne;const q=A[K.id];if(q){const W=(ne=q.value)==null?void 0:ne.clone(null),de=i.outputs.find(X=>X.declaration&&ji.fromLoopOutputDeclarationToBodyArgumentDeclarationName(X.declaration)===J(K,o));if(!de)return;U.push({valueOwner:de,type:Ae.ExecutionResult,inheritanceLink:null,value:W})}}),E={value:[oe.Error,oe.Return].includes(V.value)?V.value:oe.Success,error:null,results:U};let F=null;if(E.error&&i.error){Me.warn("Raw error executing entity: ",E.error);const K=(y=i.error)==null?void 0:y.getDataType(null),q=dt(K||null,i.error,o);K!=null&&K.asType?q==null||q.setValueAsTypeSingle(E.error):q==null||q.metaSync({value:E.error},null),F={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:q}}return{value:E.value,entity:i,error:F,results:E.results}}catch(E){if(Me.warn("Error executing loop: ",E),i.error){const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,o);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(E):A==null||A.metaSync({value:E},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A},results:[]}}else return{value:oe.Error,entity:i,error:null,results:[]}}}async executeFunctionCall(i,a,o,p={}){var y,v;const e={...po,...p};try{let E={value:oe.Success,error:null,results:[]};E=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,a,o,e);const w=i.outputs.map(P=>{var q,ne,W,de;const V=[...P.declaration.getCounterparts(),P.declaration],U=E.results.find(X=>V.some(z=>X.valueOwner.id===(z==null?void 0:z.id))),F=P==null?void 0:P.getDataType(null),K=dt(F,P,o);return F!=null&&F.asType?Array.isArray((q=U==null?void 0:U.value)==null?void 0:q.valueAsType)?K==null||K.setValueAsTypeList((ne=U==null?void 0:U.value)==null?void 0:ne.valueAsTypeList):K==null||K.setValueAsTypeSingle(((W=U==null?void 0:U.value)==null?void 0:W.valueAsType)||null):K==null||K.metaSync({value:(de=U==null?void 0:U.value)==null?void 0:de.value},null),{valueOwner:P,type:Ae.ExecutionResult,inheritanceLink:null,value:K}});let A=null;if(E.error&&i.error){Me.warn("Raw error executing entity: ",E.error);const P=(y=i.error)==null?void 0:y.getDataType(null),V=dt(P||null,i.error,o);P!=null&&P.asType?V==null||V.setValueAsTypeSingle(E.error):V==null||V.metaSync({value:E.error},null),A={valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:V}}return{value:E.value,entity:i,error:A,results:w}}catch(E){if(!i.error)return{value:oe.Error,entity:i,error:null,results:[]};const w=(v=i.error)==null?void 0:v.getDataType(null),A=dt(w,i.error,o);return w!=null&&w.asType?A==null||A.setValueAsTypeSingle(E):A==null||A.metaSync({value:E},null),{value:oe.Error,entity:i,error:{valueOwner:i.error,type:Ae.ExecutionResult,inheritanceLink:null,value:A},results:[]}}}async executeCondition(i,a){var p,e,y,v,E,w,A,P,V,U,F,K,q,ne,W,de,X,ce,z,Y,pe,ee,ue,Ie,Ue,Pe,Ce,$e,ke,xe,ot,Rt,dr,Ar,Br,Xr,ci,Ts,Bs,wn,Us,pi,Is,Rn,ra,tf,El,rf;let o=!1;switch(i.declaration.id){case ai.Empty:{o=!((e=(p=a[0])==null?void 0:p.value)!=null&&e.value);break}case ai.NotEmpty:{o=!!((v=(y=a[0])==null?void 0:y.value)!=null&&v.value);break}case ut.Equal:{if([ae.String,ae.Number,ae.Boolean,ae.Null,ae.Enum,ae.Date,ae.UUID].includes((w=(E=a[0])==null?void 0:E.value)==null?void 0:w.name)){o=((P=(A=a[0])==null?void 0:A.value)==null?void 0:P.value)===((U=(V=a[1])==null?void 0:V.value)==null?void 0:U.value);break}if(((K=(F=a[0])==null?void 0:F.value)==null?void 0:K.name)===ae.KeyValue||((ne=(q=a[0])==null?void 0:q.value)==null?void 0:ne.name)===ae.Untyped){const ia=(de=(W=a[0])==null?void 0:W.value)==null?void 0:de.value,fi=(ce=(X=a[1])==null?void 0:X.value)==null?void 0:ce.value;o=JSON.stringify(ia)===JSON.stringify(fi);break}break}case ut.NotEqual:{if([ae.String,ae.Number,ae.Boolean,ae.Null,ae.Enum,ae.Date,ae.UUID].includes((Y=(z=a[0])==null?void 0:z.value)==null?void 0:Y.name)){o=((ee=(pe=a[0])==null?void 0:pe.value)==null?void 0:ee.value)!==((Ie=(ue=a[1])==null?void 0:ue.value)==null?void 0:Ie.value);break}if(((Pe=(Ue=a[0])==null?void 0:Ue.value)==null?void 0:Pe.name)===ae.Untyped||(($e=(Ce=a[0])==null?void 0:Ce.value)==null?void 0:$e.name)===ae.KeyValue){const ia=(xe=(ke=a[0])==null?void 0:ke.value)==null?void 0:xe.value,fi=(Rt=(ot=a[1])==null?void 0:ot.value)==null?void 0:Rt.value;o=JSON.stringify(ia)!==JSON.stringify(fi);break}break}case ut.MoreThanOrEqual:{o=((Ar=(dr=a[0])==null?void 0:dr.value)==null?void 0:Ar.value)>=((Xr=(Br=a[1])==null?void 0:Br.value)==null?void 0:Xr.value);break}case ut.MoreThan:{o=((Ts=(ci=a[0])==null?void 0:ci.value)==null?void 0:Ts.value)>((wn=(Bs=a[1])==null?void 0:Bs.value)==null?void 0:wn.value);break}case ut.LessThanOrEqual:{o=((pi=(Us=a[0])==null?void 0:Us.value)==null?void 0:pi.value)<=((Rn=(Is=a[1])==null?void 0:Is.value)==null?void 0:Rn.value);break}case ut.LessThan:{o=((tf=(ra=a[0])==null?void 0:ra.value)==null?void 0:tf.value)<((rf=(El=a[1])==null?void 0:El.value)==null?void 0:rf.value);break}case Kr.And:{o=(await Promise.all(i.andChildrenGroup.map(async fi=>{const Hd=this.mergeExernalValuesWithInternalInputs(a,fi);return(await this.executeCondition(fi,Hd)).value===oe.Success}))).every(fi=>fi);break}case Kr.Or:{o=(await Promise.all(i.orChildrenGroup.map(async fi=>{const Hd=this.mergeExernalValuesWithInternalInputs(a,fi);return(await this.executeCondition(fi,Hd)).value===oe.Success}))).some(fi=>fi);break}}return{value:o?oe.Success:oe.Error,entity:i,error:null,results:[]}}async executeDetachedFullFunctionDeclarationLogic(i,a,o,p={}){const e={...po,...p,onBeforeEntityExecution:(E,w,A)=>{var P;return((P=p==null?void 0:p.onBeforeEntityExecution)==null?void 0:P.call(p,E,w,{...A,detached:!0}))||Promise.resolve()},onEntityExecuted:(E,w,A)=>{var P;return((P=p==null?void 0:p.onEntityExecuted)==null?void 0:P.call(p,E,w,{...A,detached:!0}))||Promise.resolve()}},y=new In(o,[i,...Im(i)],i,this,this.parentContext);return y.inheritValuesFromContext(this),await y.execute(e,a)}async executeFullFunctionDeclarationLogic(i,a,o={}){const p={...po,...o},e=Im(i);e.forEach(A=>{this.addEntity(A)}),e.reduce((A,P)=>fr.includes(P.type)?[...A,...P.outputs]:pr.includes(P.type)&&P.type!==f.Condition?[...A,...P.outputs,...P.inputs]:P.type===f.Condition?[...A,...P.inputs]:A,[]).forEach(A=>{this.lastExecutionResults.removeValue(A.id)});const v=await this.executeBranch(i,p,a),w=i.getUniqueReturnDeclarations().reduce((A,P)=>{const V=v==null?void 0:v.results.find(U=>U.valueOwner.id===P.id);return V?[...A,V]:A},[]);return{...v||{},value:(v==null?void 0:v.value)||oe.Success,entity:i,error:(v==null?void 0:v.error)||null,results:w}}static async executeEntryPointEntity(i,a){return{value:oe.Success,entity:i,error:null,results:a}}static async executeVariable(i,a){return{value:oe.Success,entity:i,error:null,results:[a]}}static async executeReturnStatement(i,a){return{value:i.throws?oe.Error:oe.Return,entity:i,error:null,results:a}}static async executeContinueStatement(i,a){return{value:oe.Continue,entity:i,error:null,results:a}}static async executeBreakStatement(i,a){return{value:oe.Break,entity:i,error:null,results:a}}mergeValues(i,a){const o=[];for(let p=0;p<a.length;p++)i!=null&&i[p]?o.push(i[p]):o.push(a[p]);return o}async executeEntity(i,a=[],o={}){var y,v,E,w,A,P,V,U,F,K,q,ne,W,de,X,ce,z;const p={...po,...o},e={detached:!1};switch(i.type){case f.Condition:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((y=p.onBeforeEntityExecution)==null?void 0:y.call(p,i,Y,e)),this.executeCondition(i,Y)}case f.InternalCall:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((v=p.onBeforeEntityExecution)==null?void 0:v.call(p,i,Y,e)),this.executeInternalCall(i,Y,this.project)}case f.Operation:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((E=p.onBeforeEntityExecution)==null?void 0:E.call(p,i,Y,e)),In.executeOperation(i,Y,this.project)}case f.VariableInstance:case f.VariableDeclaration:{let Y=My(i,this.valueResolutionContext);const pe=Pi(i),ee=pe.getDataType(null);if(ee!=null&&ee.isObject()){let Ue={};if(((w=ee==null?void 0:ee.entity)==null?void 0:w.type)===f.DefinitionEntity&&(Ue={...Ue,...ee.entity.getActiveRawDefaultValue()}),Y!=null&&Y.value)Tr((A=Y==null?void 0:Y.value)==null?void 0:A.value)&&(Ue={...Ue,...(P=Y==null?void 0:Y.value)==null?void 0:P.value}),Y==null||Y.value.metaSync({value:Ue},null);else{const Pe=dt(ee,i,this.project);Pe==null||Pe.metaSync({value:Ue},null),Y={valueOwner:pe,type:Ae.ExecutionResult,inheritanceLink:null,value:Pe}}this.lastExecutionResults.writeValue(pe,Y.value),pe.inputs.forEach(Pe=>{var Ce;if(((Ce=Pe.declaration)==null?void 0:Ce.type)===f.Property&&Pe.declaration.static){const $e=this.lastExecutionResults.readValue(Pe.declaration.id),ke=J(Pe,this.project),xe=Mr(ke);if($e)$e.metaSync({value:Ue[xe]},null),this.lastExecutionResults.writeValue(Pe.declaration,$e);else{const ot=dt(Pe.getDataType(null),Pe,this.project);ot==null||ot.metaSync({value:Ue[xe]},null),this.lastExecutionResults.writeValue(Pe.declaration,ot)}}})}else this.lastExecutionResults.writeValue(pe,Y==null?void 0:Y.value);const ue=[],Ie=(V=Y==null?void 0:Y.value)!=null&&V.value&&Tr((U=Y.value)==null?void 0:U.value)?((F=Y.value)==null?void 0:F.value)||{}:{};return i.outputs.map(Ue=>{const Pe=Mr(J(Ue,this.project)),Ce=Ie[Pe],$e=dt(Ue.getDataType(null),Ue,this.project);$e==null||$e.metaSync({value:Ce},null);const ke={value:$e,valueOwner:Ue,type:Ae.ExecutionResult,inheritanceLink:Y?{sources:[Y],target:i}:null};ue.push(ke)}),Y.type=Ae.ExecutionResult,{value:oe.Success,entity:i,error:null,results:[Y,...ue]}}case f.FunctionCall:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((K=p.onBeforeEntityExecution)==null?void 0:K.call(p,i,Y,e)),this.executeFunctionCall(i,Y,this.project)}case f.FunctionDeclaration:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((q=p.onBeforeEntityExecution)==null?void 0:q.call(p,i,Y,e)),In.executeEntryPointEntity(i,Y)}case f.Search:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((ne=p.onBeforeEntityExecution)==null?void 0:ne.call(p,i,Y,e)),this.executeSearch(i,Y,this.project)}case f.Loop:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((W=p.onBeforeEntityExecution)==null?void 0:W.call(p,i,Y,e)),this.executeLoop(i,Y,this.project,p)}case f.ReturnStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((de=p.onBeforeEntityExecution)==null?void 0:de.call(p,i,Y,e)),In.executeReturnStatement(i,Y)}case f.ContinueStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((X=p.onBeforeEntityExecution)==null?void 0:X.call(p,i,Y,e)),In.executeContinueStatement(i,Y)}case f.BreakStatement:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((ce=p.onBeforeEntityExecution)==null?void 0:ce.call(p,i,Y,e)),In.executeBreakStatement(i,Y)}case f.GlobalEvent:{const Y=this.mergeExernalValuesWithInternalInputs(a,i);return await((z=p.onBeforeEntityExecution)==null?void 0:z.call(p,i,Y,e)),In.executeEntryPointEntity(i,Y)}default:return{value:oe.Error,entity:i,error:null,results:[]}}}storeLastExecutionValues(i){i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),i.results.forEach(a=>{const o=vn(a.valueOwner,this.project);a.value?o.forEach(p=>{this.lastExecutionResults.writeValue(p,a.value)}):o.forEach(p=>{this.lastExecutionResults.removeValue(p.id)})})}async executeBranch(i,a={},o=[]){var E;const p={...po,...a},e={detached:!1};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const v=await this.executeEntity(i,o,p);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(v),await((E=p.onEntityExecuted)==null?void 0:E.call(p,i,v,e)),v.value===oe.Success){const w=(i.successCalls||i.calls||[]).filter(F=>this.hasEntity(F));(i.errorCalls||[]).forEach(F=>{this.skip(F)});let P=[];const V=(await Promise.all(w.map(F=>this.schedule(F,v.results,p)))).filter(F=>!!F),U=V.filter(F=>!!F).find(F=>F.value===oe.Error||F.value===oe.Return||F.value===oe.Break||F.value===oe.Continue);return U||(P=[...P,...V],v)}else if(v.value===oe.Error){const w=(i.errorCalls||[]).filter(F=>this.hasEntity(F));(i.successCalls||i.calls||[]).forEach(F=>{this.skip(F)});let P=[];const V=(await Promise.all(w.map(F=>this.schedule(F,v.results,p)))).filter(F=>!!F),U=V.filter(F=>!!F).find(F=>F.value===oe.Error||F.value===oe.Return||F.value===oe.Break||F.value===oe.Continue);return U||(P=[...P,...V],v)}else{if(v.value===oe.Return)return v;if(v.value===oe.Break)return v;if(v.value===oe.Continue)return v}return v}async execute(i={},a=[]){const o={...po,...i};this.state="running";const p=await this.executeBranch(this.entryPoint,o,a);return this.state="finished-success",p}addEntity(i){var a;this.entities.includes(i)||(this.entities.push(i),(a=this.onAddEntityCallback)==null||a.call(this,i))}addEntities(i){i.forEach(a=>this.addEntity(a))}removeEntity(i){var a;if(i!==this.entryPoint){const o=this.entities.indexOf(i);o>-1&&(this.entities.splice(o,1),(a=this.onRemoveEntityCallback)==null||a.call(this,i))}}hasEntity(i){var p,e,y;if(this.entities.includes(i))return!0;if(((p=i.parent)==null?void 0:p.type)===f.FunctionDeclaration&&((y=(e=i.parent)==null?void 0:e.parent)==null?void 0:y.type)===f.DefinitionEntity)return this.entities.includes(i.parent);const a=mr(i);if(!a)return!1;const o=a.type===f.Loop&&i.parent===a.body?a.body:null;return o?this.entities.includes(o)||this.entities.includes(a):this.entities.includes(a)}removeScheduled(i){const a=this.scheduled.indexOf(i);a>-1&&this.scheduled.splice(a,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const a=this.project.get(i);return a?this.hasEntity(a):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}removeFromExecutingList(i){const a=this.executing.indexOf(i);a>-1&&this.executing.splice(a,1)}removeFromAlreadyExecutedList(i){const a=this.executed.indexOf(i);a>-1&&this.executed.splice(a,1)}removeFromSkippedList(i){var o;const a=this.skipped.indexOf(i);a>-1&&(this.skipped.splice(a,1),(o=this.onRemoveFromSkippedListCallback)==null||o.call(this,i))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var a;this.skipped.includes(i)||(this.skipped.push(i),(a=this.onAddToSkippedListCallback)==null||a.call(this,i))}}function yTe(d){var u,i;if(d.isList)return"list";if(((u=d.entity)==null?void 0:u.type)===f.DefinitionEntity)return"definition-entity";switch((i=d.entity)==null?void 0:i.name){case ae.Number:return"number";case ae.String:return"text";case ae.Boolean:return"boolean";case ae.UUID:return"uuid";case ae.Date:return"date-time";default:return"definition-entity"}}const xp={[f.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[f.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[f.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[f.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[f.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[f.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[f.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[f.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[f.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[f.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[f.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[f.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[f.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[f.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[f.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[f.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[f.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[f.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[f.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[f.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[f.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[f.ReturnDeclaration]:{singular:"Output definition",plural:"Output definitions",shortSingular:"Output",shortPlural:"Outputs"},[f.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"},[f.DataType]:{singular:"Data type",plural:"Data types",shortSingular:"Data type",shortPlural:"Data types"},[f.LiteralValue]:{singular:"Literal value",plural:"Literal values",shortSingular:"Value",shortPlural:"Values"}};function gA(d){const u=Am(d);if(!u){const a=Kd(d);if(a.includes(Le.HTTP_ENDPOINT))return"HTTP endpoint";if(a.includes(Le.PERSISTED_ENTITY))return"Persisted entity";if(a.includes(Le.CRON_JOB))return"Scheduled execution";if(a.includes(Le.RELATIONAL_DATABASE))return"Relational database"}if(u){let a="Extension of "+J(u,u.project)+" entity",o=Td(a);const p=Kd(d);return p.includes(Le.HTTP_ENDPOINT)?"HTTP endpoint"+(o?", "+o:""):p.includes(Le.PERSISTED_ENTITY)?"Persisted entity"+(o?", "+o:""):p.includes(Le.CRON_JOB)?"Scheduled execution"+(o?", "+o:""):p.includes(Le.RELATIONAL_DATABASE)?"Relational database"+(o?", "+o:""):a}let i="";return d.abstract&&(i="Template "),d.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function J6(d){return d.parent.type===f.DefinitionEntity||d.parent.type===f.InstalledProject?"Internal action of "+J(d.parent,d.project):d.parent.type===f.Loop?"Action repeated on every iteration":"Internal action of entity"}function DA(d){return mb(d)?J6(d):"Custom trigger"}function mTe(d){var u;switch(d.type){case f.DefinitionEntity:return gA(d);case f.FunctionDeclaration:return DA(d)}return(u=xp[d.type])==null?void 0:u.singular}function vTe(d){var u;switch(d.type){case f.DefinitionEntity:return gA(d);case f.FunctionDeclaration:return DA(d)}return(u=xp[d.type])==null?void 0:u.singular}const OA=4e4,Y6=280,ETe=300,CA=65,Md=32,Xy=39,z6=26,X6=49,Qy=44,TTe=35,em=52,$A=10,$a=$A*2,tm=38,rm=90,PA=270,Q6=OA/2+120,e5=OA/2+180;function t5(d){let i=Md+Qy+tm+$A;const a=[...d.inputs];return a.length&&(i+=$a,a.forEach(()=>{i+=z6})),{height:i,width:280}}function r5(d){let i=CA;const a=[];if([f.DefinitionEntity].includes(d.type)){const v=[...d.suggestedProperties||[],...d.properties||[]];v.length&&(i+=$a,v.forEach(E=>{i+=E.static?X6:Xy}))}if([f.DefinitionEntity,f.InstalledProject,f.Loop].includes(d.type)){const v=[...(d==null?void 0:d.suggestedMethods)||[],...d.methods||[],...d.functions||[],...d.body?[d.body]:[]];v.length&&(i+=$a,v.forEach(E=>{const w=t5(E);i+=w.height}))}pr.includes(d.type)?(yt.includes(d.type)?a.push(...(d.usedInputs||[]).flatMap(v=>[v])||[]):a.push(...(d.inputs||[]).flatMap(v=>[v])||[]),d.error&&(i+=em)):[f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)?(a.push(...d.outputs||[]),d.throws&&(i+=em)):d.type===f.Condition&&(a.push(d.inputs[0]),d.inputs[1]&&a.push(d.inputs[1]));const o=a.length;o&&(i+=o*Xy,i+=$a);const p=[];if(d.type===f.FunctionDeclaration||d.type===f.GlobalEvent?p.push(...d.inputs||[]):pr.includes(d.type)&&(yt.includes(d.type)?p.push(...d.usedOutputs||[]):p.push(...d.outputs||[])),yt.includes(d.type)){d.readsValue&&(i+=$a,i+=Qy),d.writesValues.length&&(i+=$a,i+=Qy),d.internalCalls.length&&d.usedInternalCalls.forEach(()=>i+=em+$a);const v=d.getDataType(null);(!v||v.inferred)&&(i+=tm)}const e=p.length;return e&&(i+=e*Xy,i+=$a),[f.DefinitionEntity,f.FunctionDeclaration,f.ReturnStatement,f.BreakStatement,f.ContinueStatement].includes(d.type)&&(i+=tm),{height:i,width:280}}function jp(d){return`${d.split("-").map((a,o)=>o===0?a.charAt(0).toUpperCase()+a.slice(1):a.toLowerCase()).join(" ")}.`}function ITe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case te.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case te.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case te.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case te.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case te.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case te.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case re.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case re.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case te.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case te.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case re.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case te.NoProperties:return"This entity has no properties, so it doesn't do anything";case te.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case te.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case te.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case te.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case te.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case te.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case te.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case te.PropertyImplementsNonAbstact:return"This property implements a non-template property";case te.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case te.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case te.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case te.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case te.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case re.InternalCallDeclarationIsNotFunctionDeclaration:return"This internal call is not an action";case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case re.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case re.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case re.UnreachableEntity:return"This entity is unreachable";case te.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";case te.AbstractEntityImplements:return"This template entity implements a non-template entity";case te.AbstractExtendingNonAbstractEntity:return"This template entity extends a non-template entity";case te.InvalidPropertiesCombination:return"This entity has an invalid combination of properties";case te.ExtendingNonInteractiveEntity:return"This entity extends a non-interactive entity";case te.ExtendsIncompatibleEntities:return"This entity extends incompatible entities";case te.ImplementingNonAbstractEntity:return"This entity implements a non-template entity";case te.ImplementsIncompatibleEntities:return"This entity implements incompatible entities";case te.LackingReturnStatementOnSomeBranches:return"This action is missing a termination on some branches";case te.LastCalledEntityMustBeReturnEntity:return"The last called entity in this action must be a termination node";case te.MissingRequiredValue:return"This action is missing a required value";case te.NoPrimaryKeyProperty:return"This entity has no primary key property";case te.NonAbstractExtendingAbstractEntity:return"This non-template entity extends a template entity";case te.NonStaticExtendingStaticEntity:return"This non-static entity extends a static entity";case te.NonStaticImplementingStaticEntity:return"This non-static entity implements a static entity";case te.StaticExtendingNonStaticEntity:return"This static entity extends a non-static entity";case te.StaticImplementingNonStaticEntity:return"This static entity implements a non-static entity";case te.VariableReadsValueAndInternalCall:return"This variable reads a value while being used to execute internal logic";case te.VariableWritesValuesAndInternalCall:return"This variable writes values while being used to execute internal logic";case re.InternalCallDeclarationNotInParentDatatypeEntity:return"This internal call declaration is not in the parent entity";case re.EmptyName:return"This entity has no name";case re.InvalidObjectStructure:return"This entity has an invalid structure";case re.LoopBodyFunctionOverwrite:return"This loop body action overwrites an action in the template entity with the same name";case re.MethodOverwritesBaseMethodWithSameImplementation:return"This action overwrites a base action with the same implementation";case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"This action overwrites an action in an extended entity with the same implementation";case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"This action overwrites an action in an implemented entity with the same implementation";case re.MissingCaller:return"This action is missing a caller";case re.NameAsResolvedCodeNameNotUniqueInScope:return"This entity has a name that is not unique in the scope of the code it is used in";case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"This entity name can only contain letters, numbers, underscores and spaces";case re.NameMustStartWithLetterOrUnderscore:return"This entity name must start with a letter or an underscore";case re.NoOverlapWithImplementedSignature:return"This action does not overlap with the implemented action signature";case re.PropertyOverwritesBasePropertyWithSameImplementation:return"This property overwrites a base property with the same implementation";case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an extended entity with the same implementation";case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an implemented entity with the same implementation";case re.ReaderWriterIncompatibleDataType:return"This reader/writer has an incompatible data type with the value it is reading/writing";case ta.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case ta.StatusCodeMustBeNumber:return"HTTP status code must be a number, between 100 and 599";case Es.UUIDMustBeString:return`UUID must be a string, eg: "${cl()}"`;case Es.UUIDMustNotContainSpaces:return`UUID must not contain spaces, eg: "${cl()}"`;case Es.UUIDMustBeValidFormat:return`UUID must be in a valid format. Eg: "${cl()}"`;case Ki.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case Ki.StringValueMustNotHaveDashes:return"This value must not contain dashes";case Ki.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return jp(d.code)}}function ATe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case te.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case te.IncorrectEntityImplementation:return"Incorrect implementation";case te.IncorrectMethodImplementation:return"Incorrect action implementation";case te.IncorrectPropertyImplementation:return"Incorrect property implementation";case te.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case te.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case re.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case re.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case te.MissingMethodImplementation:return"Missing action";case te.MissingPropertyImplementation:return"Missing property";case re.NameNotUniqueInScope:return"Duplicate name";case te.NoProperties:return"No properties";case te.NonStaticPropertyInStaticEntity:return"Non-static property";case te.StaticEntityWithNonStaticProperties:return"Non-static properties";case te.ReadingFromIncompatibleType:return"Read from different type";case te.WritingToIncompatibleType:return"Write to different type";case te.ScopeWithoutLogic:return"No logic";case te.NonStaticPropertyImplementsStatic:return"Invalid static property";case te.PropertyImplementsIncompatibleType:return"Incompatible data type";case te.PropertyImplementsNonAbstact:return"Non-template property";case te.StaticPropertyImplementsNonStatic:return"Non-static property";case te.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case te.VariableHasInputsAndInternalCall:return"Bad internal call";case te.VariableHasOutputsAndInternalCall:return"Bad internal call";case te.VariableIsCalledAndHasInternalCall:return"Bad internal call";case re.InternalCallDeclarationIsNotFunctionDeclaration:return"Declaration not an action";case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case re.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case re.InternalCallParentMissingDataType:return"Parent has no data type";case re.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case re.UnreachableEntity:return"Unreachable entity";case te.DisconnectedCallableEntity:return"Disconnected entity";case te.AbstractEntityImplements:return"Abstract entity implements a non-template entity";case te.AbstractExtendingNonAbstractEntity:return"Abstract entity extends a non-template entity";case te.InvalidPropertiesCombination:return"Invalid properties combination";case te.ExtendingNonInteractiveEntity:return"Extending non-interactive entity";case te.ExtendsIncompatibleEntities:return"Extends incompatible entities";case te.ImplementingNonAbstractEntity:return"Implementing non-template entity";case te.ImplementsIncompatibleEntities:return"Implements incompatible entities";case te.LackingReturnStatementOnSomeBranches:return"Missing termination on some branches";case te.LastCalledEntityMustBeReturnEntity:return"Last called entity must be a termination node";case te.MissingRequiredValue:return"Missing required value";case te.NoPrimaryKeyProperty:return"No primary key property";case te.NonAbstractExtendingAbstractEntity:return"Non-template entity extending a template entity";case te.NonStaticExtendingStaticEntity:return"Non-static entity extending a static entity";case te.NonStaticImplementingStaticEntity:return"Non-static entity implementing a static entity";case te.StaticExtendingNonStaticEntity:return"Static entity extending a non-static entity";case te.StaticImplementingNonStaticEntity:return"Static entity implementing a non-static entity";case te.VariableReadsValueAndInternalCall:return"Variable reads value and has internal call";case te.VariableWritesValuesAndInternalCall:return"Variable writes values and has internal call";case re.EmptyName:return"Empty name";case re.InvalidObjectStructure:return"Invalid object structure";case re.LoopBodyFunctionOverwrite:return"Loop body action overwrites action with same name";case re.MethodOverwritesBaseMethodWithSameImplementation:return"Action overwrites base action with same implementation";case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case re.MissingCaller:return"Missing caller";case re.NameAsResolvedCodeNameNotUniqueInScope:return"Name not unique in scope";case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"Name can only contain letters, numbers, underscores and spaces";case re.NameMustStartWithLetterOrUnderscore:return"Name must start with letter or underscore";case re.NoOverlapWithImplementedSignature:return"No overlap with implemented signature";case re.PropertyOverwritesBasePropertyWithSameImplementation:return"Property overwrites base property with same implementation";case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case re.ReaderWriterIncompatibleDataType:return"Reader/writer incompatible data type";case ta.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case ta.StatusCodeMustBeNumber:return"HTTP status code must be a number";case Es.UUIDMustBeString:return"UUID must be a string";case Es.UUIDMustNotContainSpaces:return"UUID must not contain spaces";case Es.UUIDMustBeValidFormat:return"UUID must be in a valid format";case Ki.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case Ki.StringValueMustNotHaveDashes:return"This value must not contain dashes";case Ki.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return jp(d.code)}}function bTe(d){switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return`${J(d.entity,d.entity.project)} has non-template actions`;case te.AbstractEntityWithNonAbstractProperties:return`${J(d.entity,d.entity.project)} has non-template properties`;case te.IncorrectEntityImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements template`;case te.IncorrectMethodImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template`;case te.IncorrectPropertyImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template`;case te.AbstractMethodInNonAbstractEntity:return`${J(d.entity,d.entity.project)} can't be a template`;case te.AbstractPropertyInNonAbstractEntity:return`${J(d.entity,d.entity.project)} can't be a template`;case re.MethodOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites action`;case re.PropertyOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites property`;case te.MissingMethodImplementation:return`${J(d.entity,d.entity.project)} is missing action`;case te.MissingPropertyImplementation:return`${J(d.entity,d.entity.project)} is missing property`;case re.NameNotUniqueInScope:return`${J(d.entity,d.entity.project)} name is not unique`;case te.NoProperties:return`${J(d.entity,d.entity.project)} has no properties`;case te.NonStaticPropertyInStaticEntity:return`${J(d.entity,d.entity.project)} has non-static property`;case te.StaticEntityWithNonStaticProperties:return`${J(d.entity,d.entity.project)} has non-static properties`;case te.ReadingFromIncompatibleType:return`${J(d.entity,d.entity.project)} reads from different type`;case te.WritingToIncompatibleType:return`${J(d.entity,d.entity.project)} writes to different type`;case te.ScopeWithoutLogic:return`${J(d.entity,d.entity.project)} has no logic`;case te.NonStaticPropertyImplementsStatic:return`${J(d.entity,d.entity.project)} has invalid static property`;case te.PropertyImplementsIncompatibleType:return`${J(d.entity,d.entity.project)} has incompatible data type`;case te.PropertyImplementsNonAbstact:return`${J(d.entity,d.entity.project)} has non-template property`;case te.StaticPropertyImplementsNonStatic:return`${J(d.entity,d.entity.project)} has non-static property`;case te.VariableCallsOthersAndHasInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableHasInputsAndInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableHasOutputsAndInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case te.VariableIsCalledAndHasInternalCall:return`${J(d.entity,d.entity.project)} has bad internal call`;case re.InternalCallDeclarationIsNotFunctionDeclaration:return`${J(d.entity,d.entity.project)} has declaration that is not an action`;case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has declaration that is not found in parent`;case re.InternalCallParentDeclarationEntityInvalidType:return`${J(d.entity,d.entity.project)} has invalid parent declaration type`;case re.InternalCallParentMissingDataType:return`${J(d.entity,d.entity.project)}'s parent has no data type`;case re.InternalCallDeclarationNotInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has declaration that is not in parent`;case re.UnreachableEntity:return`${J(d.entity,d.entity.project)} is unreachable`;case te.DisconnectedCallableEntity:return`${J(d.entity,d.entity.project)} is not executed by any entity`;case te.AbstractEntityImplements:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.AbstractExtendingNonAbstractEntity:return`${J(d.entity,d.entity.project)} extends a non-template entity`;case te.InvalidPropertiesCombination:return`${J(d.entity,d.entity.project)} has invalid properties combination`;case te.ExtendingNonInteractiveEntity:return`${J(d.entity,d.entity.project)} extends a non-interactive entity`;case te.ExtendsIncompatibleEntities:return`${J(d.entity,d.entity.project)} extends incompatible entities`;case te.ImplementingNonAbstractEntity:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.ImplementsIncompatibleEntities:return`${J(d.entity,d.entity.project)} implements incompatible entities`;case te.LackingReturnStatementOnSomeBranches:return`${J(d.entity,d.entity.project)} is missing termination on some branches`;case te.LastCalledEntityMustBeReturnEntity:return`${J(d.entity,d.entity.project)}'s last called entity must be a termination node`;case te.MissingRequiredValue:return`${J(d.entity,d.entity.project)} is missing a required value`;case te.NoPrimaryKeyProperty:return`${J(d.entity,d.entity.project)} has no primary key property`;case te.NonAbstractExtendingAbstractEntity:return`${J(d.entity,d.entity.project)} extends a template entity`;case te.NonStaticExtendingStaticEntity:return`${J(d.entity,d.entity.project)} extends a static entity`;case te.NonStaticImplementingStaticEntity:return`${J(d.entity,d.entity.project)} implements a static entity`;case te.StaticExtendingNonStaticEntity:return`${J(d.entity,d.entity.project)} extends a non-static entity`;case te.StaticImplementingNonStaticEntity:return`${J(d.entity,d.entity.project)} implements a non-static entity`;case te.VariableReadsValueAndInternalCall:return`${J(d.entity,d.entity.project)} reads a value and has internal call`;case te.VariableWritesValuesAndInternalCall:return`${J(d.entity,d.entity.project)} writes values and has internal call`;case re.EmptyName:return`${xp[d.entity.type]} has no name`;case re.InvalidObjectStructure:return`${J(d.entity,d.entity.project)} has invalid structure`;case re.LoopBodyFunctionOverwrite:return`${J(d.entity,d.entity.project)}'s loop body action overwrites an action`;case re.MethodOverwritesBaseMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites base action`;case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MissingCaller:return`${J(d.entity,d.entity.project)} is missing a caller`;case re.NameAsResolvedCodeNameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a name not unique in the scope`;case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${J(d.entity,d.entity.project)} name can only contain letters, numbers, underscores and spaces`;case re.NameMustStartWithLetterOrUnderscore:return`${J(d.entity,d.entity.project)} name must start with letter or underscore`;case re.NoOverlapWithImplementedSignature:return`${J(d.entity,d.entity.project)} has no overlap with implemented signature`;case re.PropertyOverwritesBasePropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites base property`;case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.ReaderWriterIncompatibleDataType:return`${J(d.entity,d.entity.project)} has reader/writer with incompatible data type`;case ta.StatusCodeMustBeBetween100And599:return`${J(d.entity,d.entity.project)} HTTP status code must be between 100 and 599`;case ta.StatusCodeMustBeNumber:return`${J(d.entity,d.entity.project)} HTTP status code must be a number`;case Es.UUIDMustBeString:return`${J(d.entity,d.entity.project)} UUID must be a string`;case Es.UUIDMustNotContainSpaces:return`${J(d.entity,d.entity.project)} UUID must not contain spaces`;case Es.UUIDMustBeValidFormat:return`${J(d.entity,d.entity.project)} UUID must be in a valid format`;case Ki.MustBeUniqueAmongSameEntities:return`${J(d.entity,d.entity.project)} value must be unique among the same kind`;case Ki.StringValueMustNotHaveDashes:return`${J(d.entity,d.entity.project)} value must not contain dashes`;case Ki.StringValueMustNotHaveSpaces:return`${J(d.entity,d.entity.project)} value must not contain spaces`;default:return`${J(d.entity,d.entity.project)} Error: ${jp(d.code)}`}}function wTe(d){var u,i,a,o;switch(d.code){case te.AbstractEntityWithNonAbstractMethods:return`${J(d.entity,d.entity.project)} has non-template actions`;case te.AbstractEntityWithNonAbstractProperties:return`${J(d.entity,d.entity.project)} has non-template properties`;case te.IncorrectEntityImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template entity`;case te.IncorrectMethodImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template action it's based on`;case te.IncorrectPropertyImplementation:return`${J(d.entity,d.entity.project)} incorrectly implements the template property it's based on`;case te.AbstractMethodInNonAbstractEntity:return`${J(d.entity,d.entity.project)} is a template action in a non-template entity`;case te.AbstractPropertyInNonAbstractEntity:return`${J(d.entity,d.entity.project)} is a template property in a non-template entity`;case re.MethodOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites an action in the template entity`;case re.PropertyOverwritesOtherSiblingWithSameName:return`${J(d.entity,d.entity.project)} overwrites a property in the template entity`;case te.MissingMethodImplementation:return`${J(d.entity,d.entity.project)} is missing an action implementation from the template entity`;case te.MissingPropertyImplementation:return`${J(d.entity,d.entity.project)} is missing a property implementation from the template entity`;case re.NameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a duplicate name in the same scope`;case te.NoProperties:return`${J(d.entity,d.entity.project)} has no properties, so it doesn't do anything`;case te.NonStaticPropertyInStaticEntity:return`${J(d.entity,d.entity.project)} has a non-static property in a static entity`;case te.StaticEntityWithNonStaticProperties:return`${J(d.entity,d.entity.project)} has non-static properties in a static entity`;case te.ReadingFromIncompatibleType:return`${J(d.entity,d.entity.project)} reads data from a value of a different data type`;case te.WritingToIncompatibleType:return`${J(d.entity,d.entity.project)} writes data to a value of a different data type`;case te.ScopeWithoutLogic:return`${J(d.entity,d.entity.project)} has no logic`;case te.NonStaticPropertyImplementsStatic:return`${J(d.entity,d.entity.project)} has a static property in a non-static entity`;case te.PropertyImplementsIncompatibleType:return`${J(d.entity,d.entity.project)} implements a property of a different data type`;case te.PropertyImplementsNonAbstact:return`${J(d.entity,d.entity.project)} implements a non-template property`;case te.StaticPropertyImplementsNonStatic:return`${J(d.entity,d.entity.project)} has a static property in a non-static entity`;case te.VariableCallsOthersAndHasInternalCall:return`${J(d.entity,d.entity.project)} calls other entities while being used to execute internal logic`;case te.VariableHasInputsAndInternalCall:return`${J(d.entity,d.entity.project)} has inputs while being used to execute internal logic`;case te.VariableHasOutputsAndInternalCall:return`${J(d.entity,d.entity.project)} has outputs while being used to execute internal logic`;case te.VariableIsCalledAndHasInternalCall:return`${J(d.entity,d.entity.project)} is called while being used to execute internal logic`;case re.InternalCallDeclarationIsNotFunctionDeclaration:return`${J(d.entity,d.entity.project)} has a declaration that is not an action`;case re.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has a declaration that is not found in ${(u=d.entity.parent.getDataType(null))!=null&&u.entity?J((i=d.entity.parent.getDataType(null))==null?void 0:i.entity,d.entity.project):"the variable's data-type entity"}`;case re.InternalCallParentDeclarationEntityInvalidType:return`${J(d.entity,d.entity.project)} is part of a variable whos data-type entity can't have actions`;case re.InternalCallParentMissingDataType:return`${J(d.entity,d.entity.project)} is part of a variable with no data-type entity`;case re.InternalCallDeclarationNotInParentDatatypeEntity:return`${J(d.entity,d.entity.project)} has a declaration doesn't belong to ${(a=d.entity.parent.getDataType(null))!=null&&a.entity?J((o=d.entity.parent.getDataType(null))==null?void 0:o.entity,d.entity.project):"the variable's data-type entity"}`;case re.UnreachableEntity:return`${J(d.entity,d.entity.project)} is unreachable`;case te.DisconnectedCallableEntity:return`${J(d.entity,d.entity.project)} is disconnected and won't be executed by anything after publishing`;case te.AbstractEntityImplements:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.AbstractExtendingNonAbstractEntity:return`${J(d.entity,d.entity.project)} extends a non-template entity`;case te.InvalidPropertiesCombination:return`${J(d.entity,d.entity.project)} has an invalid combination of properties`;case te.ExtendingNonInteractiveEntity:return`${J(d.entity,d.entity.project)} extends a non-interactive entity`;case te.ExtendsIncompatibleEntities:return`${J(d.entity,d.entity.project)} extends incompatible entities`;case te.ImplementingNonAbstractEntity:return`${J(d.entity,d.entity.project)} implements a non-template entity`;case te.ImplementsIncompatibleEntities:return`${J(d.entity,d.entity.project)} implements incompatible entities`;case te.LackingReturnStatementOnSomeBranches:return`${J(d.entity,d.entity.project)} has branches that don't terminate`;case te.LastCalledEntityMustBeReturnEntity:return`${J(d.entity,d.entity.project)} must end with a termination node`;case te.MissingRequiredValue:return`${J(d.entity,d.entity.project)} is missing a required value`;case te.NoPrimaryKeyProperty:return`${J(d.entity,d.entity.project)} has no primary key property`;case te.NonAbstractExtendingAbstractEntity:return`${J(d.entity,d.entity.project)} is a non-template entity extending a template entity`;case te.NonStaticExtendingStaticEntity:return`${J(d.entity,d.entity.project)} is a non-static entity extending a static entity`;case te.NonStaticImplementingStaticEntity:return`${J(d.entity,d.entity.project)} is a non-static entity implementing a static entity`;case te.StaticExtendingNonStaticEntity:return`${J(d.entity,d.entity.project)} is a static entity extending a non-static entity`;case te.StaticImplementingNonStaticEntity:return`${J(d.entity,d.entity.project)} is a static entity implementing a non-static entity`;case te.VariableReadsValueAndInternalCall:return`${J(d.entity,d.entity.project)} reads a value and has an internal call`;case te.VariableWritesValuesAndInternalCall:return`${J(d.entity,d.entity.project)} writes values and has an internal call`;case re.EmptyName:return`${xp[d.entity.type]} has no name`;case re.InvalidObjectStructure:return`${J(d.entity,d.entity.project)} has an invalid structure`;case re.LoopBodyFunctionOverwrite:return`${J(d.entity,d.entity.project)}'s loop body action overwrites`;case re.MethodOverwritesBaseMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites a base action with same implementation`;case re.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another action with same implementation`;case re.MissingCaller:return`${J(d.entity,d.entity.project)} is missing a caller`;case re.NameAsResolvedCodeNameNotUniqueInScope:return`${J(d.entity,d.entity.project)} has a name that is not unique in the scope`;case re.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${J(d.entity,d.entity.project)} name can only contain letters, numbers, underscores and spaces`;case re.NameMustStartWithLetterOrUnderscore:return`${J(d.entity,d.entity.project)} name must start with letter or underscore`;case re.NoOverlapWithImplementedSignature:return`${J(d.entity,d.entity.project)} has no overlap with implemented signature`;case re.PropertyOverwritesBasePropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites a base property with same implementation`;case re.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${J(d.entity,d.entity.project)} overwrites another property with same implementation`;case re.ReaderWriterIncompatibleDataType:return`${J(d.entity,d.entity.project)} has a reader/writer with incompatible data type`;case ta.StatusCodeMustBeBetween100And599:return`${J(d.entity,d.entity.project)} HTTP status code must be between 100 and 599`;case ta.StatusCodeMustBeNumber:return`${J(d.entity,d.entity.project)} HTTP status code must be a number, between 100 and 599`;case Es.UUIDMustBeString:return`${J(d.entity,d.entity.project)} UUID must be a string, eg: "${cl()}"`;case Es.UUIDMustNotContainSpaces:return`${J(d.entity,d.entity.project)} UUID must not contain spaces, eg: "${cl()}"`;case Es.UUIDMustBeValidFormat:return`${J(d.entity,d.entity.project)} UUID must be in a valid format. Eg: "${cl()}"`;case Ki.MustBeUniqueAmongSameEntities:return`${J(d.entity,d.entity.project)} value must be unique among the same kind`;case Ki.StringValueMustNotHaveDashes:return`${J(d.entity,d.entity.project)} value must not contain dashes`;case Ki.StringValueMustNotHaveSpaces:return`${J(d.entity,d.entity.project)} value must not contain spaces`;default:return`${J(d.entity,d.entity.project)} Error: ${jp(d.code)}`}}var NA=(d=>(d.ValuesAlreadyConnected="values-already-connected",d.CannotReadMoreThanOneValue="cannot-read-more-than-one-value",d.CannotReadValueFromChildren="cannot-read-value-from-children",d.CannotWriteValueToChildren="cannot-write-value-to-children",d.CannotBeCalledByChildren="cannot-be-called-by-children",d.ExecutionsAlreadyConnected="executions-already-connected",d.DataTypesNotCompatible="data-types-not-compatible",d.CannotCallAncestor="cannot-call-ancestor",d.CannotConnectToItself="cannot-connect-to-itself",d.CannotWriteValueToAncestor="cannot-write-value-to-ancestor",d.NotInScope="not-in-scope",d.IsNotValueWrittingEntity="is-not-value-writting-entity",d.IsNotValueReadingEntity="is-not-value-reading-entity",d.ContinueOrBreakStatementCalledFromOutsideLoop="continue-or-break-statement-called-from-outside-loop",d.ElementInLoopBodyCallingOutsideLoop="element-in-loop-body-calling-outside-loop",d.CallerIsInHigherScope="caller-is-in-higher-scope",d.CallerIsInLowerScope="caller-is-in-lower-scope",d.CallIsInHigherScope="call-is-in-higher-scope",d.CallIsInLowerScope="call-is-in-lower-scope",d.OtherIncompatibleScopeReason="other-incompatible-scope-reason",d.SiblingInternalCallAlreadyUsedInParentVariable="sibling-internal-call-already-used-in-parent-variable",d.ErrorOututMapCannotBeConnectedToParentSuccessBranchCallees="error-output-map-cannot-be-connected-to-parent-success-branch-callees",d.SuccessOutputMapCannotBeConnectedToParentErrorBranchCallees="success-output-map-cannot-be-connected-to-parent-error-branch-callees",d))(NA||{});const RTe=Object.values(NA);var VA=(d=>(d.NotPartOfOngoingTest="not-part-of-ongoing-test",d.CannotBeAddedToTest="cannot-be-added-to-test",d))(VA||{});const _Te=Object.values(VA);var LA=(d=>(d.Suggestion="suggestion",d.CanvasGloballyDisabled="canvas-globally-disabled",d.CannotInteractWithInputInVariableWithInternalCalls="cannot-interact-with-input-in-variable-with-internal-calls",d.CannotInteractWithOutputInVariableWithInternalCalls="cannot-interact-with-output-in-variable-with-internal-calls",d))(LA||{});const gTe=Object.values(LA);function DTe(d,u){const i=[...d,...u];return Array.from(new Set(i))}function OTe(d,u){const i=[...d,...u],a=Array.from(new Set(i));return{hasChanged:a.length!==d.length,reasons:a}}function CTe(d,u){const i=d.filter(o=>!u.includes(o));return{hasChanged:i.length!==d.length,reasons:i}}function $Te(d,u){return d.find(i=>i.entity.id===u)||null}function i5(d){return d.filter((u,i)=>d.indexOf(u)===i)}class Ai{constructor(u,i,a=null,o){g(this,"ids",[]);g(this,"entity");g(this,"entityCardHeight");g(this,"entityCardWidth");g(this,"index");g(this,"childEntities",[]);g(this,"children",[]);g(this,"parents",[]);g(this,"calculationEntryPoint");g(this,"_onlyEntities",null);g(this,"_changeSet",null);if(this.index=i,this.entity=u,this.calculationEntryPoint=a||this,this===this.calculationEntryPoint&&!o)throw new Error("Change set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(u,i,a){const o=Q6-PA-Y6,p=e5-rm-CA;u.metaSync({x:u.x||o,y:u.y||p},i);const e=new Ai(u,0,null,i);e._onlyEntities=a||[],e.ids=["0"];const y=[];e.next(E=>{y.push(...E)}),Ai.recursivelyAssembleChildrenAreas(y),e.resolveChildrenOverlaps();const v=e.flattenChildEntities();return e._onlyEntities?v.filter(E=>(e._onlyEntities||[]).includes(E)):v}static recursivelyAssembleChildrenAreas(u){const i=[];u.forEach(a=>{a.next(o=>{i.push(...o)})}),i.length>0&&Ai.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(u){this.calculationEntryPoint._changeSet=u}findAreaInChildrenFromEntity(u){if(this.entity===u)return this;const i=this.children.find(o=>o.entity===u);return i||this.children.reduce((o,p)=>o||p.findAreaInChildrenFromEntity(u),null)}findAreaFromEntity(u){if(this.entity===u)return this;const i=this.calculationEntryPoint.children,a=i.find(p=>p.entity===u);return a||i.reduce((p,e)=>p||e.findAreaInChildrenFromEntity(u),null)}addParent(u){if(!this.parents.includes(u)){const i=Ai.resolveIds(u,this.index);this.ids.push(...i),this.parents.push(u)}}static resolveIds(u,i){return u?u.ids.map(a=>`${a}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const u=bn(this.entity,!0);if(this.entity.type===f.Project){const i=[],a=[],o=[];u.forEach(e=>{if(f.DefinitionEntity===e.type){a.push(e);return}else if(Dt.includes(e.type)){o.push(e);return}i.push(e)});const p=i.sort((e,y)=>{const v=!!hm(e,y).length,E=bn(e),w=bn(y);return v?0:E.length&&!w.length?-1:!E.length&&w.length?1:0}).filter(e=>!Eo(e).length);this.childEntities=[...a,...o,...p]}else{const i=[],a=[],o=[],p=[],e=[];wi.includes(this.entity.type)&&ym(this.entity).forEach(E=>{if(yt.includes(E.type)){o.push(E);return}const w=mr(E);i.push(w)}),Nr.includes(this.entity.type)&&a.push(...this.entity.detachedChildren);const y=u.filter(v=>{const E=i.includes(v);return E||o.includes(v)||a.includes(v)?!1:yt.includes(v.type)?(o.push(v),!1):oi.includes(v.type)&&!E?(p.push(v),!1):v.type===f.DefinitionEntity?(e.push(v),!1):!0});i.sort((v,E)=>ml(v,E)?-1:0),p.sort((v,E)=>ml(v,E)?-1:0),o.sort((v,E)=>lb(v,E)?1:lb(E,v)?-1:0),this.childEntities=[...e,...i,...p,...y,...o,...a]}}calculateCardSize(){const u=r5(this.entity);this.entityCardWidth=u.width,this.entityCardHeight=u.height}static getBoundriesOfTwoAreas(u,i){return{top:Math.min(u.top,i.top),left:Math.min(u.left,i.left),bottom:Math.max(u.bottom,i.bottom),right:Math.max(u.right,i.right)}}static getBoundriedOfCombinedAreas(u,i){const a=u.filter(p=>!i.includes(p));return a.reduce((p,e)=>i.includes(e)?p:Ai.getBoundriesOfTwoAreas(p,e.fullBranchArea),a[0].fullBranchArea)}getFullAreaUntilAny(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!u.includes(e)).map(e=>e.getFullAreaUntilAny(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),i)}getFullAreaUntilAreaOrAnyChildren(u){const i=[u,...u.flattenChildren()],a=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(u)).reduce((e,y)=>Ai.getBoundriesOfTwoAreas(e,y),a)}getFullAreaUntil(u){const i=this.ownEntityPlusBufferArea;return this.children.filter(p=>p!==u).map(p=>p.getFullAreaUntil(u)).reduce((p,e)=>Ai.getBoundriesOfTwoAreas(p,e),i)}get fullBranchArea(){const u=this.ownEntityPlusBufferArea;return this.children.map(o=>o.fullBranchArea).reduce((o,p)=>Ai.getBoundriesOfTwoAreas(o,p),u)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const u=this.ownEntityArea;return{top:u.top,left:u.left,bottom:u.bottom+rm,right:u.right+PA}}static filterOutRepeatedAreas(u){return u.filter((i,a)=>u.indexOf(i)===a)}getEarliestId(u,i){const a=u.split("-"),o=i.split("-");return a.length<o.length?u:a.length>o.length?i:a.reduce((e,y,v)=>y<o[v]?u:i,u)}getEarliestLevel(){return this.ids.reduce((a,o)=>this.getEarliestId(a,o),this.ids[0]).split("-").length}countColumns(){let u=0;if(this!==this.calculationEntryPoint)u++;else return u;if(!this.parents.length)return u;const a=this.parents.reduce((o,p)=>p.getEarliestLevel()>o.getEarliestLevel()?p:o,this.parents[0]).countColumns();return u+=a,u}getLatestId(u,i){if(u===i)return u;const a=u.split("-"),o=i.split("-");return a.length<o.length?i:a.length>o.length?u:a.reduce((e,y,v)=>y>o[v]?u:i,u)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((a,o)=>this.getLatestId(a,o),this.ids[0]).split("-").length}smoothPosition(){const u=this.flattenSiblings();if(!u.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(a=>{a!==this.calculationEntryPoint&&a.shiftDownAlone(i)})}else if([...Dt].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=u.filter(a=>!this.parents.includes(a));i.length?i.every(o=>{const p=this.countColumns(),e=o.countColumns();return p>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(u,i){if(u.includes(this))return u;this.move(this.entity,{y:this.entity.y+i});let a=[...u,this];return this.children.forEach(o=>{if(Ai.getEarliestParentInChain(o)!==this)return;const e=$Te(a,o.entity.id);a=Ai.filterOutRepeatedAreas([...a]),e||(a=a.filter(v=>v!==o));const y=o.shiftDownUntilAny(a,i);a.push(...y)}),a}shiftRightUntilAny(u,i){u.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(a=>{const o=Ai.filterOutRepeatedAreas([...this.flattenSiblings(),...u]);Ai.getEarliestParentInChain(a)===this&&a.shiftRightUntilAny(o,i)}))}shiftRight(u){this.move(this.entity,{x:this.entity.x+u}),this.children.forEach(i=>{const o=i.flattenSiblings().filter(p=>p!==i);i.shiftRightUntilAny(o,u)})}shiftDownAlone(u){this.move(this.entity,{y:this.entity.y+u})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const u=this.parents.reduce((o,p)=>{const e=p.ownEntityArea,y=e.top+Md,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(o,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Md;this.shiftDownAlone(a)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const u=this.children.reduce((o,p)=>{const e=p.ownEntityArea,y=e.top+Md,v={top:y,left:e.left,bottom:y,right:e.right};return Ai.getBoundriesOfTwoAreas(o,v)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),a=(u.bottom-u.top)/2-Md;return this.shiftDownAlone(a),a}resolveChildrenOverlaps(){const u=this.flattenChildren();let i=[];u.forEach(a=>{const o=a.adjustVerticallyToAvoidOverlaps();i.push(...o)}),u.forEach(a=>{a.smoothPosition()})}static getEarliestParentInChain(u){let i=u.parents[0];return u.parents.length&&(i=u.parents.sort((a,o)=>{if(!a.ids.length)return-1;if(!o.ids.length)return 1;const p=a.ids.sort((y,v)=>y.length<v.length?-1:0),e=o.ids.sort((y,v)=>y.length<v.length?-1:0);return p[0].length-e[0].length})[0]),i}flattenEarlierSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,o)=>{if(u.has(o.entity.id))return a;u.add(o.entity.id);const e=o.children.slice(0,o.children.indexOf(this)).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenSiblings(u=new Set){return u.add(this.entity.id),this.parents.reduce((a,o)=>{if(u.has(o.entity.id))return a;u.add(o.entity.id);const e=o.children.filter(y=>y!==this).reduce((y,v)=>[...y,v,...v.flattenChildren(u)],[]);return[...a,...e]},[])}flattenChildren(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a,...a.flattenChildren(u)]),[])}flattenParents(u=new Set){return this.parents.reduce((a,o)=>u.has(o.entity.id)?a:(u.add(o.entity.id),[...a,o,...o.flattenParents(u)]),[])}getAreaIfRendered(u){return this.calculationEntryPoint.flattenChildren().find(o=>o.entity.id===u.id)||null}getLowerSiblings(){const u=this.parents.reduce((i,a)=>{const o=a.children.indexOf(this),p=a.children.slice(o+1);return[...i,...p]},[]);return i5(u)}getLowerAreas(){const u=this.getLowerSiblings(),i=this.parents.reduce((a,o)=>[...a,...o.getLowerAreas()],[]);return i5([...u,...i])}adjustVerticallyToAvoidOverlaps(u=[]){const a=Ai.getEarliestParentInChain(this).children[this.index-1];if(!a)return u;const o=this.flattenEarlierSiblings(),p=this.flattenParents(),e=[...o,...p,a],E=R(e.flatMap(V=>hm(this.entity,V.entity))).filter(V=>V.id!==this.entity.id).map(V=>this.findAreaFromEntity(V)).filter(V=>!!V),w=this.getFullAreaUntilAny(E),A=a.getFullAreaUntilAny(E),P=e.reduce((V,U)=>U===this||U.fullBranchArea.left!==w.left?V:Math.max(V,U.fullBranchArea.bottom),A.bottom);if(w.top<P){const V=P-w.top+rm;return this.shiftDownUntilAny(u,V)}return u}move(u,i){(this.onlyEntities||[]).includes(u)&&u.metaSync(i,this.changeSet)}addChild(u){const i=this.childEntities[u];let a=null;i.x&&i.y?a=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),a||(a=new Ai(i,u,this.calculationEntryPoint));const o=this.ownEntityPlusBufferArea;this.children.includes(a)||(this.children.push(a),a.addParent(this));const p=a.fullBranchArea;if(p.left<o.right){const e=o.right-p.left;a.shiftRight(e)}return a}flattenChildEntities(u=new Set){return this.children.reduce((i,a)=>u.has(a.entity.id)?i:(u.add(a.entity.id),[...i,a.entity,...a.flattenChildEntities(u)]),[])}next(u){const i=[];this.childEntities.forEach((a,o)=>{const p=this.addChild(o);p&&i.push(p)}),u(i)}}var Gp=(d=>(d.Amazon="amazon",d.Google="google",d.Microsoft="microsoft",d))(Gp||{}),kr=(d=>(d.RelationalDatabase="relational-database",d.CompiledLocalCodebase="compiled-local-codebase",d.CloudHostedCodebase="cloud-hosted-codebase",d.HttpApi="http-api",d.HttpEndpoint="http-endpoint",d.ServerlessFunction="serverless-function",d))(kr||{}),MA=(d=>(d.Post="post",d.Get="get",d.Acknowledgement="acknowledgment",d.Progress="progress",d.Error="error",d.Complete="complete",d))(MA||{}),hl=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.Skipped="skipped",d.AbortedByUser="aborted-by-user",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(hl||{}),BA=(d=>(d.Queued="queued",d.Running="running",d.Success="success",d.Failed="failed",d.CleanedUp="cleaned-up",d.UnrecoverableFailure="unrecoverable-failure",d.Reverted="reverted",d.UnpublishingStarted="unpublishing-started",d.Unpublished="unpublished",d))(BA||{}),mt=(d=>(d.ProjectNotFound="project-not-found",d.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",d.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",d.DeploymentCompleted="deployment-completed",d.DeploymentStarted="deployment-started",d.DeploymentFailed="deployment-failed",d.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",d.RequestPayloadValidationFailed="request-payload-validation-failed",d.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",d.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",d.ProjectAlreadyBeingPublished="project-already-being-published",d.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",d.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",d.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",d.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",d.CreatingNewRelationalDatabase="creating-new-relational-database",d.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",d.RelationalDatabaseAlreadyExists="relational-database-already-exists",d.RelationalDatabaseDeletionStarted="relational-database-deletion-started",d.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",d.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",d.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",d.HttpApiDeploymentStarted="http-api-deployment-started",d.HttpApiDeploymentCompleted="http-api-deployment-completed",d.HttpApiDeploymentFailed="http-api-deployment-failed",d.CreatingNewHttpApi="creating-new-http-api",d.HttpApiAlreadyExists="http-api-already-exists",d.HttpApiDeletionStarted="http-api-deletion-started",d.HttpApiDeletionCompleted="http-api-deletion-completed",d.HttpApiDeletionFailed="http-api-deletion-failed",d.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",d.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",d.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",d.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",d.BundlingCodebaseForDownload="bundling-codebase-for-download",d.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",d.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",d.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",d.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",d.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",d.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",d.CodeCompilationStarted="code-compilation-started",d.CodeCompilationCompleted="code-compilation-completed",d.CodeCompilationFailed="code-compilation-failed",d.BundleCodebaseStarted="bundle-codebase-started",d.BundleCodebaseCompleted="bundle-codebase-completed",d.BundleCodebaseFailed="bundle-codebase-failed",d.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",d.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",d.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",d.MigrateRelationalDatabaseStarted="migrate-relational-database-started",d.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",d.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",d))(mt||{}),An=(d=>(d.CodeCompilation="code-compilation",d.RelationalDatabaseDeployment="relational-database-deployment",d.RelationalDatabaseDeletion="relational-database-deletion",d.HttpApiDeployment="http-api-deployment",d.HttpApiDeletion="http-api-deletion",d.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",d.BundleCodebase="bundle-codebase",d.MigrateRelationalDatabase="migrate-relational-database",d.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",d.CodebaseCleanup="codebase-cleanup",d))(An||{});kr.CloudHostedCodebase,kr.HttpApi,kr.RelationalDatabase,kr.CloudHostedCodebase,kr.CloudHostedCodebase,kr.RelationalDatabase,kr.CloudHostedCodebase,kr.CloudHostedCodebase;function s5(d){return`project-${d}-http-api`}function n5(d){return`entity-${d}-database`}class a5{constructor(u,i,a,o,p,e,y,v,E){g(this,"stepType");g(this,"id");g(this,"resourceType");g(this,"index");g(this,"dependency",[]);g(this,"lastEvent",null);g(this,"lasEventTimestamp",null);g(this,"status",hl.Queued);g(this,"publicationRun");g(this,"resource");this.stepType=u,this.id=i,this.resourceType=a,this.status=o,this.dependency=p,this.index=e,this.lasEventTimestamp=y,this.publicationRun=v,this.resource=E}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(u){var i,a;this.status=u.status,this.dependency=u.dependency,this.index=u.index,this.stepType=u.stepType,this.resourceType=u.resourceType,this.lastEvent=u.lastEvent,this.id=u.id,(a=this.resource)==null||a.setDetails((i=u.resource)==null?void 0:i.details)}}var o5=(d=>(d.Ready="ready",d.Provisioning="provisioning",d.Queued="queued",d.ProvisioningFailed="provisioning-failed",d.Deleting="deleting",d.DeletingFailed="deleting-failed",d.Deleted="deleted",d))(o5||{});class UA{constructor(u,i,a){g(this,"provisionedBy");g(this,"publicationRun");g(this,"resourceType");g(this,"provider");g(this,"resourceId");g(this,"details",null);g(this,"name",null);g(this,"status","queued");this.publicationRun=u,this.resourceType=i,this.provider=a}setDetails(u){this.details=u}setStatus(u){this.status=u}setProvisionedBy(u){this.provisionedBy=u}}class xA extends UA{constructor(i,a,o,p){super(i,o,p);g(this,"resourceType");g(this,"owners",new Map);g(this,"details",null);g(this,"status","queued");a.forEach(e=>{this.owners.set(e.id,e)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,a;return this.resourceType===kr.HttpApi?this.resourceId=s5(this.publicationRun.project.id):this.resourceType===kr.RelationalDatabase&&(this.resourceId=n5((a=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:a.id)),this.resourceId}}class jA extends UA{constructor(i,a,o){super(i,a,o);g(this,"resourceType");g(this,"details",null);g(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceType===kr.CompiledLocalCodebase?this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`:this.resourceType===kr.CloudHostedCodebase&&(this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`),this.resourceId}}class PTe{constructor(u,i){g(this,"id");g(this,"projectAutoIncrementPublicationCount");g(this,"projectPublishedSemanticVersion");g(this,"projectVersion");g(this,"projectId");g(this,"cloudProvider");g(this,"triggeredBy");g(this,"createdAt");g(this,"updatedAt");g(this,"status");g(this,"steps",[]);g(this,"editor");g(this,"explicitResources",new Map);g(this,"implicitGlobalResources",new Map);g(this,"finalGlobalEvent",null);g(this,"finalStatus",null);this.id=u.id,this.projectAutoIncrementPublicationCount=u.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=u.projectPublishedSemanticVersion,this.projectVersion=u.projectVersion,this.projectId=u.projectId,this.cloudProvider=u.cloudProvider,this.triggeredBy=u.triggeredBy,this.createdAt=u.createdAt,this.updatedAt=u.updatedAt,this.status=u.status,this.editor=i}get project(){return this.editor.project}getInfraTypes(u){return this.steps.filter(i=>u.includes(i.resourceType))}getStepsTypes(u){return this.steps.filter(i=>u.includes(i.stepType))}toIds(u){return u.map(i=>i.id)}getResourceForEntity(u){const i=Array.from(this.explicitResources.values()).find(a=>a.owners.has(u.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(kr.CompiledLocalCodebase,new jA(this,kr.CompiledLocalCodebase,Gp.Amazon)),this.implicitGlobalResources.set(kr.CloudHostedCodebase,new jA(this,kr.CloudHostedCodebase,Gp.Amazon));const u=this.project.entities.filter(a=>es(a,Le.HTTP_ENDPOINT)),i=this.project.entities.filter(a=>es(a,Le.RELATIONAL_DATABASE));if(i.length&&i.forEach(a=>{const o=new xA(this,[a],kr.RelationalDatabase,Gp.Amazon);this.explicitResources.set(o.resourceId,o)}),u.length){const a=new xA(this,u,kr.HttpApi,Gp.Amazon);this.explicitResources.set(a.resourceId,a)}}setSteps(u,i){u.forEach(a=>{this.addStep(a,i)}),this.editor.events.emit(mt.ProjectPublishRequestAcknowledged,{})}addStep(u,i){const a=u.dependency||[];if(a.length){const p=a.filter(e=>!this.steps.find(y=>y.id===e));if(p.length)throw new Error(`Missing dependencies: ${p.join(", ")}`)}if(!u.resource)throw new Error(`Resource not found for step ${u.stepType} (${u.id})`);if(!this.steps.find(p=>p.id===u.id)){const p=this.implicitGlobalResources.get(u.resourceType)||this.explicitResources.get(u.resource.resourceId),e=new a5(u.stepType,u.id,u.resourceType,u.status,a,u.index,i,this,p);this.steps.push(e)}}onUpdate(u){var i;if(Me.log("onUpdate",u),(i=u.payload)!=null&&i.stepType){const a=this.steps.find(o=>{var p;return o.id===((p=u.payload)==null?void 0:p.id)});a&&L(u.emittedAt).isAfter(L(a.lasEventTimestamp))&&a.update(u.payload)}this.editor.events.emit("publication-updated",{}),u.type===MA.Error?(this.finalStatus=BA.Failed,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-error",u)):u.type===MA.Complete&&(this.finalStatus=BA.Success,this.finalGlobalEvent=u.event,this.editor.events.emit("project-publication-completed",u))}}function NTe(d){switch(d){case An.CodeCompilation:return"Code generation";case An.RelationalDatabaseDeployment:return"Database creation";case An.HttpApiDeployment:return"HTTP gateway creation";case An.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case An.BundleCodebase:return"Bundle code";case An.MigrateRelationalDatabase:return"Database structure migration";case An.BusinessLogicCodebaseDeployment:return"Update servers with new code";case An.CodebaseCleanup:return"Code cleanup";case An.HttpApiDeletion:return"HTTP gateway deletion";case An.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function VTe(d){switch(d){case mt.DeploymentCompleted:return"Successfully published";case mt.DeploymentStarted:return"Publication started";case mt.DeploymentFailed:return"Publication failed";case mt.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case mt.RequestPayloadValidationFailed:return"Request payload validation failed";case mt.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case mt.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case mt.RelationalDatabaseDeploymentStarted:return"Database creation started";case mt.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case mt.RelationalDatabaseDeploymentFailed:return"Database creation failed";case mt.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case mt.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case mt.RelationalDatabaseAlreadyExists:return"Database already exists";case mt.HttpApiDeploymentStarted:return"HTTP gateway creation started";case mt.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case mt.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case mt.CreatingNewHttpApi:return"Creating new HTTP gateway";case mt.HttpApiAlreadyExists:return"HTTP gateway already exists";case mt.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case mt.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case mt.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case mt.BundlingCodebaseForDownload:return"Bundling code for download";case mt.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case mt.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case mt.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case mt.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case mt.CodeCompilationStarted:return"Code generation started";case mt.CodeCompilationCompleted:return"Code generation completed";case mt.CodeCompilationFailed:return"Code generation failed";case mt.BundleCodebaseStarted:return"Code bundling started";case mt.BundleCodebaseCompleted:return"Code bundling completed";case mt.BundleCodebaseFailed:return"Code bundling failed";case mt.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case mt.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case mt.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case mt.MigrateRelationalDatabaseStarted:return"Database structure migration started";case mt.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case mt.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case mt.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case mt.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case mt.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case mt.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case mt.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case mt.ProjectNotFound:return"Project not found";case mt.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case mt.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case mt.HttpApiDeletionStarted:return"HTTP gateway deletion started";case mt.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case mt.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case mt.RelationalDatabaseDeletionStarted:return"Database deletion started";case mt.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case mt.RelationalDatabaseDeletionFailed:return"Database deletion failed";case mt.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var l5=(d=>(d.NO_LOGIC="NO_LOGIC",d.NO_NAME="NO_NAME",d.NO_CHANGES="NO_CHANGES",d.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",d))(l5||{});function LTe(d){switch(d){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function MTe(d){switch(d){case kr.RelationalDatabase:return"Relational database";case kr.HttpEndpoint:case kr.HttpApi:return"HTTP endpoints";case kr.ServerlessFunction:case kr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function BTe(d){switch(d){case hl.Running:return"In progress";case hl.Failed:return"Failed";case hl.Success:return"Succeeded";case hl.Skipped:return"Skipped";case hl.Queued:default:return"Queued"}}function UTe(d,u){let i=null;const a=[];if(!d.id)i={...d,id:N.UUID.uuid()};else if(!Db(d.id)){const y=N.UUID.uuid();i={...d,id:y},a.push(new ie({id:`${d.id}--${k.InvalidUUIDStringFormat}`,message:`Entity with id "${d.id}" has an invalid UUID string format. The 'id' property must be a valid UUID string.
|
|
200
200
|
The 'id' has been changed to "${y}".`,severity:Z.Warning,code:k.InvalidUUIDStringFormat}))}if(i={...d,id:(i==null?void 0:i.id)||d.id||""},!d.type)return{errors:[...a,new ie({id:`${i.id}--${k.MissingTypeProperty}`,message:`Entity with id "${i.id}" is missing a 'type' property.`,severity:Z.Error,code:k.MissingTypeProperty})],modifiedData:i};if(d.type===f.GenericReference)return{errors:[...a,new ie({id:`${i.id}--${k.RootReference}`,message:`Generic reference entity with id "${i.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:Z.Error,code:k.RootReference})],modifiedData:i};const o=i,p=u.instances[o.id],e=u.builtInInstances[o.id];if(p&&!e&&o.type!==f.GenericReference){let y=`A previously generated entity with id "${o.id}" already exists in the project state.
|
|
201
201
|
Are you trying to update that entity?
|
|
202
202
|
If so, you should use the 'update' action for core mutable metadata properties, or 'delete' and then 'post' again to replace it.
|