@cratis/screenplay-language 4.73.2 → 4.73.3
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/bundles/{chunk-WZ4PM4ZP.js → chunk-FAEWXRF3.js} +2 -2
- package/dist/bundles/chunk-FAEWXRF3.js.map +7 -0
- package/dist/bundles/index.js +28 -28
- package/dist/bundles/index.js.map +2 -2
- package/dist/bundles/sub-languages/projection/index.js +1 -1
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/bundles/chunk-WZ4PM4ZP.js.map +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l}from"./chunk-AYDF3IFZ.js";var fo="screenplay",Sd={id:fo,extensions:[".play"],aliases:["Screenplay","screenplay","play"],mimetypes:["text/x-screenplay"]},hd=["domain","import","concept","type","policy","persona","authentication","module","layout","theme","ui","feature","slice","event","system","eventsource","operation","command","query","projection","capture","reaction","reducer","trigger","screen","dialog","form","contribute","constraint","specification","seed","behavior"];var gi=["description","template","profile","require","authenticated","role","claim","subject","authorize","validate","produces","reads","as","handler","performer","observable","identifier","reason","from","when","given","then","arguments","result","clock","exactly","error","message","not","empty","rule","matches","all","max","min","length","today","true","false","and","or","by","filter","data","via","action","navigate","to","label","section","table","summary","title","column","field","on","unique","file","concurrency","eventSource","sourceType","streamType","streamId","tag","for","readmodel","no","when","every","at","where","invokes","contains","starts","with","provider","uses","parameter","order","execute","open","close","refresh","set","notify","confirm","raise","interval","success","failure","click","double","select","submit","change","load","unload","enter","leave","info","warning"],gd=["csharp","typescript","react","html","sql"],pn=["command","arguments","tenant","causedBy","causation","occurred","identity"],fn=["subject","name","userName"],un=["id","name","userName","isAuthenticated","roles","claims"],yn=["StateChange","StateView","Automation","Translate"],$t=["Uuid","String","Int","Decimal","Bool","Date","DateTime"],xd=["@pii","@sensitive"],$d={comments:{lineComment:"//"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:'"',close:'"'}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:'"',close:'"'}],folding:{offSide:!0},indentationRules:{increaseIndentPattern:/^\s*(module|feature|slice|policy|persona|authentication|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|validate|produces|handler|implementation(?=\s*$)|performer|rule|section|concurrency|seed|for|when|then|arguments|result|every|at)\b.*$/,decreaseIndentPattern:/(?!)/}};function Xe(t){let e=/^([\w.]+)(\[\])?(\?|\s+optional)?$/.exec(t);return{name:e?.[1]??t,isCollection:e?.[2]!==void 0,isOptional:e?.[3]!==void 0}}l(Xe,"typeReferenceSymbol");function kd(t){return`${t.name}${t.isCollection?"[]":""}${t.isOptional?" optional":""}`}l(kd,"typeReferenceText");function Ie(t){let e=!1,n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(r==="\\"&&e&&i+1<t.length)i++;else if(r==='"'&&!n)e=!e;else if(r==="`"&&!e)n=!n;else if(!e&&!n&&r==="/"&&t[i+1]==="/")return t.slice(0,i)}return t}l(Ie,"withoutComment");function V(t){return t.length-t.trimStart().length}l(V,"indentOf");function mn(t){return t.trim().split(/\s+/)[0]??""}l(mn,"firstWord");function oe(t){let e=new Array(t.length).fill(!1),n=!1;for(let i=0;i<t.length;i++){if(/^\s*```(?:[a-z]+)?\s*$/.test(t[i])&&(!n||/^\s*```\s*$/.test(t[i]))){e[i]=!0,n=!n;continue}e[i]=n}return e}l(oe,"fenceMap");function xi(t,e,n,i){let r=[],o=i;for(let a=n-1;a>=0&&o>0;a--){if(e[a])continue;let s=Ie(t[a]);if(s.trim().length===0)continue;let p=V(s);p<o&&(r.push(mn(s)),o=p)}return r}l(xi,"enclosingChain");function Ed(t,e,n,i){for(let r=n-1;r>=0&&i>0;r--){if(e[r])continue;let o=Ie(t[r]);if(o.trim().length!==0&&V(o)<i)return o.trim()}}l(Ed,"nearestEnclosingLine");var c={InvalidProducesDeclaration:"PLAY0042",ProducesWhenWithoutEvent:"PLAY0043",InvalidPropertyMapping:"PLAY0044",DuplicateProducesTarget:"PLAY0193",EventSourceIdInPayload:"PLAY0469",ExplicitProducesTargetsRequired:"PLAY0470",RedundantEventId:"PLAY0471",InvalidEventId:"PLAY0472",InlineEventCollision:"PLAY0473",InlineEventOutsideCommand:"PLAY0474",InlineEventGeneration:"PLAY0475",ReservedProductionMetadata:"PLAY0476",InvalidEventDocumentation:"PLAY0477",UnknownTopLevelConstruct:"PLAY0001",InvalidDomainDeclaration:"PLAY0002",DuplicateDomain:"PLAY0003",DomainNotFirst:"PLAY0004",InvalidImportDeclaration:"PLAY0005",TabIndentation:"PLAY0006",InvalidConceptDeclaration:"PLAY0007",UnknownPrimitiveType:"PLAY0008",InvalidEnumerationValue:"PLAY0009",UnknownConceptDirective:"PLAY0010",ValidateReadAsEnumerationBlock:"PLAY0011",AttributeReasonWithoutAttribute:"PLAY0012",DuplicateAttributeReason:"PLAY0013",InvalidTypeDeclaration:"PLAY0014",TypeWithoutProperties:"PLAY0015",InvalidPropertyDeclaration:"PLAY0016",IdentifierOutsideCommand:"PLAY0017",InvalidEventDeclaration:"PLAY0018",IdentifierOnEventProperty:"PLAY0019",TagPropertyReadAsTag:"PLAY0020",InvalidModuleDeclaration:"PLAY0021",UnknownModuleDirective:"PLAY0022",InvalidFeatureDeclaration:"PLAY0023",UnknownFeatureDirective:"PLAY0024",InvalidSliceDeclaration:"PLAY0027",UnknownSliceType:"PLAY0028",UnknownSliceDirective:"PLAY0029",InvalidPersonaDeclaration:"PLAY0030",InvalidPersonaPolicyReference:"PLAY0031",UnknownPersonaDirective:"PLAY0032",InvalidCommandDeclaration:"PLAY0033",UnknownCommandDirective:"PLAY0034",DuplicateCommandIdentifier:"PLAY0036",InvalidQueryDeclaration:"PLAY0047",UnknownQueryDirective:"PLAY0048",InvalidQueryParameter:"PLAY0049",InvalidProjectionDeclaration:"PLAY0056",EmptyProjection:"PLAY0057",UnknownProjectionDirective:"PLAY0058",FromWithoutEvent:"PLAY0061",InvalidEventReference:"PLAY0062",InvalidJoinDeclaration:"PLAY0063",JoinWithoutEvent:"PLAY0064",InvalidChildrenDeclaration:"PLAY0065",InvalidNestedDeclaration:"PLAY0066",NestedBlockWithoutFrom:"PLAY0067",InvalidRemoveDeclaration:"PLAY0068",UnknownRemoveDirective:"PLAY0069",InvalidClearDeclaration:"PLAY0070",ClearWithOutsideNestedBlock:"PLAY0071",InvalidSpecificationDeclaration:"PLAY0094",UnknownSpecificationDirective:"PLAY0095",InvalidSpecificationWhen:"PLAY0096",DuplicateSpecificationWhen:"PLAY0097",InvalidThenError:"PLAY0098",InvalidReadModelStep:"PLAY0099",InvalidEventStep:"PLAY0100",InvalidSpecificationValue:"PLAY0101",InvalidScreenDeclaration:"PLAY0102",UnknownScreenDirective:"PLAY0103",InvalidDataDirective:"PLAY0104",InvalidActionDirective:"PLAY0105",UnknownActionDirective:"PLAY0106",InvalidNavigation:"PLAY0107",InvalidScreenLayoutSlot:"PLAY0108",InvalidTitleDirective:"PLAY0109",UnknownTableDirective:"PLAY0110",UnknownSummaryDirective:"PLAY0111",AuthorizeWithoutPolicy:"PLAY0122",InvalidPolicyReference:"PLAY0123",InvalidConstraintDeclaration:"PLAY0132",ConstraintWithoutRule:"PLAY0133",InvalidConstraintBody:"PLAY0134",DuplicateConstraintBody:"PLAY0135",InvalidReactionDeclaration:"PLAY0136",InvalidReactionTrigger:"PLAY0137",ReactionWithoutTrigger:"PLAY0138",InvalidValidateDeclaration:"PLAY0140",InvalidValidationRule:"PLAY0141",InvalidRuleName:"PLAY0143",UnknownRuleImplementationDirective:"PLAY0144",InvalidDescription:"PLAY0145",EmptyDescription:"PLAY0146",DuplicateDescription:"PLAY0147",TagWithoutValue:"PLAY0148",InvalidTagValue:"PLAY0149",UnknownContextPath:"PLAY0153",UnknownContextCausedByProperty:"PLAY0154",UnknownContextIdentityProperty:"PLAY0155",ExpectedCodeFence:"PLAY0163",UnclosedCodeBlock:"PLAY0164",DuplicateDeclaration:"PLAY0168",RepeatedSingularDeclarationAcrossFiles:"PLAY0172",RepeatedDeclarationAcrossFiles:"PLAY0173",ConflictingDescriptionAcrossFiles:"PLAY0174",UnexpectedTokenInAuthorize:"PLAY0184",UnclosedAuthorizeGroup:"PLAY0185",InvalidReadModelDeclaration:"PLAY0186",InvalidInvokesDeclaration:"PLAY0194",InvalidScopeDeclaration:"PLAY0199",DuplicateScope:"PLAY0200",InvalidIntervalTrigger:"PLAY0249",InvalidScheduleTrigger:"PLAY0250",DuplicateReactionTrigger:"PLAY0253",InvalidSpecificationEventSource:"PLAY0275",DuplicateSpecificationEventSource:"PLAY0276",InvalidProjectionVariantDeclaration:"PLAY0277",InvalidEntersOnDeclaration:"PLAY0279",NestedProjectionVariantNotAllowed:"PLAY0280",InvalidStructuredValue:"PLAY0291",DuplicateStructuredValueMember:"PLAY0294",ConflictingSpecificationActions:"PLAY0358",InvalidSpecificationEventOrder:"PLAY0359",InvalidValidationSeverity:"PLAY0368",VariantRequiresEnteringEvent:"PLAY0382",DuplicateProjectionVariant:"PLAY0384",DuplicateVariantEnteringEvent:"PLAY0385",InvalidSpecificationDenied:"PLAY0388",DuplicateAuthorizationAcrossFiles:"PLAY0394",FileConstraintOnlySupportsUniqueness:"PLAY0396",LegacyInlineCodeFence:"PLAY0397",InvalidEventGeneration:"PLAY0446",InvalidFileImport:"PLAY0454",FileImportMatchesNothing:"PLAY0455",ImportedFileNotFound:"PLAY0456",ConflictingImportPlacement:"PLAY0457",ImportCycle:"PLAY0458",ModuleInPlacedFile:"PLAY0459",UnexpectedInPlacedFile:"PLAY0460",InvalidSpecificationClock:"PLAY0461",InvalidSpecificationTrigger:"PLAY0462",InvalidSpecificationCapture:"PLAY0463",InvalidSpecificationQueryAction:"PLAY0464",InvalidSpecificationQuery:"PLAY0265",UnknownSpecificationQueryDirective:"PLAY0266",DuplicateSpecificationQueryArguments:"PLAY0267",InvalidAbsentReadModelStep:"PLAY0453",LegacyOptionalSuffix:"PLAY0479",InvalidOptionalModifierOrder:"PLAY0480",OptionalReadsNotSupported:"PLAY0481",InvalidSpecificationCaller:"PLAY0386",DuplicateSpecificationCallerOrDenied:"PLAY0387",GeneratedPropertyOutsideCommand:"PLAY0482",InvalidGeneratedType:"PLAY0483",InvalidGeneratedModifierOrder:"PLAY0484",GeneratedPropertySuppliedAsInput:"PLAY0485",InvalidCommandResponse:"PLAY0486",InvalidResponseSource:"PLAY0487",DuplicateResponseField:"PLAY0488",InvalidResponseShape:"PLAY0489",InvalidGeneratedFixture:"PLAY0490",InvalidReturnExpectation:"PLAY0491",InvalidImplementationBlock:"PLAY0492",InvalidImplementationHint:"PLAY0493",ConflictingImplementationSources:"PLAY0494",UnknownType:"PLAY0165",InvalidSystemDeclaration:"PLAY0495",InvalidOperationDeclaration:"PLAY0496",InvalidProductionReference:"PLAY0497",ProductionDeclarationCollision:"PLAY0498",OperationOutsideCommand:"PLAY0499",InvalidSystemReference:"PLAY0500",InvalidOperationMapping:"PLAY0501",InvalidOperationSpecification:"PLAY0502",InvalidCaptureDeclaration:"PLAY0078",UnknownCaptureDirective:"PLAY0079",InvalidMapEntry:"PLAY0080",InvalidTranslation:"PLAY0081",InvalidSplitDeclaration:"PLAY0082",InvalidSplitTarget:"PLAY0083",InvalidAppendDeclaration:"PLAY0084",UnknownAppendDirective:"PLAY0085",WhenWithoutTrigger:"PLAY0086",InvalidWhenClause:"PLAY0087",InvalidWhenTransitionClause:"PLAY0088",MixedWhenCombinators:"PLAY0089",WhenCombinatorWithoutProperty:"PLAY0090",UnknownCaptureBlockDirective:"PLAY0091",InvalidCompositeKeyPart:"PLAY0072",TemplateInCompositeKey:"PLAY0073",EmptyCompositeKey:"PLAY0074",InvalidProjectionMapping:"PLAY0075",ExpectedLiteralValue:"PLAY0150",InvalidExpression:"PLAY0152",UnterminatedInterpolation:"PLAY0157",UnterminatedTemplateExpression:"PLAY0156",ProjectionDocumentWithoutProjection:"PLAY0055",CaptureDocumentWithoutCapture:"PLAY0077",SpecificationDocumentWithoutSpecification:"PLAY0093",InvalidSeedDeclaration:"PLAY0128",InvalidSeedGroup:"PLAY0129",InvalidSeedEvent:"PLAY0130",InvalidSeedPropertyAssignment:"PLAY0131",InvalidPolicyDeclaration:"PLAY0112",UnknownPolicyDirective:"PLAY0113",PolicyWithoutRequirement:"PLAY0114",ExpectedRoleName:"PLAY0118",ExpectedClaimName:"PLAY0119",ExpectedClaimMatches:"PLAY0120",ExpectedClaimMatchTarget:"PLAY0121",MixedPolicyImplementation:"PLAY0440",RepeatedPolicyRequirement:"PLAY0441",UnexpectedTokenInPolicyCondition:"PLAY0115",ExpectedPolicyCondition:"PLAY0116",UnclosedPolicyConditionGroup:"PLAY0117",UnexpectedTokenInCondition:"PLAY0158",ExpectedCondition:"PLAY0159",UnclosedConditionGroup:"PLAY0160",InvalidNumericDirective:"PLAY0508",DuplicateNumericDirective:"PLAY0509",LateNumericDirective:"PLAY0510",InexactNumericLiteral:"PLAY0511",MixedNumericModes:"PLAY0512",IncompatibleNumericSource:"PLAY0513",EventFromLaterSlice:"PLAY0516",TimelineCycleGroup:"PLAY0517",InvalidEventSourceDeclaration:"PLAY0503",InvalidCommandStream:"PLAY0504",AmbiguousCommandStream:"PLAY0505",UnsupportedStreamIdType:"PLAY0506",RedundantSourceStreamId:"PLAY0507",UnknownEvent:"PLAY0166",UnknownReadModelProperty:"PLAY0514",PiiNotSupportedOnIdentifier:"PLAY0515",HandlerWithoutImplementation:"PLAY0045",UnknownHandlerDirective:"PLAY0046",CommandWithProducesAndHandler:"PLAY0035",AbsoluteFileReference:"PLAY0264",InvalidTriggerData:"PLAY0246"};function Ne(t,e=!1,n){let i=[],r=0,o=0;for(let a of t.split(`
|
|
1
|
+
import{a as l}from"./chunk-AYDF3IFZ.js";var fo="screenplay",Sd={id:fo,extensions:[".play"],aliases:["Screenplay","screenplay","play"],mimetypes:["text/x-screenplay"]},hd=["domain","import","concept","type","policy","persona","authentication","module","layout","theme","ui","feature","slice","event","system","eventsource","operation","command","query","projection","capture","reaction","reducer","readmodel","trigger","screen","dialog","form","contribute","constraint","specification","seed","behavior"];var gi=["description","template","profile","require","authenticated","role","claim","subject","authorize","validate","produces","reads","as","handler","performer","observable","identifier","reason","from","when","given","then","arguments","result","clock","exactly","error","message","not","empty","rule","matches","all","max","min","length","today","true","false","and","or","by","filter","data","via","action","navigate","to","label","section","table","summary","title","column","field","on","unique","file","concurrency","eventSource","sourceType","streamType","streamId","tag","for","readmodel","no","when","every","at","where","invokes","contains","starts","with","provider","uses","parameter","order","execute","open","close","refresh","set","notify","confirm","raise","interval","success","failure","click","double","select","submit","change","load","unload","enter","leave","info","warning"],gd=["csharp","typescript","react","html","sql"],pn=["command","arguments","tenant","causedBy","causation","occurred","identity"],fn=["subject","name","userName"],un=["id","name","userName","isAuthenticated","roles","claims"],yn=["StateChange","StateView","Automation","Translate"],$t=["Uuid","String","Int","Decimal","Bool","Date","DateTime"],xd=["@pii","@sensitive"],$d={comments:{lineComment:"//"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:'"',close:'"'}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:'"',close:'"'}],folding:{offSide:!0},indentationRules:{increaseIndentPattern:/^\s*(module|feature|slice|policy|persona|authentication|provider|event|command|query|type|screen|projection|capture|reaction|trigger|constraint|specification|layout|template|validate|produces|handler|implementation(?=\s*$)|performer|rule|section|concurrency|seed|for|when|then|arguments|result|every|at)\b.*$/,decreaseIndentPattern:/(?!)/}};function Xe(t){let e=/^([\w.]+)(\[\])?(\?|\s+optional)?$/.exec(t);return{name:e?.[1]??t,isCollection:e?.[2]!==void 0,isOptional:e?.[3]!==void 0}}l(Xe,"typeReferenceSymbol");function kd(t){return`${t.name}${t.isCollection?"[]":""}${t.isOptional?" optional":""}`}l(kd,"typeReferenceText");function Ie(t){let e=!1,n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(r==="\\"&&e&&i+1<t.length)i++;else if(r==='"'&&!n)e=!e;else if(r==="`"&&!e)n=!n;else if(!e&&!n&&r==="/"&&t[i+1]==="/")return t.slice(0,i)}return t}l(Ie,"withoutComment");function V(t){return t.length-t.trimStart().length}l(V,"indentOf");function mn(t){return t.trim().split(/\s+/)[0]??""}l(mn,"firstWord");function oe(t){let e=new Array(t.length).fill(!1),n=!1;for(let i=0;i<t.length;i++){if(/^\s*```(?:[a-z]+)?\s*$/.test(t[i])&&(!n||/^\s*```\s*$/.test(t[i]))){e[i]=!0,n=!n;continue}e[i]=n}return e}l(oe,"fenceMap");function xi(t,e,n,i){let r=[],o=i;for(let a=n-1;a>=0&&o>0;a--){if(e[a])continue;let s=Ie(t[a]);if(s.trim().length===0)continue;let p=V(s);p<o&&(r.push(mn(s)),o=p)}return r}l(xi,"enclosingChain");function Ed(t,e,n,i){for(let r=n-1;r>=0&&i>0;r--){if(e[r])continue;let o=Ie(t[r]);if(o.trim().length!==0&&V(o)<i)return o.trim()}}l(Ed,"nearestEnclosingLine");var c={InvalidProducesDeclaration:"PLAY0042",ProducesWhenWithoutEvent:"PLAY0043",InvalidPropertyMapping:"PLAY0044",DuplicateProducesTarget:"PLAY0193",EventSourceIdInPayload:"PLAY0469",ExplicitProducesTargetsRequired:"PLAY0470",RedundantEventId:"PLAY0471",InvalidEventId:"PLAY0472",InlineEventCollision:"PLAY0473",InlineEventOutsideCommand:"PLAY0474",InlineEventGeneration:"PLAY0475",ReservedProductionMetadata:"PLAY0476",InvalidEventDocumentation:"PLAY0477",UnknownTopLevelConstruct:"PLAY0001",InvalidDomainDeclaration:"PLAY0002",DuplicateDomain:"PLAY0003",DomainNotFirst:"PLAY0004",InvalidImportDeclaration:"PLAY0005",TabIndentation:"PLAY0006",InvalidConceptDeclaration:"PLAY0007",UnknownPrimitiveType:"PLAY0008",InvalidEnumerationValue:"PLAY0009",UnknownConceptDirective:"PLAY0010",ValidateReadAsEnumerationBlock:"PLAY0011",AttributeReasonWithoutAttribute:"PLAY0012",DuplicateAttributeReason:"PLAY0013",InvalidTypeDeclaration:"PLAY0014",TypeWithoutProperties:"PLAY0015",InvalidPropertyDeclaration:"PLAY0016",IdentifierOutsideCommand:"PLAY0017",InvalidEventDeclaration:"PLAY0018",IdentifierOnEventProperty:"PLAY0019",TagPropertyReadAsTag:"PLAY0020",InvalidModuleDeclaration:"PLAY0021",UnknownModuleDirective:"PLAY0022",InvalidFeatureDeclaration:"PLAY0023",UnknownFeatureDirective:"PLAY0024",InvalidSliceDeclaration:"PLAY0027",UnknownSliceType:"PLAY0028",UnknownSliceDirective:"PLAY0029",InvalidPersonaDeclaration:"PLAY0030",InvalidPersonaPolicyReference:"PLAY0031",UnknownPersonaDirective:"PLAY0032",InvalidCommandDeclaration:"PLAY0033",UnknownCommandDirective:"PLAY0034",DuplicateCommandIdentifier:"PLAY0036",InvalidQueryDeclaration:"PLAY0047",UnknownQueryDirective:"PLAY0048",InvalidQueryParameter:"PLAY0049",InvalidProjectionDeclaration:"PLAY0056",EmptyProjection:"PLAY0057",UnknownProjectionDirective:"PLAY0058",FromWithoutEvent:"PLAY0061",InvalidEventReference:"PLAY0062",InvalidJoinDeclaration:"PLAY0063",JoinWithoutEvent:"PLAY0064",InvalidChildrenDeclaration:"PLAY0065",InvalidNestedDeclaration:"PLAY0066",NestedBlockWithoutFrom:"PLAY0067",InvalidRemoveDeclaration:"PLAY0068",UnknownRemoveDirective:"PLAY0069",InvalidClearDeclaration:"PLAY0070",ClearWithOutsideNestedBlock:"PLAY0071",InvalidSpecificationDeclaration:"PLAY0094",UnknownSpecificationDirective:"PLAY0095",InvalidSpecificationWhen:"PLAY0096",DuplicateSpecificationWhen:"PLAY0097",InvalidThenError:"PLAY0098",InvalidReadModelStep:"PLAY0099",InvalidEventStep:"PLAY0100",InvalidSpecificationValue:"PLAY0101",InvalidScreenDeclaration:"PLAY0102",UnknownScreenDirective:"PLAY0103",InvalidDataDirective:"PLAY0104",InvalidActionDirective:"PLAY0105",UnknownActionDirective:"PLAY0106",InvalidNavigation:"PLAY0107",InvalidScreenLayoutSlot:"PLAY0108",InvalidTitleDirective:"PLAY0109",UnknownTableDirective:"PLAY0110",UnknownSummaryDirective:"PLAY0111",AuthorizeWithoutPolicy:"PLAY0122",InvalidPolicyReference:"PLAY0123",InvalidConstraintDeclaration:"PLAY0132",ConstraintWithoutRule:"PLAY0133",InvalidConstraintBody:"PLAY0134",DuplicateConstraintBody:"PLAY0135",InvalidReactionDeclaration:"PLAY0136",InvalidReactionTrigger:"PLAY0137",ReactionWithoutTrigger:"PLAY0138",InvalidValidateDeclaration:"PLAY0140",InvalidValidationRule:"PLAY0141",InvalidRuleName:"PLAY0143",UnknownRuleImplementationDirective:"PLAY0144",InvalidDescription:"PLAY0145",EmptyDescription:"PLAY0146",DuplicateDescription:"PLAY0147",TagWithoutValue:"PLAY0148",InvalidTagValue:"PLAY0149",UnknownContextPath:"PLAY0153",UnknownContextCausedByProperty:"PLAY0154",UnknownContextIdentityProperty:"PLAY0155",ExpectedCodeFence:"PLAY0163",UnclosedCodeBlock:"PLAY0164",DuplicateDeclaration:"PLAY0168",RepeatedSingularDeclarationAcrossFiles:"PLAY0172",RepeatedDeclarationAcrossFiles:"PLAY0173",ConflictingDescriptionAcrossFiles:"PLAY0174",UnexpectedTokenInAuthorize:"PLAY0184",UnclosedAuthorizeGroup:"PLAY0185",InvalidReadModelDeclaration:"PLAY0186",InvalidInvokesDeclaration:"PLAY0194",InvalidScopeDeclaration:"PLAY0199",DuplicateScope:"PLAY0200",InvalidIntervalTrigger:"PLAY0249",InvalidScheduleTrigger:"PLAY0250",DuplicateReactionTrigger:"PLAY0253",InvalidSpecificationEventSource:"PLAY0275",DuplicateSpecificationEventSource:"PLAY0276",InvalidProjectionVariantDeclaration:"PLAY0277",InvalidEntersOnDeclaration:"PLAY0279",NestedProjectionVariantNotAllowed:"PLAY0280",InvalidStructuredValue:"PLAY0291",DuplicateStructuredValueMember:"PLAY0294",ConflictingSpecificationActions:"PLAY0358",InvalidSpecificationEventOrder:"PLAY0359",InvalidValidationSeverity:"PLAY0368",VariantRequiresEnteringEvent:"PLAY0382",DuplicateProjectionVariant:"PLAY0384",DuplicateVariantEnteringEvent:"PLAY0385",InvalidSpecificationDenied:"PLAY0388",DuplicateAuthorizationAcrossFiles:"PLAY0394",FileConstraintOnlySupportsUniqueness:"PLAY0396",LegacyInlineCodeFence:"PLAY0397",InvalidEventGeneration:"PLAY0446",InvalidFileImport:"PLAY0454",FileImportMatchesNothing:"PLAY0455",ImportedFileNotFound:"PLAY0456",ConflictingImportPlacement:"PLAY0457",ImportCycle:"PLAY0458",ModuleInPlacedFile:"PLAY0459",UnexpectedInPlacedFile:"PLAY0460",InvalidSpecificationClock:"PLAY0461",InvalidSpecificationTrigger:"PLAY0462",InvalidSpecificationCapture:"PLAY0463",InvalidSpecificationQueryAction:"PLAY0464",InvalidSpecificationQuery:"PLAY0265",UnknownSpecificationQueryDirective:"PLAY0266",DuplicateSpecificationQueryArguments:"PLAY0267",InvalidAbsentReadModelStep:"PLAY0453",LegacyOptionalSuffix:"PLAY0479",InvalidOptionalModifierOrder:"PLAY0480",OptionalReadsNotSupported:"PLAY0481",InvalidSpecificationCaller:"PLAY0386",DuplicateSpecificationCallerOrDenied:"PLAY0387",GeneratedPropertyOutsideCommand:"PLAY0482",InvalidGeneratedType:"PLAY0483",InvalidGeneratedModifierOrder:"PLAY0484",GeneratedPropertySuppliedAsInput:"PLAY0485",InvalidCommandResponse:"PLAY0486",InvalidResponseSource:"PLAY0487",DuplicateResponseField:"PLAY0488",InvalidResponseShape:"PLAY0489",InvalidGeneratedFixture:"PLAY0490",InvalidReturnExpectation:"PLAY0491",InvalidImplementationBlock:"PLAY0492",InvalidImplementationHint:"PLAY0493",ConflictingImplementationSources:"PLAY0494",UnknownType:"PLAY0165",InvalidSystemDeclaration:"PLAY0495",InvalidOperationDeclaration:"PLAY0496",InvalidProductionReference:"PLAY0497",ProductionDeclarationCollision:"PLAY0498",OperationOutsideCommand:"PLAY0499",InvalidSystemReference:"PLAY0500",InvalidOperationMapping:"PLAY0501",InvalidOperationSpecification:"PLAY0502",InvalidCaptureDeclaration:"PLAY0078",UnknownCaptureDirective:"PLAY0079",InvalidMapEntry:"PLAY0080",InvalidTranslation:"PLAY0081",InvalidSplitDeclaration:"PLAY0082",InvalidSplitTarget:"PLAY0083",InvalidAppendDeclaration:"PLAY0084",UnknownAppendDirective:"PLAY0085",WhenWithoutTrigger:"PLAY0086",InvalidWhenClause:"PLAY0087",InvalidWhenTransitionClause:"PLAY0088",MixedWhenCombinators:"PLAY0089",WhenCombinatorWithoutProperty:"PLAY0090",UnknownCaptureBlockDirective:"PLAY0091",InvalidCompositeKeyPart:"PLAY0072",TemplateInCompositeKey:"PLAY0073",EmptyCompositeKey:"PLAY0074",InvalidProjectionMapping:"PLAY0075",ExpectedLiteralValue:"PLAY0150",InvalidExpression:"PLAY0152",UnterminatedInterpolation:"PLAY0157",UnterminatedTemplateExpression:"PLAY0156",ProjectionDocumentWithoutProjection:"PLAY0055",CaptureDocumentWithoutCapture:"PLAY0077",SpecificationDocumentWithoutSpecification:"PLAY0093",InvalidSeedDeclaration:"PLAY0128",InvalidSeedGroup:"PLAY0129",InvalidSeedEvent:"PLAY0130",InvalidSeedPropertyAssignment:"PLAY0131",InvalidPolicyDeclaration:"PLAY0112",UnknownPolicyDirective:"PLAY0113",PolicyWithoutRequirement:"PLAY0114",ExpectedRoleName:"PLAY0118",ExpectedClaimName:"PLAY0119",ExpectedClaimMatches:"PLAY0120",ExpectedClaimMatchTarget:"PLAY0121",MixedPolicyImplementation:"PLAY0440",RepeatedPolicyRequirement:"PLAY0441",UnexpectedTokenInPolicyCondition:"PLAY0115",ExpectedPolicyCondition:"PLAY0116",UnclosedPolicyConditionGroup:"PLAY0117",UnexpectedTokenInCondition:"PLAY0158",ExpectedCondition:"PLAY0159",UnclosedConditionGroup:"PLAY0160",InvalidNumericDirective:"PLAY0508",DuplicateNumericDirective:"PLAY0509",LateNumericDirective:"PLAY0510",InexactNumericLiteral:"PLAY0511",MixedNumericModes:"PLAY0512",IncompatibleNumericSource:"PLAY0513",EventFromLaterSlice:"PLAY0516",TimelineCycleGroup:"PLAY0517",InvalidEventSourceDeclaration:"PLAY0503",InvalidCommandStream:"PLAY0504",AmbiguousCommandStream:"PLAY0505",UnsupportedStreamIdType:"PLAY0506",RedundantSourceStreamId:"PLAY0507",UnknownEvent:"PLAY0166",UnknownReadModelProperty:"PLAY0514",PiiNotSupportedOnIdentifier:"PLAY0515",HandlerWithoutImplementation:"PLAY0045",UnknownHandlerDirective:"PLAY0046",CommandWithProducesAndHandler:"PLAY0035",AbsoluteFileReference:"PLAY0264",InvalidTriggerData:"PLAY0246"};function Ne(t,e=!1,n){let i=[],r=0,o=0;for(let a of t.split(`
|
|
2
2
|
`)){r++;let s=a.endsWith("\r")?a.replace(/\r+$/,""):a,p=s.length-s.trimStart().length,f=uo(s.substring(p),e).trimEnd();i.push(n===void 0?{number:r,raw:s,indent:p,content:f,startOffset:o}:{number:r,raw:s,indent:p,content:f,path:n,startOffset:o}),o+=a.length+1}return i}l(Ne,"splitLines");function et(t,e=!1){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];if(o==="\\"&&n&&r+1<t.length)r++;else if(o==='"'&&!i)n=!n;else if(o==="`"&&!n)i=!i;else if(!n&&!i&&(o==="/"&&r+1<t.length&&t[r+1]==="/"||e&&o==="#"))return r}return-1}l(et,"commentStart");function uo(t,e){let n=et(t,e);return n<0?t:t.substring(0,n)}l(uo,"stripComment");var Re=[],tt=l(t=>t.length===0,"isDocumentPlacement");function vt(t){return t.length===0?"the application":t.length===1?`module '${t[0]}'`:`feature '${t.join(".")}'`}l(vt,"describePlacement");var Sn="\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}",nt="[\\u0009-\\u000d\\u0020\\u0085\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]";function _(t){let e=`(?=[\\u0000-\\uFFFF])[${Sn}]`,n=t.replace(/\[([^\]]*\\w[^\]]*)\]/g,(i,r)=>{let o=r.replaceAll("\\w","");return o===""?`(?:${e})`:`(?:${e}|[${o}])`});return new RegExp(n.replaceAll("\\w",`(?:${e})`),"u")}l(_,"nativePattern");function E(t){let e="",n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(r==="\\"&&i+1<t.length){let o=t[i+1];i++,o==="w"?e+=n?Sn:`[${Sn}]`:o==="d"?e+="\\p{Nd}":e+=`\\${o}`;continue}r==="["&&!n?n=!0:r==="]"&&n&&(n=!1),e+=r}return new RegExp(e,"u")}l(E,"pattern");var qe=l((t,e,n)=>n===void 0?{line:t,column:e}:{line:t,column:e,path:n},"sourceLocation");var hn=l(t=>t.content.length===0,"isBlank"),d=l(t=>qe(t.number,t.indent+(t.contentOffset??0)+1,t.path),"locationOf"),$i=l(t=>qe(t.number,1,t.path),"startOf");var yo=E("^(?:(?:or|and)\\s+)?[A-Za-z_(][\\w\\s()]*$"),mo=new RegExp(E("\\(|\\)|[A-Za-z_]\\w*").source,"gu"),So=E("^[A-Z]\\w*$");function Pe(t,e){let n=e.content.substring(9);for(let s=t.peekChild(e.indent);s!==void 0&&yo.test(s.content);s=t.peekChild(e.indent))t.reader.takeSignificant(),n+=` ${s.content}`;let i=ho(n),r=d(e);if(i.length===0)return t.error(c.AuthorizeWithoutPolicy,"Expected at least one policy after 'authorize'",r),null;let a=new gn(t,i,r).parse();return a===null?null:{kind:"AuthorizeSyntax",requirement:a,location:r}}l(Pe,"parseAuthorize");function ge(t,e){return t===null?e:e===null?t:{kind:"AuthorizeSyntax",requirement:{kind:"LogicalPolicyRequirementSyntax",left:t.requirement,operator:"And",right:e.requirement,location:t.location},location:t.location}}l(ge,"combineAuthorize");function ho(t){let e=[];for(let n of t.match(mo)??[])e.length>0&&go(e[e.length-1])&&xo(n)&&e.push("and"),e.push(n);return e}l(ho,"tokenize");var vi=l(t=>t!=="("&&t!==")"&&t!=="and"&&t!=="or","isName"),go=l(t=>t===")"||vi(t),"isOperandEnd"),xo=l(t=>t==="("||vi(t),"isOperandStart"),gn=class{static{l(this,"RequirementParser")}context;tokens;location;#e=0;constructor(e,n,i){this.context=e,this.tokens=n,this.location=i}parse(){let e=this.#t();return e!==null&&this.#e<this.tokens.length&&this.context.error(c.UnexpectedTokenInAuthorize,`Unexpected '${this.tokens[this.#e]}' in authorize`,this.location),e}#t(){return this.#n("or","Or",()=>this.#i())}#i(){return this.#n("and","And",()=>this.#r())}#n(e,n,i){let r=i();for(;r!==null&&this.tokens[this.#e]===e;){this.#e++;let o=i();if(o===null)return null;r={kind:"LogicalPolicyRequirementSyntax",left:r,operator:n,right:o,location:this.location}}return r}#r(){if(this.tokens[this.#e]!=="(")return this.#s();this.#e++;let e=this.#t();return this.tokens[this.#e]===")"?this.#e++:this.context.error(c.UnclosedAuthorizeGroup,"Expected ')' in authorize",this.location),e}#s(){if(this.#e>=this.tokens.length)return this.context.error(c.AuthorizeWithoutPolicy,"Expected a policy name",this.location),null;let e=this.tokens[this.#e++];return So.test(e)?{kind:"PolicyReferenceSyntax",name:e,location:this.location}:(this.context.error(c.InvalidPolicyReference,`Invalid policy reference '${e}' - policy names are PascalCase identifiers`,this.location),null)}};var U='(?:[^"\\\\]|\\\\.)*',$o={"\\":"\\",'"':'"',n:`
|
|
3
3
|
`,r:"\r",t:" "};function z(t){if(!t.includes("\\"))return t;let e="";for(let n=0;n<t.length;n++){let i=n+1<t.length?$o[t[n+1]]:void 0;t[n]==="\\"&&i!==void 0?(e+=i,n++):e+=t[n]}return e}l(z,"unescapeString");function Be(t,e,n,i=!1){let o=n.content.startsWith("```")?n:t.reader.peekSignificant(),a=e==="description"?"```text":`\`\`\`${e}`;if(o===void 0||o!==n&&o.indent<=n.indent||o.content!==a&&!(i&&e==="description"&&o.content==="```markdown")&&!(o.content==="```"&&o!==n))return t.error(c.ExpectedCodeFence,`Expected an opening \`\`\`${e==="description"?"text":e} fence after '${e}'`,d(n)),null;o!==n&&t.reader.takeSignificant(),e==="description"&&o.content==="```"&&t.warning(c.LegacyInlineCodeFence,"A bare description fence is deprecated - use '```text' instead",d(o));let s=[];for(;;){let p=t.reader.takeRaw();if(p===void 0){t.error(c.UnclosedCodeBlock,"Unclosed inline code block - expected a closing ``` line",d(o));break}if(p.raw.trim()==="```")break;let f=0;for(;f<o.indent&&f<p.raw.length&&p.raw[f]===" ";)f++;s.push(p.raw.substring(f))}return s.join(`
|
|
4
4
|
`)}l(Be,"parseFencedText");var vo=E(`^description\\s+"(${U})"$`);function G(t,e,n,i,r=!1){if(e.content==="description"){let a=Be(t,"description",e,r);return a===null?n:a.trim().length===0?(t.error(c.EmptyDescription,`${i} declares an empty description - the fenced block must contain text`,d(e)),n):ki(t,e,n,i,a)}let o=vo.exec(e.content);return o===null?(t.error(c.InvalidDescription,`Invalid description '${e.content}' - expected 'description "<text>"'`,d(e)),n):ki(t,e,n,i,z(o[1]))}l(G,"parseDescription");function ki(t,e,n,i,r){return n!==null?(t.error(c.DuplicateDescription,`${i} already declares a description - at most one is allowed`,d(e)),n):r}l(ki,"keep");var ko=E('^import\\s+"([^"\\\\]+)"$'),bo=E('^import\\s+"'),bi=l(t=>bo.test(t),"isFileImport");function Ci(t){let e=ko.exec(t.content);return e===null?void 0:{kind:"FileImportSyntax",pattern:e[1],location:d(t)}}l(Ci,"tryParseFileImport");function Fe(t,e,n){let i=Ci(e);if(i!==void 0){n.push(i);return}t.error(c.InvalidFileImport,`Invalid import '${e.content}' - inside a module or feature, import names files: 'import "<path or glob>"'`,d(e)),t.skipBlock(e.indent)}l(Fe,"parseFileImport");var R=l(t=>{let e=t.indexOf(" ");return e===-1?t:t.substring(0,e)},"firstWord"),Q=l(t=>t.replaceAll("@",""),"unescapeIdentifier");function Ei(t,e){let n=[],i=0,r=!1,o=!1;for(let a=0;a<t.length;a++){let s=t[a];s==="\\"&&r&&a+1<t.length?a++:s==='"'&&!o?r=!r:s==="`"&&!r?o=!o:s===e&&!r&&!o&&(n.push(t.substring(i,a)),i=a+1)}return n.push(t.substring(i)),n}l(Ei,"splitTopLevel");var Co=E("^form\\s+[A-Za-z_]\\w*\\s+for\\s+([A-Za-z_]\\w*(?:\\.\\w+)*)$"),Eo=E("^(execute|invokes)\\s+([A-Za-z_]\\w*(?:\\.\\w+)*)$"),Po=E("^field\\s+([\\w.]+)(?:\\s|$)"),Oo=E("^with\\s+([A-Za-z_]\\w*)\\s+from\\s+.+$"),Ao=E("^(@?[\\w.]+)\\s*=(?!=|>)\\s*.+$"),wo=E("^parameter\\s+([A-Za-z_]\\w*)(?:\\s+([\\w.]+(?:\\[\\])?))?$"),Io=new Set(["refresh","navigate","open","close","set","notify","confirm","raise","on"]);function fe(t,e){let n=[],i=new Set,r=[],o=R(e.content)==="behavior",a=l(s=>{for(;n.length>0&&n[n.length-1].indent>=s.indent;)n.pop();let p=o&&n.length===0?wo.exec(s.content):null;p!==null&&i.add(p[1]);let f=Co.exec(s.content),m=Eo.exec(s.content);if(f!==null)n.push({command:f[1],kind:"form",indent:s.indent});else if(m!==null)n.push({command:m[2],kind:m[1],indent:s.indent});else if(Io.has(R(s.content)))n.push({command:"",kind:"other",indent:s.indent});else{let u=n.at(-1);if(u===void 0||u.kind==="other")return;let y=(u.kind==="form"?Po:u.kind==="execute"?Oo:Ao).exec(s.content);y!==null&&r.push({command:u.command,property:Q(y[1]),scope:t.scope,location:d(s)})}},"recognize");a(e);for(let s=t.peekChild(e.indent);s!==void 0;s=t.peekChild(e.indent))t.reader.takeSignificant(),s.content.startsWith("```")?t.skipFencedBody():a(s);for(let s of r)t.inputUses.push(i.has(s.command)?{...s,isParameter:!0}:s)}l(fe,"collectInputUses");var Pi=["StateChange","StateView","Automation","Translate"];var it=["tag"];var Ro=E(`^id\\s+"(${U})"$`),Ye=class{static{l(this,"EventMetadataParser")}name;value={id:null,description:null,documentation:null};constructor(e){this.name=e}tryParse(e,n){let i=d(n);switch(R(n.content)){case"id":{let r=Ro.exec(n.content),o=r===null?"":z(r[1]);return o.trim().length===0||this.value.id!==null?e.error(c.InvalidEventId,`Event '${this.name}' accepts one nonempty 'id "<old-name>"'`,i):(this.value.id=o,o===this.name&&e.information(c.RedundantEventId,`Event '${this.name}' already has this name as its identity - remove the redundant id`,i)),!0}case"description":return this.value.description=G(e,n,this.value.description,`Event '${this.name}'`,!0),!0;case"documentation":{if(n.content!=="documentation"||e.peekChild(n.indent)?.content!=="```markdown")return e.error(c.InvalidEventDocumentation,`Event '${this.name}' documentation requires a fenced markdown block`,i),e.skipOpaqueBlock(n.indent),!0;let r=Be(e,"markdown",n);return r===null||r.trim().length===0||this.value.documentation!==null?e.error(c.InvalidEventDocumentation,`Event '${this.name}' accepts one nonempty documentation block`,i):this.value.documentation=r,!0}default:return!1}}};var xn="79228162514264337593543950335";function ke(t){let e=Oi(t);if(e===void 0)return;let n=e.integer+e.fraction,i=0;for(;i<n.length&&n[i]==="0";)i++;if(i===n.length)return Object.freeze({literalType:"ExactNumber",value:"0"});let r=n.length;for(;n[r-1]==="0";)r--;let o=e.fraction.length-e.exponent-(n.length-r),a=o<0?-o:0;if(o>28||r-i+a>xn.length)return;let s=n.substring(i,r)+"0".repeat(a);if(s.length===xn.length&&s>xn)return;let p=Math.max(0,o),f=p===0?s:s.length>p?`${s.substring(0,s.length-p)}.${s.substring(s.length-p)}`:`0.${"0".repeat(p-s.length)}${s}`;return Object.freeze({literalType:"ExactNumber",value:(e.negative?"-":"")+f})}l(ke,"parseExactNumber");function rt(t){return Oi(t)!==void 0}l(rt,"isExactNumberToken");function Oi(t){let e=t.startsWith("-"),n=e?1:0,i=n;for(;i<t.length&&$n(t[i]);)i++;if(i===n)return;let r=t.substring(n,i),o="";if(t[i]==="."){let s=++i;for(;i<t.length&&$n(t[i]);)i++;if(i===s)return;o=t.substring(s,i)}let a=0;if(t[i]==="e"||t[i]==="E"){i++;let s=t[i]==="-";(t[i]==="+"||t[i]==="-")&&i++;let p=i,f=t.length+29;for(;i<t.length&&$n(t[i]);)a=Math.min(f,a*10+t.charCodeAt(i++)-48);if(i===p)return;s&&(a=-a)}return i===t.length?{negative:e,integer:r,fraction:o,exponent:a}:void 0}l(Oi,"scan");function $n(t){return t>="0"&&t<="9"}l($n,"isDigit");var Ai=64,ae=class extends Error{static{l(this,"InvalidStructuredValue")}},kt=class{static{l(this,"StructuredValueParser")}text;start;context;#e=0;constructor(e,n,i){this.text=e,this.start=n,this.context=i}parse(){let e=this.#t(0);if(this.#o(),this.#e<this.text.length)throw new ae(`'${this.text[this.#e]}' is invalid after a single JSON value.`);return e}#t(e){this.#o();let n=this.#c(),i=this.text[this.#e];if(i==="["||i==="{"){if(e>=Ai)throw new ae(`The value nests deeper than ${Ai} levels.`);return i==="["?this.#i(e,n):this.#n(e,n)}if(i==='"')return{kind:"LiteralExpressionSyntax",value:this.#r(),location:n};for(let[r,o]of[["true",!0],["false",!1],["null",null]])if(this.text.startsWith(r,this.#e))return this.#e+=r.length,{kind:"LiteralExpressionSyntax",value:o,location:n};return this.#d(n)}#i(e,n){this.#e++;let i=[];if(this.#o(),this.#a("]"))return{kind:"ListExpressionSyntax",items:i,location:n};for(;;){if(i.push(this.#t(e+1)),this.#o(),this.#a("]"))return{kind:"ListExpressionSyntax",items:i,location:n};this.#l(",")}}#n(e,n){this.#e++;let i=[],r=new Set;if(this.#o(),this.#a("}"))return{kind:"ObjectExpressionSyntax",members:i,location:n};for(;;){this.#o();let o=this.#c();if(this.text[this.#e]!=='"')throw new ae("Expected a property name in double quotes.");let a=this.#r();this.#o(),this.#l(":");let s=this.#t(e+1);if(r.has(a)?this.context?.error(c.DuplicateStructuredValueMember,`Duplicate property '${a}' in structured value`,o):(r.add(a),i.push({kind:"ObjectMemberSyntax",name:a,value:s,location:o})),this.#o(),this.#a("}"))return{kind:"ObjectExpressionSyntax",members:i,location:n};this.#l(",")}}#r(){let e=this.#s(this.#e),n=this.text.substring(this.#e,e);this.#e=e;try{return JSON.parse(n)}catch{throw new ae(`${n} is not a valid JSON string.`)}}#s(e){for(let n=e+1;n<this.text.length;n++)if(this.text[n]==="\\")n++;else if(this.text[n]==='"')return n+1;throw new ae("A string is not closed.")}#d(e){let n=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(this.text.substring(this.#e));if(n===null)throw new ae(`'${this.text[this.#e]??""}' is an invalid start of a value.`);if(this.#e+=n[0].length,this.context?.sourceOptions.numericMode==="exact"){let r=ke(n[0]);return r===void 0?(this.context.error(c.InexactNumericLiteral,"Numeric literal is not exactly representable in the bounded Decimal domain.",e),{kind:"RawExpressionSyntax",text:n[0],location:e}):{kind:"LiteralExpressionSyntax",value:r,location:e}}let i=Number(n[0]);if(!Number.isFinite(i))throw new ae("JSON number is outside the finite Double range.");return{kind:"LiteralExpressionSyntax",value:i,location:e}}#c(){return{...this.start,column:this.start.column+this.#e}}#o(){for(;this.#e<this.text.length&&`
|
|
@@ -13,4 +13,4 @@ import{a as l}from"./chunk-AYDF3IFZ.js";var fo="screenplay",Sd={id:fo,extensions
|
|
|
13
13
|
`)}l(Ik,"describeEventContext");function Rk(t,e){let n=e.kind==="collection"||e.kind==="function"?[]:gt[e.type]??[],i=[`**$eventContext.${t}**: \`${e.type}\``,"",e.description];return n.length>0&&i.push("",`**Members:** ${n.map(r=>`\`${r.name}\``).join(", ")}`),i.join(`
|
|
14
14
|
`)}l(Rk,"describeEventContextMember");function ui(t){let e=t.properties.filter(o=>o.isIdentifier&&!we(o).isOptional&&!we(o).isCollection),n=e.length===1?e[0].name:void 0,i=t.produces??[],r=i.some(o=>o.target!==void 0&&o.target!==n)||i.some(o=>o.inline&&o.target===void 0)&&i.some(o=>!o.inline&&o.target===void 0);return{identifier:n,mixed:r}}l(ui,"productionDestinations");function Bk(t,e){let n=Ke(t,e?.authoringDocuments??e?.authoringSources,e?.authoringPlacement,e?.authoringPath),i=Ae(t);return ht(i).commands.map(r=>({...r,produces:r.produces?.filter(o=>!n.operationProductionLines?.has(o.line)&&n.operations.references.some(a=>a.location.line-1===o.line&&a.kind==="event")),productionHeaders:r.productionHeaders?.filter(o=>!n.operationProductionLines?.has(o))})).flatMap(r=>{let{identifier:o,mixed:a}=ui(r);if(a||r.productionHeaders?.length!==r.produces?.length)return[];let s=r.produces?.some(p=>p.target!==void 0||p.inline);return(r.produces??[]).flatMap(p=>p.target!==void 0||p.inline&&(o===void 0||/\bgeneration\b/.test(i[p.line]))?[]:!p.inline&&s?[]:[{line:p.line,column:i[p.line].length+1,label:p.inline?`for ${o}`:"for <new event source>"}])})}l(Bk,"destinationHints");var W={invalidEventSourceDeclaration:"PLAY0503",invalidCommandStream:"PLAY0504",ambiguousCommandStream:"PLAY0505",unsupportedStreamIdType:"PLAY0506",redundantSourceStreamId:"PLAY0507",eventFromLaterSlice:"PLAY0516",timelineCycleGroup:"PLAY0517",invalidImplementationBlock:"PLAY0492",invalidImplementationHint:"PLAY0493",conflictingImplementationSources:"PLAY0494",eventSourceIdInPayload:"PLAY0469",explicitProducesTargetsRequired:"PLAY0470",redundantEventId:"PLAY0471",invalidEventId:"PLAY0472",inlineEventCollision:"PLAY0473",inlineEventOutsideCommand:"PLAY0474",inlineEventGeneration:"PLAY0475",reservedProductionMetadata:"PLAY0476",invalidEventDocumentation:"PLAY0477",tabIndentation:"PLAY0006",unknownPrimitiveType:"PLAY0008",unknownSliceType:"PLAY0028",duplicateCommandIdentifier:"PLAY0036",unknownContextPath:"PLAY0153",unknownContextCausedByProperty:"PLAY0154",unknownContextIdentityProperty:"PLAY0155",unclosedCodeBlock:"PLAY0164",unknownType:"PLAY0165",unknownEvent:"PLAY0166",unknownPolicy:"PLAY0167",duplicateDeclaration:"PLAY0168",unknownEventContextMember:"PLAY0295",unknownEventContextPath:"PLAY0296",eventContextPathBelowCollection:"PLAY0297",missingEventContextPath:"PLAY0298",unresolvedDynamicKeySource:"PLAY0299",invalidFileImport:"PLAY0454",omittedProductionDestination:"PLAY0478",legacyOptionalSuffix:"PLAY0479",invalidOptionalModifierOrder:"PLAY0480",optionalReadsNotSupported:"PLAY0481",unavailableResponseExecution:"PLAY0268",generatedPropertyOutsideCommand:"PLAY0482",invalidGeneratedType:"PLAY0483",invalidGeneratedModifierOrder:"PLAY0484",generatedPropertyInput:"PLAY0485",invalidCommandResponse:"PLAY0486",invalidResponseSource:"PLAY0487",duplicateResponseField:"PLAY0488",invalidResponseShape:"PLAY0489",invalidGeneratedFixture:"PLAY0490",invalidReturnExpectation:"PLAY0491"};var rd=/^import(\s+)"([^"\\]+)"\s*(?:\/\/.*)?$/,od=/^import\s+"/;function ao(t){return od.test(t.trim())}l(ao,"isFileImportLine");function yi(t,e){let n=V(t),i=t.slice(n).match(rd);if(!i)return;let r=n+6+i[1].length+2;return{pattern:i[2],line:e,startColumn:r,endColumn:r+i[2].length}}l(yi,"fileImportOn");function zk(t){let e=oe(t),n=[];for(let i=0;i<t.length;i++){if(e[i])continue;let r=yi(t[i],i);r&&n.push(r)}return n}l(zk,"fileImports");var oo=l(t=>t.split("/").slice(0,-1),"folderOf");function ad(t,e){let n=e.split("/"),i=0;for(;i<t.length&&i<n.length-1&&t[i]===n[i];)i++;return[...t.slice(i).map(()=>".."),...n.slice(i)].join("/")}l(ad,"relativeTo");function Vk(t,e){let n=oo(t),i=new Set;for(let r of e.filter(o=>o!==t&&o.toLowerCase().endsWith(".play"))){let o=ad(n,r),a=oo(o);i.add(o),i.add([...a,"*.play"].join("/"));for(let s=0;s<=a.length;s++)i.add([...a.slice(0,s),"**","*.play"].join("/"))}return[...i].sort()}l(Vk,"importablePaths");var sd=new Set(["namespace","sequence","correlation","causation","causedBy","occurred"]),ld=/^id\s+"((?:[^"\\]|\\.)*)"$/;function so(t,e,n,i=new Set){t=Ae(t);let r=[],o=oe(t),a=cd(t,o),s=new Set(e.commands.flatMap(y=>y.productionHeaders??[])),p=new Map,f=new Set;for(let y of[e,n]){for(let h of y.events)p.set(h.name,(p.get(h.name)??0)+1);for(let h of y.imports)f.add(h.shortName)}let m=l((y,h,C,g="error")=>{r.push({line:y,startColumn:V(t[y])+1,endColumn:t[y].length+1,code:h,message:C,severity:g})},"report");for(let y of e.events){let h=Je(t,o,y.line,V(t[y.line]));if(y.inline){let P=new Set;for(let v of y.properties)P.has(v.name)&&m(v.line,W.duplicateDeclaration,`Event '${y.name}' already declares property '${v.name}'.`),P.add(v.name);s.has(y.line)||m(y.line,W.inlineEventOutsideCommand,"Inline events can only be declared inside commands."),y.generation!==void 0&&m(y.line,W.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),((p.get(y.name)??0)>1||f.has(y.name))&&m(y.line,W.inlineEventCollision,`Inline event '${y.name}' collides with another declaration or import.`)}let C=!1,g=!1;for(let P of h){let v=t[P].trim(),b=v.split(/\s+/)[0];if(y.inline&&b==="generation"&&m(P,W.inlineEventGeneration,"Inline events are generation 1; extract the event before declaring generations."),y.inline&&b==="origin"&&m(P,W.reservedProductionMetadata,"An inline event is local to its command and cannot declare origin."),!/^(?:id|description|documentation)\s+[\w.]+(?:\[\])?(?:\?|\s+optional)?(?:\s*=.*)?$/.test(v)){if(b==="id"){let $=v.match(ld);C||$===null||$[1].trim().length===0?m(P,W.invalidEventId,'Expected one nonempty id "<old-name>".'):$[1]===y.name&&m(P,W.redundantEventId,"This id repeats the event name; remove it.","information"),C=!0}if(b==="documentation"){let $=P+1;for(;$<t.length&&t[$].trim().length===0;)$++;(g||v!=="documentation"||t[$]?.trim()!=="```markdown"||V(t[$])<=V(t[P])||!a.has($))&&m(P,W.invalidEventDocumentation,"Expected one nonempty fenced markdown documentation block."),g=!0}}}}let u=[];for(let y=0;y<t.length;y++){if(o[y]||t[y].trim().length===0)continue;let h=V(t[y]);for(;u.length>0&&u[u.length-1].indent>=h;)u.pop();let C=t[y].trim().split(/\s+/)[0];sd.has(C)&&u.at(-1)?.event&&m(y,W.reservedProductionMetadata,`'${C}' is system-assigned production metadata.`),C==="produces"&&u.push({indent:h,event:!i.has(y)&&!/^\s*produces\s+operation\b/.test(t[y])})}for(let y of e.commands){let{identifier:h,mixed:C}=ui(y);for(let g of y.produces??[]){C&&g.target===void 0&&m(g.line,W.explicitProducesTargetsRequired,`Production '${g.name}' must state for explicitly when destinations differ.`);let P=g.target??(g.inline?h:void 0);if(!(h===void 0||P!==h))for(let v of g.mappings.filter(b=>b.source===h))m(v.line,W.eventSourceIdInPayload,`The payload copies '${h}', which already identifies the event source.`,g.inline?"warning":"information")}}return r}l(so,"validateInlineEvents");function cd(t,e){let n=new Set,i,r=!1;for(let o=0;o<t.length;o++){if(!e[o])continue;let a=t[o].trim();i===void 0?(i=o,r=!1):a==="```"?(r&&t[i].trim()==="```markdown"&&n.add(i),i=void 0):a.length>0&&(r=!0)}return n}l(cd,"nonemptyMarkdownBlocks");function pe(t,e,n,i,r,o){return{severity:t,message:r,line:e,startColumn:n,endColumn:n+i,code:o}}l(pe,"issue");function Se(t,e,n,i,r,o){let a=n.indexOf(i)+1;return pe(t,e,a,i.length,r,o)}l(Se,"tokenIssue");function dd(t,e,n){let i=[],r=new Set([...ci(e,$t),...ci(n,[])]),o=l((s,p)=>{for(let f of s.filter(m=>!r.has(we(m).name))){let m=we(f).name;i.push(pe("warning",f.line,f.sourceType.startColumn,f.sourceType.text.length,m==="optional"?`Unknown type 'optional' on '${f.name}' of ${p} \u2014 did you forget the type before 'optional'?`:`Unknown type '${m}' on '${f.name}' of ${p} \u2014 declare it with 'concept ${m} : <Primitive>' or 'type ${m}'.`,W.unknownType))}},"checkProperties");for(let s of e.types)o(s.properties,`type '${s.name}'`);for(let s of e.events)o(s.properties,`event '${s.name}'`);for(let s of e.queries)o(s.parameters,`query '${s.name}'`);for(let s of e.commands){o(s.properties,`command '${s.name}'`);let p=s.properties.filter(f=>f.isIdentifier);for(let f of p.slice(1))i.push(Se("error",f.line,t[f.line],"identifier",`Command '${s.name}' already marks '${p[0].name}' as identifier \u2014 only one property can be the identifier.`,W.duplicateCommandIdentifier))}let a=new Map;for(let s of[...e.concepts,...e.types]){if(a.get(s.name)===void 0){a.set(s.name,s.line);continue}i.push(Se("error",s.line,t[s.line],s.name,`Duplicate declaration of '${s.name}' \u2014 concept and type names must be unique.`,W.duplicateDeclaration))}return i}l(dd,"validateDeclarations");function hb(t,e={}){let n=oe(t),i=ht(t),r=e.application??ln(),o=io(t,{...r,authoringPath:e.path??r.authoringPath,authoringPlacement:e.placement??r.authoringPlacement}),a=Ke(t,o.authoringDocuments??o.authoringSources?.filter($=>$!==t.join(`
|
|
15
15
|
`)),o.authoringPlacement,o.authoringPath,o.authoringPlacementResolved),s=new Set(a.eventSources.routes.map($=>$.location.line-1)),p={...i,commands:i.commands.map($=>({...$,properties:$.properties.filter(x=>!s.has(x.line)),produces:$.produces?.filter(x=>!a.operationProductionLines?.has(x.line)),productionHeaders:$.productionHeaders?.filter(x=>!a.operationProductionLines?.has(x))}))},f=new Set([...cn(p),...cn(r)]),m=new Set([...p.policies,...r.policies].map($=>$.name)),u=dd(t,p,r);u.push(...pd(t,p));let y=new Set([c.LegacyOptionalSuffix,c.InvalidOptionalModifierOrder,c.OptionalReadsNotSupported]),h=new Set([c.UnknownEvent,c.UnknownReadModelProperty,c.PiiNotSupportedOnIdentifier]),C=new Set([c.EventFromLaterSlice,c.TimelineCycleGroup]),g=new Set;for(let $ of e.compilerDiagnostics??a.diagnostics){if(!y.has($.code)&&!h.has($.code)&&!C.has($.code)&&$.code!==c.UnknownRuleImplementationDirective&&$.code!==c.InvalidValidationRule&&$.code!==c.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY048[2-9]$|^PLAY004[56]$/.test($.code))continue;let x=$.location.line-1;$.code===c.UnknownEvent&&g.add(x);let S=Xn(t[x],$)||t[x].length-$.location.column+1;u.push(pe($.severity,x,$.location.column,S,$.message,$.code))}let P=l(($,x,S)=>{!f.has(S)&&!g.has($)&&u.push(Se("warning",$,x,S,`Unknown event type '${S}' \u2014 declare it in a slice or import it.`,W.unknownEvent))},"checkEvent"),v=-1;for(let $=0;$<t.length;$++){let x=t[$],S=x.trim();if(n[$]||S.length===0)continue;let k=x.match(/^[ ]*(\t+)/);if(k&&u.push(pe("warning",$,k[0].length-k[1].length+1,k[1].length,"Screenplay is indentation-based \u2014 use spaces, not tabs.",W.tabIndentation)),v>=0){if(V(x)>v&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(S)){for(let D of S.split(/\s+/).filter(B=>B!=="or"))m.has(D)||u.push(Se("warning",$,x,D,`Unknown policy '${D}' \u2014 declare it with 'policy ${D}'.`,W.unknownPolicy));continue}v=-1}let O=fd(t,n,$);O&&u.push(O);let w=S.match(/^slice\s+(\w+)/);w&&!yn.includes(w[1])&&u.push(Se("error",$,x,w[1],`Unknown slice type '${w[1]}' \u2014 expected ${yn.join(", ")}.`,W.unknownSliceType));let I=S.match(/^concept\s+\w+\s*:\s*(\w+)/);I&&I[1]!=="Enum"&&!$t.includes(I[1])&&u.push(Se("error",$,x,I[1],`Unknown primitive type '${I[1]}' \u2014 expected ${$t.join(", ")} or Enum.`,W.unknownPrimitiveType));let j=S.match(/^authorize\s+(.*)$/);if(j){v=V(x);for(let D of j[1].split(/\s+/).filter(B=>B!=="or"&&B.length>0))m.has(D)||u.push(Se("warning",$,x,D,`Unknown policy '${D}' \u2014 declare it with 'policy ${D}'.`,W.unknownPolicy))}let q=S.match(/^on\s+([A-Z]\w*)\s*$/);q&&P($,x,q[1]);let F=S.match(/^produces\s+([A-Z]\w*)\s*$/);if(F&&!a.operationProductionLines?.has($)&&P($,x,F[1]),/^produces\s+when\b/.test(S)&&!a.operationProductionLines?.has($))for(let D=$+1;D<t.length;D++){let B=t[D];if(!(n[D]||B.trim().length===0)){if(V(B)>V(x)){let J=B.trim().match(/^([A-Z]\w*)\s*$/);J&&P(D,B,J[1])}break}}let Y=S.match(/^unique\s+event\s+([A-Z]\w*)/);Y&&P($,x,Y[1]);let N=S.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);N&&P($,x,N[1]);for(let D of x.match(/\$context\.[\w.]+/g)??[]){let B=D.substring(9).split(".");pn.includes(B[0])?B[0]==="causedBy"&&B.length>1&&!fn.includes(B[1])?u.push(Se("warning",$,x,D,`Unknown $context.causedBy property '${B[1]}' \u2014 expected ${fn.join(", ")}.`,W.unknownContextCausedByProperty)):B[0]==="identity"&&B.length>1&&!un.includes(B[1])&&u.push(Se("warning",$,x,D,`Unknown $context.identity property '${B[1]}' \u2014 expected ${un.join(", ")}.`,W.unknownContextIdentityProperty)):u.push(Se("warning",$,x,D,`Unknown $context path '${B.join(".")}' \u2014 expected one of ${pn.join(", ")}.`,W.unknownContextPath))}}u.push(...yd(t,n)),u.push(...so(t,p,r,a.operationProductionLines));let b=t.map(($,x)=>({line:$,index:x})).filter(({line:$})=>/^\s*```(?:[a-z]+)?\s*$/.test($));if(b.length%2===1){let $=b[b.length-1];u.push(pe("error",$.index,1,$.line.length+1,"Unclosed inline code block \u2014 expected a closing ``` line.",W.unclosedCodeBlock))}return u}l(hb,"validateLines");function pd(t,e){let n=[];t=Ae(t);for(let i of e.commands){let r=i.properties.filter(o=>o.isIdentifier&&!we(o).isOptional&&!we(o).isCollection);if(r.length===1)for(let o of i.produces??[]){if(o.inline||o.conditional||o.target!==void 0)continue;let a=o.line;n.push(pe("information",a,V(t[a])+1,t[a].trim().length,`Plain 'produces ${o.name}' omits its destination \u2014 use 'for ${r[0].name}' to explicitly select the command's identifier.`,W.omittedProductionDestination))}}return n}l(pd,"validateProductionDestinations");function fd(t,e,n){let i=t[n],r=i.trim().replace(/\s*\/\/.*$/,"");if(!/^import\b/.test(r)||yi(i,n))return;let o=V(i);if(!(!(o>0&&["module","feature"].includes(xi(t,e,n,o)[0]))&&!ao(i)))return pe("error",n,o+1,r.length,`Invalid import '${r}' \u2014 inside a module or feature, import names files: 'import "<path or glob>"'.`,W.invalidFileImport)}l(fd,"validateImport");var ud=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function yd(t,e){let n=[],i=l(r=>r.map(o=>o.name).join(", "),"names");for(let r=0;r<t.length;r++){let o=t[r];if(e[r])continue;for(let p of o.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let f=p[0].substring(p[1]?.length??0),m=p[2];if(m.length===0){p[1]&&n.push(pe("error",r,(p.index??0)+2,f.length,`'$eventContext' names no member - expected one of ${i(fi("").expected)}.`,W.missingEventContextPath));continue}let u=m.substring(1),y=fi(u),h=(p.index??0)+(p[1]?.length??0)+1;switch(y.status){case"missing":n.push(pe("error",r,h,f.length,`'$eventContext.${u}' names no member - expected one of ${i(y.expected)}.`,W.missingEventContextPath));break;case"unknownMember":n.push(pe("warning",r,h,f.length,`Unknown event context member '${y.segment}' in '$eventContext.${u}' - expected one of ${i(y.expected)}.`,W.unknownEventContextMember));break;case"unknownSubPath":{let C=y.expected.length===0?"no members to address":`members ${i(y.expected)}`;n.push(pe("warning",r,h,f.length,`Unknown event context path '$eventContext.${u}' - '${y.member?.name}' (${y.member?.type}) has ${C}.`,W.unknownEventContextPath));break}case"belowCollection":n.push(pe("error",r,h,f.length,`'$eventContext.${u}' cannot resolve - '${y.member?.name}' is a collection (${y.member?.type}) and cannot be addressed below.`,W.eventContextPathBelowCollection));break}}let a=o.trim().match(ud)?.[1],s=a?.match(/\.\$(\w+)/)?.[1];a&&s&&s!=="eventContext"&&n.push(Se("warning",r,o,a,`Dynamic dictionary key '$${s}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${s}' becomes the key.`,W.unresolvedDynamicKeySource))}return n}l(yd,"validateEventContextPaths");export{fo as a,Sd as b,hd as c,gi as d,gd as e,pn as f,fn as g,yn as h,$t as i,xd as j,$d as k,Xe as l,kd as m,c as n,le as o,bn as p,Cn as q,vx as r,kx as s,Ie as t,V as u,mn as v,oe as w,xi as x,Ed as y,Ae as z,rk as A,Ke as B,oi as C,lk as D,ai as E,ck as F,we as G,Je as H,ht as I,ln as J,io as K,cn as L,td as M,Ck as N,ci as O,nd as P,di as Q,pi as R,id as S,wk as T,Ik as U,Rk as V,ui as W,Bk as X,W as Y,ao as Z,yi as _,zk as $,Vk as aa,hb as ba,yd as ca};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-FAEWXRF3.js.map
|