state-machine-cat 9.0.1 → 9.2.1

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/README.md CHANGED
@@ -98,13 +98,14 @@ bin/smcat docs/sample.smcat
98
98
  ```
99
99
 
100
100
  > <details>
101
- > <summary>note for use on Node.js 12 and up</summary>
102
- > On Node.js 12 (and up) you might see a warning message on stderr:
101
+ > <summary>note for when GraphViz `dot` isn't installed</summary>
102
+ > You might see a warning message on stderr:
103
103
  > <code>Invalid asm.js: Function definition doesn't match use</code>.
104
- > It's harmless. See <a href="docs/faq.md#q-im-on-node-12-and-get-a-warning-when-i-convert-to-svg-with-the-cli-whats-up">the FAQ</a> for details.
104
+ > It's generated by viz.js that serves as a fully functional fallback
105
+ > for GraphViz `dot` . See <a href="docs/faq.md#viz">the FAQ</a> for details.
105
106
  > </details>
106
107
 
107
- Or, if you'd rather have the native GraphViz dot do that for you:
108
+ Or, if you'd rather pull dot output through GraphViz dot yourself:
108
109
 
109
110
  ```sh
110
111
  bin/smcat -T dot docs/sample.smcat -o - | dot -T svg -odoc/sample.svg
@@ -125,6 +126,12 @@ When you pass the `--desugar` (&tritime; experimental) switch, state-machine-cat
125
126
  before rendering, transform some pseudo states into transitions - see
126
127
  [de-sugaring state machines](docs/desugar.md) for details.
127
128
 
129
+ ### Syntax highlighting
130
+
131
+ - For editors supporting tree sitter (like atom): there's [tree-sitter-smcat](https://github.com/sverweij/tree-sitter-smcat)
132
+ - The [atom-state-machine-cat-preview](https://github.com/sverweij/atom-state-machine-cat-preview) plugin includes syntax highlighting for atom as well.
133
+ - For vim there's [ambagasdowa/vim-syntax-smcat](https://github.com/ambagasdowa/vim-syntax-smcat/)
134
+
128
135
  ### State chart XML (SCXML)
129
136
 
130
137
  _state machine cat_ can write **and read** valid core constructs
package/bin/smcat.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import program from "commander";
3
- import semver from "semver";
3
+ import satisfies from "semver/functions/satisfies.js";
4
4
  import { readFileSync } from "node:fs";
5
5
  import actions from "../src/cli/actions.mjs";
6
6
  import makeDescription from "../src/cli/make-description.mjs";
@@ -12,7 +12,7 @@ const $package = JSON.parse(
12
12
  );
13
13
 
14
14
  /* c8 ignore start */
15
- if (!semver.satisfies(process.versions.node, $package.engines.node)) {
15
+ if (!satisfies(process.versions.node, $package.engines.node)) {
16
16
  process.stderr.write(
17
17
  `\nERROR: your node version (${process.versions.node}) is not recent enough.\n`
18
18
  );
@@ -35,7 +35,7 @@ function presentError(pError) {
35
35
  try {
36
36
  program
37
37
  .version($package.version)
38
- .description(makeDescription(process.versions.node))
38
+ .description(makeDescription())
39
39
  .option(
40
40
  "-T --output-type <type>",
41
41
  validations.validOutputTypeRE,
@@ -1,10 +1,10 @@
1
- var Pr=Object.create;var ce=Object.defineProperty,Or=Object.defineProperties,Cr=Object.getOwnPropertyDescriptor,Er=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertyNames,rn=Object.getOwnPropertySymbols,_r=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable;var sn=(t,e,n)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F=(t,e)=>{for(var n in e||(e={}))on.call(e,n)&&sn(t,n,e[n]);if(rn)for(var n of rn(e))Fr.call(e,n)&&sn(t,n,e[n]);return t},V=(t,e)=>Or(t,Er(e)),cn=t=>ce(t,"__esModule",{value:!0});var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rr=(t,e)=>{cn(t);for(var n in e)ce(t,n,{get:e[n],enumerable:!0})},Tr=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Ar(e))!on.call(t,d)&&d!=="default"&&ce(t,d,{get:()=>e[d],enumerable:!(n=Cr(e,d))||n.enumerable});return t},B=t=>Tr(cn(ce(t!=null?Pr(_r(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Rn=X(()=>{var Le=require("handlebars/dist/handlebars.runtime"),io=Le.template,co=Le.templates=Le.templates||{};co["smcat.template.hbs"]=io({1:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p="",r=(r=m(n,"note")||(e!=null?m(e,"note"):e))!=null?r:c,b={name:"note",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:0},end:{line:4,column:9}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"note")?u:y.call(e,u,b))!=null&&(p+=u),p+=(u=(m(n,"quotifyState")||e&&m(e,"quotifyState")||c).call(o,e!=null?m(e,"name"):e,{name:"quotifyState",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:5,column:0},end:{line:5,column:40}}}))!=null?u:"",r=(r=m(n,"hasExtendedAttributes")||(e!=null?m(e,"hasExtendedAttributes"):e))!=null?r:c,b={name:"hasExtendedAttributes",hash:{},fn:t.program(6,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:4},end:{line:6,column:270}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"hasExtendedAttributes")?u:y.call(e,u,b))!=null&&(p+=u),p+=(u=m(n,"if").call(o,e!=null?m(e,"actions"):e,{name:"if",hash:{},fn:t.program(18,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:4},end:{line:7,column:28}}}))!=null?u:"",r=(r=m(n,"actions")||(e!=null?m(e,"actions"):e))!=null?r:c,b={name:"actions",hash:{},fn:t.program(20,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:28},end:{line:7,column:93}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"actions")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"statemachine")||(e!=null?m(e,"statemachine"):e))!=null?r:c,b={name:"statemachine",hash:{},fn:t.program(22,a,0),inverse:t.noop,data:a,loc:{start:{line:8,column:4},end:{line:10,column:19}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"statemachine")?u:y.call(e,u,b))!=null&&(p+=u),p+((u=m(n,"if").call(o,a&&m(a,"last"),{name:"if",hash:{},fn:t.program(24,a,0),inverse:t.program(26,a,0),data:a,loc:{start:{line:11,column:0},end:{line:11,column:30}}}))!=null?u:"")+`
1
+ var Pr=Object.create;var ue=Object.defineProperty,Or=Object.defineProperties,Cr=Object.getOwnPropertyDescriptor,Er=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertyNames,rn=Object.getOwnPropertySymbols,_r=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable;var sn=(t,e,n)=>e in t?ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F=(t,e)=>{for(var n in e||(e={}))on.call(e,n)&&sn(t,n,e[n]);if(rn)for(var n of rn(e))Fr.call(e,n)&&sn(t,n,e[n]);return t},V=(t,e)=>Or(t,Er(e)),cn=t=>ue(t,"__esModule",{value:!0});var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rr=(t,e)=>{cn(t);for(var n in e)ue(t,n,{get:e[n],enumerable:!0})},Tr=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Ar(e))!on.call(t,d)&&d!=="default"&&ue(t,d,{get:()=>e[d],enumerable:!(n=Cr(e,d))||n.enumerable});return t},B=t=>Tr(cn(ue(t!=null?Pr(_r(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Rn=X(()=>{var Le=require("handlebars/dist/handlebars.runtime"),co=Le.template,uo=Le.templates=Le.templates||{};uo["smcat.template.hbs"]=co({1:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p="",r=(r=m(n,"note")||(e!=null?m(e,"note"):e))!=null?r:c,b={name:"note",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:0},end:{line:4,column:9}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"note")?u:y.call(e,u,b))!=null&&(p+=u),p+=(u=(m(n,"quotifyState")||e&&m(e,"quotifyState")||c).call(o,e!=null?m(e,"name"):e,{name:"quotifyState",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:5,column:0},end:{line:5,column:40}}}))!=null?u:"",r=(r=m(n,"hasExtendedAttributes")||(e!=null?m(e,"hasExtendedAttributes"):e))!=null?r:c,b={name:"hasExtendedAttributes",hash:{},fn:t.program(6,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:4},end:{line:6,column:270}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"hasExtendedAttributes")?u:y.call(e,u,b))!=null&&(p+=u),p+=(u=m(n,"if").call(o,e!=null?m(e,"actions"):e,{name:"if",hash:{},fn:t.program(18,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:4},end:{line:7,column:28}}}))!=null?u:"",r=(r=m(n,"actions")||(e!=null?m(e,"actions"):e))!=null?r:c,b={name:"actions",hash:{},fn:t.program(20,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:28},end:{line:7,column:93}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"actions")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"statemachine")||(e!=null?m(e,"statemachine"):e))!=null?r:c,b={name:"statemachine",hash:{},fn:t.program(22,a,0),inverse:t.noop,data:a,loc:{start:{line:8,column:4},end:{line:10,column:19}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"statemachine")?u:y.call(e,u,b))!=null&&(p+=u),p+((u=m(n,"if").call(o,a&&m(a,"last"),{name:"if",hash:{},fn:t.program(24,a,0),inverse:t.program(26,a,0),data:a,loc:{start:{line:11,column:0},end:{line:11,column:30}}}))!=null?u:"")+`
2
2
  `},2:function(t,e,n,d,a){return"# "+((e=t.lambda(e,e))!=null?e:"")+`
3
3
  `},4:function(t,e,n,d,a){return""},6:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p=" [",r=(r=m(n,"typeExplicitlySet")||(e!=null?m(e,"typeExplicitlySet"):e))!=null?r:c,b={name:"typeExplicitlySet",hash:{},fn:t.program(7,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:32},end:{line:6,column:107}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"typeExplicitlySet")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c,b={name:"label",hash:{},fn:t.program(10,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:107},end:{line:6,column:142}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"label")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:142},end:{line:6,column:178}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"class")||(e!=null?m(e,"class"):e))!=null?r:c,b={name:"class",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:178},end:{line:6,column:214}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"class")?u:y.call(e,u,b))!=null&&(p+=u),p+((u=m(n,"if").call(o,e!=null?m(e,"active"):e,{name:"if",hash:{},fn:t.program(16,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:214},end:{line:6,column:242}}}))!=null?u:"")+"]"},7:function(t,e,n,d,a){var o=t.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]},c=(c=o(n,"type")||(e!=null?o(e,"type"):e))!=null?c:t.hooks.helperMissing,a={name:"type",hash:{},fn:t.program(8,a,0),inverse:t.noop,data:a,loc:{start:{line:6,column:54},end:{line:6,column:85}}},c=typeof c=="function"?c.call(e!=null?e:t.nullContext||{},a):c;return(c=o(n,"type")?c:t.hooks.blockHelperMissing.call(e,c,a))!=null?c:""},8:function(t,e,n,d,a){return"type="+((e=t.lambda(e,e))!=null?e:"")+" "},10:function(t,e,n,d,a){return'label="'+((e=t.lambda(e,e))!=null?e:"")+'"'},12:function(t,e,n,d,a){return' color="'+((e=t.lambda(e,e))!=null?e:"")+'"'},14:function(t,e,n,d,a){return' class="'+((e=t.lambda(e,e))!=null?e:"")+'"'},16:function(t,e,n,d,a){return" active"},18:function(t,e,n,d,a){return": "},20:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return(a=(o(n,"quotifyActions")||e&&o(e,"quotifyActions")||t.hooks.helperMissing).call(e!=null?e:t.nullContext||{},e,{name:"quotifyActions",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:40},end:{line:7,column:80}}}))!=null?a:""},22:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return` {
4
4
  `+((t=t.invokePartial(o(d,"smcat.template.hbs"),e,{name:"smcat.template.hbs",data:a,indent:" ",helpers:n,partials:d,decorators:t.decorators}))!=null?t:"")+"}"},24:function(t,e,n,d,a){return";"},26:function(t,e,n,d,a){return","},28:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p="",r=(r=m(n,"note")||(e!=null?m(e,"note"):e))!=null?r:c,b={name:"note",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:15,column:0},end:{line:17,column:9}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"note")?u:y.call(e,u,b))!=null&&(p+=u),p+=((u=(m(n,"quotifyState")||e&&m(e,"quotifyState")||c).call(o,e!=null?m(e,"from"):e,{name:"quotifyState",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:18,column:0},end:{line:18,column:39}}}))!=null?u:"")+" => "+((u=(m(n,"quotifyState")||e&&m(e,"quotifyState")||c).call(o,e!=null?m(e,"to"):e,{name:"quotifyState",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:18,column:43},end:{line:18,column:81}}}))!=null?u:""),r=(r=m(n,"hasExtendedAttributes")||(e!=null?m(e,"hasExtendedAttributes"):e))!=null?r:c,b={name:"hasExtendedAttributes",hash:{},fn:t.program(29,a,0),inverse:t.noop,data:a,loc:{start:{line:19,column:4},end:{line:19,column:130}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"hasExtendedAttributes")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c,b={name:"label",hash:{},fn:t.program(34,a,0),inverse:t.noop,data:a,loc:{start:{line:20,column:4},end:{line:20,column:62}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"label")?u:y.call(e,u,b))!=null&&(p+=u),p+`;
5
5
  `},29:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p=" [",r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(30,a,0),inverse:t.noop,data:a,loc:{start:{line:19,column:32},end:{line:19,column:68}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"type")||(e!=null?m(e,"type"):e))!=null?r:c,b={name:"type",hash:{},fn:t.program(32,a,0),inverse:t.noop,data:a,loc:{start:{line:19,column:69},end:{line:19,column:102}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"type")?u:y.call(e,u,b))!=null&&(p+=u),p+"]"},30:function(t,e,n,d,a){return'color="'+((e=t.lambda(e,e))!=null?e:"")+'"'},32:function(t,e,n,d,a){return" type="+((e=t.lambda(e,e))!=null?e:"")},34:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return": "+((a=(o(n,"quotifyLabel")||e&&o(e,"quotifyLabel")||t.hooks.helperMissing).call(e!=null?e:t.nullContext||{},e,{name:"quotifyLabel",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:20,column:16},end:{line:20,column:52}}}))!=null?a:"")},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.lookupProperty||function(p,r){if(Object.prototype.hasOwnProperty.call(p,r))return p[r]},f=((m=c(n,"each").call(o,e!=null?c(e,"states"):e,{name:"each",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:12,column:9}}}))!=null?m:"")+`
6
- `,y=(y=c(n,"transitions")||(e!=null?c(e,"transitions"):e))!=null?y:t.hooks.helperMissing,a={name:"transitions",hash:{},fn:t.program(28,a,0),inverse:t.noop,data:a,loc:{start:{line:14,column:0},end:{line:21,column:16}}},m=typeof y=="function"?y.call(o,a):y;return(m=c(n,"transitions")?m:t.hooks.blockHelperMissing.call(e,m,a))!=null&&(f+=m),f},usePartial:!0,useData:!0})});var Hn=X((Zs,Mn)=>{var ne=require("handlebars/dist/handlebars.runtime.js"),Tn=require("lodash.clonedeep");Rn();var uo=/;|,|{| |\[/,fo=/;|,|{/,mo=/;|{/;function ze(t,e){return t.test(e)?`"${e}"`:e}ne.registerPartial("smcat.template.hbs",ne.templates["smcat.template.hbs"]);function po(t){return t==="activity"?"":`${t}/ `}function ho(t){let e=F({},t);return e.actions=(t.actions||[]).map(n=>`${po(n.type)}${n.body}`).join(`
7
- `),e}function go(t){return(Object.prototype.hasOwnProperty.call(t,"label")||Object.prototype.hasOwnProperty.call(t,"typeExplicitlySet")||Object.prototype.hasOwnProperty.call(t,"color")||Object.prototype.hasOwnProperty.call(t,"active")||Object.prototype.hasOwnProperty.call(t,"class"))&&(t.hasExtendedAttributes=!0),t}function Bn(t,e){return t.map(go).filter(n=>n.statemachine).forEach(n=>{n.statemachine.states=Bn(n.statemachine.states,e)}),t.map(ho)}function yo(t){return(Object.prototype.hasOwnProperty.call(t,"type")||Object.prototype.hasOwnProperty.call(t,"color")||Object.prototype.hasOwnProperty.call(t,"class"))&&(t.hasExtendedAttributes=!0),t}function vo(t){return t.map(yo)}ne.registerHelper("quotifyState",t=>ze(uo,t));ne.registerHelper("quotifyLabel",t=>ze(mo,t));ne.registerHelper("quotifyActions",t=>ze(fo,t));Mn.exports=function(e){return ne.templates["smcat.template.hbs"](V(F({},e),{states:Bn(Tn(e.states)),transitions:vo(Tn(e.transitions||[]))}))}});var In=X(()=>{var Xe=require("handlebars/dist/handlebars.runtime"),Vo=Xe.template,Do=Xe.templates=Xe.templates||{};Do["dot.template.hbs"]=Vo({1:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(S,I){if(Object.prototype.hasOwnProperty.call(S,I))return S[I]},b="",u=(u=r(n,"noteName")||(e!=null?r(e,"noteName"):e))!=null?u:y,j={name:"noteName",hash:{},fn:t.noop,inverse:t.program(2,a,0,o,c),data:a,loc:{start:{line:9,column:2},end:{line:26,column:15}}},$=typeof u==m?u.call(f,j):u;return($=r(n,"noteName")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"noteName")||(e!=null?r(e,"noteName"):e))!=null?u:y,j={name:"noteName",hash:{},fn:t.program(19,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:2},end:{line:37,column:15}}},$=typeof u==m?u.call(f,j):u,($=r(n,"noteName")?$:p.call(e,$,j))!=null&&(b+=$),b},2:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p="",r=(r=m(n,"isCompositeSelf")||(e!=null?m(e,"isCompositeSelf"):e))!=null?r:c,b={name:"isCompositeSelf",hash:{},fn:t.noop,inverse:t.program(3,a,0),data:a,loc:{start:{line:10,column:4},end:{line:16,column:24}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"isCompositeSelf")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"isCompositeSelf")||(e!=null?m(e,"isCompositeSelf"):e))!=null?r:c,b={name:"isCompositeSelf",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:17,column:4},end:{line:25,column:24}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"isCompositeSelf")?u:y.call(e,u,b))!=null&&(p+=u),p},3:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p=' "'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:11,column:5},end:{line:11,column:15}}}):r)!=null?u:"")+'" -> "'+((u=typeof(r=(r=m(n,"to")||(e!=null?m(e,"to"):e))!=null?r:c)==f?r.call(o,{name:"to",hash:{},data:a,loc:{start:{line:11,column:21},end:{line:11,column:29}}}):r)!=null?u:"")+'" [label="',r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c,b={name:"label",hash:{},fn:t.noop,inverse:t.program(4,a,0),data:a,loc:{start:{line:11,column:39},end:{line:11,column:60}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"label")?u:y.call(e,u,b))!=null&&(p+=u),p+=((u=typeof(r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c)==f?r.call(o,{name:"label",hash:{},data:a,loc:{start:{line:11,column:60},end:{line:11,column:71}}}):r)!=null?u:"")+'"',r=(r=m(n,"fromComposite")||(e!=null?m(e,"fromComposite"):e))!=null?r:c,b={name:"fromComposite",hash:{},fn:t.program(6,a,0),inverse:t.noop,data:a,loc:{start:{line:12,column:28},end:{line:12,column:92}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"fromComposite")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"toComposite")||(e!=null?m(e,"toComposite"):e))!=null?r:c,b={name:"toComposite",hash:{},fn:t.program(8,a,0),inverse:t.noop,data:a,loc:{start:{line:13,column:28},end:{line:13,column:86}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"toComposite")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(10,a,0),inverse:t.noop,data:a,loc:{start:{line:14,column:28},end:{line:14,column:85}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"width")||(e!=null?m(e,"width"):e))!=null?r:c,b={name:"width",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:15,column:28},end:{line:15,column:68}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"width")?u:y.call(e,u,b))!=null&&(p+=u),p+' class="'+((u=typeof(r=(r=m(n,"class")||(e!=null?m(e,"class"):e))!=null?r:c)==f?r.call(o,{name:"class",hash:{},data:a,loc:{start:{line:15,column:76},end:{line:15,column:87}}}):r)!=null?u:"")+`"]
6
+ `,y=(y=c(n,"transitions")||(e!=null?c(e,"transitions"):e))!=null?y:t.hooks.helperMissing,a={name:"transitions",hash:{},fn:t.program(28,a,0),inverse:t.noop,data:a,loc:{start:{line:14,column:0},end:{line:21,column:16}}},m=typeof y=="function"?y.call(o,a):y;return(m=c(n,"transitions")?m:t.hooks.blockHelperMissing.call(e,m,a))!=null&&(f+=m),f},usePartial:!0,useData:!0})});var Hn=X((Ks,Mn)=>{var le=require("handlebars/dist/handlebars.runtime.js"),Tn=require("lodash.clonedeep");Rn();var fo=/;|,|{| |\[/,mo=/;|,|{/,po=/;|{/;function ze(t,e){return t.test(e)?`"${e}"`:e}le.registerPartial("smcat.template.hbs",le.templates["smcat.template.hbs"]);function ho(t){return t==="activity"?"":`${t}/ `}function go(t){let e=F({},t);return e.actions=(t.actions||[]).map(n=>`${ho(n.type)}${n.body}`).join(`
7
+ `),e}function yo(t){return(Object.prototype.hasOwnProperty.call(t,"label")||Object.prototype.hasOwnProperty.call(t,"typeExplicitlySet")||Object.prototype.hasOwnProperty.call(t,"color")||Object.prototype.hasOwnProperty.call(t,"active")||Object.prototype.hasOwnProperty.call(t,"class"))&&(t.hasExtendedAttributes=!0),t}function Bn(t,e){return t.map(yo).filter(n=>n.statemachine).forEach(n=>{n.statemachine.states=Bn(n.statemachine.states,e)}),t.map(go)}function vo(t){return(Object.prototype.hasOwnProperty.call(t,"type")||Object.prototype.hasOwnProperty.call(t,"color")||Object.prototype.hasOwnProperty.call(t,"class"))&&(t.hasExtendedAttributes=!0),t}function bo(t){return t.map(vo)}le.registerHelper("quotifyState",t=>ze(fo,t));le.registerHelper("quotifyLabel",t=>ze(po,t));le.registerHelper("quotifyActions",t=>ze(mo,t));Mn.exports=function(e){return le.templates["smcat.template.hbs"](V(F({},e),{states:Bn(Tn(e.states)),transitions:bo(Tn(e.transitions||[]))}))}});var Nn=X(()=>{var Xe=require("handlebars/dist/handlebars.runtime"),Do=Xe.template,Lo=Xe.templates=Xe.templates||{};Lo["dot.template.hbs"]=Do({1:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(I,N){if(Object.prototype.hasOwnProperty.call(I,N))return I[N]},b="",u=(u=r(n,"noteName")||(e!=null?r(e,"noteName"):e))!=null?u:y,j={name:"noteName",hash:{},fn:t.noop,inverse:t.program(2,a,0,o,c),data:a,loc:{start:{line:9,column:2},end:{line:26,column:15}}},$=typeof u==m?u.call(f,j):u;return($=r(n,"noteName")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"noteName")||(e!=null?r(e,"noteName"):e))!=null?u:y,j={name:"noteName",hash:{},fn:t.program(19,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:2},end:{line:37,column:15}}},$=typeof u==m?u.call(f,j):u,($=r(n,"noteName")?$:p.call(e,$,j))!=null&&(b+=$),b},2:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p="",r=(r=m(n,"isCompositeSelf")||(e!=null?m(e,"isCompositeSelf"):e))!=null?r:c,b={name:"isCompositeSelf",hash:{},fn:t.noop,inverse:t.program(3,a,0),data:a,loc:{start:{line:10,column:4},end:{line:16,column:24}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"isCompositeSelf")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"isCompositeSelf")||(e!=null?m(e,"isCompositeSelf"):e))!=null?r:c,b={name:"isCompositeSelf",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:17,column:4},end:{line:25,column:24}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"isCompositeSelf")?u:y.call(e,u,b))!=null&&(p+=u),p},3:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p=' "'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:11,column:5},end:{line:11,column:15}}}):r)!=null?u:"")+'" -> "'+((u=typeof(r=(r=m(n,"to")||(e!=null?m(e,"to"):e))!=null?r:c)==f?r.call(o,{name:"to",hash:{},data:a,loc:{start:{line:11,column:21},end:{line:11,column:29}}}):r)!=null?u:"")+'" [label="',r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c,b={name:"label",hash:{},fn:t.noop,inverse:t.program(4,a,0),data:a,loc:{start:{line:11,column:39},end:{line:11,column:60}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"label")?u:y.call(e,u,b))!=null&&(p+=u),p+=((u=typeof(r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c)==f?r.call(o,{name:"label",hash:{},data:a,loc:{start:{line:11,column:60},end:{line:11,column:71}}}):r)!=null?u:"")+'"',r=(r=m(n,"fromComposite")||(e!=null?m(e,"fromComposite"):e))!=null?r:c,b={name:"fromComposite",hash:{},fn:t.program(6,a,0),inverse:t.noop,data:a,loc:{start:{line:12,column:28},end:{line:12,column:92}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"fromComposite")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"toComposite")||(e!=null?m(e,"toComposite"):e))!=null?r:c,b={name:"toComposite",hash:{},fn:t.program(8,a,0),inverse:t.noop,data:a,loc:{start:{line:13,column:28},end:{line:13,column:86}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"toComposite")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(10,a,0),inverse:t.noop,data:a,loc:{start:{line:14,column:28},end:{line:14,column:85}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"width")||(e!=null?m(e,"width"):e))!=null?r:c,b={name:"width",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:15,column:28},end:{line:15,column:68}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"width")?u:y.call(e,u,b))!=null&&(p+=u),p+' class="'+((u=typeof(r=(r=m(n,"class")||(e!=null?m(e,"class"):e))!=null?r:c)==f?r.call(o,{name:"class",hash:{},data:a,loc:{start:{line:15,column:76},end:{line:15,column:87}}}):r)!=null?u:"")+`"]
8
8
  `},4:function(t,e,n,d,a){return" "},6:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return' ltail="cluster_'+((o=typeof(o=(o=o(n,"from")||(e!=null?o(e,"from"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"from",hash:{},data:a,loc:{start:{line:12,column:63},end:{line:12,column:73}}}):o)!=null?o:"")+'"'},8:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return' lhead="cluster_'+((o=typeof(o=(o=o(n,"to")||(e!=null?o(e,"to"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"to",hash:{},data:a,loc:{start:{line:13,column:61},end:{line:13,column:69}}}):o)!=null?o:"")+'"'},10:function(t,e,n,d,a){var o=t.lambda;return' color="'+((t=o(e,e))!=null?t:"")+'" fontcolor="'+((t=o(e,e))!=null?t:"")+'"'},12:function(t,e,n,d,a){return' penwidth="'+((e=t.lambda(e,e))!=null?e:"")+'"'},14:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.hooks.blockHelperMissing,m=t.lookupProperty||function(j,$){if(Object.prototype.hasOwnProperty.call(j,$))return j[$]},p=' "'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:18,column:7},end:{line:18,column:17}}}):r)!=null?u:"")+'" -> "self_'+((u=typeof(r=(r=m(n,"name")||(e!=null?m(e,"name"):e))!=null?r:c)==f?r.call(o,{name:"name",hash:{},data:a,loc:{start:{line:18,column:28},end:{line:18,column:38}}}):r)!=null?u:"")+'" [label="',r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c,b={name:"label",hash:{},fn:t.noop,inverse:t.program(4,a,0),data:a,loc:{start:{line:18,column:48},end:{line:18,column:69}}},u=typeof r==f?r.call(o,b):r;return(u=m(n,"label")?u:y.call(e,u,b))!=null&&(p+=u),p+=((u=typeof(r=(r=m(n,"label")||(e!=null?m(e,"label"):e))!=null?r:c)==f?r.call(o,{name:"label",hash:{},data:a,loc:{start:{line:18,column:69},end:{line:18,column:80}}}):r)!=null?u:"")+'" arrowhead=none',r=(r=m(n,"tailportflags")||(e!=null?m(e,"tailportflags"):e))!=null?r:c,b={name:"tailportflags",hash:{},fn:t.program(15,a,0),inverse:t.noop,data:a,loc:{start:{line:19,column:28},end:{line:19,column:73}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"tailportflags")?u:y.call(e,u,b))!=null&&(p+=u),p+=' ltail="cluster_'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:19,column:89},end:{line:19,column:99}}}):r)!=null?u:"")+'"',r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(10,a,0),inverse:t.noop,data:a,loc:{start:{line:20,column:28},end:{line:20,column:85}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),p+=' class="'+((u=typeof(r=(r=m(n,"class")||(e!=null?m(e,"class"):e))!=null?r:c)==f?r.call(o,{name:"class",hash:{},data:a,loc:{start:{line:20,column:93},end:{line:20,column:104}}}):r)!=null?u:"")+`"]
9
9
  "self_`+((u=typeof(r=(r=m(n,"name")||(e!=null?m(e,"name"):e))!=null?r:c)==f?r.call(o,{name:"name",hash:{},data:a,loc:{start:{line:21,column:12},end:{line:21,column:22}}}):r)!=null?u:"")+'" -> "'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:21,column:28},end:{line:21,column:38}}}):r)!=null?u:"")+'" [lhead="cluster_'+((u=typeof(r=(r=m(n,"from")||(e!=null?m(e,"from"):e))!=null?r:c)==f?r.call(o,{name:"from",hash:{},data:a,loc:{start:{line:21,column:56},end:{line:21,column:66}}}):r)!=null?u:"")+'"',r=(r=m(n,"headportflags")||(e!=null?m(e,"headportflags"):e))!=null?r:c,b={name:"headportflags",hash:{},fn:t.program(15,a,0),inverse:t.noop,data:a,loc:{start:{line:22,column:28},end:{line:22,column:73}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"headportflags")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"color")||(e!=null?m(e,"color"):e))!=null?r:c,b={name:"color",hash:{},fn:t.program(17,a,0),inverse:t.noop,data:a,loc:{start:{line:23,column:28},end:{line:23,column:65}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"color")?u:y.call(e,u,b))!=null&&(p+=u),r=(r=m(n,"width")||(e!=null?m(e,"width"):e))!=null?r:c,b={name:"width",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:24,column:28},end:{line:24,column:68}}},u=typeof r==f?r.call(o,b):r,(u=m(n,"width")?u:y.call(e,u,b))!=null&&(p+=u),p+' class="'+((u=typeof(r=(r=m(n,"class")||(e!=null?m(e,"class"):e))!=null?r:c)==f?r.call(o,{name:"class",hash:{},data:a,loc:{start:{line:24,column:76},end:{line:24,column:87}}}):r)!=null?u:"")+`"]
10
10
  `},15:function(t,e,n,d,a){return" "+((e=t.lambda(e,e))!=null?e:"")},17:function(t,e,n,d,a){return' color="'+((e=t.lambda(e,e))!=null?e:"")+'"'},19:function(t,e,n,d,a,o,c){var f,y=t.lambda,m=t.hooks.blockHelperMissing,p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "i_'+((f=y(e,e))!=null?f:"")+`" [shape=point style=invis margin=0 width=0 height=0 fixedsize=true]
@@ -19,7 +19,7 @@ var Pr=Object.create;var ce=Object.defineProperty,Or=Object.defineProperties,Cr=
19
19
 
20
20
  `+((b=t.invokePartial(p(d,"dot.states.template.hbs"),e,{name:"dot.states.template.hbs",data:a,indent:" ",helpers:n,partials:d,decorators:t.decorators}))!=null?b:"")+`
21
21
  `,r=(r=p(n,"transitions")||(e!=null?p(e,"transitions"):e))!=null?r:y,a={name:"transitions",hash:{},fn:t.program(1,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:8,column:2},end:{line:38,column:18}}},b=typeof r==m?r.call(f,a):r;return(b=p(n,"transitions")?b:t.hooks.blockHelperMissing.call(e,b,a))!=null&&(d+=b),d+`}
22
- `},usePartial:!0,useData:!0,useDepths:!0})});var Nn=X(()=>{var Je=require("handlebars/dist/handlebars.runtime"),Lo=Je.template,zo=Je.templates=Je.templates||{};zo["dot.states.template.hbs"]=Lo({1:function(t,e,n,d,a){var o=t.lookupProperty||function(y,m){if(Object.prototype.hasOwnProperty.call(y,m))return y[m]},c="",f=(f=o(n,"nestedExternalSelfTransitions")||(e!=null?o(e,"nestedExternalSelfTransitions"):e))!=null?f:t.hooks.helperMissing,a={name:"nestedExternalSelfTransitions",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:2},end:{line:4,column:36}}},f=typeof f=="function"?f.call(e!=null?e:t.nullContext||{},a):f;return(f=o(n,"nestedExternalSelfTransitions")?f:t.hooks.blockHelperMissing.call(e,f,a))!=null&&(c+=f),c},2:function(t,e,n,d,a){return' "self_'+((e=t.lambda(e,e))!=null?e:"")+`" [shape=point style=invis width=0 height=0 fixedsize=true]
22
+ `},usePartial:!0,useData:!0,useDepths:!0})});var Sn=X(()=>{var Je=require("handlebars/dist/handlebars.runtime"),zo=Je.template,Uo=Je.templates=Je.templates||{};Uo["dot.states.template.hbs"]=zo({1:function(t,e,n,d,a){var o=t.lookupProperty||function(y,m){if(Object.prototype.hasOwnProperty.call(y,m))return y[m]},c="",f=(f=o(n,"nestedExternalSelfTransitions")||(e!=null?o(e,"nestedExternalSelfTransitions"):e))!=null?f:t.hooks.helperMissing,a={name:"nestedExternalSelfTransitions",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:2},end:{line:4,column:36}}},f=typeof f=="function"?f.call(e!=null?e:t.nullContext||{},a):f;return(f=o(n,"nestedExternalSelfTransitions")?f:t.hooks.blockHelperMissing.call(e,f,a))!=null&&(c+=f),c},2:function(t,e,n,d,a){return' "self_'+((e=t.lambda(e,e))!=null?e:"")+`" [shape=point style=invis width=0 height=0 fixedsize=true]
23
23
  `},4:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "'+((o=typeof(c=(c=p(n,"name")||(e!=null?p(e,"name"):e))!=null?c:y)==m?c.call(f,{name:"name",hash:{},data:a,loc:{start:{line:7,column:3},end:{line:7,column:13}}}):c)!=null?o:"")+'" [shape=circle style=filled class="'+((o=typeof(c=(c=p(n,"class")||(e!=null?p(e,"class"):e))!=null?c:y)==m?c.call(f,{name:"class",hash:{},data:a,loc:{start:{line:7,column:49},end:{line:7,column:60}}}):c)!=null?o:"")+'" '+((o=p(n,"if").call(f,e!=null?p(e,"color"):e,{name:"if",hash:{},fn:t.program(5,a,0),inverse:t.program(7,a,0),data:a,loc:{start:{line:7,column:62},end:{line:7,column:150}}}))!=null?o:"")+((o=p(n,"if").call(f,e!=null?p(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:150},end:{line:7,column:184}}}))!=null?o:"")+`fixedsize=true height=0.15 label=""]
24
24
  `},5:function(t,e,n,d,a){var o,c=e!=null?e:t.nullContext||{},f=t.hooks.helperMissing,y="function",m=t.lookupProperty||function(p,r){if(Object.prototype.hasOwnProperty.call(p,r))return p[r]};return'color="'+((t=typeof(o=(o=m(n,"color")||(e!=null?m(e,"color"):e))!=null?o:f)==y?o.call(c,{name:"color",hash:{},data:a,loc:{start:{line:7,column:82},end:{line:7,column:93}}}):o)!=null?t:"")+'" fillcolor="'+((t=typeof(o=(o=m(n,"color")||(e!=null?m(e,"color"):e))!=null?o:f)==y?o.call(c,{name:"color",hash:{},data:a,loc:{start:{line:7,column:106},end:{line:7,column:117}}}):o)!=null?t:"")+'" '},7:function(t,e,n,d,a){return"fillcolor=black "},9:function(t,e,n,d,a){return"penwidth=3.0 "},11:function(t,e,n,d,a){var o=e!=null?e:t.nullContext||{},c=t.hooks.helperMissing,f="function",y=t.lookupProperty||function(b,u){if(Object.prototype.hasOwnProperty.call(b,u))return b[u]},m=' "'+((r=typeof(p=(p=y(n,"name")||(e!=null?y(e,"name"):e))!=null?p:c)==f?p.call(o,{name:"name",hash:{},data:a,loc:{start:{line:10,column:3},end:{line:10,column:13}}}):p)!=null?r:"")+'" [margin=0 class="'+((r=typeof(p=(p=y(n,"class")||(e!=null?y(e,"class"):e))!=null?p:c)==f?p.call(o,{name:"class",hash:{},data:a,loc:{start:{line:10,column:32},end:{line:10,column:43}}}):p)!=null?r:"")+'" '+((r=y(n,"if").call(o,e!=null?y(e,"color"):e,{name:"if",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:10,column:45},end:{line:10,column:85}}}))!=null?r:"")+((r=y(n,"if").call(o,e!=null?y(e,"active"):e,{name:"if",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:10,column:85},end:{line:10,column:134}}}))!=null?r:"")+`label= <
25
25
  <table align="center" cellborder="0" border="2" style="rounded" width="48">
@@ -30,7 +30,7 @@ var Pr=Object.create;var ce=Object.defineProperty,Or=Object.defineProperties,Cr=
30
30
  <tr><td align="left" cellpadding="2">`+t.escapeExpression(t.lambda(e,e))+`</td></tr>
31
31
  `},25:function(t,e,n,d,a){return"<hr/>"},27:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "'+((o=typeof(c=(c=p(n,"name")||(e!=null?p(e,"name"):e))!=null?c:y)==m?c.call(f,{name:"name",hash:{},data:a,loc:{start:{line:21,column:3},end:{line:21,column:13}}}):c)!=null?o:"")+'" [shape=circle class="'+((o=typeof(c=(c=p(n,"class")||(e!=null?p(e,"class"):e))!=null?c:y)==m?c.call(f,{name:"class",hash:{},data:a,loc:{start:{line:21,column:36},end:{line:21,column:47}}}):c)!=null?o:"")+'" '+((o=p(n,"if").call(f,e!=null?p(e,"color"):e,{name:"if",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:21,column:49},end:{line:21,column:89}}}))!=null?o:"")+((o=p(n,"if").call(f,e!=null?p(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0),inverse:t.noop,data:a,loc:{start:{line:21,column:89},end:{line:21,column:123}}}))!=null?o:"")+`label="H"]
32
32
  `},29:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "'+((o=typeof(c=(c=p(n,"name")||(e!=null?p(e,"name"):e))!=null?c:y)==m?c.call(f,{name:"name",hash:{},data:a,loc:{start:{line:24,column:3},end:{line:24,column:13}}}):c)!=null?o:"")+'" [shape=circle class="'+((o=typeof(c=(c=p(n,"class")||(e!=null?p(e,"class"):e))!=null?c:y)==m?c.call(f,{name:"class",hash:{},data:a,loc:{start:{line:24,column:36},end:{line:24,column:47}}}):c)!=null?o:"")+'" '+((o=p(n,"if").call(f,e!=null?p(e,"color"):e,{name:"if",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:24,column:49},end:{line:24,column:89}}}))!=null?o:"")+((o=p(n,"if").call(f,e!=null?p(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0),inverse:t.noop,data:a,loc:{start:{line:24,column:89},end:{line:24,column:123}}}))!=null?o:"")+`label="H*"]
33
- `},31:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(S,I){if(Object.prototype.hasOwnProperty.call(S,I))return S[I]},b=' "'+(($=typeof(u=(u=r(n,"name")||(e!=null?r(e,"name"):e))!=null?u:y)==m?u.call(f,{name:"name",hash:{},data:a,loc:{start:{line:27,column:3},end:{line:27,column:13}}}):u)!=null?$:"")+'" [shape=diamond fixedsize=true width=0.35 height=0.35 fontsize=10 class="'+(($=typeof(u=(u=r(n,"class")||(e!=null?r(e,"class"):e))!=null?u:y)==m?u.call(f,{name:"class",hash:{},data:a,loc:{start:{line:27,column:87},end:{line:27,column:98}}}):u)!=null?$:"")+'" '+(($=r(n,"if").call(f,e!=null?r(e,"color"):e,{name:"if",hash:{},fn:t.program(12,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:100},end:{line:27,column:140}}}))!=null?$:"")+(($=r(n,"if").call(f,e!=null?r(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:140},end:{line:27,column:174}}}))!=null?$:"")+`label=" "]
33
+ `},31:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(I,N){if(Object.prototype.hasOwnProperty.call(I,N))return I[N]},b=' "'+(($=typeof(u=(u=r(n,"name")||(e!=null?r(e,"name"):e))!=null?u:y)==m?u.call(f,{name:"name",hash:{},data:a,loc:{start:{line:27,column:3},end:{line:27,column:13}}}):u)!=null?$:"")+'" [shape=diamond fixedsize=true width=0.35 height=0.35 fontsize=10 class="'+(($=typeof(u=(u=r(n,"class")||(e!=null?r(e,"class"):e))!=null?u:y)==m?u.call(f,{name:"class",hash:{},data:a,loc:{start:{line:27,column:87},end:{line:27,column:98}}}):u)!=null?$:"")+'" '+(($=r(n,"if").call(f,e!=null?r(e,"color"):e,{name:"if",hash:{},fn:t.program(12,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:100},end:{line:27,column:140}}}))!=null?$:"")+(($=r(n,"if").call(f,e!=null?r(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:27,column:140},end:{line:27,column:174}}}))!=null?$:"")+`label=" "]
34
34
  "`+(($=typeof(u=(u=r(n,"name")||(e!=null?r(e,"name"):e))!=null?u:y)==m?u.call(f,{name:"name",hash:{},data:a,loc:{start:{line:28,column:3},end:{line:28,column:13}}}):u)!=null?$:"")+'" -> "'+(($=typeof(u=(u=r(n,"name")||(e!=null?r(e,"name"):e))!=null?u:y)==m?u.call(f,{name:"name",hash:{},data:a,loc:{start:{line:28,column:19},end:{line:28,column:29}}}):u)!=null?$:"")+'" [label=<',u=(u=r(n,"actions")||(e!=null?r(e,"actions"):e))!=null?u:y,j={name:"actions",hash:{},fn:t.program(32,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:28,column:39},end:{line:28,column:144}}},$=typeof u==m?u.call(f,j):u;return($=r(n,"actions")?$:p.call(e,$,j))!=null&&(b+=$),b+='> color="#FFFFFF01"',u=(u=r(n,"color")||(e!=null?r(e,"color"):e))!=null?u:y,j={name:"color",hash:{},fn:t.program(41,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:28,column:163},end:{line:28,column:203}}},$=typeof u==m?u.call(f,j):u,($=r(n,"color")?$:p.call(e,$,j))!=null&&(b+=$),b+' class="'+(($=typeof(u=(u=r(n,"class")||(e!=null?r(e,"class"):e))!=null?u:y)==m?u.call(f,{name:"class",hash:{},data:a,loc:{start:{line:28,column:211},end:{line:28,column:222}}}):u)!=null?$:"")+`"];
