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