import{a as r,b as l,c,d,e as v,g as u,i as E,s as m,t as S}from"./chunk-4R4BOZG6.mjs";import{a as i}from"./chunk-AQ6EADP3.mjs";var k=class extends S{static{i(this,"EventModelingTokenBuilder")}static{r(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},y=new Set(["cmd","command"]),h=new Set(["evt","event"]),s=new Set(["rmo","readmodel"]),M=new Set(["pcr","processor"]),T=new Set(["ui"]);function g(e){let t=e.validation.EventModelingValidator,o=e.validation.ValidationRegistry;if(o){let n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};o.register(n,t)}}i(g,"registerValidationChecks");r(g,"registerValidationChecks");var C=class{static{i(this,"EventModelingValidator")}static{r(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(y.has(e.modelEntityType)?this.validateSources(e,new Set([...T,...M]),"command","ui or processor",t):h.has(e.modelEntityType)?this.validateSources(e,y,"event","command",t):s.has(e.modelEntityType)?this.validateSources(e,h,"read model","event",t):M.has(e.modelEntityType)?this.validateSources(e,s,"processor","read model",t):T.has(e.modelEntityType)&&this.validateSources(e,s,"ui","read model",t))}validateSources(e,t,o,n,p){for(let V of e.sourceFrames){let a=V.ref;a!==void 0&&!t.has(a.modelEntityType)&&p("error",`A ${o} can only receive input from a ${n}, not from '${a.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},w={parser:{TokenBuilder:r(()=>new k,"TokenBuilder"),ValueConverter:r(()=>new m,"ValueConverter")},validation:{EventModelingValidator:r(()=>new C,"EventModelingValidator")}};function F(e=v){let t=d(c(e),u),o=d(l({shared:t}),E,w);return t.ServiceRegistry.register(o),g(o),{shared:t,EventModel:o}}i(F,"createEventModelingServices");r(F,"createEventModelingServices");export{w as a,F as b};