35
35
  `},32:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.lookupProperty||function(m,p){if(Object.prototype.hasOwnProperty.call(m,p))return m[p]};return((e=y(n,"if").call(f,a&&y(a,"first"),{name:"if",hash:{},fn:t.program(33,a,0,o,c),inverse:t.program(35,a,0,o,c),data:a,loc:{start:{line:28,column:51},end:{line:28,column:82}}}))!=null?e:"")+((e=y(n,"if").call(f,c[1]!=null?y(c[1],"active"):c[1],{name:"if",hash:{},fn:t.program(37,a,0,o,c),inverse:t.program(39,a,0,o,c),data:a,loc:{start:{line:28,column:82},end:{line:28,column:131}}}))!=null?e:"")},33:function(t,e,n,d,a){return""},35:function(t,e,n,d,a){return"\\n"},37:function(t,e,n,d,a){return"<i>"+t.escapeExpression(t.lambda(e,e))+"</i>"},39:function(t,e,n,d,a){return t.escapeExpression(t.lambda(e,e))},41:function(t,e,n,d,a){return' fontcolor="'+((e=t.lambda(e,e))!=null?e:"")+'"'},43:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "'+((o=typeof(c=(c=p(n,"name")||(e!=null?p(e,"name"):e))!=null?c:y)==m?c.call(f,{name:"name",hash:{},data:a,loc:{start:{line:31,column:3},end:{line:31,column:13}}}):c)!=null?o:"")+'" [shape=rect class="'+((o=typeof(c=(c=p(n,"class")||(e!=null?p(e,"class"):e))!=null?c:y)==m?c.call(f,{name:"class",hash:{},data:a,loc:{start:{line:31,column:34},end:{line:31,column:45}}}):c)!=null?o:"")+'" '+((o=p(n,"if").call(f,e!=null?p(e,"color"):e,{name:"if",hash:{},fn:t.program(5,a,0),inverse:t.program(7,a,0),data:a,loc:{start:{line:31,column:47},end:{line:31,column:135}}}))!=null?o:"")+((o=p(n,"if").call(f,e!=null?p(e,"active"):e,{name:"if",hash:{},fn:t.program(9,a,0),inverse:t.noop,data:a,loc:{start:{line:31,column:135},end:{line:31,column:169}}}))!=null?o:"")+'label=" " fixedsize=true style=filled '+((o=typeof(c=(c=p(n,"sizingExtras")||(e!=null?p(e,"sizingExtras"):e))!=null?c:y)==m?c.call(f,{name:"sizingExtras",hash:{},data:a,loc:{start:{line:31,column:207},end:{line:31,column:225}}}):c)!=null?o:"")+`]
36
36
  `},45:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.lookupProperty||function(r,b){if(Object.prototype.hasOwnProperty.call(r,b))return r[b]};return' "'+((o=typeof(c=(c=p(n,"name")||(e!=null?p(e,"name"):e))!=null?c:y)==m?c.call(f,{name:"name",hash:{},data:a,loc:{start:{line:37,column:3},end:{line:37,column:13}}}):c)!=null?o:"")+`" [label= <
@@ -53,10 +53,10 @@ var Pr=Object.create;var ce=Object.defineProperty,Or=Object.defineProperties,Cr=
53
53
  <tr><td align="left">`+t.escapeExpression(t.lambda(e,e))+`</td></tr>
54
54
  `},53:function(t,e,n,d,a){return'style="dashed" penwidth=1'},55:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return"style=rounded "+((a=o(n,"if").call(e!=null?e:t.nullContext||{},e!=null?o(e,"active"):e,{name:"if",hash:{},fn:t.program(56,a,0),inverse:t.program(58,a,0),data:a,loc:{start:{line:57,column:77},end:{line:57,column:130}}}))!=null?a:"")},56:function(t,e,n,d,a){return"penwidth=3.0"},58:function(t,e,n,d,a){return"penwidth=2.0"},60:function(t,e,n,d,a,o,c){var f=t.lookupProperty||function(p,r){if(Object.prototype.hasOwnProperty.call(p,r))return p[r]},y="",m=(m=f(n,"noteName")||(e!=null?f(e,"noteName"):e))!=null?m:t.hooks.helperMissing,a={name:"noteName",hash:{},fn:t.program(61,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:63,column:4},end:{line:66,column:17}}},m=typeof m=="function"?m.call(e!=null?e:t.nullContext||{},a):m;return(m=f(n,"noteName")?m:t.hooks.blockHelperMissing.call(e,m,a))!=null&&(y+=m),y},61:function(t,e,n,d,a,o,c){var f=t.lambda,y=t.lookupProperty||function(m,p){if(Object.prototype.hasOwnProperty.call(m,p))return m[p]};return' "'+((t=f(e,e))!=null?t:"")+'" [color=black fontcolor=black label="'+((t=f(c[1]!=null?y(c[1],"noteFlattened"):c[1],e))!=null?t:"")+`" shape=note fontsize=10 fillcolor="#ffffcc" penwidth=1.0]
55
55
  "`+((t=f(c[1]!=null?y(c[1],"name"):c[1],e))!=null?t:"")+'" -> "'+((t=f(e,e))!=null?t:"")+`" [style=dashed arrowtail=none arrowhead=none]
56
- `},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(S,I){if(Object.prototype.hasOwnProperty.call(S,I))return S[I]},b="",u=(u=r(n,"compositeStates")||(e!=null?r(e,"compositeStates"):e))!=null?u:y,j={name:"compositeStates",hash:{},fn:t.program(1,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:5,column:20}}},$=typeof u==m?u.call(f,j):u;return($=r(n,"compositeStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"initialStates")||(e!=null?r(e,"initialStates"):e))!=null?u:y,j={name:"initialStates",hash:{},fn:t.program(4,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:6,column:0},end:{line:8,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"initialStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"regularStates")||(e!=null?r(e,"regularStates"):e))!=null?u:y,j={name:"regularStates",hash:{},fn:t.program(11,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:9,column:0},end:{line:19,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"regularStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"historyStates")||(e!=null?r(e,"historyStates"):e))!=null?u:y,j={name:"historyStates",hash:{},fn:t.program(27,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:20,column:0},end:{line:22,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"historyStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"deepHistoryStates")||(e!=null?r(e,"deepHistoryStates"):e))!=null?u:y,j={name:"deepHistoryStates",hash:{},fn:t.program(29,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:23,column:0},end:{line:25,column:22}}},$=typeof u==m?u.call(f,j):u,($=r(n,"deepHistoryStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"choiceStates")||(e!=null?r(e,"choiceStates"):e))!=null?u:y,j={name:"choiceStates",hash:{},fn:t.program(31,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:26,column:0},end:{line:29,column:17}}},$=typeof u==m?u.call(f,j):u,($=r(n,"choiceStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"forkjoinStates")||(e!=null?r(e,"forkjoinStates"):e))!=null?u:y,j={name:"forkjoinStates",hash:{},fn:t.program(43,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:30,column:0},end:{line:32,column:19}}},$=typeof u==m?u.call(f,j):u,($=r(n,"forkjoinStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"junctionStates")||(e!=null?r(e,"junctionStates"):e))!=null?u:y,j={name:"junctionStates",hash:{},fn:t.program(4,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:33,column:0},end:{line:35,column:19}}},$=typeof u==m?u.call(f,j):u,($=r(n,"junctionStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"terminateStates")||(e!=null?r(e,"terminateStates"):e))!=null?u:y,j={name:"terminateStates",hash:{},fn:t.program(45,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:36,column:0},end:{line:43,column:20}}},$=typeof u==m?u.call(f,j):u,($=r(n,"terminateStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"finalStates")||(e!=null?r(e,"finalStates"):e))!=null?u:y,j={name:"finalStates",hash:{},fn:t.program(48,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:44,column:0},end:{line:46,column:16}}},$=typeof u==m?u.call(f,j):u,($=r(n,"finalStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"compositeStates")||(e!=null?r(e,"compositeStates"):e))!=null?u:y,j={name:"compositeStates",hash:{},fn:t.program(50,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:47,column:0},end:{line:61,column:20}}},$=typeof u==m?u.call(f,j):u,($=r(n,"compositeStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"states")||(e!=null?r(e,"states"):e))!=null?u:y,j={name:"states",hash:{},fn:t.program(60,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:62,column:0},end:{line:67,column:11}}},$=typeof u==m?u.call(f,j):u,($=r(n,"states")?$:p.call(e,$,j))!=null&&(b+=$),b},useData:!0,useDepths:!0})});var Dn=X((ui,Vn)=>{var de=require("handlebars/dist/handlebars.runtime.js");In();Nn();de.registerPartial("dot.states.template.hbs",de.templates["dot.states.template.hbs"]);de.registerHelper("stateSection",t=>de.templates["dot.states.template.hbs"](Go(t)));function J(t){return e=>e.type===t}function Uo(t){return e=>t.includes(e.type)}function Go(t){return t.initialStates=t.states.filter(J("initial")),t.regularStates=t.states.filter(e=>J("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(J("history")),t.deepHistoryStates=t.states.filter(J("deephistory")),t.choiceStates=t.states.filter(J("choice")),t.forkjoinStates=t.states.filter(Uo(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(J("junction")),t.terminateStates=t.states.filter(J("terminate")),t.finalStates=t.states.filter(J("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}Vn.exports=function(e){return de.templates["dot.template.hbs"](e)}});var Yn=X(()=>{var Ye=require("handlebars/dist/handlebars.runtime"),ys=Ye.template,vs=Ye.templates=Ye.templates||{};vs["scxml.template.hbs"]=ys({1:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return'initial="'+t.escapeExpression(typeof(o=(o=o(n,"initial")||(e!=null?o(e,"initial"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"initial",hash:{},data:a,loc:{start:{line:2,column:71},end:{line:2,column:82}}}):o)+'" '},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a){var o,c=t.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`<?xml version="1.0" encoding="UTF-8"?>
56
+ `},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a,o,c){var f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.hooks.blockHelperMissing,r=t.lookupProperty||function(I,N){if(Object.prototype.hasOwnProperty.call(I,N))return I[N]},b="",u=(u=r(n,"compositeStates")||(e!=null?r(e,"compositeStates"):e))!=null?u:y,j={name:"compositeStates",hash:{},fn:t.program(1,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:5,column:20}}},$=typeof u==m?u.call(f,j):u;return($=r(n,"compositeStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"initialStates")||(e!=null?r(e,"initialStates"):e))!=null?u:y,j={name:"initialStates",hash:{},fn:t.program(4,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:6,column:0},end:{line:8,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"initialStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"regularStates")||(e!=null?r(e,"regularStates"):e))!=null?u:y,j={name:"regularStates",hash:{},fn:t.program(11,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:9,column:0},end:{line:19,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"regularStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"historyStates")||(e!=null?r(e,"historyStates"):e))!=null?u:y,j={name:"historyStates",hash:{},fn:t.program(27,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:20,column:0},end:{line:22,column:18}}},$=typeof u==m?u.call(f,j):u,($=r(n,"historyStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"deepHistoryStates")||(e!=null?r(e,"deepHistoryStates"):e))!=null?u:y,j={name:"deepHistoryStates",hash:{},fn:t.program(29,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:23,column:0},end:{line:25,column:22}}},$=typeof u==m?u.call(f,j):u,($=r(n,"deepHistoryStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"choiceStates")||(e!=null?r(e,"choiceStates"):e))!=null?u:y,j={name:"choiceStates",hash:{},fn:t.program(31,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:26,column:0},end:{line:29,column:17}}},$=typeof u==m?u.call(f,j):u,($=r(n,"choiceStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"forkjoinStates")||(e!=null?r(e,"forkjoinStates"):e))!=null?u:y,j={name:"forkjoinStates",hash:{},fn:t.program(43,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:30,column:0},end:{line:32,column:19}}},$=typeof u==m?u.call(f,j):u,($=r(n,"forkjoinStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"junctionStates")||(e!=null?r(e,"junctionStates"):e))!=null?u:y,j={name:"junctionStates",hash:{},fn:t.program(4,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:33,column:0},end:{line:35,column:19}}},$=typeof u==m?u.call(f,j):u,($=r(n,"junctionStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"terminateStates")||(e!=null?r(e,"terminateStates"):e))!=null?u:y,j={name:"terminateStates",hash:{},fn:t.program(45,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:36,column:0},end:{line:43,column:20}}},$=typeof u==m?u.call(f,j):u,($=r(n,"terminateStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"finalStates")||(e!=null?r(e,"finalStates"):e))!=null?u:y,j={name:"finalStates",hash:{},fn:t.program(48,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:44,column:0},end:{line:46,column:16}}},$=typeof u==m?u.call(f,j):u,($=r(n,"finalStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"compositeStates")||(e!=null?r(e,"compositeStates"):e))!=null?u:y,j={name:"compositeStates",hash:{},fn:t.program(50,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:47,column:0},end:{line:61,column:20}}},$=typeof u==m?u.call(f,j):u,($=r(n,"compositeStates")?$:p.call(e,$,j))!=null&&(b+=$),u=(u=r(n,"states")||(e!=null?r(e,"states"):e))!=null?u:y,j={name:"states",hash:{},fn:t.program(60,a,0,o,c),inverse:t.noop,data:a,loc:{start:{line:62,column:0},end:{line:67,column:11}}},$=typeof u==m?u.call(f,j):u,($=r(n,"states")?$:p.call(e,$,j))!=null&&(b+=$),b},useData:!0,useDepths:!0})});var Dn=X((fi,Vn)=>{var de=require("handlebars/dist/handlebars.runtime.js");Nn();Sn();de.registerPartial("dot.states.template.hbs",de.templates["dot.states.template.hbs"]);de.registerHelper("stateSection",t=>de.templates["dot.states.template.hbs"](Xo(t)));function J(t){return e=>e.type===t}function Go(t){return e=>t.includes(e.type)}function Xo(t){return t.initialStates=t.states.filter(J("initial")),t.regularStates=t.states.filter(e=>J("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(J("history")),t.deepHistoryStates=t.states.filter(J("deephistory")),t.choiceStates=t.states.filter(J("choice")),t.forkjoinStates=t.states.filter(Go(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(J("junction")),t.terminateStates=t.states.filter(J("terminate")),t.finalStates=t.states.filter(J("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}Vn.exports=function(e){return de.templates["dot.template.hbs"](e)}});var Yn=X(()=>{var Ye=require("handlebars/dist/handlebars.runtime"),vs=Ye.template,bs=Ye.templates=Ye.templates||{};bs["scxml.template.hbs"]=vs({1:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return'initial="'+t.escapeExpression(typeof(o=(o=o(n,"initial")||(e!=null?o(e,"initial"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"initial",hash:{},data:a,loc:{start:{line:2,column:71},end:{line:2,column:82}}}):o)+'" '},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a){var o,c=t.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <scxml xmlns="http://www.w3.org/2005/07/scxml" `+((o=c(n,"if").call(e!=null?e:t.nullContext||{},e!=null?c(e,"initial"):e,{name:"if",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:47},end:{line:2,column:91}}}))!=null?o:"")+`version="1.0">
58
58
  `+((o=t.invokePartial(c(d,"scxml.states.template.hbs"),e,{name:"scxml.states.template.hbs",data:a,helpers:n,partials:d,decorators:t.decorators}))!=null?o:"")+`</scxml>
59
- `},usePartial:!0,useData:!0})});var Zn=X(()=>{var Ze=require("handlebars/dist/handlebars.runtime"),bs=Ze.template,xs=Ze.templates=Ze.templates||{};xs["scxml.states.template.hbs"]=bs({1:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.escapeExpression,r=t.lookupProperty||function(b,u){if(Object.prototype.hasOwnProperty.call(b,u))return b[u]};return" <"+p(typeof(c=(c=r(n,"kind")||(e!=null?r(e,"kind"):e))!=null?c:y)==m?c.call(f,{name:"kind",hash:{},data:a,loc:{start:{line:2,column:5},end:{line:2,column:13}}}):c)+' id="'+p(typeof(c=(c=r(n,"id")||(e!=null?r(e,"id"):e))!=null?c:y)==m?c.call(f,{name:"id",hash:{},data:a,loc:{start:{line:2,column:18},end:{line:2,column:24}}}):c)+'"'+((o=r(n,"if").call(f,e!=null?r(e,"initial"):e,{name:"if",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:25},end:{line:2,column:69}}}))!=null?o:"")+((o=r(n,"if").call(f,e!=null?r(e,"type"):e,{name:"if",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:69},end:{line:2,column:104}}}))!=null?o:"")+`>
59
+ `},usePartial:!0,useData:!0})});var Zn=X(()=>{var Ze=require("handlebars/dist/handlebars.runtime"),xs=Ze.template,$s=Ze.templates=Ze.templates||{};$s["scxml.states.template.hbs"]=xs({1:function(t,e,n,d,a){var o,c,f=e!=null?e:t.nullContext||{},y=t.hooks.helperMissing,m="function",p=t.escapeExpression,r=t.lookupProperty||function(b,u){if(Object.prototype.hasOwnProperty.call(b,u))return b[u]};return" <"+p(typeof(c=(c=r(n,"kind")||(e!=null?r(e,"kind"):e))!=null?c:y)==m?c.call(f,{name:"kind",hash:{},data:a,loc:{start:{line:2,column:5},end:{line:2,column:13}}}):c)+' id="'+p(typeof(c=(c=r(n,"id")||(e!=null?r(e,"id"):e))!=null?c:y)==m?c.call(f,{name:"id",hash:{},data:a,loc:{start:{line:2,column:18},end:{line:2,column:24}}}):c)+'"'+((o=r(n,"if").call(f,e!=null?r(e,"initial"):e,{name:"if",hash:{},fn:t.program(2,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:25},end:{line:2,column:69}}}))!=null?o:"")+((o=r(n,"if").call(f,e!=null?r(e,"type"):e,{name:"if",hash:{},fn:t.program(4,a,0),inverse:t.noop,data:a,loc:{start:{line:2,column:69},end:{line:2,column:104}}}))!=null?o:"")+`>
60
60
  `+((o=t.invokePartial(r(d,"scxml.states.template.hbs"),e,{name:"scxml.states.template.hbs",data:a,indent:" ",helpers:n,partials:d,decorators:t.decorators}))!=null?o:"")+((o=r(n,"each").call(f,e!=null?r(e,"onentries"):e,{name:"each",hash:{},fn:t.program(6,a,0),inverse:t.noop,data:a,loc:{start:{line:4,column:4},end:{line:6,column:13}}}))!=null?o:"")+((o=r(n,"each").call(f,e!=null?r(e,"onexits"):e,{name:"each",hash:{},fn:t.program(8,a,0),inverse:t.noop,data:a,loc:{start:{line:7,column:4},end:{line:9,column:13}}}))!=null?o:"")+((o=r(n,"each").call(f,e!=null?r(e,"transitions"):e,{name:"each",hash:{},fn:t.program(10,a,0),inverse:t.noop,data:a,loc:{start:{line:10,column:4},end:{line:18,column:13}}}))!=null?o:"")+" </"+p(typeof(c=(c=r(n,"kind")||(e!=null?r(e,"kind"):e))!=null?c:y)==m?c.call(f,{name:"kind",hash:{},data:a,loc:{start:{line:19,column:6},end:{line:19,column:14}}}):c)+`>
61
61
  `},2:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return' initial="'+t.escapeExpression(typeof(o=(o=o(n,"initial")||(e!=null?o(e,"initial"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"initial",hash:{},data:a,loc:{start:{line:2,column:50},end:{line:2,column:61}}}):o)+'"'},4:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return' type="'+t.escapeExpression(typeof(o=(o=o(n,"type")||(e!=null?o(e,"type"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"type",hash:{},data:a,loc:{start:{line:2,column:88},end:{line:2,column:96}}}):o)+'"'},6:function(t,e,n,d,a){return" <onentry>"+t.escapeExpression(t.lambda(e,e))+`</onentry>
62
62
  `},8:function(t,e,n,d,a){return" <onexit>"+t.escapeExpression(t.lambda(e,e))+`</onexit>
@@ -64,16 +64,16 @@ var Pr=Object.create;var ce=Object.defineProperty,Or=Object.defineProperties,Cr=
64
64
  `+m(typeof(o=(o=p(n,"action")||(e!=null?p(e,"action"):e))!=null?o:f)==y?o.call(c,{name:"action",hash:{},data:a,loc:{start:{line:13,column:12},end:{line:13,column:22}}}):o)+`
65
65
  </transition>
66
66
  `},12:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return'event="'+t.escapeExpression(typeof(o=(o=o(n,"event")||(e!=null?o(e,"event"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"event",hash:{},data:a,loc:{start:{line:12,column:40},end:{line:12,column:49}}}):o)+'" '},14:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return'cond="'+t.escapeExpression(typeof(o=(o=o(n,"cond")||(e!=null?o(e,"cond"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"cond",hash:{},data:a,loc:{start:{line:12,column:76},end:{line:12,column:84}}}):o)+'" '},16:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return'type="'+t.escapeExpression(typeof(o=(o=o(n,"type")||(e!=null?o(e,"type"):e))!=null?o:t.hooks.helperMissing)=="function"?o.call(e!=null?e:t.nullContext||{},{name:"type",hash:{},data:a,loc:{start:{line:12,column:111},end:{line:12,column:119}}}):o)+'" '},18:function(t,e,n,d,a){var o,c=e!=null?e:t.nullContext||{},f=t.lookupProperty||function(y,m){if(Object.prototype.hasOwnProperty.call(y,m))return y[m]};return" <transition "+((o=f(n,"if").call(c,e!=null?f(e,"event"):e,{name:"if",hash:{},fn:t.program(12,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:20},end:{line:16,column:58}}}))!=null?o:"")+((o=f(n,"if").call(c,e!=null?f(e,"cond"):e,{name:"if",hash:{},fn:t.program(14,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:58},end:{line:16,column:93}}}))!=null?o:"")+((o=f(n,"if").call(c,e!=null?f(e,"type"):e,{name:"if",hash:{},fn:t.program(16,a,0),inverse:t.noop,data:a,loc:{start:{line:16,column:93},end:{line:16,column:128}}}))!=null?o:"")+'target="'+t.escapeExpression(typeof(e=(e=f(n,"target")||(e!=null?f(e,"target"):e))!=null?e:t.hooks.helperMissing)=="function"?e.call(c,{name:"target",hash:{},data:a,loc:{start:{line:16,column:136},end:{line:16,column:146}}}):e)+`"/>
67
- `},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return(a=o(n,"each").call(e!=null?e:t.nullContext||{},e!=null?o(e,"states"):e,{name:"each",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:20,column:9}}}))!=null?a:""},usePartial:!0,useData:!0})});var el=X((Ri,Kn)=>{var Ke=require("handlebars/dist/handlebars.runtime.js");Yn();Zn();Ke.registerPartial("scxml.states.template.hbs",Ke.templates["scxml.states.template.hbs"]);Kn.exports=function(e){return Ke.templates["scxml.template.hbs"](e)}});Rr(exports,{default:()=>$s,getAllowedValues:()=>sl,render:()=>rl,version:()=>ol});var Be=B(require("lodash.get")),un=Object.freeze({inputType:{default:"smcat",values:[{name:"smcat"},{name:"json"},{name:"scxml"}]},outputType:{default:"svg",values:[{name:"svg"},{name:"eps"},{name:"ps"},{name:"ps2"},{name:"dot"},{name:"smcat"},{name:"json"},{name:"ast"},{name:"scxml"},{name:"oldsvg"},{name:"oldps2"},{name:"oldeps"},{name:"scjson"}]},engine:{default:"dot",values:[{name:"dot"},{name:"circo"},{name:"fdp"},{name:"neato"},{name:"osage"},{name:"twopi"}]},direction:{default:"top-down",values:[{name:"top-down"},{name:"bottom-top"},{name:"left-right"},{name:"right-left"}]},desugar:{default:!1,values:[{name:!0},{name:!1}]}});function Br(t,e){return(0,Be.default)(t,e,(0,Be.default)(un,`${e}.default`))}function Mr(){return un}var H={getAllowedValues:Mr,getOptionValue:Br};var On=B(require("ajv"));function fn(t,e=!1){let n=[];return t.filter(d=>Boolean(d.statemachine)).forEach(d=>{Object.prototype.hasOwnProperty.call(d.statemachine,"states")&&(n=n.concat(fn(d.statemachine.states,!0)))}),n.concat(t.map(d=>({name:d.name,type:d.type,statemachine:Boolean(d.statemachine),hasParent:e})))}function mn(t){let e=[];return Object.prototype.hasOwnProperty.call(t,"transitions")&&(e=t.transitions),Object.prototype.hasOwnProperty.call(t,"states")&&t.states.filter(n=>Boolean(n.statemachine)).forEach(n=>{e=e.concat(mn(n.statemachine))}),e}var D=class{constructor(e){this._flattenedStates=fn(e.states||[]),this._flattenedTransitions=mn(e)}get flattenedTransitions(){return this._flattenedTransitions}findStateByName(e){return this._flattenedStates.find(n=>n.name===e)}findStatesByTypes(e){return this._flattenedStates.filter(n=>e.includes(n.type))}findExternalSelfTransitions(e){return this._flattenedTransitions.filter(n=>n.from===e&&n.to===e&&n.type!=="internal")}findTransitionsByFrom(e){return this._flattenedTransitions.filter(n=>n.from===e)}findTransitionsByTo(e){return this._flattenedTransitions.filter(n=>n.to===e)}};var Hr="^(entry|activity|exit)\\s*/\\s*([^\\n$]*)(\\n|$)",qr=new RegExp(Hr);function pn(t,e){return t.includes(e)}var Sr=[{re:/initial/,stateType:"initial"},{re:/final/,stateType:"final"},{re:/parallel/,stateType:"parallel"},{re:/(deep.*history)|(history.*deep)/,stateType:"deephistory"},{re:/history/,stateType:"history"},{re:/^\^.*/,stateType:"choice"},{re:/^].*/,stateType:"forkjoin"}];function Ir(t){return e=>e.re.test(t)}function dn(t){return(Sr.find(Ir(t))||{stateType:"regular"}).stateType}function Me(t){return{name:t,type:dn(t)}}function hn(t){return Boolean(t.statemachine)}function gn(t){let e=t.states||[];return e.filter(hn).reduce((n,d)=>n.concat(gn(d.statemachine)),e.map(n=>n.name))}function yn(t,e){e=e||gn(t),t.states=t.states||[];let n=t.transitions||[];return t.states.filter(hn).forEach(d=>{d.statemachine.states=yn(d.statemachine,e)}),n.forEach(d=>{pn(e,d.from)||(e.push(d.from),t.states.push(Me(d.from))),pn(e,d.to)||(e.push(d.to),t.states.push(Me(d.to)))}),t.states}function Nr(t,e){let n="junction";return t<=1&&e>1&&(n="fork"),t>1&&e<=1&&(n="join"),n}function vn(t,e=new D(t)){return t.states=t.states.map(n=>{if(n.type==="forkjoin"&&!n.typeExplicitlySet){let d=e.findTransitionsByTo(n.name).length,a=e.findTransitionsByFrom(n.name).length;n.type=Nr(d,a)}return n.statemachine&&(n.statemachine=vn(n.statemachine,e)),n}),t}function Vr(t,e){return t.name===e.name}function Dr(t,e){return t.reduce((n,d)=>{let a=n.findIndex(o=>e(o,d));return a>-1?(n[a]=d,n):n.concat(d)},[])}function Lr(t){let e=/([^[/]+)?(\[[^\]]+\])?[^/]*(\/.+)?/,n={},d=t.match(e),a=1,o=2,c=3;return d[a]&&(n.event=d[a].trim()),d[o]&&(n.cond=d[o].slice(1,-1).trim()),d[c]&&(n.action=d[c].slice(1,d[c].length).trim()),n}function bn(t,e,n,d=a=>a){d(n)&&(t[e]=n)}function zr(t,e,n){bn(t,e,n,d=>d&&d.length>0)}function Ur(t){let e=t.match(qr),n=1,d=2;return e?{type:e[n],body:e[d]}:{type:"activity",body:t}}function Gr(t){return t.split(/\n\s*/g).map(e=>e.trim()).map(Ur)}var T={initState:Me,extractUndeclaredStates:yn,classifyForkJoins:vn,getStateType:dn,stateEqual:Vr,uniq:Dr,parseTransitionExpression:Lr,extractActions:Gr,setIf:bn,setIfNotEmpty:zr};function Xr(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Z(t,e,n,d){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Z.prototype),a.expected=e,a.found=n,a.location=d,a.name="SyntaxError",a}Xr(Z,Error);function He(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Z.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,d;for(d=0;d<t.length;d++)if(t[d].source===this.location.source){n=t[d].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,o=this.location.source+":"+a.line+":"+a.column;if(n){var c=this.location.end,f=He("",a.line.toString().length),y=n[a.line-1],m=a.line===c.line?c.column:y.length+1;e+=`
67
+ `},compiler:[8,">= 4.3.0"],main:function(t,e,n,d,a){var o=t.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return(a=o(n,"each").call(e!=null?e:t.nullContext||{},e!=null?o(e,"states"):e,{name:"each",hash:{},fn:t.program(1,a,0),inverse:t.noop,data:a,loc:{start:{line:1,column:0},end:{line:20,column:9}}}))!=null?a:""},usePartial:!0,useData:!0})});var el=X((Ti,Kn)=>{var Ke=require("handlebars/dist/handlebars.runtime.js");Yn();Zn();Ke.registerPartial("scxml.states.template.hbs",Ke.templates["scxml.states.template.hbs"]);Kn.exports=function(e){return Ke.templates["scxml.template.hbs"](e)}});Rr(exports,{default:()=>js,getAllowedValues:()=>sl,render:()=>rl,version:()=>ol});var Me=B(require("lodash.get")),un=Object.freeze({inputType:{default:"smcat",values:[{name:"smcat"},{name:"json"},{name:"scxml"}]},outputType:{default:"svg",values:[{name:"svg"},{name:"eps"},{name:"ps"},{name:"ps2"},{name:"dot"},{name:"smcat"},{name:"json"},{name:"ast"},{name:"scxml"},{name:"oldsvg"},{name:"oldps2"},{name:"oldeps"},{name:"scjson"}]},engine:{default:"dot",values:[{name:"dot"},{name:"circo"},{name:"fdp"},{name:"neato"},{name:"osage"},{name:"twopi"}]},direction:{default:"top-down",values:[{name:"top-down"},{name:"bottom-top"},{name:"left-right"},{name:"right-left"}]},desugar:{default:!1,values:[{name:!0},{name:!1}]}});function Br(t,e){return(0,Me.default)(t,e,(0,Me.default)(un,`${e}.default`))}function Mr(){return un}var H={getAllowedValues:Mr,getOptionValue:Br};var On=B(require("ajv"));function fn(t,e=!1){let n=[];return t.filter(d=>Boolean(d.statemachine)).forEach(d=>{Object.prototype.hasOwnProperty.call(d.statemachine,"states")&&(n=n.concat(fn(d.statemachine.states,!0)))}),n.concat(t.map(d=>({name:d.name,type:d.type,statemachine:Boolean(d.statemachine),hasParent:e})))}function mn(t){let e=[];return Object.prototype.hasOwnProperty.call(t,"transitions")&&(e=t.transitions),Object.prototype.hasOwnProperty.call(t,"states")&&t.states.filter(n=>Boolean(n.statemachine)).forEach(n=>{e=e.concat(mn(n.statemachine))}),e}var D=class{constructor(e){this._flattenedStates=fn(e.states||[]),this._flattenedTransitions=mn(e)}get flattenedTransitions(){return this._flattenedTransitions}findStateByName(e){return this._flattenedStates.find(n=>n.name===e)}findStatesByTypes(e){return this._flattenedStates.filter(n=>e.includes(n.type))}findExternalSelfTransitions(e){return this._flattenedTransitions.filter(n=>n.from===e&&n.to===e&&n.type!=="internal")}findTransitionsByFrom(e){return this._flattenedTransitions.filter(n=>n.from===e)}findTransitionsByTo(e){return this._flattenedTransitions.filter(n=>n.to===e)}};var Hr="^(entry|activity|exit)\\s*/\\s*([^\\n$]*)(\\n|$)",qr=new RegExp(Hr);function pn(t,e){return t.includes(e)}var Ir=[{re:/initial/,stateType:"initial"},{re:/final/,stateType:"final"},{re:/parallel/,stateType:"parallel"},{re:/(deep.*history)|(history.*deep)/,stateType:"deephistory"},{re:/history/,stateType:"history"},{re:/^\^.*/,stateType:"choice"},{re:/^].*/,stateType:"forkjoin"}];function Nr(t){return e=>e.re.test(t)}function dn(t){return(Ir.find(Nr(t))||{stateType:"regular"}).stateType}function He(t){return{name:t,type:dn(t)}}function hn(t){return Boolean(t.statemachine)}function gn(t){let e=t.states||[];return e.filter(hn).reduce((n,d)=>n.concat(gn(d.statemachine)),e.map(n=>n.name))}function yn(t,e){e=e||gn(t),t.states=t.states||[];let n=t.transitions||[];return t.states.filter(hn).forEach(d=>{d.statemachine.states=yn(d.statemachine,e)}),n.forEach(d=>{pn(e,d.from)||(e.push(d.from),t.states.push(He(d.from))),pn(e,d.to)||(e.push(d.to),t.states.push(He(d.to)))}),t.states}function Sr(t,e){let n="junction";return t<=1&&e>1&&(n="fork"),t>1&&e<=1&&(n="join"),n}function vn(t,e=new D(t)){return t.states=t.states.map(n=>{if(n.type==="forkjoin"&&!n.typeExplicitlySet){let d=e.findTransitionsByTo(n.name).length,a=e.findTransitionsByFrom(n.name).length;n.type=Sr(d,a)}return n.statemachine&&(n.statemachine=vn(n.statemachine,e)),n}),t}function Vr(t,e){return t.name===e.name}function Dr(t,e){return t.reduce((n,d)=>{let a=n.findIndex(o=>e(o,d));return a>-1?(n[a]=d,n):n.concat(d)},[])}function Lr(t){let e=/([^[/]+)?(\[[^\]]+\])?[^/]*(\/.+)?/,n={},d=t.match(e),a=1,o=2,c=3;return d[a]&&(n.event=d[a].trim()),d[o]&&(n.cond=d[o].slice(1,-1).trim()),d[c]&&(n.action=d[c].slice(1,d[c].length).trim()),n}function bn(t,e,n,d=a=>a){d(n)&&(t[e]=n)}function zr(t,e,n){bn(t,e,n,d=>d&&d.length>0)}function Ur(t){let e=t.match(qr),n=1,d=2;return e?{type:e[n],body:e[d]}:{type:"activity",body:t}}function Gr(t){return t.split(/\n\s*/g).map(e=>e.trim()).map(Ur)}var T={initState:He,extractUndeclaredStates:yn,classifyForkJoins:vn,getStateType:dn,stateEqual:Vr,uniq:Dr,parseTransitionExpression:Lr,extractActions:Gr,setIf:bn,setIfNotEmpty:zr};function Xr(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Z(t,e,n,d){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Z.prototype),a.expected=e,a.found=n,a.location=d,a.name="SyntaxError",a}Xr(Z,Error);function qe(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Z.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,d;for(d=0;d<t.length;d++)if(t[d].source===this.location.source){n=t[d].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,o=this.location.source+":"+a.line+":"+a.column;if(n){var c=this.location.end,f=qe("",a.line.toString().length),y=n[a.line-1],m=a.line===c.line?c.column:y.length+1;e+=`
68
68
  --> `+o+`
69
69
  `+f+` |
70
70
  `+a.line+" | "+y+`
71
- `+f+" | "+He("",a.column-1)+He("",m-a.column,"^")}else e+=`
72
- at `+o}return e};Z.buildMessage=function(t,e){var n={literal:function(m){return'"'+a(m.text)+'"'},class:function(m){var p=m.parts.map(function(r){return Array.isArray(r)?o(r[0])+"-"+o(r[1]):o(r)});return"["+(m.inverted?"^":"")+p+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function d(m){return m.charCodeAt(0).toString(16).toUpperCase()}function a(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+d(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+d(p)})}function o(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+d(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+d(p)})}function c(m){return n[m.type](m)}function f(m){var p=m.map(c),r,b;if(p.sort(),p.length>0){for(r=1,b=1;r<p.length;r++)p[r-1]!==p[r]&&(p[b]=p[r],b++);p.length=b}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function y(m){return m?'"'+a(m)+'"':"end of input"}return"Expected "+f(t)+" but "+y(e)+" found."};function xn(t,e){e=e!==void 0?e:{};var n={},d=e.grammarSource,a={program:Xt},o=Xt,c=",",f=";",y="[",m="]",p=":",r="{",b="}",u="=",j="label",$="color",S="class",I="active",nt="type",lt="regular",at="initial",rt="terminate",ot="final",st="parallel",it="history",ct="deephistory",ut="choice",ft="forkjoin",mt="fork",pt="join",dt="junction",il="width",ht="external",gt="internal",yt="->",vt="=>>",bt="=>",xt=">>",$t=":>",jt="--",kt="==",wt="<-",Pt="<<=",Ot="<=",Ct="<<",Et="<:",cl="#",ul=".",U='"',he='\\"',At="/*",ge="*/",_t="//",Ft=/^[0-9]/,Rt=/^[a-zA-Z0-9_\- ]/,Tt=/^[^;, "\t\n\r=\-><:{[]/,fl=/^[ \t]/,ml=/^[\r\n]/,pl=/^[^\r\n]/,dl=_("statemachine"),ye=C(",",!1),K=C(";",!1),hl=_("state"),Bt=C("[",!1),Mt=C("]",!1),Ht=C(":",!1),ae=C("{",!1),gl=C("}",!1),yl=_("extended state attributes"),vl=_("extended state attribute"),Q=C("=",!1),bl=_("state attribute name"),xl=C("label",!0),qt=C("color",!0),$l=_("class attribute"),jl=C("class",!0),kl=_("state flag"),wl=C("active",!0),Pl=_("state type"),St=C("type",!0),Ol=_("state type type"),Cl=C("regular",!1),El=C("initial",!1),Al=C("terminate",!1),_l=C("final",!1),Fl=C("parallel",!1),Rl=C("history",!1),Tl=C("deephistory",!1),Bl=C("choice",!1),Ml=C("forkjoin",!1),Hl=C("fork",!1),ql=C("join",!1),Sl=C("junction",!1),Il=_("transition"),Nl=_("extended transition attributes"),Vl=_("extended transition attribute"),Dl=_("transition attribute name"),Ll=_("transition type name"),zl=_("numeric transition attribute name"),Ul=C("width",!0),Gl=_("transition type value"),Xl=C("external",!1),Jl=C("internal",!1),Ql=_("left to right arrow"),Wl=C("->",!1),Yl=C("=>>",!1),Zl=C("=>",!1),Kl=C(">>",!1),ea=C(":>",!1),ta=C("--",!1),na=C("==",!1),la=_("right to left arrow"),aa=C("<-",!1),ra=C("<<=",!1),oa=C("<=",!1),sa=C("<<",!1),ia=C("<:",!1),ca=C("#",!1),ua=C(".",!1),It=te([["0","9"]],!1,!1),fa=_("double quoted string"),G=C('"',!1),Nt=C('\\"',!1),W=Ga(),ma=_("valid class string"),Vt=te([["a","z"],["A","Z"],["0","9"],"_","-"," "],!1,!1),pa=_("identifier"),Dt=te([";",","," ",'"'," ",`
73
- `,"\r","=","-",">","<",":","{","["],!0,!1),da=_("whitespace"),ha=te([" "," "],!1,!1),ga=_("line end"),ya=te(["\r",`
74
- `],!1,!1),va=C("/*",!1),Lt=C("*/",!1),ba=C("//",!1),xa=te(["\r",`
75
- `],!0,!1),$a=_("comment"),ja=function(l){return l.states=T.extractUndeclaredStates(l),T.classifyForkJoins(l)},ka=function(l,i){let g={};return T.setIf(g,"states",l),T.setIfNotEmpty(g,"transitions",i),g},Ee=function(l){return l},wa=function(l){return T.uniq(l[0].concat(l[1]),T.stateEqual)},Pa=function(l,i,g){return g},Oa=function(l,i,g,h){return h},Ca=function(l,i,g,h,k){return k},Ea=function(l,i,g,h,k){let O=T.initState(i);return(g||[]).forEach(E=>T.setIf(O,E.name,E.value)),T.setIf(O,"typeExplicitlySet",(g||[]).some(E=>E.typeExplicitlySet)),T.setIf(O,"statemachine",k),T.setIfNotEmpty(O,"note",l),Boolean(h)&&T.setIfNotEmpty(O,"actions",T.extractActions(h)),O},re=function(l,i){return{name:l,value:i}},Aa=function(l,i){return{name:l,value:i}},_a=function(l){return{name:l,value:!0}},Fa=function(l,i){return{name:l,value:i,typeExplicitlySet:!0}},ee=function(l){return l.toLowerCase()},Ra=function(l,i,g){return g},Ta=function(l,i,g,h){return h},Ba=function(l,i,g,h){return h&&(i.label=h,i=Object.assign(i,T.parseTransitionExpression(h))),(g||[]).forEach(k=>T.setIf(i,k.name,k.value)),T.setIfNotEmpty(i,"note",l),i},Ma=function(l,i){return{from:l,to:i}},Ha=function(l,i){return{from:i,to:l}},qa=function(l){return l},Sa=function(l){return l.join("").trim()},Ia=function(l){return parseFloat(l.join(""))},Na=function(l){return parseInt(l.join(""),10)},Va=function(l){return l.join("").replace(/\\\"/g,'"')},q=function(l){return l},Da=function(l){return l.join("")},zt=function(l){return l.join("").trim()},La=function(l){return l.join("")},za=function(l,i,g){return l+i.join("")+g},Ua=function(l,i){return l+i.join("")},s=0,w=0,ve=[{line:1,column:1}],N=0,Ae=[],v=0,be;if("startRule"in e){if(!(e.startRule in a))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');o=a[e.startRule]}function js(){return t.substring(w,s)}function ks(){return w}function ws(){return{source:d,start:w,end:s}}function Ps(){return oe(w,s)}function Os(l,i){throw i=i!==void 0?i:oe(w,s),Gt([_(l)],t.substring(w,s),i)}function Cs(l,i){throw i=i!==void 0?i:oe(w,s),Ja(l,i)}function C(l,i){return{type:"literal",text:l,ignoreCase:i}}function te(l,i,g){return{type:"class",parts:l,inverted:i,ignoreCase:g}}function Ga(){return{type:"any"}}function Xa(){return{type:"end"}}function _(l){return{type:"other",description:l}}function Ut(l){var i=ve[l],g;if(i)return i;for(g=l-1;!ve[g];)g--;for(i=ve[g],i={line:i.line,column:i.column};g<l;)t.charCodeAt(g)===10?(i.line++,i.column=1):i.column++,g++;return ve[l]=i,i}function oe(l,i){var g=Ut(l),h=Ut(i);return{source:d,start:{offset:l,line:g.line,column:g.column},end:{offset:i,line:h.line,column:h.column}}}function x(l){s<N||(s>N&&(N=s,Ae=[]),Ae.push(l))}function Ja(l,i){return new Z(l,null,null,i)}function Gt(l,i,g){return new Z(Z.buildMessage(l,i),l,i,g)}function Xt(){var l,i,g,h;return l=s,i=P(),g=Jt(),h=P(),w=l,l=ja(g),l}function Jt(){var l,i,g,h;for(v++,l=s,i=Qa(),i===n&&(i=null),g=[],h=Yt();h!==n;)g.push(h),h=Yt();return w=l,l=ka(i,g),v--,i=n,v===0&&x(dl),l}function Qa(){var l,i,g,h,k,O;for(l=s,i=s,g=[],h=s,k=_e(),k!==n?(t.charCodeAt(s)===44?(O=c,s++):(O=n,v===0&&x(ye)),O!==n?(w=h,h=Ee(k)):(s=h,h=n)):(s=h,h=n);h!==n;)g.push(h),h=s,k=_e(),k!==n?(t.charCodeAt(s)===44?(O=c,s++):(O=n,v===0&&x(ye)),O!==n?(w=h,h=Ee(k)):(s=h,h=n)):(s=h,h=n);return h=s,k=_e(),k!==n?(t.charCodeAt(s)===59?(O=f,s++):(O=n,v===0&&x(K)),O!==n?(w=h,h=Ee(k)):(s=h,h=n)):(s=h,h=n),h!==n?(g=[g,h],i=g):(s=i,i=n),i!==n&&(w=l,i=wa(i)),l=i,l}function _e(){var l,i,g,h,k,O,E,A,L,M,Y,an,Re,wr,Te;for(v++,l=s,i=[],g=xe();g!==n;)i.push(g),g=xe();return g=P(),h=ie(),h!==n?(k=P(),O=s,t.charCodeAt(s)===91?(E=y,s++):(E=n,v===0&&x(Bt)),E!==n?(A=Wa(),t.charCodeAt(s)===93?(L=m,s++):(L=n,v===0&&x(Mt)),L!==n?(w=O,O=Pa(i,h,A)):(s=O,O=n)):(s=O,O=n),O===n&&(O=null),E=P(),A=s,t.charCodeAt(s)===58?(L=p,s++):(L=n,v===0&&x(Ht)),L!==n?(M=P(),Y=mr(),Y!==n?(an=P(),w=A,A=Oa(i,h,O,Y)):(s=A,A=n)):(s=A,A=n),A===n&&(A=null),L=P(),M=s,t.charCodeAt(s)===123?(Y=r,s++):(Y=n,v===0&&x(ae)),Y!==n?(an=P(),Re=Jt(),Re!==n?(wr=P(),t.charCodeAt(s)===125?(Te=b,s++):(Te=n,v===0&&x(gl)),Te!==n?(w=M,M=Ca(i,h,O,A,Re)):(s=M,M=n)):(s=M,M=n)):(s=M,M=n),M===n&&(M=null),Y=P(),w=l,l=Ea(i,h,O,A,M)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(hl)),l}function Wa(){var l,i;for(v++,l=[],i=Qt();i!==n;)l.push(i),i=Qt();return v--,i=n,v===0&&x(yl),l}function Qt(){var l,i,g,h,k,O,E,A;return v++,l=s,i=P(),g=Ya(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=se(),E!==n?(A=P(),w=l,l=re(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Wt(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=Kt(),E!==n?(A=P(),w=l,l=Aa(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Za(),g!==n?(h=P(),w=l,l=_a(g)):(s=l,l=n),l===n&&(l=s,i=P(),g=Ka(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=er(),E!==n?(A=P(),w=l,l=Fa(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)))),v--,l===n&&(i=n,v===0&&x(vl)),l}function Ya(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===j?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(xl)),i===n&&(t.substr(s,5).toLowerCase()===$?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(qt))),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x(bl)),l}function Wt(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===S?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(jl)),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x($l)),l}function Za(){var l,i;return v++,l=s,t.substr(s,6).toLowerCase()===I?(i=t.substr(s,6),s+=6):(i=n,v===0&&x(wl)),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x(kl)),l}function Ka(){var l,i;return v++,l=s,t.substr(s,4).toLowerCase()===nt?(i=t.substr(s,4),s+=4):(i=n,v===0&&x(St)),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x(Pl)),l}function er(){var l,i;return v++,t.substr(s,7)===lt?(l=lt,s+=7):(l=n,v===0&&x(Cl)),l===n&&(t.substr(s,7)===at?(l=at,s+=7):(l=n,v===0&&x(El)),l===n&&(t.substr(s,9)===rt?(l=rt,s+=9):(l=n,v===0&&x(Al)),l===n&&(t.substr(s,5)===ot?(l=ot,s+=5):(l=n,v===0&&x(_l)),l===n&&(t.substr(s,8)===st?(l=st,s+=8):(l=n,v===0&&x(Fl)),l===n&&(t.substr(s,7)===it?(l=it,s+=7):(l=n,v===0&&x(Rl)),l===n&&(t.substr(s,11)===ct?(l=ct,s+=11):(l=n,v===0&&x(Tl)),l===n&&(t.substr(s,6)===ut?(l=ut,s+=6):(l=n,v===0&&x(Bl)),l===n&&(t.substr(s,8)===ft?(l=ft,s+=8):(l=n,v===0&&x(Ml)),l===n&&(t.substr(s,4)===mt?(l=mt,s+=4):(l=n,v===0&&x(Hl)),l===n&&(t.substr(s,4)===pt?(l=pt,s+=4):(l=n,v===0&&x(ql)),l===n&&(t.substr(s,8)===dt?(l=dt,s+=8):(l=n,v===0&&x(Sl))))))))))))),v--,l===n&&(i=n,v===0&&x(Ol)),l}function Yt(){var l,i,g,h,k,O,E,A,L;for(v++,l=s,i=[],g=xe();g!==n;)i.push(g),g=xe();return g=tr(),g!==n?(h=s,t.charCodeAt(s)===91?(k=y,s++):(k=n,v===0&&x(Bt)),k!==n?(O=nr(),t.charCodeAt(s)===93?(E=m,s++):(E=n,v===0&&x(Mt)),E!==n?(A=P(),w=h,h=Ra(i,g,O)):(s=h,h=n)):(s=h,h=n),h===n&&(h=null),k=s,t.charCodeAt(s)===58?(O=p,s++):(O=n,v===0&&x(Ht)),O!==n?(E=P(),A=fr(),A!==n?(L=P(),w=k,k=Ta(i,g,h,A)):(s=k,k=n)):(s=k,k=n),k===n&&(k=null),t.charCodeAt(s)===59?(O=f,s++):(O=n,v===0&&x(K)),O!==n?(w=l,l=Ba(i,g,h,k)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(Il)),l}function tr(){var l,i,g,h,k,O,E,A;return l=s,i=P(),g=ie(),g!==n?(h=P(),k=sr(),k!==n?(O=P(),E=ie(),E!==n?(A=P(),w=l,l=Ma(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=ie(),g!==n?(h=P(),k=ir(),k!==n?(O=P(),E=ie(),E!==n?(A=P(),w=l,l=Ha(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)),l}function nr(){var l,i;for(v++,l=[],i=Zt();i!==n;)l.push(i),i=Zt();return v--,i=n,v===0&&x(Nl),l}function Zt(){var l,i,g,h,k,O,E,A;return v++,l=s,i=P(),g=lr(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=se(),E!==n?(A=P(),w=l,l=re(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Wt(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=Kt(),E!==n?(A=P(),w=l,l=re(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=ar(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=or(),E!==n?(A=P(),w=l,l=re(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=rr(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=cr(),E!==n?(A=P(),w=l,l=re(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)))),v--,l===n&&(i=n,v===0&&x(Vl)),l}function lr(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===$?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(qt)),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x(Dl)),l}function ar(){var l,i;return v++,l=s,t.substr(s,4).toLowerCase()===nt?(i=t.substr(s,4),s+=4):(i=n,v===0&&x(St)),i!==n&&(w=l,i=ee(i)),l=i,v--,l===n&&(i=n,v===0&&x(Ll)),l}function rr(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===il?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(Ul)),i!==n&&(w=l,i=qa(i)),l=i,v--,l===n&&(i=n,v===0&&x(zl)),l}function or(){var l,i;return v++,t.substr(s,8)===ht?(l=ht,s+=8):(l=n,v===0&&x(Xl)),l===n&&(t.substr(s,8)===gt?(l=gt,s+=8):(l=n,v===0&&x(Jl))),v--,l===n&&(i=n,v===0&&x(Gl)),l}function sr(){var l,i;return v++,t.substr(s,2)===yt?(l=yt,s+=2):(l=n,v===0&&x(Wl)),l===n&&(t.substr(s,3)===vt?(l=vt,s+=3):(l=n,v===0&&x(Yl)),l===n&&(t.substr(s,2)===bt?(l=bt,s+=2):(l=n,v===0&&x(Zl)),l===n&&(t.substr(s,2)===xt?(l=xt,s+=2):(l=n,v===0&&x(Kl)),l===n&&(t.substr(s,2)===$t?(l=$t,s+=2):(l=n,v===0&&x(ea)),l===n&&(t.substr(s,2)===jt?(l=jt,s+=2):(l=n,v===0&&x(ta)),l===n&&(t.substr(s,2)===kt?(l=kt,s+=2):(l=n,v===0&&x(na)))))))),v--,l===n&&(i=n,v===0&&x(Ql)),l}function ir(){var l,i;return v++,t.substr(s,2)===wt?(l=wt,s+=2):(l=n,v===0&&x(aa)),l===n&&(t.substr(s,3)===Pt?(l=Pt,s+=3):(l=n,v===0&&x(ra)),l===n&&(t.substr(s,2)===Ot?(l=Ot,s+=2):(l=n,v===0&&x(oa)),l===n&&(t.substr(s,2)===Ct?(l=Ct,s+=2):(l=n,v===0&&x(sa)),l===n&&(t.substr(s,2)===Et?(l=Et,s+=2):(l=n,v===0&&x(ia)))))),v--,l===n&&(i=n,v===0&&x(la)),l}function xe(){var l,i,g,h,k;if(l=s,i=P(),t.charCodeAt(s)===35?(g=cl,s++):(g=n,v===0&&x(ca)),g!==n){for(h=[],k=$e();k!==n;)h.push(k),k=$e();w=l,l=Sa(h)}else s=l,l=n;return l}function cr(){var l;return l=ur(),l===n&&(l=Fe()),l}function ur(){var l,i,g,h,k;return l=s,i=s,g=Fe(),g!==n?(t.charCodeAt(s)===46?(h=ul,s++):(h=n,v===0&&x(ua)),h!==n?(k=Fe(),k!==n?(g=[g,h,k],i=g):(s=i,i=n)):(s=i,i=n)):(s=i,i=n),i!==n&&(w=l,i=Ia(i)),l=i,l}function Fe(){var l,i,g;if(l=s,i=[],Ft.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(It)),g!==n)for(;g!==n;)i.push(g),Ft.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(It));else i=n;return i!==n&&(w=l,i=Na(i)),l=i,l}function fr(){var l;return l=se(),l===n&&(l=hr()),l}function mr(){var l;return l=se(),l===n&&(l=gr()),l}function se(){var l,i,g,h;return v++,l=s,t.charCodeAt(s)===34?(i=U,s++):(i=n,v===0&&x(G)),i!==n?(g=pr(),t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),h!==n?(w=l,l=Va(g)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(fa)),l}function pr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.substr(s,2)===he?(h=he,s+=2):(h=n,v===0&&x(Nt)),h===n&&(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W))),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.substr(s,2)===he?(h=he,s+=2):(h=n,v===0&&x(Nt)),h===n&&(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W))),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function Kt(){var l,i,g,h;return v++,l=s,t.charCodeAt(s)===34?(i=U,s++):(i=n,v===0&&x(G)),i!==n?(g=dr(),t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),h!==n?(w=l,l=Da(g)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(ma)),l}function dr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(Rt.test(t.charAt(s))?(h=t.charAt(s),s++):(h=n,v===0&&x(Vt)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(Rt.test(t.charAt(s))?(h=t.charAt(s),s++):(h=n,v===0&&x(Vt)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function hr(){var l,i;return l=s,i=vr(),w=l,i=zt(i),l=i,l}function gr(){var l,i;return l=s,i=yr(),w=l,i=zt(i),l=i,l}function yr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===44?(h=c,s++):(h=n,v===0&&x(ye)),h===n&&(t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(K)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(ae)))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===44?(h=c,s++):(h=n,v===0&&x(ye)),h===n&&(t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(K)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(ae)))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function vr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(K)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(ae))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(K)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(ae))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function ie(){var l,i,g;if(v++,l=s,i=[],Tt.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Dt)),g!==n)for(;g!==n;)i.push(g),Tt.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Dt));else i=n;return i!==n&&(w=l,i=La(i)),l=i,l===n&&(l=se()),v--,l===n&&(i=n,v===0&&x(pa)),l}function en(){var l,i;return v++,l=s,fl.test(t.charAt(s))?(i=t.charAt(s),s++):(i=n,v===0&&x(ha)),i!==n&&(w=l,i=q(i)),l=i,v--,l===n&&(i=n,v===0&&x(da)),l}function tn(){var l,i;return v++,l=s,ml.test(t.charAt(s))?(i=t.charAt(s),s++):(i=n,v===0&&x(ya)),i!==n&&(w=l,i=q(i)),l=i,v--,l===n&&(i=n,v===0&&x(ga)),l}function br(){var l;return t.substr(s,2)===At?(l=At,s+=2):(l=n,v===0&&x(va)),l}function xr(){var l;return t.substr(s,2)===ge?(l=ge,s+=2):(l=n,v===0&&x(Lt)),l}function nn(){var l,i,g;return l=s,i=s,v++,t.substr(s,2)===ge?(g=ge,s+=2):(g=n,v===0&&x(Lt)),v--,g===n?i=void 0:(s=i,i=n),i!==n?(t.length>s?(g=t.charAt(s),s++):(g=n,v===0&&x(W)),g!==n?(w=l,l=q(g)):(s=l,l=n)):(s=l,l=n),l}function $r(){var l,i,g,h;if(l=s,i=br(),i!==n){for(g=[],h=nn();h!==n;)g.push(h),h=nn();h=xr(),h!==n?(w=l,l=za(i,g,h)):(s=l,l=n)}else s=l,l=n;return l}function jr(){var l;return t.substr(s,2)===_t?(l=_t,s+=2):(l=n,v===0&&x(ba)),l}function $e(){var l;return pl.test(t.charAt(s))?(l=t.charAt(s),s++):(l=n,v===0&&x(xa)),l}function kr(){var l,i,g,h;if(l=s,i=jr(),i!==n){for(g=[],h=$e();h!==n;)g.push(h),h=$e();w=l,l=Ua(i,g)}else s=l,l=n;return l}function ln(){var l,i;return v++,l=kr(),l===n&&(l=$r()),v--,l===n&&(i=n,v===0&&x($a)),l}function P(){var l,i;for(l=[],i=en(),i===n&&(i=tn(),i===n&&(i=ln()));i!==n;)l.push(i),i=en(),i===n&&(i=tn(),i===n&&(i=ln()));return l}if(be=o(),be!==n&&s===t.length)return be;throw be!==n&&s<t.length&&x(Xa()),Gt(Ae,N<t.length?t.charAt(N):null,N<t.length?oe(N,N+1):oe(N,N))}var Se=B(require("fast-xml-parser")),me=B(require("he")),Ie=B(require("lodash.castarray")),$n=B(require("lodash.get"));function Jr(t,e,n){let d="";return t&&(d+=t),e&&(d+=` [${e}]`),n&&(d+=`/ ${n}`),d.trim()}var je={formatLabel:Jr};var ue=B(require("lodash.get")),fe=B(require("lodash.castarray"));function Qr(t){let e={id:t.id?`${t.id}.initial`:"initial"};return t.initial.transition&&Object.assign(e,{transition:[t.initial.transition]}),e}function Wr(t){return{id:"initial",transition:[{target:t.initial}]}}function Yr(t){let e=[],n={};return t.initial&&(t.initial.transition||t.initial.id?n=Qr(t):n=Wr(t),e.push(n)),e}function qe(t){return V(F({},t),{initial:Yr(t),state:(0,fe.default)((0,ue.default)(t,"state",[])),parallel:(0,fe.default)((0,ue.default)(t,"parallel",[])),history:(0,fe.default)((0,ue.default)(t,"history",[])),final:(0,fe.default)((0,ue.default)(t,"final",[]))})}var Zr=je.formatLabel;function jn(t,e){return(0,Ie.default)(t[e]).map(n=>({type:e==="onexit"?"exit":"entry",body:me.default.decode(n).trim()}))}function Kr(t){let e=[];return t.onentry&&(e=e.concat(jn(t,"onentry"))),t.onexit&&(e=e.concat(jn(t,"onexit"))),e}function eo(t,e){return t==="history"&&e.type==="deep"?"deephistory":t}function pe(t){return e=>{let n={name:e.id,type:eo(t,e)};return T.getStateType(e.id)!==n.type&&(n.typeExplicitlySet=!0),(e.onentry||e.onexit)&&(n.actions=Kr(e)),Object.keys(e).some(d=>["initial","state","history","parallel","final"].includes(d))&&(n.statemachine=kn(e)),n}}function to(t){let e={};return t.event&&(e.event=t.event.split(/\s+/).join(`
76
- `)),t.cond&&(e.cond=t.cond),t["#text"]&&(e.action=me.default.decode(t["#text"]).trim()),t.type&&(e.type=t.type),e}function no(t){let e={};typeof t=="string"?e.action=me.default.decode(t).trim():Object.assign(e,to(t));let n=Zr(e.event,e.cond,e.action);return n&&(e.label=n),e}function lo(t){return(e,n)=>{let d=(n.target||t.id).split(/\s+/),a=no(n);return e.concat(d.map(o=>F({from:t.id,to:o},a)))}}function Ne(t){return t.filter(e=>Object.prototype.hasOwnProperty.call(e,"transition")).reduce((e,n)=>e.concat((0,Ie.default)(n.transition).reduce(lo(n),[])),[])}function kn(t){let e=qe(t),n={};n.states=e.initial.map(pe("initial")).concat(e.state.map(pe("regular"))).concat(e.parallel.map(pe("parallel"))).concat(e.history.map(pe("history"))).concat(e.final.map(pe("final")));let d=Ne(e.initial).concat(Ne(e.state)).concat(Ne(e.parallel));return d.length>0&&(n.transitions=d),n}function wn(t){let e=t.trim();if(Se.default.validate(e)===!0){let n=Se.default.parse(e,{attributeNamePrefix:"",ignoreAttributes:!1,tagValueProcessor:d=>me.default.decode(d),stopNodes:["onentry","onexit","transition"]});return kn((0,$n.default)(n,"scxml",{}))}throw new Error(`That doesn't look like valid xml ...
77
- `)}var Pn={$schema:"http://json-schema.org/draft-07/schema#",title:"state-machine-cat abstract syntax tree schema",$ref:"#/definitions/StateMachineType",$id:"org.js.state-machine-cat/v7.4.0",definitions:{StateType:{type:"string",enum:["regular","initial","terminate","final","parallel","history","deephistory","choice","forkjoin","fork","join","junction"]},TransitionType:{type:"string",enum:["internal","external"]},NoteType:{type:"array",items:{type:"string"}},ActionTypeType:{type:"string",enum:["entry","activity","exit"]},ActionType:{type:"object",required:["type","body"],additionalProperties:!1,properties:{type:{$ref:"#/definitions/ActionTypeType"},body:{type:"string"}}},ClassType:{type:"string",pattern:"^[a-zA-Z0-9_\\- ]*$"},StateMachineType:{type:"object",additionalProperties:!1,required:["states"],properties:{states:{type:"array",items:{type:"object",required:["name","type"],additionalProperties:!1,properties:{name:{description:"The name and identifier of the state. Unique within the root state machine.",type:"string"},type:{description:"What kind of state (or pseudo state) this state is. E.g. 'regular' for normal states or 'initial', 'final', 'choice' etc for pseudo states. Most UML (pseudo-) states are supported.",$ref:"#/definitions/StateType"},label:{description:"The display label of the state. If it's not present, most renderers will use the states' name in stead.",type:"string"},color:{description:'Color to use for rendering the state. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},active:{description:"If true the state is considered to be active and rendered as such.",type:"boolean"},typeExplicitlySet:{description:"The default parser derives the `type` from the `name` with inband signaling. The user can override that behavior by explicitly setting the `type`. This attribute is there to express that (and make sure that on next parses & processing it doesn't get accidentily re-derived from the name again).",type:"boolean"},isComposite:{description:"convenience, derived attribute - set to true if there's a state machine inside the state; false in all other cases. For internal use - @deprecated",type:"boolean"},actions:{type:"array",description:"A series of actions and their types. The type describe when the action takes place (on entry, exit, or otherwise ('activity'))",items:{$ref:"#/definitions/ActionType"}},note:{description:"Comments related to this state. Some renderers will use the note attribute to render a note (i.e. as a post-it) attached to the state.",$ref:"#/definitions/NoteType"},statemachine:{description:"state machine nested within the state.",$ref:"#/definitions/StateMachineType"}}}},transitions:{type:"array",items:{type:"object",required:["from","to"],additionalProperties:!1,properties:{from:{description:"The name of the state this transition transitions from",type:"string"},to:{description:"The name of the state this transition transitions to",type:"string"},label:{description:"A display label to represent this transition. Parsers can parse this label into events conditions and actions.",type:"string"},event:{description:"Event triggering the transition",type:"string"},cond:{description:"Condition for the transition to occur.",type:"string"},action:{description:"Action to execute when the transition occurs.",type:"string"},note:{description:"Comments related to this transition",$ref:"#/definitions/NoteType"},color:{description:'Color to use for rendering the transition. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},width:{description:"The line width to use for rendering the transition",type:"number",minimum:0,maximum:30},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},type:{description:"Whether the transition is external (default) or internal. See https://www.w3.org/TR/scxml/#transition for details.",$ref:"#/definitions/TransitionType"}}}}}}}};var Cn=new On.default;function ao(t,e){if(!Cn.validate(t,e))throw new Error(`The provided JSON is not a valid state-machine-cat AST: ${Cn.errorsText()}.
78
- `)}var En={getAST(t,e){let n=t;return H.getOptionValue(e,"inputType")==="smcat"?n=xn(t):H.getOptionValue(e,"inputType")==="scxml"?n=wn(t):typeof t=="string"&&(n=JSON.parse(t)),ao(Pn,n),n}};var Ve=B(require("lodash.clonedeep")),De=B(require("lodash.reject"));function ro(t,e,n){return t?`${t}${n}${e}`:e}function oo(t,e){let n=V(F(F({},t),e),{from:t.from,to:e.to});return e.action&&(n.action=ro(t.action,e.action,`
79
- `)),(n.event||n.cond||n.action)&&(n.label=je.formatLabel(n.event,n.cond,n.action)),n}function so(t,e,n){return t.reduce((d,a)=>(e.forEach((o,c)=>{o===a.to&&n[o]?d=d.concat(n[o].map(f=>oo(a,f))):d=c===0?d.concat(a):d}),d),[])}function An(t,e,n){let d=(0,Ve.default)(t);return d.transitions&&e.length>0&&(d.transitions=so(d.transitions,e,n)),d.states=d.states.map(a=>a.statemachine?V(F({},a),{statemachine:An(a.statemachine,e,n)}):a),d}function _n(t,e){let n=(0,Ve.default)(t);return n.transitions&&(n.transitions=(0,De.default)(n.transitions,d=>e.some(a=>a===d.from||a===d.to))),n.states=(0,De.default)(n.states,d=>e.includes(d.name)).map(d=>d.statemachine?V(F({},d),{statemachine:_n(d.statemachine,e)}):d),n}var Fn=(t,e=["fork","junction","choice"])=>{let n=new D(t),d=n.findStatesByTypes(e).map(c=>c.name),a=d.reduce((c,f)=>(c[f]=n.findTransitionsByFrom(f),c),{}),o=An(t,d,a);return _n(o,d)};var nl=B(require("lodash.has")),ll=B(Hn());var Ln=B(require("lodash.clonedeep"));var bo=[{name:"fontname",value:'"Helvetica"'},{name:"fontsize",value:"12"},{name:"penwidth",value:"2.0"}],xo={dot:[{name:"splines",value:"true"},{name:"ordering",value:"out"},{name:"compound",value:"true"},{name:"overlap",value:"scale"},{name:"nodesep",value:"0.3"},{name:"ranksep",value:"0.1"}],fdp:[{name:"K",value:"0.9"}],osage:[{name:"pack",value:"42"}],neato:[{name:"epsilon",value:"0.9"}]},$o={"bottom-top":[{name:"rankdir",value:"BT"}],"left-right":[{name:"rankdir",value:"LR"}],"right-left":[{name:"rankdir",value:"RL"}]},jo=[{name:"shape",value:"plaintext"},{name:"style",value:"filled"},{name:"fillcolor",value:'"#FFFFFF01"'},{name:"fontname",value:"Helvetica"},{name:"fontsize",value:12},{name:"penwidth",value:"2.0"}],ko=[{name:"fontname",value:"Helvetica"},{name:"fontsize",value:10}];function Ue(t){return`${t.name}=${t.value}`}var ke={buildGraphAttributes:(t,e,n)=>bo.concat(xo[t]||[]).concat($o[e]||[]).concat(n||[]).map(Ue).join(" "),buildNodeAttributes:t=>jo.concat(t||[]).map(Ue).join(" "),buildEdgeAttributes:t=>ko.concat(t||[]).map(Ue).join(" ")};var qn=B(require("lodash.get"));function wo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g,"\\l").replace(/"/g,'\\"').concat("\\l")}function Po(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g," \\l").replace(/"/g,'\\"').concat(" \\l")}function Oo(t){let e=t||"top-down";return e==="top-down"||e==="bottom-top"}function Co(t,e){return e.from===e.to&&t.findStateByName(e.from).statemachine&&e.type!=="internal"}var z={escapeString:wo,escapeLabelString:Po,isVertical:Oo,isCompositeSelf:Co};function Sn(t){return e=>e.type===t}function Ge(t){return e=>t.includes(e.type)}function Eo(t){return t.label=t.label||t.name,t}function Ao(t){return Object.prototype.hasOwnProperty.call(t,"note")&&(t.noteName=`note_${t.name}`),t}function _o(t){let e=["state",t.type];return Object.prototype.hasOwnProperty.call(t,"class")&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}function Fo(t){return t==="activity"?"":`${t}/ `}function Ro(t){let e=F({},t);return t.actions&&(e.actions=t.actions.map(n=>`${Fo(n.type)}${n.body}`)),e}function To(t){return Object.prototype.hasOwnProperty.call(t,"note")&&(t.noteFlattened=t.note.join("")),t}function Bo(t){return e=>{let n=(0,qn.default)((t||[]).find(d=>d.name==="color"),"value");return n&&!e.color&&Ge(["initial","fork","join","junction","forkjoin","final"])(e)&&(e.color=n),e}}function Mo(t){return t.note&&(t.note=t.note.map(z.escapeString)),t}function Ho(t){return e=>Ge(["fork","join","forkjoin"])(e)?F({sizingExtras:z.isVertical(t)?"height=0.1":"width=0.1"},e):e}function qo(t){return t.type==="parallel"&&t.statemachine&&t.statemachine.states&&(t.statemachine.states=t.statemachine.states.map(e=>Sn("regular")(e)?V(F({},e),{parentIsParallel:!0}):e)),t}var R={isType:Sn,isOneOfTypes:Ge,setLabel:Eo,classifyState:_o,nameNote:Ao,flattenActions:Ro,flattenNote:To,recolor:Bo,escapeStateStrings:Mo,tipForkJoinStates:Ho,flagParallelChildren:qo};function So(t){return t.note&&(t.note=t.note.map(z.escapeString)),t.label&&(t.label=z.escapeLabelString(t.label)),t}function Io(t){return e=>{let n={};return e.isCompositeSelf&&(z.isVertical(t)?n={tailportflags:'tailport="e" headport="e"',headportflags:'tailport="w"'}:e.hasParent?n={tailportflags:'tailport="n" headport="n"',headportflags:'tailport="s"'}:n={tailportflags:'tailport="s" headport="s"',headportflags:'tailport="n"'}),F(F({},e),n)}}function No(t){let e=["transition"];return t.type&&e.push(t.type),t.class&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}var we={escapeTransitionStrings:So,addPorts:Io,classifyTransition:No};var Pe=class{constructor(){this.reset()}reset(){this.COUNTER=0}next(){return++this.COUNTER}nextAsString(){let e=10;return this.next().toString(e)}};var zn=B(Dn());var Un={};function Xo(t){return e=>(Object.prototype.hasOwnProperty.call(e,"statemachine")&&(e.nestedExternalSelfTransitions=t.findExternalSelfTransitions(e.name).map(n=>n.name)),e)}function Gn(t,e,n,d){return t.filter(a=>a.statemachine).forEach(a=>{a.statemachine.states=Gn(a.statemachine.states,e,n,d)}),t.map(R.setLabel).map(R.nameNote).map(R.classifyState).map(R.escapeStateStrings).map(R.flattenNote).map(R.flattenActions).map(R.flagParallelChildren).map(R.tipForkJoinStates(e)).map(R.recolor(n)).map(Xo(d))}function Jo(t){return t.initialStates=t.states.filter(R.isType("initial")),t.regularStates=t.states.filter(e=>R.isType("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(R.isType("history")),t.deepHistoryStates=t.states.filter(R.isType("deephistory")),t.choiceStates=t.states.filter(R.isType("choice")),t.forkjoinStates=t.states.filter(R.isOneOfTypes(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(R.isType("junction")),t.terminateStates=t.states.filter(R.isType("terminate")),t.finalStates=t.states.filter(R.isType("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}function Qo(t){return e=>(t.findStateByName(e.from).statemachine&&(e.fromComposite=!0),t.findStateByName(e.to).statemachine&&(e.toComposite=!0),e)}function Wo(t){return e=>{let n={};return z.isCompositeSelf(t,e)&&(t.findStateByName(e.from).hasParent?n={hasParent:!0,isCompositeSelf:!0}:n={isCompositeSelf:!0}),F(F({},e),n)}}function Yo(t){return t.name=`tr_${t.from}_${t.to}_${Un.nextAsString()}`,Boolean(t.note)&&(t.noteName=`note_${t.name}`),t}function Zo(t,e){return t.flattenedTransitions.map(Yo).map(we.escapeTransitionStrings).map(we.classifyTransition).map(R.flattenNote).map(Qo(t)).map(Wo(t)).map(we.addPorts(e))}var Oe=(t,e)=>{e=e||{},Un=new Pe;let n=(0,Ln.default)(t),d=new D(n);return n.transitions=Zo(d,e.direction),n.states=Gn(n.states,e.direction,e.dotNodeAttrs,d),n=Jo(n),n.graphAttributes=ke.buildGraphAttributes(H.getOptionValue(e,"engine"),H.getOptionValue(e,"direction"),e.dotGraphAttrs),n.nodeAttributes=ke.buildNodeAttributes(e.dotNodeAttrs),n.edgeAttributes=ke.buildEdgeAttributes(e.dotEdgeAttrs),(0,zn.default)(n)};var Xn=B(require("viz.js"));var Ko={oldsvg:"svg",oldps2:"ps2",oldeps:"eps"},Qe=(t,e)=>(0,Xn.default)(Oe(t,e),{engine:H.getOptionValue(e,"engine"),format:Ko[H.getOptionValue(e,"outputType")]||"svg"});var es=/[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,ts=/[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;function Jn(t){return t.replace(es,"_")}function ns(t){let e=Jn(t);return e.match(ts)&&(e=`_${t}`),e}var Ce=t=>(t=t||"",t.length===0?"__empty":ns(t[0]).concat(Jn(t.slice(1))));var ls=/[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,as=/[.]/g;function Qn(t){return t.replace(ls,"_")}function rs(t){let e=Qn(t);return e.match(as)&&(e=`_${t}`),e}function os(t){return t=t.replace(/\s+/g," ").trim(),rs(t[0]).concat(Qn(t.slice(1)))}var Wn=t=>(t=t||"",t.length===0?"empty":t.split(/[\n\r]+/).filter(e=>e.length>0).map(os).join(" "));var ss={regular:"state",initial:"initial",final:"final",terminate:"final",parallel:"parallel",history:"history",deephistory:"history"};function is(t){return ss[t]||"state"}function cs(t){let e={target:Ce(t.to)};return Boolean(t.event)&&(e.event=Wn(t.event)),Boolean(t.cond)&&(e.cond=t.cond),Boolean(t.action)&&(e.action=t.action),Boolean(t.type)&&(e.type=t.type),e}function us(t,e){return t.filter(n=>n.type===e).map(n=>n.body)}function We(t,e,n,d){let a=us(n,d);a.length>0&&(t[e]=(t[e]||[]).concat(a))}function fs(t,e){Boolean(e.actions)&&(We(t,"onentries",e.actions,"entry"),We(t,"onentries",e.actions,"activity"),We(t,"onexits",e.actions,"exit"))}function ms(t,e,n){let d=n.filter(a=>a.from===e.name).map(cs);d.length>0&&(t.transitions=d)}function ps(t,e,n){if(Boolean(e.statemachine)){let d=le(e.statemachine,null,n);t.states=(t.states||[]).concat(d.states),d.initial&&(t.initial=d.initial)}}function ds(t){return t=t||[],e=>{let n={kind:is(e.type),id:Ce(e.name)};return e.type==="deephistory"&&(n.type="deep"),fs(n,e),ms(n,e,t),ps(n,e,t),n}}function hs(t){let e=null,n=t.states.filter(d=>d.type==="initial");return n.length>0&&(e=n[0].name),e}function gs(t,e){let n=e;if(e&&t.transitions){let d=t.transitions.filter(a=>a.from===e);d.length>0&&!d[0].action&&(n=d[0].to)}return n}function le(t,e,n){let d=hs(t),a=gs(t,d),o={states:t.states.filter(c=>a&&a!==d?c.type!=="initial":!0).map(ds(n||new D(t).flattenedTransitions))};return a&&(o.initial=Ce(a)),o}var tl=B(el());function et(t){return(0,tl.default)(le(t))}function tt(t){let e={smcat:ll.default,dot:Oe,svg:Qe,oldsvg:Qe,scjson:le,scxml:et};return(0,nl.default)(e,t)?e[t]:n=>n}var al="9.0.1";function rl(t,e){let n=En.getAST(t,e),d=H.getOptionValue(e,"desugar");return tt(H.getOptionValue(e,"outputType"))(d?Fn(n):n,e)}var ol=al;function sl(){return H.getAllowedValues()}var $s={render:rl,version:ol,getAllowedValues:sl};
71
+ `+f+" | "+qe("",a.column-1)+qe("",m-a.column,"^")}else e+=`
72
+ at `+o}return e};Z.buildMessage=function(t,e){var n={literal:function(m){return'"'+a(m.text)+'"'},class:function(m){var p=m.parts.map(function(r){return Array.isArray(r)?o(r[0])+"-"+o(r[1]):o(r)});return"["+(m.inverted?"^":"")+p+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function d(m){return m.charCodeAt(0).toString(16).toUpperCase()}function a(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+d(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+d(p)})}function o(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+d(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+d(p)})}function c(m){return n[m.type](m)}function f(m){var p=m.map(c),r,b;if(p.sort(),p.length>0){for(r=1,b=1;r<p.length;r++)p[r-1]!==p[r]&&(p[b]=p[r],b++);p.length=b}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function y(m){return m?'"'+a(m)+'"':"end of input"}return"Expected "+f(t)+" but "+y(e)+" found."};function xn(t,e){e=e!==void 0?e:{};var n={},d=e.grammarSource,a={program:Xt},o=Xt,c=",",f=";",y="[",m="]",p=":",r="{",b="}",u="=",j="label",$="color",I="class",N="active",nt="type",lt="regular",at="initial",rt="terminate",ot="final",st="parallel",it="history",ct="deephistory",ut="choice",ft="forkjoin",mt="fork",pt="join",dt="junction",il="width",ht="external",gt="internal",yt="->",vt="=>>",bt="=>",xt=">>",$t=":>",jt="--",kt="==",wt="<-",Pt="<<=",Ot="<=",Ct="<<",Et="<:",cl="#",ul=".",U='"',he='\\"',At="/*",ge="*/",_t="//",Ft=/^[0-9]/,Rt=/^[a-zA-Z0-9_\- ]/,Tt=/^[^;, "\t\n\r=\-><:{[]/,fl=/^[ \t]/,ml=/^[\r\n]/,pl=/^[^\r\n]/,dl=_("statemachine"),ye=C(",",!1),ee=C(";",!1),hl=_("state"),Bt=C("[",!1),Mt=C("]",!1),Ht=C(":",!1),re=C("{",!1),gl=C("}",!1),yl=_("extended state attributes"),vl=_("extended state attribute"),Q=C("=",!1),bl=_("state attribute name"),xl=C("label",!0),qt=C("color",!0),$l=_("class attribute"),jl=C("class",!0),kl=_("state flag"),wl=C("active",!0),Pl=_("state type"),It=C("type",!0),Ol=_("state type type"),Cl=C("regular",!1),El=C("initial",!1),Al=C("terminate",!1),_l=C("final",!1),Fl=C("parallel",!1),Rl=C("history",!1),Tl=C("deephistory",!1),Bl=C("choice",!1),Ml=C("forkjoin",!1),Hl=C("fork",!1),ql=C("join",!1),Il=C("junction",!1),Nl=_("transition"),Sl=_("extended transition attributes"),Vl=_("extended transition attribute"),Dl=_("transition attribute name"),Ll=_("transition type name"),zl=_("numeric transition attribute name"),Ul=C("width",!0),Gl=_("transition type value"),Xl=C("external",!1),Jl=C("internal",!1),Ql=_("left to right arrow"),Wl=C("->",!1),Yl=C("=>>",!1),Zl=C("=>",!1),Kl=C(">>",!1),ea=C(":>",!1),ta=C("--",!1),na=C("==",!1),la=_("right to left arrow"),aa=C("<-",!1),ra=C("<<=",!1),oa=C("<=",!1),sa=C("<<",!1),ia=C("<:",!1),ca=C("#",!1),ua=C(".",!1),Nt=ne([["0","9"]],!1,!1),fa=_("double quoted string"),G=C('"',!1),St=C('\\"',!1),W=Ga(),ma=_("valid class string"),Vt=ne([["a","z"],["A","Z"],["0","9"],"_","-"," "],!1,!1),pa=_("identifier"),Dt=ne([";",","," ",'"'," ",`
73
+ `,"\r","=","-",">","<",":","{","["],!0,!1),da=_("whitespace"),ha=ne([" "," "],!1,!1),ga=_("line end"),ya=ne(["\r",`
74
+ `],!1,!1),va=C("/*",!1),Lt=C("*/",!1),ba=C("//",!1),xa=ne(["\r",`
75
+ `],!0,!1),$a=_("comment"),ja=function(l){return l.states=T.extractUndeclaredStates(l),T.classifyForkJoins(l)},ka=function(l,i){let g={};return T.setIf(g,"states",l),T.setIfNotEmpty(g,"transitions",i),g},Ae=function(l){return l},wa=function(l){return T.uniq(l[0].concat(l[1]),T.stateEqual)},Pa=function(l,i,g){return g},Oa=function(l,i,g,h){return h},Ca=function(l,i,g,h,k){return k},Ea=function(l,i,g,h,k){let O=T.initState(i);return(g||[]).forEach(E=>T.setIf(O,E.name,E.value)),T.setIf(O,"typeExplicitlySet",(g||[]).some(E=>E.typeExplicitlySet)),T.setIf(O,"statemachine",k),T.setIfNotEmpty(O,"note",l),Boolean(h)&&T.setIfNotEmpty(O,"actions",T.extractActions(h)),O},oe=function(l,i){return{name:l,value:i}},Aa=function(l,i){return{name:l,value:i}},_a=function(l){return{name:l,value:!0}},Fa=function(l,i){return{name:l,value:i,typeExplicitlySet:!0}},te=function(l){return l.toLowerCase()},Ra=function(l,i,g){return g},Ta=function(l,i,g,h){return h},Ba=function(l,i,g,h){return h&&(i.label=h,i=Object.assign(i,T.parseTransitionExpression(h))),(g||[]).forEach(k=>T.setIf(i,k.name,k.value)),T.setIfNotEmpty(i,"note",l),i},Ma=function(l,i){return{from:l,to:i}},Ha=function(l,i){return{from:i,to:l}},qa=function(l){return l},Ia=function(l){return l.join("").trim()},Na=function(l){return parseFloat(l.join(""))},Sa=function(l){return parseInt(l.join(""),10)},Va=function(l){return l.join("").replace(/\\\"/g,'"')},q=function(l){return l},Da=function(l){return l.join("")},zt=function(l){return l.join("").trim()},La=function(l){return l.join("")},za=function(l,i,g){return l+i.join("")+g},Ua=function(l,i){return l+i.join("")},s=0,w=0,ve=[{line:1,column:1}],S=0,_e=[],v=0,be;if("startRule"in e){if(!(e.startRule in a))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');o=a[e.startRule]}function ks(){return t.substring(w,s)}function ws(){return w}function Ps(){return{source:d,start:w,end:s}}function Os(){return se(w,s)}function Cs(l,i){throw i=i!==void 0?i:se(w,s),Gt([_(l)],t.substring(w,s),i)}function Es(l,i){throw i=i!==void 0?i:se(w,s),Ja(l,i)}function C(l,i){return{type:"literal",text:l,ignoreCase:i}}function ne(l,i,g){return{type:"class",parts:l,inverted:i,ignoreCase:g}}function Ga(){return{type:"any"}}function Xa(){return{type:"end"}}function _(l){return{type:"other",description:l}}function Ut(l){var i=ve[l],g;if(i)return i;for(g=l-1;!ve[g];)g--;for(i=ve[g],i={line:i.line,column:i.column};g<l;)t.charCodeAt(g)===10?(i.line++,i.column=1):i.column++,g++;return ve[l]=i,i}function se(l,i){var g=Ut(l),h=Ut(i);return{source:d,start:{offset:l,line:g.line,column:g.column},end:{offset:i,line:h.line,column:h.column}}}function x(l){s<S||(s>S&&(S=s,_e=[]),_e.push(l))}function Ja(l,i){return new Z(l,null,null,i)}function Gt(l,i,g){return new Z(Z.buildMessage(l,i),l,i,g)}function Xt(){var l,i,g,h;return l=s,i=P(),g=Jt(),h=P(),w=l,l=ja(g),l}function Jt(){var l,i,g,h;for(v++,l=s,i=Qa(),i===n&&(i=null),g=[],h=Yt();h!==n;)g.push(h),h=Yt();return w=l,l=ka(i,g),v--,i=n,v===0&&x(dl),l}function Qa(){var l,i,g,h,k,O;for(l=s,i=s,g=[],h=s,k=Fe(),k!==n?(t.charCodeAt(s)===44?(O=c,s++):(O=n,v===0&&x(ye)),O!==n?(w=h,h=Ae(k)):(s=h,h=n)):(s=h,h=n);h!==n;)g.push(h),h=s,k=Fe(),k!==n?(t.charCodeAt(s)===44?(O=c,s++):(O=n,v===0&&x(ye)),O!==n?(w=h,h=Ae(k)):(s=h,h=n)):(s=h,h=n);return h=s,k=Fe(),k!==n?(t.charCodeAt(s)===59?(O=f,s++):(O=n,v===0&&x(ee)),O!==n?(w=h,h=Ae(k)):(s=h,h=n)):(s=h,h=n),h!==n?(g=[g,h],i=g):(s=i,i=n),i!==n&&(w=l,i=wa(i)),l=i,l}function Fe(){var l,i,g,h,k,O,E,A,L,M,Y,an,Te,wr,Be;for(v++,l=s,i=[],g=xe();g!==n;)i.push(g),g=xe();return g=P(),h=ce(),h!==n?(k=P(),O=s,t.charCodeAt(s)===91?(E=y,s++):(E=n,v===0&&x(Bt)),E!==n?(A=Wa(),t.charCodeAt(s)===93?(L=m,s++):(L=n,v===0&&x(Mt)),L!==n?(w=O,O=Pa(i,h,A)):(s=O,O=n)):(s=O,O=n),O===n&&(O=null),E=P(),A=s,t.charCodeAt(s)===58?(L=p,s++):(L=n,v===0&&x(Ht)),L!==n?(M=P(),Y=mr(),Y!==n?(an=P(),w=A,A=Oa(i,h,O,Y)):(s=A,A=n)):(s=A,A=n),A===n&&(A=null),L=P(),M=s,t.charCodeAt(s)===123?(Y=r,s++):(Y=n,v===0&&x(re)),Y!==n?(an=P(),Te=Jt(),Te!==n?(wr=P(),t.charCodeAt(s)===125?(Be=b,s++):(Be=n,v===0&&x(gl)),Be!==n?(w=M,M=Ca(i,h,O,A,Te)):(s=M,M=n)):(s=M,M=n)):(s=M,M=n),M===n&&(M=null),Y=P(),w=l,l=Ea(i,h,O,A,M)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(hl)),l}function Wa(){var l,i;for(v++,l=[],i=Qt();i!==n;)l.push(i),i=Qt();return v--,i=n,v===0&&x(yl),l}function Qt(){var l,i,g,h,k,O,E,A;return v++,l=s,i=P(),g=Ya(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=ie(),E!==n?(A=P(),w=l,l=oe(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Wt(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=Kt(),E!==n?(A=P(),w=l,l=Aa(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Za(),g!==n?(h=P(),w=l,l=_a(g)):(s=l,l=n),l===n&&(l=s,i=P(),g=Ka(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=er(),E!==n?(A=P(),w=l,l=Fa(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)))),v--,l===n&&(i=n,v===0&&x(vl)),l}function Ya(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===j?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(xl)),i===n&&(t.substr(s,5).toLowerCase()===$?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(qt))),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x(bl)),l}function Wt(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===I?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(jl)),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x($l)),l}function Za(){var l,i;return v++,l=s,t.substr(s,6).toLowerCase()===N?(i=t.substr(s,6),s+=6):(i=n,v===0&&x(wl)),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x(kl)),l}function Ka(){var l,i;return v++,l=s,t.substr(s,4).toLowerCase()===nt?(i=t.substr(s,4),s+=4):(i=n,v===0&&x(It)),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x(Pl)),l}function er(){var l,i;return v++,t.substr(s,7)===lt?(l=lt,s+=7):(l=n,v===0&&x(Cl)),l===n&&(t.substr(s,7)===at?(l=at,s+=7):(l=n,v===0&&x(El)),l===n&&(t.substr(s,9)===rt?(l=rt,s+=9):(l=n,v===0&&x(Al)),l===n&&(t.substr(s,5)===ot?(l=ot,s+=5):(l=n,v===0&&x(_l)),l===n&&(t.substr(s,8)===st?(l=st,s+=8):(l=n,v===0&&x(Fl)),l===n&&(t.substr(s,7)===it?(l=it,s+=7):(l=n,v===0&&x(Rl)),l===n&&(t.substr(s,11)===ct?(l=ct,s+=11):(l=n,v===0&&x(Tl)),l===n&&(t.substr(s,6)===ut?(l=ut,s+=6):(l=n,v===0&&x(Bl)),l===n&&(t.substr(s,8)===ft?(l=ft,s+=8):(l=n,v===0&&x(Ml)),l===n&&(t.substr(s,4)===mt?(l=mt,s+=4):(l=n,v===0&&x(Hl)),l===n&&(t.substr(s,4)===pt?(l=pt,s+=4):(l=n,v===0&&x(ql)),l===n&&(t.substr(s,8)===dt?(l=dt,s+=8):(l=n,v===0&&x(Il))))))))))))),v--,l===n&&(i=n,v===0&&x(Ol)),l}function Yt(){var l,i,g,h,k,O,E,A,L;for(v++,l=s,i=[],g=xe();g!==n;)i.push(g),g=xe();return g=tr(),g!==n?(h=s,t.charCodeAt(s)===91?(k=y,s++):(k=n,v===0&&x(Bt)),k!==n?(O=nr(),t.charCodeAt(s)===93?(E=m,s++):(E=n,v===0&&x(Mt)),E!==n?(A=P(),w=h,h=Ra(i,g,O)):(s=h,h=n)):(s=h,h=n),h===n&&(h=null),k=s,t.charCodeAt(s)===58?(O=p,s++):(O=n,v===0&&x(Ht)),O!==n?(E=P(),A=fr(),A!==n?(L=P(),w=k,k=Ta(i,g,h,A)):(s=k,k=n)):(s=k,k=n),k===n&&(k=null),t.charCodeAt(s)===59?(O=f,s++):(O=n,v===0&&x(ee)),O!==n?(w=l,l=Ba(i,g,h,k)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(Nl)),l}function tr(){var l,i,g,h,k,O,E,A;return l=s,i=P(),g=ce(),g!==n?(h=P(),k=sr(),k!==n?(O=P(),E=ce(),E!==n?(A=P(),w=l,l=Ma(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=ce(),g!==n?(h=P(),k=ir(),k!==n?(O=P(),E=ce(),E!==n?(A=P(),w=l,l=Ha(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)),l}function nr(){var l,i;for(v++,l=[],i=Zt();i!==n;)l.push(i),i=Zt();return v--,i=n,v===0&&x(Sl),l}function Zt(){var l,i,g,h,k,O,E,A;return v++,l=s,i=P(),g=lr(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=ie(),E!==n?(A=P(),w=l,l=oe(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=Wt(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=Kt(),E!==n?(A=P(),w=l,l=oe(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=ar(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=or(),E!==n?(A=P(),w=l,l=oe(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n),l===n&&(l=s,i=P(),g=rr(),g!==n?(h=P(),t.charCodeAt(s)===61?(k=u,s++):(k=n,v===0&&x(Q)),k!==n?(O=P(),E=cr(),E!==n?(A=P(),w=l,l=oe(g,E)):(s=l,l=n)):(s=l,l=n)):(s=l,l=n)))),v--,l===n&&(i=n,v===0&&x(Vl)),l}function lr(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===$?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(qt)),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x(Dl)),l}function ar(){var l,i;return v++,l=s,t.substr(s,4).toLowerCase()===nt?(i=t.substr(s,4),s+=4):(i=n,v===0&&x(It)),i!==n&&(w=l,i=te(i)),l=i,v--,l===n&&(i=n,v===0&&x(Ll)),l}function rr(){var l,i;return v++,l=s,t.substr(s,5).toLowerCase()===il?(i=t.substr(s,5),s+=5):(i=n,v===0&&x(Ul)),i!==n&&(w=l,i=qa(i)),l=i,v--,l===n&&(i=n,v===0&&x(zl)),l}function or(){var l,i;return v++,t.substr(s,8)===ht?(l=ht,s+=8):(l=n,v===0&&x(Xl)),l===n&&(t.substr(s,8)===gt?(l=gt,s+=8):(l=n,v===0&&x(Jl))),v--,l===n&&(i=n,v===0&&x(Gl)),l}function sr(){var l,i;return v++,t.substr(s,2)===yt?(l=yt,s+=2):(l=n,v===0&&x(Wl)),l===n&&(t.substr(s,3)===vt?(l=vt,s+=3):(l=n,v===0&&x(Yl)),l===n&&(t.substr(s,2)===bt?(l=bt,s+=2):(l=n,v===0&&x(Zl)),l===n&&(t.substr(s,2)===xt?(l=xt,s+=2):(l=n,v===0&&x(Kl)),l===n&&(t.substr(s,2)===$t?(l=$t,s+=2):(l=n,v===0&&x(ea)),l===n&&(t.substr(s,2)===jt?(l=jt,s+=2):(l=n,v===0&&x(ta)),l===n&&(t.substr(s,2)===kt?(l=kt,s+=2):(l=n,v===0&&x(na)))))))),v--,l===n&&(i=n,v===0&&x(Ql)),l}function ir(){var l,i;return v++,t.substr(s,2)===wt?(l=wt,s+=2):(l=n,v===0&&x(aa)),l===n&&(t.substr(s,3)===Pt?(l=Pt,s+=3):(l=n,v===0&&x(ra)),l===n&&(t.substr(s,2)===Ot?(l=Ot,s+=2):(l=n,v===0&&x(oa)),l===n&&(t.substr(s,2)===Ct?(l=Ct,s+=2):(l=n,v===0&&x(sa)),l===n&&(t.substr(s,2)===Et?(l=Et,s+=2):(l=n,v===0&&x(ia)))))),v--,l===n&&(i=n,v===0&&x(la)),l}function xe(){var l,i,g,h,k;if(l=s,i=P(),t.charCodeAt(s)===35?(g=cl,s++):(g=n,v===0&&x(ca)),g!==n){for(h=[],k=$e();k!==n;)h.push(k),k=$e();w=l,l=Ia(h)}else s=l,l=n;return l}function cr(){var l;return l=ur(),l===n&&(l=Re()),l}function ur(){var l,i,g,h,k;return l=s,i=s,g=Re(),g!==n?(t.charCodeAt(s)===46?(h=ul,s++):(h=n,v===0&&x(ua)),h!==n?(k=Re(),k!==n?(g=[g,h,k],i=g):(s=i,i=n)):(s=i,i=n)):(s=i,i=n),i!==n&&(w=l,i=Na(i)),l=i,l}function Re(){var l,i,g;if(l=s,i=[],Ft.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Nt)),g!==n)for(;g!==n;)i.push(g),Ft.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Nt));else i=n;return i!==n&&(w=l,i=Sa(i)),l=i,l}function fr(){var l;return l=ie(),l===n&&(l=hr()),l}function mr(){var l;return l=ie(),l===n&&(l=gr()),l}function ie(){var l,i,g,h;return v++,l=s,t.charCodeAt(s)===34?(i=U,s++):(i=n,v===0&&x(G)),i!==n?(g=pr(),t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),h!==n?(w=l,l=Va(g)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(fa)),l}function pr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.substr(s,2)===he?(h=he,s+=2):(h=n,v===0&&x(St)),h===n&&(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W))),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.substr(s,2)===he?(h=he,s+=2):(h=n,v===0&&x(St)),h===n&&(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W))),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function Kt(){var l,i,g,h;return v++,l=s,t.charCodeAt(s)===34?(i=U,s++):(i=n,v===0&&x(G)),i!==n?(g=dr(),t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),h!==n?(w=l,l=Da(g)):(s=l,l=n)):(s=l,l=n),v--,l===n&&(i=n,v===0&&x(ma)),l}function dr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(Rt.test(t.charAt(s))?(h=t.charAt(s),s++):(h=n,v===0&&x(Vt)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===34?(h=U,s++):(h=n,v===0&&x(G)),v--,h===n?g=void 0:(s=g,g=n),g!==n?(Rt.test(t.charAt(s))?(h=t.charAt(s),s++):(h=n,v===0&&x(Vt)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function hr(){var l,i;return l=s,i=vr(),w=l,i=zt(i),l=i,l}function gr(){var l,i;return l=s,i=yr(),w=l,i=zt(i),l=i,l}function yr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===44?(h=c,s++):(h=n,v===0&&x(ye)),h===n&&(t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(ee)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(re)))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===44?(h=c,s++):(h=n,v===0&&x(ye)),h===n&&(t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(ee)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(re)))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function vr(){var l,i,g,h;for(l=[],i=s,g=s,v++,t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(ee)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(re))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);i!==n;)l.push(i),i=s,g=s,v++,t.charCodeAt(s)===59?(h=f,s++):(h=n,v===0&&x(ee)),h===n&&(t.charCodeAt(s)===123?(h=r,s++):(h=n,v===0&&x(re))),v--,h===n?g=void 0:(s=g,g=n),g!==n?(t.length>s?(h=t.charAt(s),s++):(h=n,v===0&&x(W)),h!==n?(w=i,i=q(h)):(s=i,i=n)):(s=i,i=n);return l}function ce(){var l,i,g;if(v++,l=s,i=[],Tt.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Dt)),g!==n)for(;g!==n;)i.push(g),Tt.test(t.charAt(s))?(g=t.charAt(s),s++):(g=n,v===0&&x(Dt));else i=n;return i!==n&&(w=l,i=La(i)),l=i,l===n&&(l=ie()),v--,l===n&&(i=n,v===0&&x(pa)),l}function en(){var l,i;return v++,l=s,fl.test(t.charAt(s))?(i=t.charAt(s),s++):(i=n,v===0&&x(ha)),i!==n&&(w=l,i=q(i)),l=i,v--,l===n&&(i=n,v===0&&x(da)),l}function tn(){var l,i;return v++,l=s,ml.test(t.charAt(s))?(i=t.charAt(s),s++):(i=n,v===0&&x(ya)),i!==n&&(w=l,i=q(i)),l=i,v--,l===n&&(i=n,v===0&&x(ga)),l}function br(){var l;return t.substr(s,2)===At?(l=At,s+=2):(l=n,v===0&&x(va)),l}function xr(){var l;return t.substr(s,2)===ge?(l=ge,s+=2):(l=n,v===0&&x(Lt)),l}function nn(){var l,i,g;return l=s,i=s,v++,t.substr(s,2)===ge?(g=ge,s+=2):(g=n,v===0&&x(Lt)),v--,g===n?i=void 0:(s=i,i=n),i!==n?(t.length>s?(g=t.charAt(s),s++):(g=n,v===0&&x(W)),g!==n?(w=l,l=q(g)):(s=l,l=n)):(s=l,l=n),l}function $r(){var l,i,g,h;if(l=s,i=br(),i!==n){for(g=[],h=nn();h!==n;)g.push(h),h=nn();h=xr(),h!==n?(w=l,l=za(i,g,h)):(s=l,l=n)}else s=l,l=n;return l}function jr(){var l;return t.substr(s,2)===_t?(l=_t,s+=2):(l=n,v===0&&x(ba)),l}function $e(){var l;return pl.test(t.charAt(s))?(l=t.charAt(s),s++):(l=n,v===0&&x(xa)),l}function kr(){var l,i,g,h;if(l=s,i=jr(),i!==n){for(g=[],h=$e();h!==n;)g.push(h),h=$e();w=l,l=Ua(i,g)}else s=l,l=n;return l}function ln(){var l,i;return v++,l=kr(),l===n&&(l=$r()),v--,l===n&&(i=n,v===0&&x($a)),l}function P(){var l,i;for(l=[],i=en(),i===n&&(i=tn(),i===n&&(i=ln()));i!==n;)l.push(i),i=en(),i===n&&(i=tn(),i===n&&(i=ln()));return l}if(be=o(),be!==n&&s===t.length)return be;throw be!==n&&s<t.length&&x(Xa()),Gt(_e,S<t.length?t.charAt(S):null,S<t.length?se(S,S+1):se(S,S))}var Ne=B(require("fast-xml-parser")),K=B(require("he")),ke=B(require("lodash.castarray")),$n=B(require("lodash.get"));function Jr(t,e,n){let d="";return t&&(d+=t),e&&(d+=` [${e}]`),n&&(d+=`/ ${n}`),d.trim()}var je={formatLabel:Jr};var fe=B(require("lodash.get")),me=B(require("lodash.castarray"));function Qr(t){let e={id:t.id?`${t.id}.initial`:"initial"};return t.initial.transition&&Object.assign(e,{transition:[t.initial.transition]}),e}function Wr(t){return{id:"initial",transition:[{target:t.initial}]}}function Yr(t){let e=[],n={};return t.initial&&(t.initial.transition||t.initial.id?n=Qr(t):n=Wr(t),e.push(n)),e}function Ie(t){return V(F({},t),{initial:Yr(t),state:(0,me.default)((0,fe.default)(t,"state",[])),parallel:(0,me.default)((0,fe.default)(t,"parallel",[])),history:(0,me.default)((0,fe.default)(t,"history",[])),final:(0,me.default)((0,fe.default)(t,"final",[]))})}var Zr=je.formatLabel;function jn(t,e){return(0,ke.default)(t[e]).map(n=>({type:e==="onexit"?"exit":"entry",body:K.default.decode(n).trim()}))}function Kr(t){return(0,ke.default)(t).map(e=>{let n=K.default.decode(e.id||"").trim();return{type:"activity",body:n||K.default.decode(e||"").trim()}})}function eo(t){let e=[];return t.onentry&&(e=e.concat(jn(t,"onentry"))),t.invoke&&(e=e.concat(Kr(t.invoke))),t.onexit&&(e=e.concat(jn(t,"onexit"))),e}function to(t,e){return t==="history"&&e.type==="deep"?"deephistory":t}function pe(t){return e=>{let n={name:e.id,type:to(t,e)};return T.getStateType(e.id)!==n.type&&(n.typeExplicitlySet=!0),(e.onentry||e.onexit||e.invoke)&&(n.actions=eo(e)),Object.keys(e).some(d=>["initial","state","history","parallel","final"].includes(d))&&(n.statemachine=kn(e)),n}}function no(t){let e={};return t.event&&(e.event=t.event.split(/\s+/).join(`
76
+ `)),t.cond&&(e.cond=t.cond),t["#text"]&&(e.action=K.default.decode(t["#text"]).trim()),t.type&&(e.type=t.type),e}function lo(t){let e={};typeof t=="string"?e.action=K.default.decode(t).trim():Object.assign(e,no(t));let n=Zr(e.event,e.cond,e.action);return n&&(e.label=n),e}function ao(t){return(e,n)=>{let d=(n.target||t.id).split(/\s+/),a=lo(n);return e.concat(d.map(o=>F({from:t.id,to:o},a)))}}function Se(t){return t.filter(e=>Object.prototype.hasOwnProperty.call(e,"transition")).reduce((e,n)=>e.concat((0,ke.default)(n.transition).reduce(ao(n),[])),[])}function kn(t){let e=Ie(t),n={};n.states=e.initial.map(pe("initial")).concat(e.state.map(pe("regular"))).concat(e.parallel.map(pe("parallel"))).concat(e.history.map(pe("history"))).concat(e.final.map(pe("final")));let d=Se(e.initial).concat(Se(e.state)).concat(Se(e.parallel));return d.length>0&&(n.transitions=d),n}function wn(t){let e=t.trim();if(Ne.default.validate(e)===!0){let n=Ne.default.parse(e,{attributeNamePrefix:"",ignoreAttributes:!1,tagValueProcessor:d=>K.default.decode(d),stopNodes:["onentry","onexit","transition"]});return kn((0,$n.default)(n,"scxml",{}))}throw new Error(`That doesn't look like valid xml ...
77
+ `)}var Pn={$schema:"http://json-schema.org/draft-07/schema#",title:"state-machine-cat abstract syntax tree schema",$ref:"#/definitions/StateMachineType",$id:"org.js.state-machine-cat/v7.4.0",definitions:{StateType:{type:"string",enum:["regular","initial","terminate","final","parallel","history","deephistory","choice","forkjoin","fork","join","junction"]},TransitionType:{type:"string",enum:["internal","external"]},NoteType:{type:"array",items:{type:"string"}},ActionTypeType:{type:"string",enum:["entry","activity","exit"]},ActionType:{type:"object",required:["type","body"],additionalProperties:!1,properties:{type:{$ref:"#/definitions/ActionTypeType"},body:{type:"string"}}},ClassType:{type:"string",pattern:"^[a-zA-Z0-9_\\- ]*$"},StateMachineType:{type:"object",additionalProperties:!1,required:["states"],properties:{states:{type:"array",items:{type:"object",required:["name","type"],additionalProperties:!1,properties:{name:{description:"The name and identifier of the state. Unique within the root state machine.",type:"string"},type:{description:"What kind of state (or pseudo state) this state is. E.g. 'regular' for normal states or 'initial', 'final', 'choice' etc for pseudo states. Most UML (pseudo-) states are supported.",$ref:"#/definitions/StateType"},label:{description:"The display label of the state. If it's not present, most renderers will use the states' name in stead.",type:"string"},color:{description:'Color to use for rendering the state. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},active:{description:"If true the state is considered to be active and rendered as such.",type:"boolean"},typeExplicitlySet:{description:"The default parser derives the `type` from the `name` with inband signaling. The user can override that behavior by explicitly setting the `type`. This attribute is there to express that (and make sure that on next parses & processing it doesn't get accidentily re-derived from the name again).",type:"boolean"},isComposite:{description:"convenience, derived attribute - set to true if there's a state machine inside the state; false in all other cases. For internal use - @deprecated",type:"boolean"},actions:{type:"array",description:"A series of actions and their types. The type describe when the action takes place (on entry, exit, or otherwise ('activity'))",items:{$ref:"#/definitions/ActionType"}},note:{description:"Comments related to this state. Some renderers will use the note attribute to render a note (i.e. as a post-it) attached to the state.",$ref:"#/definitions/NoteType"},statemachine:{description:"state machine nested within the state.",$ref:"#/definitions/StateMachineType"}}}},transitions:{type:"array",items:{type:"object",required:["from","to"],additionalProperties:!1,properties:{from:{description:"The name of the state this transition transitions from",type:"string"},to:{description:"The name of the state this transition transitions to",type:"string"},label:{description:"A display label to represent this transition. Parsers can parse this label into events conditions and actions.",type:"string"},event:{description:"Event triggering the transition",type:"string"},cond:{description:"Condition for the transition to occur.",type:"string"},action:{description:"Action to execute when the transition occurs.",type:"string"},note:{description:"Comments related to this transition",$ref:"#/definitions/NoteType"},color:{description:'Color to use for rendering the transition. Accepts all css color names ("blue") and hex notation - with ("#0000FF77") or without ("#0000FF") transparency.',type:"string"},width:{description:"The line width to use for rendering the transition",type:"number",minimum:0,maximum:30},class:{description:"Class name to give the state in dot and svg output.",$ref:"#/definitions/ClassType"},type:{description:"Whether the transition is external (default) or internal. See https://www.w3.org/TR/scxml/#transition for details.",$ref:"#/definitions/TransitionType"}}}}}}}};var Cn=new On.default;function ro(t,e){if(!Cn.validate(t,e))throw new Error(`The provided JSON is not a valid state-machine-cat AST: ${Cn.errorsText()}.
78
+ `)}var En={getAST(t,e){let n=t;return H.getOptionValue(e,"inputType")==="smcat"?n=xn(t):H.getOptionValue(e,"inputType")==="scxml"?n=wn(t):typeof t=="string"&&(n=JSON.parse(t)),ro(Pn,n),n}};var Ve=B(require("lodash.clonedeep")),De=B(require("lodash.reject"));function oo(t,e,n){return t?`${t}${n}${e}`:e}function so(t,e){let n=V(F(F({},t),e),{from:t.from,to:e.to});return e.action&&(n.action=oo(t.action,e.action,`
79
+ `)),(n.event||n.cond||n.action)&&(n.label=je.formatLabel(n.event,n.cond,n.action)),n}function io(t,e,n){return t.reduce((d,a)=>(e.forEach((o,c)=>{o===a.to&&n[o]?d=d.concat(n[o].map(f=>so(a,f))):d=c===0?d.concat(a):d}),d),[])}function An(t,e,n){let d=(0,Ve.default)(t);return d.transitions&&e.length>0&&(d.transitions=io(d.transitions,e,n)),d.states=d.states.map(a=>a.statemachine?V(F({},a),{statemachine:An(a.statemachine,e,n)}):a),d}function _n(t,e){let n=(0,Ve.default)(t);return n.transitions&&(n.transitions=(0,De.default)(n.transitions,d=>e.some(a=>a===d.from||a===d.to))),n.states=(0,De.default)(n.states,d=>e.includes(d.name)).map(d=>d.statemachine?V(F({},d),{statemachine:_n(d.statemachine,e)}):d),n}var Fn=(t,e=["fork","junction","choice"])=>{let n=new D(t),d=n.findStatesByTypes(e).map(c=>c.name),a=d.reduce((c,f)=>(c[f]=n.findTransitionsByFrom(f),c),{}),o=An(t,d,a);return _n(o,d)};var nl=B(require("lodash.has")),ll=B(Hn());var Ln=B(require("lodash.clonedeep"));var xo=[{name:"fontname",value:'"Helvetica"'},{name:"fontsize",value:"12"},{name:"penwidth",value:"2.0"}],$o={dot:[{name:"splines",value:"true"},{name:"ordering",value:"out"},{name:"compound",value:"true"},{name:"overlap",value:"scale"},{name:"nodesep",value:"0.3"},{name:"ranksep",value:"0.1"}],fdp:[{name:"K",value:"0.9"}],osage:[{name:"pack",value:"42"}],neato:[{name:"epsilon",value:"0.9"}]},jo={"bottom-top":[{name:"rankdir",value:"BT"}],"left-right":[{name:"rankdir",value:"LR"}],"right-left":[{name:"rankdir",value:"RL"}]},ko=[{name:"shape",value:"plaintext"},{name:"style",value:"filled"},{name:"fillcolor",value:'"#FFFFFF01"'},{name:"fontname",value:"Helvetica"},{name:"fontsize",value:12},{name:"penwidth",value:"2.0"}],wo=[{name:"fontname",value:"Helvetica"},{name:"fontsize",value:10}];function Ue(t){return`${t.name}=${t.value}`}var we={buildGraphAttributes:(t,e,n)=>xo.concat($o[t]||[]).concat(jo[e]||[]).concat(n||[]).map(Ue).join(" "),buildNodeAttributes:t=>ko.concat(t||[]).map(Ue).join(" "),buildEdgeAttributes:t=>wo.concat(t||[]).map(Ue).join(" ")};var qn=B(require("lodash.get"));function Po(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g,"\\l").replace(/"/g,'\\"').concat("\\l")}function Oo(t){return t.replace(/\\/g,"\\\\").replace(/\n\s*/g," \\l").replace(/"/g,'\\"').concat(" \\l")}function Co(t){let e=t||"top-down";return e==="top-down"||e==="bottom-top"}function Eo(t,e){return e.from===e.to&&t.findStateByName(e.from).statemachine&&e.type!=="internal"}var z={escapeString:Po,escapeLabelString:Oo,isVertical:Co,isCompositeSelf:Eo};function In(t){return e=>e.type===t}function Ge(t){return e=>t.includes(e.type)}function Ao(t){return t.label=t.label||t.name,t}function _o(t){return Object.prototype.hasOwnProperty.call(t,"note")&&(t.noteName=`note_${t.name}`),t}function Fo(t){let e=["state",t.type];return Object.prototype.hasOwnProperty.call(t,"class")&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}function Ro(t){return t==="activity"?"":`${t}/ `}function To(t){let e=F({},t);return t.actions&&(e.actions=t.actions.map(n=>`${Ro(n.type)}${n.body}`)),e}function Bo(t){return Object.prototype.hasOwnProperty.call(t,"note")&&(t.noteFlattened=t.note.join("")),t}function Mo(t){return e=>{let n=(0,qn.default)((t||[]).find(d=>d.name==="color"),"value");return n&&!e.color&&Ge(["initial","fork","join","junction","forkjoin","final"])(e)&&(e.color=n),e}}function Ho(t){return t.note&&(t.note=t.note.map(z.escapeString)),t}function qo(t){return e=>Ge(["fork","join","forkjoin"])(e)?F({sizingExtras:z.isVertical(t)?"height=0.1":"width=0.1"},e):e}function Io(t){return t.type==="parallel"&&t.statemachine&&t.statemachine.states&&(t.statemachine.states=t.statemachine.states.map(e=>In("regular")(e)?V(F({},e),{parentIsParallel:!0}):e)),t}var R={isType:In,isOneOfTypes:Ge,setLabel:Ao,classifyState:Fo,nameNote:_o,flattenActions:To,flattenNote:Bo,recolor:Mo,escapeStateStrings:Ho,tipForkJoinStates:qo,flagParallelChildren:Io};function No(t){return t.note&&(t.note=t.note.map(z.escapeString)),t.label&&(t.label=z.escapeLabelString(t.label)),t}function So(t){return e=>{let n={};return e.isCompositeSelf&&(z.isVertical(t)?n={tailportflags:'tailport="e" headport="e"',headportflags:'tailport="w"'}:e.hasParent?n={tailportflags:'tailport="n" headport="n"',headportflags:'tailport="s"'}:n={tailportflags:'tailport="s" headport="s"',headportflags:'tailport="n"'}),F(F({},e),n)}}function Vo(t){let e=["transition"];return t.type&&e.push(t.type),t.class&&e.push(t.class.trim().replace(/[ ]{2,}/g," ")),t.class=e.join(" "),t}var Pe={escapeTransitionStrings:No,addPorts:So,classifyTransition:Vo};var Oe=class{constructor(){this.reset()}reset(){this.COUNTER=0}next(){return++this.COUNTER}nextAsString(){let e=10;return this.next().toString(e)}};var zn=B(Dn());var Un={};function Jo(t){return e=>(Object.prototype.hasOwnProperty.call(e,"statemachine")&&(e.nestedExternalSelfTransitions=t.findExternalSelfTransitions(e.name).map(n=>n.name)),e)}function Gn(t,e,n,d){return t.filter(a=>a.statemachine).forEach(a=>{a.statemachine.states=Gn(a.statemachine.states,e,n,d)}),t.map(R.setLabel).map(R.nameNote).map(R.classifyState).map(R.escapeStateStrings).map(R.flattenNote).map(R.flattenActions).map(R.flagParallelChildren).map(R.tipForkJoinStates(e)).map(R.recolor(n)).map(Jo(d))}function Qo(t){return t.initialStates=t.states.filter(R.isType("initial")),t.regularStates=t.states.filter(e=>R.isType("regular")(e)&&!e.statemachine),t.historyStates=t.states.filter(R.isType("history")),t.deepHistoryStates=t.states.filter(R.isType("deephistory")),t.choiceStates=t.states.filter(R.isType("choice")),t.forkjoinStates=t.states.filter(R.isOneOfTypes(["fork","join","forkjoin"])),t.junctionStates=t.states.filter(R.isType("junction")),t.terminateStates=t.states.filter(R.isType("terminate")),t.finalStates=t.states.filter(R.isType("final")),t.compositeStates=t.states.filter(e=>e.statemachine),t}function Wo(t){return e=>(t.findStateByName(e.from).statemachine&&(e.fromComposite=!0),t.findStateByName(e.to).statemachine&&(e.toComposite=!0),e)}function Yo(t){return e=>{let n={};return z.isCompositeSelf(t,e)&&(t.findStateByName(e.from).hasParent?n={hasParent:!0,isCompositeSelf:!0}:n={isCompositeSelf:!0}),F(F({},e),n)}}function Zo(t){return t.name=`tr_${t.from}_${t.to}_${Un.nextAsString()}`,Boolean(t.note)&&(t.noteName=`note_${t.name}`),t}function Ko(t,e){return t.flattenedTransitions.map(Zo).map(Pe.escapeTransitionStrings).map(Pe.classifyTransition).map(R.flattenNote).map(Wo(t)).map(Yo(t)).map(Pe.addPorts(e))}var Ce=(t,e)=>{e=e||{},Un=new Oe;let n=(0,Ln.default)(t),d=new D(n);return n.transitions=Ko(d,e.direction),n.states=Gn(n.states,e.direction,e.dotNodeAttrs,d),n=Qo(n),n.graphAttributes=we.buildGraphAttributes(H.getOptionValue(e,"engine"),H.getOptionValue(e,"direction"),e.dotGraphAttrs),n.nodeAttributes=we.buildNodeAttributes(e.dotNodeAttrs),n.edgeAttributes=we.buildEdgeAttributes(e.dotEdgeAttrs),(0,zn.default)(n)};var Xn=B(require("viz.js"));var es={oldsvg:"svg",oldps2:"ps2",oldeps:"eps"},Qe=(t,e)=>(0,Xn.default)(Ce(t,e),{engine:H.getOptionValue(e,"engine"),format:es[H.getOptionValue(e,"outputType")]||"svg"});var ts=/[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,ns=/[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;function Jn(t){return t.replace(ts,"_")}function ls(t){let e=Jn(t);return e.match(ns)&&(e=`_${t}`),e}var Ee=t=>(t=t||"",t.length===0?"__empty":ls(t[0]).concat(Jn(t.slice(1))));var as=/[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g,rs=/[.]/g;function Qn(t){return t.replace(as,"_")}function os(t){let e=Qn(t);return e.match(rs)&&(e=`_${t}`),e}function ss(t){return t=t.replace(/\s+/g," ").trim(),os(t[0]).concat(Qn(t.slice(1)))}var Wn=t=>(t=t||"",t.length===0?"empty":t.split(/[\n\r]+/).filter(e=>e.length>0).map(ss).join(" "));var is={regular:"state",initial:"initial",final:"final",terminate:"final",parallel:"parallel",history:"history",deephistory:"history"};function cs(t){return is[t]||"state"}function us(t){let e={target:Ee(t.to)};return Boolean(t.event)&&(e.event=Wn(t.event)),Boolean(t.cond)&&(e.cond=t.cond),Boolean(t.action)&&(e.action=t.action),Boolean(t.type)&&(e.type=t.type),e}function fs(t,e){return t.filter(n=>n.type===e).map(n=>n.body)}function We(t,e,n,d){let a=fs(n,d);a.length>0&&(t[e]=(t[e]||[]).concat(a))}function ms(t,e){Boolean(e.actions)&&(We(t,"onentries",e.actions,"entry"),We(t,"onentries",e.actions,"activity"),We(t,"onexits",e.actions,"exit"))}function ps(t,e,n){let d=n.filter(a=>a.from===e.name).map(us);d.length>0&&(t.transitions=d)}function ds(t,e,n){if(Boolean(e.statemachine)){let d=ae(e.statemachine,null,n);t.states=(t.states||[]).concat(d.states),d.initial&&(t.initial=d.initial)}}function hs(t){return t=t||[],e=>{let n={kind:cs(e.type),id:Ee(e.name)};return e.type==="deephistory"&&(n.type="deep"),ms(n,e),ps(n,e,t),ds(n,e,t),n}}function gs(t){let e=null,n=t.states.filter(d=>d.type==="initial");return n.length>0&&(e=n[0].name),e}function ys(t,e){let n=e;if(e&&t.transitions){let d=t.transitions.filter(a=>a.from===e);d.length>0&&!d[0].action&&(n=d[0].to)}return n}function ae(t,e,n){let d=gs(t),a=ys(t,d),o={states:t.states.filter(c=>a&&a!==d?c.type!=="initial":!0).map(hs(n||new D(t).flattenedTransitions))};return a&&(o.initial=Ee(a)),o}var tl=B(el());function et(t){return(0,tl.default)(ae(t))}function tt(t){let e={smcat:ll.default,dot:Ce,svg:Qe,oldsvg:Qe,scjson:ae,scxml:et};return(0,nl.default)(e,t)?e[t]:n=>n}var al="9.2.1";function rl(t,e){let n=En.getAST(t,e),d=H.getOptionValue(e,"desugar");return tt(H.getOptionValue(e,"outputType"))(d?Fn(n):n,e)}var ol=al;function sl(){return H.getAllowedValues()}var js={render:rl,version:ol,getAllowedValues:sl};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-machine-cat",
3
- "version": "9.0.1",
3
+ "version": "9.2.1",
4
4
  "description": "write beautiful state charts",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "module": "./src/index.mjs",
@@ -44,14 +44,14 @@
44
44
  "depcruise:view-report": "depcruise --output-type err-html --config config/dependency-cruiser.js --prefix vscode://file/$(pwd)/ src test bin | browser",
45
45
  "lint": "run-p --aggregate-output lint:eslint lint:prettier lint:types",
46
46
  "lint:eslint": "eslint --cache --cache-location .cache src test config",
47
- "lint:prettier": "prettier --check bin/*.mjs {src,test}/\\*\\*/\\*.{js,mjs} config/\\*\\*/\\*.{js,json} tools/*.{js,mjs,json} types/*.ts *.{json,yml,md} docs/{smcat-online-interpreter.js,*.md}",
47
+ "lint:prettier": "prettier --check bin/*.mjs {src,test}/**/*.{js,mjs} {config,test}/**/*.{js,json} tools/*.{js,mjs,json} types/*.ts *.{json,yml,md} docs/{smcat-online-interpreter.js,*.md}",
48
48
  "lint:types": "run-s lint:types:*",
49
- "lint:types:tsc": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters types/*.d.ts",
50
- "lint:types:tslint": "tslint types/*.d.ts",
49
+ "lint:types:tsc": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters types/state-machine-cat.d.ts",
50
+ "lint:types:eslint": "eslint types/*.d.ts",
51
51
  "lint:fix": "run-s lint:fix:eslint lint:fix:prettier lint:fix:types",
52
52
  "lint:fix:eslint": "eslint --cache --cache-location .cache --fix src test config",
53
- "lint:fix:prettier": "prettier --loglevel warn --write bin/*.mjs {src,test}/\\*\\*/\\*.{js,mjs} config/\\*\\*/\\*.{js,json} tools/*.{js,mjs,json} types/*.ts *.{json,yml,md} docs/{smcat-online-interpreter.js,*.md}",
54
- "lint:fix:types": "tslint --fix types/*.d.ts",
53
+ "lint:fix:prettier": "prettier --loglevel warn --write bin/*.mjs {src,test}/**/*.{js,mjs} {config,test}/**/*.{js,json} tools/*.{js,mjs,json} types/*.ts *.{json,yml,md} docs/{smcat-online-interpreter.js,*.md}",
54
+ "lint:fix:types": "eslint --fix types",
55
55
  "scm:push": "run-p --aggregate-output scm:push:*",
56
56
  "scm:push:github": "run-p --aggregate-output scm:push:github:*",
57
57
  "scm:push:github:commits": "git push",
@@ -84,18 +84,26 @@
84
84
  "LICENSE"
85
85
  ],
86
86
  "upem": {
87
- "donotup": [
87
+ "policies": [
88
88
  {
89
- "package": "viz.js",
90
- "because": "viz.js >=2 ditched its async interface, which we use. Will need some code reshuffling which is not worth it a.t.m."
89
+ "package": "eslint",
90
+ "policy": "wanted",
91
+ "because": "some plugins are not compatible with eslint 8 yet"
92
+ },
93
+ {
94
+ "package": "fast-xml-parser",
95
+ "policy": "wanted",
96
+ "because": "fast-xml-parser 4 is in beta (while using the 'latest' tag) and we prefer non-beta"
91
97
  },
92
98
  {
93
99
  "package": "husky",
100
+ "policy": "pin",
94
101
  "because": "(npm7 & husky don't play nice together - and it might be it's not going to be solved satisfactorily) https://github.com/typicode/husky/issues/822 "
95
102
  },
96
103
  {
97
- "package": "prettier",
98
- "because": "prettier 2.3.0 gives different results locally vs on the ci"
104
+ "package": "viz.js",
105
+ "policy": "pin",
106
+ "because": "viz.js >=2 ditched its async interface, which we use. Will need some code reshuffling which is not worth it a.t.m."
99
107
  }
100
108
  ]
101
109
  },
@@ -118,10 +126,10 @@
118
126
  "state-machine-cat": "bin/smcat.mjs"
119
127
  },
120
128
  "dependencies": {
121
- "ajv": "8.6.1",
122
- "chalk": "4.1.1",
123
- "commander": "8.0.0",
124
- "fast-xml-parser": "3.19.0",
129
+ "ajv": "8.8.2",
130
+ "chalk": "5.0.0",
131
+ "commander": "8.3.0",
132
+ "fast-xml-parser": "3.21.1",
125
133
  "get-stream": "6.0.1",
126
134
  "handlebars": "4.7.7",
127
135
  "he": "1.2.0",
@@ -131,39 +139,39 @@
131
139
  "lodash.get": "4.4.2",
132
140
  "lodash.has": "4.5.2",
133
141
  "lodash.reject": "4.6.0",
134
- "semver": "7.3.5",
142
+ "semver": "^7.3.5",
135
143
  "viz.js": "1.8.2",
136
- "wrap-ansi": "8.0.0"
144
+ "wrap-ansi": "8.0.1"
137
145
  },
138
146
  "devDependencies": {
139
- "c8": "7.7.3",
147
+ "@typescript-eslint/eslint-plugin": "5.4.0",
148
+ "@typescript-eslint/parser": "5.4.0",
149
+ "c8": "7.10.0",
140
150
  "chai": "4.3.4",
141
151
  "chai-as-promised": "7.1.1",
142
152
  "chai-json-schema": "1.5.1",
143
153
  "chai-xml": "0.4.0",
144
- "dependency-cruiser": "10.0.4",
145
- "esbuild": "0.12.15",
146
- "eslint": "7.30.0",
154
+ "dependency-cruiser": "11.0.0",
155
+ "esbuild": "0.14.0",
156
+ "eslint": "^7.32.0",
147
157
  "eslint-config-moving-meadow": "2.0.9",
148
158
  "eslint-config-prettier": "8.3.0",
149
- "eslint-plugin-budapestian": "2.3.0",
150
- "eslint-plugin-import": "2.23.4",
159
+ "eslint-plugin-budapestian": "3.0.1",
160
+ "eslint-plugin-import": "2.25.3",
151
161
  "eslint-plugin-mocha": "9.0.0",
152
162
  "eslint-plugin-node": "11.1.0",
153
163
  "eslint-plugin-security": "1.4.0",
154
- "eslint-plugin-unicorn": "34.0.1",
164
+ "eslint-plugin-unicorn": "39.0.0",
155
165
  "husky": "4.3.0",
156
- "lint-staged": "11.0.0",
157
- "mocha": "9.0.2",
166
+ "lint-staged": "12.1.2",
167
+ "mocha": "9.1.3",
158
168
  "npm-run-all": "4.1.5",
159
169
  "peggy": "1.2.0",
160
- "prettier": "2.2.1",
170
+ "prettier": "^2.5.0",
161
171
  "query-string": "7.0.1",
162
- "tslint": "6.1.3",
163
- "tslint-config-prettier": "1.18.0",
164
- "typescript": "4.3.5",
165
- "upem": "6.0.0",
166
- "xml-name-validator": "3.0.0"
172
+ "typescript": "4.5.2",
173
+ "upem": "^7.0.0",
174
+ "xml-name-validator": "4.0.0"
167
175
  },
168
176
  "eslintIgnore": [
169
177
  "coverage",
@@ -1,31 +1,36 @@
1
+ // seems eslint-plugin-import and eslint-plugin-node can't handle exports
2
+ // fields yet. No man overboard not checking against this, because dependency-cruiser
3
+ // will also find them
4
+ // eslint-disable-next-line import/no-unresolved, node/no-missing-import
1
5
  import chalk from "chalk";
2
6
  import indentString from "indent-string";
3
7
  import wrapAnsi from "wrap-ansi";
4
- import semver from "semver";
8
+ import dotToVectorNative from "../render/vector/dot-to-vector-native.mjs";
5
9
 
6
10
  function wrapAndIndent(pString) {
7
11
  const lDogmaticMaxConsoleWidth = 78;
8
12
  const lDefaultIndent = 2;
9
13
 
10
- const MAX_WIDTH = lDogmaticMaxConsoleWidth - lDefaultIndent;
14
+ const lMaxWidth = lDogmaticMaxConsoleWidth - lDefaultIndent;
11
15
 
12
- return indentString(wrapAnsi(pString, MAX_WIDTH), lDefaultIndent);
16
+ return indentString(wrapAnsi(pString, lMaxWidth), lDefaultIndent);
13
17
  }
14
18
 
15
- export default (pNodeVersion) => {
19
+ export default (pDotIsAvailable = dotToVectorNative.isAvailable({})) => {
16
20
  const lDescription =
17
21
  "Write beautiful state charts - https://github.com/sverweij/state-machine-cat";
18
22
  const lNode12Warning =
19
- "When you output svg on node >=12, you might see " +
23
+ "When you want to output svg and the native GraphViz isn't installed, " +
24
+ "state-machine-cat will fall back to viz.js and you might see " +
20
25
  `${chalk.italic(
21
26
  "'Invalid asm.js: Function definition doesn't match use'"
22
27
  )}. ` +
23
- "It's harmless. See " +
24
- `https://github.com/sverweij/state-machine-cat/blob/develop/docs/faq.md#q-im-on-node-12-and-get-a-warning-when-i-convert-to-svg-with-the-cli-whats-up`;
28
+ "It's harmless and your svg will come out ok. See " +
29
+ `https://github.com/sverweij/state-machine-cat/blob/develop/docs/faq.md#viz`;
25
30
 
26
31
  return indentString(
27
- semver.satisfies(pNodeVersion, ">=12")
28
- ? `${lDescription}\n\n${wrapAndIndent(chalk.dim(lNode12Warning))}`
29
- : lDescription
32
+ pDotIsAvailable
33
+ ? lDescription
34
+ : `${lDescription}\n\n${wrapAndIndent(chalk.dim(lNode12Warning))}`
30
35
  );
31
36
  };
@@ -16,12 +16,28 @@ function extractActions(pState, pActionType) {
16
16
  }));
17
17
  }
18
18
 
19
+ function extractActionsFromInvokes(pInvokeTriggers) {
20
+ return _castArray(pInvokeTriggers).map((pInvokeTrigger) => {
21
+ const lId = he.decode(pInvokeTrigger.id || "").trim();
22
+
23
+ return {
24
+ type: "activity",
25
+ body: lId || he.decode(pInvokeTrigger || "").trim(),
26
+ };
27
+ });
28
+ }
29
+
19
30
  function deriveActions(pState) {
20
31
  let lReturnValue = [];
21
32
 
22
33
  if (pState.onentry) {
23
34
  lReturnValue = lReturnValue.concat(extractActions(pState, "onentry"));
24
35
  }
36
+ if (pState.invoke) {
37
+ lReturnValue = lReturnValue.concat(
38
+ extractActionsFromInvokes(pState.invoke)
39
+ );
40
+ }
25
41
  if (pState.onexit) {
26
42
  lReturnValue = lReturnValue.concat(extractActions(pState, "onexit"));
27
43
  }
@@ -42,7 +58,7 @@ function mapState(pType) {
42
58
  if (parserHelpers.getStateType(pState.id) !== lReturnValue.type) {
43
59
  lReturnValue.typeExplicitlySet = true;
44
60
  }
45
- if (pState.onentry || pState.onexit) {
61
+ if (pState.onentry || pState.onexit || pState.invoke) {
46
62
  lReturnValue.actions = deriveActions(pState);
47
63
  }
48
64
  if (
@@ -17,7 +17,8 @@
17
17
  // The SCXML xsd doesn't seem to mention '*' (\u002A) as an allowed character. But
18
18
  // they _are_ used in event descriptors in the SCXML spec. So we've excluded
19
19
  // them from forbidden characters
20
- const EVENT_CHAR_FORBIDDEN_RE = /[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
20
+ const EVENT_CHAR_FORBIDDEN_RE =
21
+ /[\u00B7|\u0300-\u036F|\u203F-\u2040|\u0000-\u0029|\u002B-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
21
22
  const START_EVENT_CHAR_FORBIDDEN_EXTRA_RE = /[.]/g;
22
23
 
23
24
  function makeValidEventChar(pCandidateEventStringTail) {
@@ -13,8 +13,10 @@
13
13
  */
14
14
 
15
15
  /* eslint no-control-regex: 0, max-len: 0, no-misleading-character-class: 0 */
16
- const NAME_CHAR_FORBIDDEN_RE = /[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
17
- const START_NAME_CHAR_FORBIDDEN_EXTRA_RE = /[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;
16
+ const NAME_CHAR_FORBIDDEN_RE =
17
+ /[\u0000-\u002C|\u002F|\u003B-\u0040|\u005B-\u0060|\u007B-\u00BF|\u00D7|\u00F7|\u0300-\u036F|\u037E|\u2000-\u200B|\u200E-\u206F|\u2190-\u2BFF|\u2FF0-\u3000|\uD800-\uF8FF|\uFDD0-\uFDEF|\uFFFE-\uFFFF]/g;
18
+ const START_NAME_CHAR_FORBIDDEN_EXTRA_RE =
19
+ /[-|.|0-9|\u00B7|\u0300-\u036F|\u203F-\u2040]/g;
18
20
 
19
21
  function makeValidNameChars(pCandidateNameTail) {
20
22
  return pCandidateNameTail.replace(NAME_CHAR_FORBIDDEN_RE, "_");
@@ -1,6 +1,10 @@
1
1
  import dotToSvgJs from "viz.js";
2
2
  import indentString from "indent-string";
3
3
  import wrapAnsi from "wrap-ansi";
4
+ // seems eslint-plugin-import and eslint-plugin-node can't handle exports
5
+ // fields yet. No man overboard not checking against this, because dependency-cruiser
6
+ // will also find them
7
+ // eslint-disable-next-line import/no-unresolved, node/no-missing-import
4
8
  import chalk from "chalk";
5
9
  import options from "../../options.mjs";
6
10
  import ast2dot from "../dot/index.mjs";
@@ -40,5 +44,3 @@ export default (pAST, pOptions) => {
40
44
  return dotToSvgJs(lDotProgram, lDotOptions);
41
45
  }
42
46
  };
43
- // file deepcode ignore ExpectsObjectDislikesPrimitive: (false positive: deepcode erroneously stipulates the first argument of wrapansi should be an array, while it should be a string (as done here))
44
- // file deepcode ignore ExpectsArray: (false positive: deepcode erroneously stipulates the first argument of wrapansi should be an array, while it should be a string (as done here))
package/src/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "9.0.1";
1
+ export const version = "9.2.1";
@@ -44,6 +44,7 @@ export interface IState {
44
44
  /**
45
45
  * State machine nested within the state.
46
46
  */
47
+ // eslint-disable-next-line no-use-before-define
47
48
  statemachine?: IStateMachine;
48
49
  /**
49
50
  * If true the state is considered to be active and rendered as such.
@@ -144,6 +145,7 @@ export interface IStateMachine {
144
145
  *
145
146
  * @type {string}
146
147
  */
148
+ // eslint-disable-next-line init-declarations
147
149
  export const version: string;
148
150
 
149
151
  export interface IAllowedValue {
@@ -197,7 +199,7 @@ export type DirectionType =
197
199
  | "left-right"
198
200
  | "right-left";
199
201
 
200
- export type dotAttrsType = {
202
+ export type dotAttributesType = {
201
203
  name: string;
202
204
  value: string;
203
205
  }[];
@@ -223,15 +225,15 @@ export interface IRenderOptions {
223
225
  /**
224
226
  * For the 'dot' renderer: Graph attributes to the engine
225
227
  */
226
- dotGraphAttrs?: dotAttrsType;
228
+ dotGraphAttrs?: dotAttributesType;
227
229
  /**
228
230
  * For the 'dot' renderer: Node attributes to the engine
229
231
  */
230
- dotNodeAttrs?: dotAttrsType;
232
+ dotNodeAttrs?: dotAttributesType;
231
233
  /**
232
234
  * For the 'dot' renderer: Edge attributes to the engine
233
235
  */
234
- dotEdgeAttrs?: dotAttrsType;
236
+ dotEdgeAttrs?: dotAttributesType;
235
237
  /**
236
238
  * If true state machine cat will replace 'sugar' pseudo states
237
239
  * (choice, forks and junctions) with their equivalent meaning
package/CHANGELOG.md DELETED
@@ -1 +0,0 @@
1
- See [state-machine-cat releases](https://github.com/sverweij/state-machine-cat/releases) on GitHub