ompchamber 1.2.1 → 2.0.0
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 +131 -147
- package/dist/client/index.html +4 -2
- package/dist/client/static/css/index.5f630421b7.css +2 -0
- package/dist/client/static/js/77.0d81c74cf0.js +139 -0
- package/dist/client/static/js/async/1k.973e8e21fc.js +2 -0
- package/dist/client/static/js/async/{3y.3186ecdd63.js → 3y.3530b824ad.js} +6 -6
- package/dist/client/static/js/async/{q.b453193538.js → 4m.928a1dde85.js} +10 -10
- package/dist/client/static/js/async/66.5dfa29f957.js +93 -0
- package/dist/client/static/js/async/7g.a7814350c3.js +1 -0
- package/dist/client/static/js/async/ar.9303e5f2e8.js +2 -0
- package/dist/client/static/js/async/{cx.9c8268d542.js → cx.3cb0242a3a.js} +1 -1
- package/dist/client/static/js/async/e.93214d622b.js +79 -0
- package/dist/client/static/js/async/g.74ff36419f.js +2 -0
- package/dist/client/static/js/async/{m.2e1ea3db9e.js.LICENSE.txt → g.74ff36419f.js.LICENSE.txt} +5 -0
- package/dist/client/static/js/async/h1.393f066d09.js +1 -0
- package/dist/client/static/js/async/jl.874d352278.js +1 -0
- package/dist/client/static/js/async/{k.d16cd09ae7.js → k.3210286401.js} +1 -1
- package/dist/client/static/js/async/{m.2e1ea3db9e.js → m.eb2e6752e2.js} +3 -3
- package/dist/client/static/js/async/m.eb2e6752e2.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/mt.0352e976d8.js +1 -0
- package/dist/client/static/js/async/{oc.eb22093f05.js → oc.b73042e8bd.js} +1 -1
- package/dist/client/static/js/async/{og.53f068804c.js → og.8eb577893a.js} +1 -1
- package/dist/client/static/js/async/px.fc6877924b.js +1 -0
- package/dist/client/static/js/async/q.33d6779f98.js +21 -0
- package/dist/client/static/js/async/{q5.88b50ffa95.js → q5.97dc1481b6.js} +1 -1
- package/dist/client/static/js/async/s.0f395cdda5.js +94 -0
- package/dist/client/static/js/async/{tr.2a0d2b7600.js → tr.e878658140.js} +1 -1
- package/dist/client/static/js/async/vt.42416b707d.js +1 -0
- package/dist/client/static/js/async/x1.da8687159b.js +90 -0
- package/dist/client/static/js/async/xe.da8dcc2015.js +2 -0
- package/dist/client/static/js/async/xe.da8dcc2015.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{xn.6360379f71.js → xn.6510c0abe2.js} +2 -2
- package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
- package/dist/client/static/js/async/yv.d99d829136.js +1 -0
- package/dist/client/static/js/index.c05535dbde.js +38 -0
- package/package.json +3 -3
- package/src/client/components/common/ComposerTextarea.tsx +9 -1
- package/src/client/components/common/MarkdownRenderer.tsx +50 -12
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +9 -3
- package/src/client/components/settings/Modal.tsx +11 -2
- package/src/client/components/settings/categories/AppearanceSettings.tsx +7 -30
- package/src/client/components/settings/categories/ProviderSettings.tsx +2 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +61 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +80 -0
- package/src/client/components/settings/categories/chat-settings/TitleSection.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +43 -6
- package/src/client/components/settings/categories/provider-settings/ModelConfigModal.tsx +54 -54
- package/src/client/components/workspace/SearchPanel.tsx +16 -3
- package/src/client/components/workspace/btw-panel/AskCard.tsx +11 -6
- package/src/client/components/workspace/btw-panel/Messages.tsx +105 -51
- package/src/client/components/workspace/btw-panel/index.tsx +124 -45
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +30 -14
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +10 -1
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +8 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +27 -16
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +11 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +8 -0
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +12 -1
- package/src/client/components/workspace/chat-timeline/index.tsx +7 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +42 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +13 -4
- package/src/client/components/workspace/editor/index.tsx +11 -2
- package/src/client/components/workspace/file-explorer/GitRepoDropdown.tsx +15 -41
- package/src/client/components/workspace/file-explorer/index.tsx +86 -16
- package/src/client/components/workspace/git-panel/index.tsx +60 -78
- package/src/client/components/workspace/terminal-panel/Header.tsx +16 -1
- package/src/client/components/workspace/terminal-panel/RealtimeXtermView.tsx +5 -5
- package/src/client/components/workspace/terminal-panel/index.tsx +6 -2
- package/src/client/components/workspace/terminal-panel/mount.ts +2 -2
- package/src/client/data/theme/terminal.ts +50 -52
- package/src/client/hooks/chat/btw/index.ts +139 -18
- package/src/client/hooks/chat/btw/intercept.ts +8 -8
- package/src/client/hooks/chat/btw/mode.ts +111 -16
- package/src/client/hooks/chat/composer/index.ts +10 -4
- package/src/client/hooks/chat/timeline/access-mode.ts +41 -0
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +87 -0
- package/src/client/hooks/chat/timeline/ask-frames.ts +20 -1
- package/src/client/hooks/chat/timeline/auto-scroll.ts +13 -4
- package/src/client/hooks/chat/timeline/index.ts +8 -20
- package/src/client/hooks/chat/timeline/queue.ts +66 -9
- package/src/client/hooks/chat/timeline/scroll.test.ts +260 -0
- package/src/client/hooks/chat/timeline/scroll.ts +93 -20
- package/src/client/hooks/chat/timeline/session-load.ts +7 -1
- package/src/client/hooks/chat/timeline/session-pagination.test.ts +167 -0
- package/src/client/hooks/chat/timeline/session-pagination.ts +37 -11
- package/src/client/hooks/settings/providers.ts +34 -3
- package/src/client/hooks/ui/open-file.ts +7 -1
- package/src/client/hooks/ui/theme.ts +82 -57
- package/src/client/hooks/workspace/file-tabs.ts +5 -1
- package/src/client/hooks/workspace/repo-scope/index.ts +119 -0
- package/src/client/hooks/workspace/repo-scope/store.test.ts +161 -0
- package/src/client/hooks/workspace/repo-scope/store.ts +201 -0
- package/src/client/hooks/workspace/search-stream.ts +24 -5
- package/src/client/main.tsx +6 -0
- package/src/client/tailwind.css +19 -56
- package/src/server/lib/btw/child.server.ts +41 -0
- package/src/server/lib/btw/lifecycle.server.ts +254 -0
- package/src/server/lib/btw/prompt.ts +13 -5
- package/src/server/lib/btw/registry.server.ts +13 -4
- package/src/server/lib/btw/runtime.server.ts +149 -156
- package/src/server/lib/btw/schema.server.ts +27 -0
- package/src/server/lib/btw/service.server.ts +106 -5
- package/src/server/lib/btw/store.server.ts +57 -6
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/db/settings-store.test.ts +65 -0
- package/src/server/lib/db/settings-store.ts +25 -0
- package/src/server/lib/fs/atomic-write.ts +42 -4
- package/src/server/lib/fs/config-lock.ts +74 -0
- package/src/server/lib/fs/git-ignore.ts +55 -5
- package/src/server/lib/fs/ripgrep.ts +119 -0
- package/src/server/lib/lifecycle/identity.ts +10 -64
- package/src/server/lib/lifecycle/proc/darwin.ts +238 -0
- package/src/server/lib/lifecycle/proc/index.ts +38 -0
- package/src/server/lib/lifecycle/proc/linux.ts +80 -0
- package/src/server/lib/lifecycle/proc/ps.ts +86 -0
- package/src/server/lib/lifecycle/proc/types.ts +33 -0
- package/src/server/lib/lifecycle/proc/win32.ts +53 -0
- package/src/server/lib/models/provider-registry.server.ts +2 -2
- package/src/server/lib/models/registry.server.ts +1 -1
- package/src/server/lib/omp/config/behavior.ts +17 -17
- package/src/server/lib/omp/config/disabled-providers.ts +84 -35
- package/src/server/lib/omp/config/document.ts +128 -0
- package/src/server/lib/omp/config/extensions.ts +11 -10
- package/src/server/lib/omp/config/mcp.ts +4 -57
- package/src/server/lib/omp/config/model-overrides.ts +123 -0
- package/src/server/lib/omp/config/models-config.ts +92 -0
- package/src/server/lib/omp/config/models-validation.ts +159 -0
- package/src/server/lib/omp/config/path-scoped.ts +74 -0
- package/src/server/lib/omp/config/providers.ts +241 -211
- package/src/server/lib/omp/config/roles.ts +6 -14
- package/src/server/lib/omp/core/auth-credentials.ts +1 -1
- package/src/server/lib/omp/rpc/frame-fold.test.ts +124 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +43 -24
- package/src/server/lib/omp/rpc/lifecycle.test.ts +41 -0
- package/src/server/lib/omp/rpc/manager.ts +21 -21
- package/src/server/lib/omp/rpc/pending-ui-dialogs.ts +11 -7
- package/src/server/lib/omp/rpc/session-commands.ts +17 -29
- package/src/server/lib/omp/rpc/session-registry.ts +5 -66
- package/src/server/lib/omp/rpc/web-state.ts +0 -6
- package/src/server/lib/omp/session/auto-title.server.test.ts +109 -11
- package/src/server/lib/omp/session/auto-title.server.ts +95 -20
- package/src/server/lib/omp/session/sidebar-data.server.ts +11 -6
- package/src/server/lib/queue/delivery-dispatch.server.test.ts +162 -0
- package/src/server/lib/queue/delivery-harness.ts +88 -0
- package/src/server/lib/queue/delivery.server.test.ts +78 -149
- package/src/server/lib/queue/delivery.server.ts +105 -13
- package/src/server/lib/queue/store.server.ts +30 -5
- package/src/server/lib/terminal/foreground.test.ts +164 -0
- package/src/server/lib/terminal/foreground.ts +34 -6
- package/src/server/lib/terminal/history.ts +8 -7
- package/src/server/plugins/compress.ts +33 -5
- package/src/server/plugins/ssr.ts +14 -7
- package/src/server/routes/btw/topics.ts +89 -2
- package/src/server/routes/fs/git.ts +5 -6
- package/src/server/routes/fs/search.ts +17 -26
- package/src/server/routes/sessions/queue.ts +17 -4
- package/src/server/routes/settings/index.ts +2 -0
- package/src/server/routes/settings/model-override.ts +69 -0
- package/src/server/routes/settings/provider-models.ts +35 -12
- package/src/server/routes/settings/providers.ts +31 -1
- package/src/server/routes/settings/root.ts +8 -3
- package/src/shared/lib/chat/btw/client.ts +34 -0
- package/src/shared/lib/chat/timeline/tool-phrases.ts +7 -0
- package/src/shared/lib/code/shiki-themes.ts +9 -5
- package/src/shared/lib/fs/file-tree.ts +17 -12
- package/src/shared/lib/markdown/autolink.test.ts +32 -0
- package/src/shared/lib/markdown/autolink.ts +50 -0
- package/src/shared/lib/markdown/document-urls.test.ts +68 -0
- package/src/shared/lib/markdown/document-urls.ts +118 -0
- package/src/shared/lib/markdown/marked.ts +27 -15
- package/src/shared/lib/markdown/mermaid.ts +2 -2
- package/src/shared/lib/models/catalog.ts +1 -1
- package/src/shared/lib/omp/session/schema-migrations.ts +30 -0
- package/src/shared/lib/omp/session/stream-state.server.test.ts +54 -0
- package/src/shared/lib/omp/session/stream-state.server.ts +70 -21
- package/src/shared/lib/settings/client.ts +10 -4
- package/src/shared/lib/settings/diff.test.ts +31 -0
- package/src/shared/lib/settings/diff.ts +37 -0
- package/src/shared/lib/theme/catalog.test.ts +168 -0
- package/src/shared/lib/theme/catalog.ts +98 -0
- package/src/shared/lib/theme/color.ts +88 -0
- package/src/shared/lib/theme/css.ts +70 -0
- package/src/shared/lib/theme/palettes/chamber.ts +61 -0
- package/src/shared/lib/theme/palettes/dark.ts +313 -0
- package/src/shared/lib/theme/palettes/light.ts +313 -0
- package/src/shared/types/btw.ts +83 -4
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/provider.ts +8 -1
- package/src/shared/types/settings/state.ts +10 -4
- package/src/shared/types/theme.ts +48 -0
- package/dist/client/static/css/index.b938f4a693.css +0 -2
- package/dist/client/static/js/77.8022a800b5.js +0 -139
- package/dist/client/static/js/async/1k.a411fe5b43.js +0 -2
- package/dist/client/static/js/async/66.86544ad741.js +0 -93
- package/dist/client/static/js/async/7g.db82aca7ba.js +0 -1
- package/dist/client/static/js/async/ar.ad5c8822a8.js +0 -2
- package/dist/client/static/js/async/e.6443e739a2.js +0 -79
- package/dist/client/static/js/async/g.ee41bfed7f.js +0 -2
- package/dist/client/static/js/async/h1.d7091cef78.js +0 -1
- package/dist/client/static/js/async/jl.4911fa3383.js +0 -1
- package/dist/client/static/js/async/mt.853be2b5aa.js +0 -1
- package/dist/client/static/js/async/ot.84c71b308f.js +0 -2
- package/dist/client/static/js/async/px.783b6f91f2.js +0 -1
- package/dist/client/static/js/async/q8.7f1b48e9cd.js +0 -21
- package/dist/client/static/js/async/q8.7f1b48e9cd.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/s.aad2ecebc6.js +0 -94
- package/dist/client/static/js/async/vt.20406a5604.js +0 -1
- package/dist/client/static/js/async/x1.fe8af17016.js +0 -90
- package/dist/client/static/js/async/xn.6360379f71.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/yg.5a94e1fc8a.js +0 -149
- package/dist/client/static/js/async/yv.2fa22f009a.js +0 -1
- package/dist/client/static/js/index.5fe7a2cb64.js +0 -34
- package/src/client/components/workspace/btw-panel/Composer.tsx +0 -183
- package/src/client/components/workspace/btw-panel/attachments.ts +0 -80
- /package/dist/client/static/js/{77.8022a800b5.js.LICENSE.txt → 77.0d81c74cf0.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{g.ee41bfed7f.js.LICENSE.txt → 1k.973e8e21fc.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3y.3186ecdd63.js.LICENSE.txt → 3y.3530b824ad.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ot.84c71b308f.js.LICENSE.txt → 4m.928a1dde85.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{q.b453193538.js.LICENSE.txt → ar.9303e5f2e8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{1k.a411fe5b43.js.LICENSE.txt → q.33d6779f98.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ar.ad5c8822a8.js.LICENSE.txt → xn.6510c0abe2.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{index.5fe7a2cb64.js.LICENSE.txt → index.c05535dbde.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["q5"],{v0(t,e,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((t,e)=>{let s=t.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),e.name&&s.attr("name",e.name),e.rx&&s.attr("rx",e.rx),e.ry&&s.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)s.attr(t,e.attrs[t]);return e.class&&s.attr("class",e.class),s},"drawRect"),l=(0,r.K)((t,e)=>{o(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),c=(0,r.K)((t,e)=>{let s=e.text.replace(i.H1," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);let a=r.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(s),r},"drawText"),h=(0,r.K)((t,e,s,i)=>{let r=t.append("image");r.attr("x",e),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),d=(0,r.K)((t,e,s,i)=>{let r=t.append("use");r.attr("x",e),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),u=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),y=(0,r.K)(()=>{let t=(0,n.Ltv)(".mermaidTooltip");return t.empty()&&(t=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip");s.d(e,{CP:()=>d,Ck:()=>y,HT:()=>p,PB:()=>u,aC:()=>h,lC:()=>l,m:()=>c,tk:()=>o})},WJ(t,e,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((t,e,s,a)=>{t.attr("class",s);let{width:n,height:c,x:h,y:d}=o(t,e);(0,i.a$)(t,c,n,a);let u=l(h,d,n,c,e);t.attr("viewBox",u),r.R.debug(`viewBox configured: ${u} with padding: ${e}`)},"setupViewPortForSVG"),o=(0,a.K)((t,e)=>{let s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`,"createViewBox");s.d(e,{P:()=>n})},OT(t,e,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((t,e)=>{let s;return"sandbox"===e&&(s=(0,r.Ltv)("#i"+t)),("sandbox"===e?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement");s.d(e,{A:()=>a})},QP(t,e,s){var i=s("OT"),r=s("WJ"),a=s("mW");s("Q");var n=s("v0");s("ix"),s("LC"),s("bQ1"),s("Ut"),s("PF"),s("iV"),s("h5");var o=s("pK"),l=s("NH"),c=s("Yr"),h=s("M4"),d=s("Gt"),u=s("El"),p=s("L"),y=function(){var t=(0,d.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],r=[2,4],a=[1,9],n=[1,11],o=[1,16],l=[1,17],c=[1,18],h=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],x=[1,31],E=[1,32],$=[1,35],D=[1,36],v=[1,37],C=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R={trace:(0,d.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,d.K)(function(t,e,s,i,r,a,n){var o=a.length-1;switch(r){case 3:return i.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:case 12:this.$=a[o];break;case 8:this.$="nl";break;case 13:let l=a[o-1];l.description=i.trimColon(a[o]),this.$=l;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:let c=i.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:c};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var h=a[o],d=a[o-2].trim();if(a[o].match(":")){var u=a[o].split(":");h=u[0],d=[d,u[1]]}this.$={stmt:"state",id:h,type:"default",description:d};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 29:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:a[o-3],url:a[o-2],tooltip:a[o-1]};break;case 33:this.$={stmt:"click",id:a[o-3],url:a[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 36:this.$={stmt:"style",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 37:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,72],22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,r,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,81],22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:(0,d.K)(function(t,e){if(e.recoverable)this.trace(t);else{var s=Error(t);throw s.hash=e,s}},"parseError"),parse:(0,d.K)(function(t){var e=this,s=[0],i=[],r=[null],a=[],n=this.table,o="",l=0,c=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y[g]=this.yy[g]);p.setInput(t,y),y.lexer=p,y.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var m=p.options&&p.options.ranges;function S(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.parseError?this.parseError=y.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,d.K)(function(t){s.length=s.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),(0,d.K)(S,"lex");for(var k,b,T,_,x,E,$,D,v,C={};;){if(T=s[s.length-1],this.defaultActions[T]?_=this.defaultActions[T]:(null==k&&(k=S()),_=n[T]&&n[T][k]),void 0===_||!_.length||!_[0]){var w="";for(E in v=[],n[T])this.terminals_[E]&&E>2&&v.push("'"+this.terminals_[E]+"'");w=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(w,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:f,expected:v})}if(_[0]instanceof Array&&_.length>1)throw Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(_[0]){case 1:s.push(k),r.push(p.yytext),a.push(p.yylloc),s.push(_[1]),k=null,b?(k=b,b=null):(c=p.yyleng,o=p.yytext,l=p.yylineno,f=p.yylloc,h>0&&h--);break;case 2:if($=this.productions_[_[1]][1],C.$=r[r.length-$],C._$={first_line:a[a.length-($||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-($||1)].first_column,last_column:a[a.length-1].last_column},m&&(C._$.range=[a[a.length-($||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[o,c,l,y,_[1],r,a].concat(u))))return x;$&&(s=s.slice(0,-1*$*2),r=r.slice(0,-1*$),a=a.slice(0,-1*$)),s.push(this.productions_[_[1]][0]),r.push(C.$),a.push(C._$),D=n[s[s.length-2]][s[s.length-1]],s.push(D);break;case 3:return!0}}return!0},"parse")};function N(){this.yy={}}return R.lexer={EOF:1,parseError:(0,d.K)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,d.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,d.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,d.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,d.K)(function(){return this._more=!0,this},"more"),reject:(0,d.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,d.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,d.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,d.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,d.K)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,d.K)(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var a in r)this[a]=r[a];return!1},"test_match"),next:(0,d.K)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,r=this._currentRules(),a=0;a<r.length;a++)if((s=this._input.match(this.rules[r[a]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[a])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,d.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,d.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,d.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,d.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,d.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,d.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,d.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,d.K)(function(t,e,s,i){function r(){let s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){let i=e.yytext.slice(0,s),r=e.yytext.slice(s);r&&t.lexer.unput(r),e.yytext=i}return!0}switch((0,d.K)(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}},(0,d.K)(N,"Parser"),N.prototype=R,R.Parser=N,new N}();y.parser=y;var g="TB",f="state",m="root",S="relation",k="default",b="divider",T="fill:none",_="fill: #333",x="markdown",E="normal",$="rect",D="rectWithTitle",v="divider",C="roundedWithTitle",w="statediagram",I=`${w}-state`,A="transition",L=`${A} note-edge`,R=`${w}-note`,N=`${w}-cluster`,K=`${w}-cluster-alt`,O="parent",B="note",F="----",P=`${F}${B}`,Y=`${F}${O}`,G=new Map,j=0,W=0,M=new Map,z=(0,d.K)((t,e,s,i)=>{if(t===v&&s?.id!==void 0&&M.has(s.id)){let t=M.get(s.id);return M.set(e,t),t}let r=W++,a=i?void 0:r;return M.set(e,a),a},"colorSlotFor");function U(t="",e=0,s="",i=F){let r=null!==s&&s.length>0?`${i}${s}`:"";return`state-${t}${r}-${e}`}(0,d.K)(U,"stateDomId");var H=(0,d.K)((t,e,s,i,r,a,n,o)=>{h.R.trace("items",e),e.forEach(e=>{switch(e.stmt){case f:case k:Q(t,e,s,i,r,a,n,o);break;case S:{Q(t,e.state1,s,i,r,a,n,o),Q(t,e.state2,s,i,r,a,n,o);let l="neo"===n,h={id:"edge"+j,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:l?"arrow_barb_neo":"arrow_barb",style:T,labelStyle:"",label:c.Y2.sanitizeText(e.description??"",(0,c.D7)()),arrowheadStyle:_,labelpos:"c",labelType:x,thickness:E,classes:A,look:n};r.push(h),j++}}})},"setupDoc"),V=(0,d.K)((t,e=g)=>{let s=e;if(t.doc)for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function X(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{let i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));let i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function J(t){return t?.classes?.join(" ")??""}function q(t){return t?.styles??[]}(0,d.K)(X,"insertOrUpdateNode"),(0,d.K)(J,"getClassesFromDbInfo"),(0,d.K)(q,"getStylesFromDbInfo");var Q=(0,d.K)((t,e,s,i,r,a,n,o)=>{let l=e.id,d=s.get(l),u=J(d),p=q(d),y=(0,c.D7)(),g=""!==u.trim()||p.length>0;if(h.R.info("dataFetcher parsedItem",e,d,p),"root"!==l){let s=$;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==k&&(s=e.type),G.get(l)||G.set(l,{id:l,shape:s,description:c.Y2.sanitizeText(l,y),cssClasses:`${u} ${I}`,cssStyles:p});let d=G.get(l);e.description&&(Array.isArray(d.description)?(d.shape=D,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=D,d.description===l?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=$,d.description=e.description),d.description=c.Y2.sanitizeTextOrArray(d.description,y)),d.description?.length===1&&d.shape===D&&("group"===d.type?d.shape=C:d.shape=$),!d.type&&e.doc&&(h.R.info("Setting cluster for XCX",l,V(e)),d.type="group",d.isGroup=!0,d.dir=V(e),d.shape=e.type===b?v:C,d.colorIndex=z(d.shape,l,t,g),d.cssClasses=`${d.cssClasses} ${N} ${a?K:""}`);let f={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:l,dir:d.dir,domId:U(l,j),type:d.type,isGroup:"group"===d.type,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:n,labelType:"markdown"};if(f.shape===v&&(f.label=""),t&&"root"!==t.id&&(h.R.trace("Setting node ",l," to be child of its parent ",t.id),f.parentId=t.id),f.centerLabel=!0,e.note){let t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:R,cssStyles:[],cssCompiledStyles:[],id:l+P+"-"+j,domId:U(l,j,B),type:"node",isGroup:!1,padding:y.flowchart?.padding,look:n,position:e.note.position},s=l+Y,a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:l+Y,domId:U(l,j,O),type:"group",isGroup:!0,padding:16,look:n,position:e.note.position};j++,a.id=s,t.parentId=s,X(i,a,o),X(i,t,o),X(i,f,o);let c=l,h=t.id;"left of"===e.note.position&&(c=t.id,h=l),r.push({id:c+"-"+h,start:c,end:h,arrowhead:"none",arrowTypeEnd:"",style:T,labelStyle:"",classes:L,pattern:"dashed",arrowheadStyle:_,labelpos:"c",labelType:x,thickness:E,look:n})}else X(i,f,o)}e.doc&&(h.R.trace("Adding nodes children "),H(e,e.doc,s,i,r,!a,n,o))},"dataFetcher"),Z=(0,d.K)(()=>{G.clear(),j=0,W=0,M.clear()},"reset"),tt=(0,d.K)((t,e=g)=>{if(!t.doc)return e;let s=e;for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),te=(0,d.K)(function(t,e){return e.db.getClasses()},"getClasses"),ts=(0,d.K)(async function(t,e,s,n){h.R.info("REF0:"),h.R.info("Drawing state diagram (v2)",e);let{securityLevel:o,state:d,layout:u}=(0,c.D7)();n.db.extract(n.db.getRootDocV2());let p=n.db.getData(),y=(0,i.A)(e,o);p.type=n.type,p.layoutAlgorithm=(0,a.q7)(u),p.nodeSpacing=d?.nodeSpacing||50,p.rankSpacing=d?.rankSpacing||50,"neo"===(0,c.D7)().look?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await (0,a.XX)(p,y);try{("function"==typeof n.db.getLinks?n.db.getLinks():new Map).forEach((t,e)=>{let s,i="string"==typeof e?e:"string"==typeof e?.id?e.id:"",r=p.nodes.find(t=>t.id===i);if(!i)return void h.R.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));let a=y.node()?.querySelectorAll("g.node, g.rough-node");if(a?.forEach(t=>{let e=t.textContent?.trim();(t.id===r?.domId||e===i)&&(s=t)}),!s)return void h.R.warn("⚠️ Could not find node matching text:",i);let n=s.parentNode;if(!n)return void h.R.warn("⚠️ Node has no parent, cannot wrap:",i);let o=document.createElementNS("http://www.w3.org/2000/svg","a"),l=t.url.replace(/^"+|"+$/g,"");if(o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l),o.setAttribute("target","_blank"),t.tooltip){let e=t.tooltip.replace(/^"+|"+$/g,"");o.setAttribute("title",e),s.setAttribute("title",e)}n.replaceChild(o,s),o.appendChild(s),h.R.info("🔗 Wrapped node in <a> tag for:",i,t.url)})}catch(t){h.R.error("❌ Error injecting clickable links:",t)}l._K.insertTitle(y,"statediagramTitleText",d?.titleTopMargin??25,n.db.getDiagramTitle()),(0,r.P)(y,8,w,d?.useMaxWidth??!0)},"draw"),ti="start",tr="color",ta="fill",tn=(0,d.K)(()=>new Map,"newClassesList"),to=(0,d.K)(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),tl=(0,d.K)(t=>JSON.parse(JSON.stringify(t)),"clone"),tc=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=tn(),this.documents={root:to()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=c.iN,this.setAccTitle=c.SV,this.getAccDescription=c.m7,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getDiagramTitle=c.ab,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{(0,d.K)(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){for(let e of(this.clear(!0),Array.isArray(t)?t:t.doc))switch(e.stmt){case f:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case S:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}let e=this.getStates(),s=(0,c.D7)();for(let t of(Z(),Q(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes),this.nodes))if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){let e=t.id.trim().split(","),s=t.styleClass.split(",");for(let t of e){let e=this.getState(t);if(!e){let s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){h.R.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===S){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===f&&("[*]"===e.id?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==m&&e.stmt!==f||!e.doc)return;let i=[],r=[];for(let t of e.doc)if(t.type===b){let e=tl(t);e.doc=tl(r),i.push(e),r=[]}else r.push(t);if(i.length>0&&r.length>0){let t={stmt:f,id:(0,l.$C)(),type:"divider",doc:tl(r)};i.push(tl(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:m,stmt:m},{id:m,stmt:m,doc:this.rootDoc},!0),{id:m,doc:this.rootDoc}}addState(t,e=k,s,i,r,a,n,o){let l=t?.trim();if(this.currentDocument.states.has(l)){let t=this.currentDocument.states.get(l);if(!t)throw Error(`State not found: ${l}`);t.doc||(t.doc=s),t.type||(t.type=e)}else h.R.info("Adding state ",l,i),this.currentDocument.states.set(l,{stmt:f,id:l,descriptions:[],type:e,doc:s,note:r,classes:[],styles:[],textStyles:[]});if(i&&(h.R.info("Setting state description",l,i),(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(l,t.trim()))),r){let t=this.currentDocument.states.get(l);if(!t)throw Error(`State not found: ${l}`);t.note=r,t.note.text=c.Y2.sanitizeText(t.note.text,(0,c.D7)())}a&&(h.R.info("Setting state classes",l,a),(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(l,t.trim()))),n&&(h.R.info("Setting state styles",l,n),(Array.isArray(n)?n:[n]).forEach(t=>this.setStyle(l,t.trim()))),o&&(h.R.info("Setting state styles",l,n),(Array.isArray(o)?o:[o]).forEach(t=>this.setTextStyle(l,t.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:to()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=tn(),t||(this.links=new Map,(0,c.IU)())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){h.R.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),h.R.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return"[*]"===t?(this.startEndCount++,`${ti}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=k){return"[*]"===t?ti:e}endIdIfNeeded(t=""){return"[*]"===t?(this.startEndCount++,`end${this.startEndCount}`):t}endTypeIfNeeded(t="",e=k){return"[*]"===t?"end":e}addRelationObjs(t,e,s=""){let i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),n=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,n,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:c.Y2.sanitizeText(s,(0,c.D7)())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){let i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),n=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(a,n),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:s?c.Y2.sanitizeText(s,(0,c.D7)()):void 0})}}addDescription(t,e){let s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(c.Y2.sanitizeText(i,(0,c.D7)()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let s=this.classes.get(t);e&&s&&e.split(",").forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(tr).exec(t)){let t=e.replace(ta,"bgFill").replace(tr,ta);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){let e=(0,n.Ck)();(0,u.Ltv)(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{let s=(0,u.Ltv)(t.currentTarget),i=s.attr("title");if(null===i)return;let r=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),e.html(p.A.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),(0,u.Ltv)(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){let e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){let e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=(0,c.D7)();for(let e of this.nodes)e.wrappingWidth??=t.state?.wrappingWidth,e.isGroup||(e.minWidth??=t.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:tt(this.getRootDocV2())}}getConfig(){return(0,c.D7)().state}},th=(0,d.K)(t=>{let{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!(0,o.P1)(e,i))return"";let r=(0,o.rq)(t.look),a=(0,o.Ic)(s),n="";for(let t=0;t<(0,o.Hu)(i);t++){let e=i[t],o=a?`fill: ${s[t%s.length]};`:"",l=`[data-look="${r}"][data-color-id="color-${t}"]`;n+=`
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["q5"],{v0(t,e,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((t,e)=>{let s=t.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),e.name&&s.attr("name",e.name),e.rx&&s.attr("rx",e.rx),e.ry&&s.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)s.attr(t,e.attrs[t]);return e.class&&s.attr("class",e.class),s},"drawRect"),l=(0,r.K)((t,e)=>{o(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),c=(0,r.K)((t,e)=>{let s=e.text.replace(i.H1," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);let a=r.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(s),r},"drawText"),h=(0,r.K)((t,e,s,i)=>{let r=t.append("image");r.attr("x",e),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),d=(0,r.K)((t,e,s,i)=>{let r=t.append("use");r.attr("x",e),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),u=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),y=(0,r.K)(()=>{let t=(0,n.Ltv)(".mermaidTooltip");return t.empty()&&(t=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip");s.d(e,{CP:()=>d,Ck:()=>y,HT:()=>p,PB:()=>u,aC:()=>h,lC:()=>l,m:()=>c,tk:()=>o})},WJ(t,e,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((t,e,s,a)=>{t.attr("class",s);let{width:n,height:c,x:h,y:d}=o(t,e);(0,i.a$)(t,c,n,a);let u=l(h,d,n,c,e);t.attr("viewBox",u),r.R.debug(`viewBox configured: ${u} with padding: ${e}`)},"setupViewPortForSVG"),o=(0,a.K)((t,e)=>{let s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`,"createViewBox");s.d(e,{P:()=>n})},OT(t,e,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((t,e)=>{let s;return"sandbox"===e&&(s=(0,r.Ltv)("#i"+t)),("sandbox"===e?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement");s.d(e,{A:()=>a})},QP(t,e,s){var i=s("OT"),r=s("WJ"),a=s("mW");s("Q");var n=s("v0");s("ix"),s("LC"),s("bQ"),s("Ut"),s("PF"),s("iV"),s("h5");var o=s("pK"),l=s("NH"),c=s("Yr"),h=s("M4"),d=s("Gt"),u=s("El"),p=s("Lu"),y=function(){var t=(0,d.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],r=[2,4],a=[1,9],n=[1,11],o=[1,16],l=[1,17],c=[1,18],h=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],x=[1,31],E=[1,32],$=[1,35],D=[1,36],v=[1,37],C=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R={trace:(0,d.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,d.K)(function(t,e,s,i,r,a,n){var o=a.length-1;switch(r){case 3:return i.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:case 12:this.$=a[o];break;case 8:this.$="nl";break;case 13:let l=a[o-1];l.description=i.trimColon(a[o]),this.$=l;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:let c=i.trimColon(a[o]);this.$={stmt:"relation",state1:a[o-3],state2:a[o-1],description:c};break;case 19:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 20:var h=a[o],d=a[o-2].trim();if(a[o].match(":")){var u=a[o].split(":");h=u[0],d=[d,u[1]]}this.$={stmt:"state",id:h,type:"default",description:d};break;case 21:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 22:this.$={stmt:"state",id:a[o],type:"fork"};break;case 23:this.$={stmt:"state",id:a[o],type:"join"};break;case 24:this.$={stmt:"state",id:a[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 29:this.$=a[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:a[o-3],url:a[o-2],tooltip:a[o-1]};break;case 33:this.$={stmt:"click",id:a[o-3],url:a[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:a[o-1].trim(),classes:a[o].trim()};break;case 36:this.$={stmt:"style",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 37:this.$={stmt:"applyClass",id:a[o-1].trim(),styleClass:a[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:a[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:a[o-2].trim(),classes:[a[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:c,22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,72],22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,r,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:n,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:c,21:[1,81],22:h,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:$,52:D,53:v,54:C,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:(0,d.K)(function(t,e){if(e.recoverable)this.trace(t);else{var s=Error(t);throw s.hash=e,s}},"parseError"),parse:(0,d.K)(function(t){var e=this,s=[0],i=[],r=[null],a=[],n=this.table,o="",l=0,c=0,h=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y[g]=this.yy[g]);p.setInput(t,y),y.lexer=p,y.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;a.push(f);var m=p.options&&p.options.ranges;function S(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.parseError?this.parseError=y.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,d.K)(function(t){s.length=s.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),(0,d.K)(S,"lex");for(var k,b,T,_,x,E,$,D,v,C={};;){if(T=s[s.length-1],this.defaultActions[T]?_=this.defaultActions[T]:(null==k&&(k=S()),_=n[T]&&n[T][k]),void 0===_||!_.length||!_[0]){var w="";for(E in v=[],n[T])this.terminals_[E]&&E>2&&v.push("'"+this.terminals_[E]+"'");w=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(w,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:f,expected:v})}if(_[0]instanceof Array&&_.length>1)throw Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(_[0]){case 1:s.push(k),r.push(p.yytext),a.push(p.yylloc),s.push(_[1]),k=null,b?(k=b,b=null):(c=p.yyleng,o=p.yytext,l=p.yylineno,f=p.yylloc,h>0&&h--);break;case 2:if($=this.productions_[_[1]][1],C.$=r[r.length-$],C._$={first_line:a[a.length-($||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-($||1)].first_column,last_column:a[a.length-1].last_column},m&&(C._$.range=[a[a.length-($||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[o,c,l,y,_[1],r,a].concat(u))))return x;$&&(s=s.slice(0,-1*$*2),r=r.slice(0,-1*$),a=a.slice(0,-1*$)),s.push(this.productions_[_[1]][0]),r.push(C.$),a.push(C._$),D=n[s[s.length-2]][s[s.length-1]],s.push(D);break;case 3:return!0}}return!0},"parse")};function N(){this.yy={}}return R.lexer={EOF:1,parseError:(0,d.K)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,d.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,d.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,d.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,d.K)(function(){return this._more=!0,this},"more"),reject:(0,d.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,d.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,d.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,d.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,d.K)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,d.K)(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var a in r)this[a]=r[a];return!1},"test_match"),next:(0,d.K)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,r=this._currentRules(),a=0;a<r.length;a++)if((s=this._input.match(this.rules[r[a]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[a])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,d.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,d.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,d.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,d.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,d.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,d.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,d.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,d.K)(function(t,e,s,i){function r(){let s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){let i=e.yytext.slice(0,s),r=e.yytext.slice(s);r&&t.lexer.unput(r),e.yytext=i}return!0}switch((0,d.K)(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}},(0,d.K)(N,"Parser"),N.prototype=R,R.Parser=N,new N}();y.parser=y;var g="TB",f="state",m="root",S="relation",k="default",b="divider",T="fill:none",_="fill: #333",x="markdown",E="normal",$="rect",D="rectWithTitle",v="divider",C="roundedWithTitle",w="statediagram",I=`${w}-state`,A="transition",L=`${A} note-edge`,R=`${w}-note`,N=`${w}-cluster`,K=`${w}-cluster-alt`,O="parent",B="note",F="----",P=`${F}${B}`,Y=`${F}${O}`,G=new Map,j=0,W=0,M=new Map,z=(0,d.K)((t,e,s,i)=>{if(t===v&&s?.id!==void 0&&M.has(s.id)){let t=M.get(s.id);return M.set(e,t),t}let r=W++,a=i?void 0:r;return M.set(e,a),a},"colorSlotFor");function U(t="",e=0,s="",i=F){let r=null!==s&&s.length>0?`${i}${s}`:"";return`state-${t}${r}-${e}`}(0,d.K)(U,"stateDomId");var H=(0,d.K)((t,e,s,i,r,a,n,o)=>{h.R.trace("items",e),e.forEach(e=>{switch(e.stmt){case f:case k:Q(t,e,s,i,r,a,n,o);break;case S:{Q(t,e.state1,s,i,r,a,n,o),Q(t,e.state2,s,i,r,a,n,o);let l="neo"===n,h={id:"edge"+j,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:l?"arrow_barb_neo":"arrow_barb",style:T,labelStyle:"",label:c.Y2.sanitizeText(e.description??"",(0,c.D7)()),arrowheadStyle:_,labelpos:"c",labelType:x,thickness:E,classes:A,look:n};r.push(h),j++}}})},"setupDoc"),V=(0,d.K)((t,e=g)=>{let s=e;if(t.doc)for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function X(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{let i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));let i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function J(t){return t?.classes?.join(" ")??""}function q(t){return t?.styles??[]}(0,d.K)(X,"insertOrUpdateNode"),(0,d.K)(J,"getClassesFromDbInfo"),(0,d.K)(q,"getStylesFromDbInfo");var Q=(0,d.K)((t,e,s,i,r,a,n,o)=>{let l=e.id,d=s.get(l),u=J(d),p=q(d),y=(0,c.D7)(),g=""!==u.trim()||p.length>0;if(h.R.info("dataFetcher parsedItem",e,d,p),"root"!==l){let s=$;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==k&&(s=e.type),G.get(l)||G.set(l,{id:l,shape:s,description:c.Y2.sanitizeText(l,y),cssClasses:`${u} ${I}`,cssStyles:p});let d=G.get(l);e.description&&(Array.isArray(d.description)?(d.shape=D,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=D,d.description===l?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=$,d.description=e.description),d.description=c.Y2.sanitizeTextOrArray(d.description,y)),d.description?.length===1&&d.shape===D&&("group"===d.type?d.shape=C:d.shape=$),!d.type&&e.doc&&(h.R.info("Setting cluster for XCX",l,V(e)),d.type="group",d.isGroup=!0,d.dir=V(e),d.shape=e.type===b?v:C,d.colorIndex=z(d.shape,l,t,g),d.cssClasses=`${d.cssClasses} ${N} ${a?K:""}`);let f={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:l,dir:d.dir,domId:U(l,j),type:d.type,isGroup:"group"===d.type,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:n,labelType:"markdown"};if(f.shape===v&&(f.label=""),t&&"root"!==t.id&&(h.R.trace("Setting node ",l," to be child of its parent ",t.id),f.parentId=t.id),f.centerLabel=!0,e.note){let t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:R,cssStyles:[],cssCompiledStyles:[],id:l+P+"-"+j,domId:U(l,j,B),type:"node",isGroup:!1,padding:y.flowchart?.padding,look:n,position:e.note.position},s=l+Y,a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:l+Y,domId:U(l,j,O),type:"group",isGroup:!0,padding:16,look:n,position:e.note.position};j++,a.id=s,t.parentId=s,X(i,a,o),X(i,t,o),X(i,f,o);let c=l,h=t.id;"left of"===e.note.position&&(c=t.id,h=l),r.push({id:c+"-"+h,start:c,end:h,arrowhead:"none",arrowTypeEnd:"",style:T,labelStyle:"",classes:L,pattern:"dashed",arrowheadStyle:_,labelpos:"c",labelType:x,thickness:E,look:n})}else X(i,f,o)}e.doc&&(h.R.trace("Adding nodes children "),H(e,e.doc,s,i,r,!a,n,o))},"dataFetcher"),Z=(0,d.K)(()=>{G.clear(),j=0,W=0,M.clear()},"reset"),tt=(0,d.K)((t,e=g)=>{if(!t.doc)return e;let s=e;for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),te=(0,d.K)(function(t,e){return e.db.getClasses()},"getClasses"),ts=(0,d.K)(async function(t,e,s,n){h.R.info("REF0:"),h.R.info("Drawing state diagram (v2)",e);let{securityLevel:o,state:d,layout:u}=(0,c.D7)();n.db.extract(n.db.getRootDocV2());let p=n.db.getData(),y=(0,i.A)(e,o);p.type=n.type,p.layoutAlgorithm=(0,a.q7)(u),p.nodeSpacing=d?.nodeSpacing||50,p.rankSpacing=d?.rankSpacing||50,"neo"===(0,c.D7)().look?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await (0,a.XX)(p,y);try{("function"==typeof n.db.getLinks?n.db.getLinks():new Map).forEach((t,e)=>{let s,i="string"==typeof e?e:"string"==typeof e?.id?e.id:"",r=p.nodes.find(t=>t.id===i);if(!i)return void h.R.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));let a=y.node()?.querySelectorAll("g.node, g.rough-node");if(a?.forEach(t=>{let e=t.textContent?.trim();(t.id===r?.domId||e===i)&&(s=t)}),!s)return void h.R.warn("⚠️ Could not find node matching text:",i);let n=s.parentNode;if(!n)return void h.R.warn("⚠️ Node has no parent, cannot wrap:",i);let o=document.createElementNS("http://www.w3.org/2000/svg","a"),l=t.url.replace(/^"+|"+$/g,"");if(o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l),o.setAttribute("target","_blank"),t.tooltip){let e=t.tooltip.replace(/^"+|"+$/g,"");o.setAttribute("title",e),s.setAttribute("title",e)}n.replaceChild(o,s),o.appendChild(s),h.R.info("🔗 Wrapped node in <a> tag for:",i,t.url)})}catch(t){h.R.error("❌ Error injecting clickable links:",t)}l._K.insertTitle(y,"statediagramTitleText",d?.titleTopMargin??25,n.db.getDiagramTitle()),(0,r.P)(y,8,w,d?.useMaxWidth??!0)},"draw"),ti="start",tr="color",ta="fill",tn=(0,d.K)(()=>new Map,"newClassesList"),to=(0,d.K)(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),tl=(0,d.K)(t=>JSON.parse(JSON.stringify(t)),"clone"),tc=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=tn(),this.documents={root:to()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=c.iN,this.setAccTitle=c.SV,this.getAccDescription=c.m7,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getDiagramTitle=c.ab,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{(0,d.K)(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){for(let e of(this.clear(!0),Array.isArray(t)?t:t.doc))switch(e.stmt){case f:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case S:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}let e=this.getStates(),s=(0,c.D7)();for(let t of(Z(),Q(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes),this.nodes))if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){let e=t.id.trim().split(","),s=t.styleClass.split(",");for(let t of e){let e=this.getState(t);if(!e){let s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){h.R.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===S){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===f&&("[*]"===e.id?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==m&&e.stmt!==f||!e.doc)return;let i=[],r=[];for(let t of e.doc)if(t.type===b){let e=tl(t);e.doc=tl(r),i.push(e),r=[]}else r.push(t);if(i.length>0&&r.length>0){let t={stmt:f,id:(0,l.$C)(),type:"divider",doc:tl(r)};i.push(tl(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:m,stmt:m},{id:m,stmt:m,doc:this.rootDoc},!0),{id:m,doc:this.rootDoc}}addState(t,e=k,s,i,r,a,n,o){let l=t?.trim();if(this.currentDocument.states.has(l)){let t=this.currentDocument.states.get(l);if(!t)throw Error(`State not found: ${l}`);t.doc||(t.doc=s),t.type||(t.type=e)}else h.R.info("Adding state ",l,i),this.currentDocument.states.set(l,{stmt:f,id:l,descriptions:[],type:e,doc:s,note:r,classes:[],styles:[],textStyles:[]});if(i&&(h.R.info("Setting state description",l,i),(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(l,t.trim()))),r){let t=this.currentDocument.states.get(l);if(!t)throw Error(`State not found: ${l}`);t.note=r,t.note.text=c.Y2.sanitizeText(t.note.text,(0,c.D7)())}a&&(h.R.info("Setting state classes",l,a),(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(l,t.trim()))),n&&(h.R.info("Setting state styles",l,n),(Array.isArray(n)?n:[n]).forEach(t=>this.setStyle(l,t.trim()))),o&&(h.R.info("Setting state styles",l,n),(Array.isArray(o)?o:[o]).forEach(t=>this.setTextStyle(l,t.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:to()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=tn(),t||(this.links=new Map,(0,c.IU)())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){h.R.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),h.R.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return"[*]"===t?(this.startEndCount++,`${ti}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=k){return"[*]"===t?ti:e}endIdIfNeeded(t=""){return"[*]"===t?(this.startEndCount++,`end${this.startEndCount}`):t}endTypeIfNeeded(t="",e=k){return"[*]"===t?"end":e}addRelationObjs(t,e,s=""){let i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),n=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,n,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:c.Y2.sanitizeText(s,(0,c.D7)())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){let i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),n=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(a,n),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:s?c.Y2.sanitizeText(s,(0,c.D7)()):void 0})}}addDescription(t,e){let s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(c.Y2.sanitizeText(i,(0,c.D7)()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let s=this.classes.get(t);e&&s&&e.split(",").forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(tr).exec(t)){let t=e.replace(ta,"bgFill").replace(tr,ta);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){let e=(0,n.Ck)();(0,u.Ltv)(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{let s=(0,u.Ltv)(t.currentTarget),i=s.attr("title");if(null===i)return;let r=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+r.left+(r.right-r.left)/2+"px").style("top",window.scrollY+r.bottom+"px"),e.html(p.A.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),(0,u.Ltv)(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){let e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){let e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=(0,c.D7)();for(let e of this.nodes)e.wrappingWidth??=t.state?.wrappingWidth,e.isGroup||(e.minWidth??=t.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:tt(this.getRootDocV2())}}getConfig(){return(0,c.D7)().state}},th=(0,d.K)(t=>{let{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!(0,o.P1)(e,i))return"";let r=(0,o.rq)(t.look),a=(0,o.Ic)(s),n="";for(let t=0;t<(0,o.Hu)(i);t++){let e=i[t],o=a?`fill: ${s[t%s.length]};`:"",l=`[data-look="${r}"][data-color-id="color-${t}"]`;n+=`
|
|
2
2
|
|
|
3
3
|
/* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers
|
|
4
4
|
the body, so what stays visible of \`outer\` is the band behind the label. */
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["s"],{gj(t,e,s){var i=s("Wq"),r=s("ja");e.A=(t,e)=>i.A.lang.round(r.A.parse(t)[e])},WJ(t,e,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((t,e,s,a)=>{t.attr("class",s);let{width:n,height:c,x:h,y:u}=l(t,e);(0,i.a$)(t,c,n,a);let d=o(h,u,n,c,e);t.attr("viewBox",d),r.R.debug(`viewBox configured: ${d} with padding: ${e}`)},"setupViewPortForSVG"),l=(0,a.K)((t,e)=>{let s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),o=(0,a.K)((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`,"createViewBox");s.d(e,{P:()=>n})},OT(t,e,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((t,e)=>{let s;return"sandbox"===e&&(s=(0,r.Ltv)("#i"+t)),("sandbox"===e?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement");s.d(e,{A:()=>a})},aT(t,e,s){var i=s("OT"),r=s("WJ"),a=s("mW");s("Q"),s("ix"),s("LC"),s("bQ"),s("Ut"),s("PF"),s("iV"),s("h5");var n=s("pK"),l=s("NH"),o=s("Yr"),c=s("M4"),h=s("Gt"),u=s("El"),d=s("gj"),y=s("Cv"),p=function(){var t=(0,h.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],s=[2,2],i=[1,7],r=[1,9],a=[1,10],n=[1,11],l=[1,12],o=[1,30],c=[1,23],u=[1,24],d=[1,25],y=[1,26],p=[1,27],b=[1,19],g=[1,28],_=[1,29],f=[1,20],m=[1,18],k=[1,21],E=[1,22],S=[2,6],T=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],$=[1,36],O=[1,37],N=[1,38],x=[1,39],C=[1,40],A=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],R=[1,46],I=[1,47],D=[1,57],v=[43,51,53,54,55,74,75],L=[1,70],w=[1,68],K=[1,65],M=[1,69],B=[1,71],G=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],F=[1,78],Y=[1,77],P=[1,76],z=[69,70,71,72,73],U=[1,91],Z=[6,9,45,50],j=[6,9,12,44,45,50,51,52],W=[1,101],q=[1,100],Q=[1,99],V=[18,61],X=[1,110],H=[1,109],J=[20,43,51,53,54,55],tt=[18,61,64,66],te={trace:(0,h.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:(0,h.K)(function(t,e,s,i,r,a,n){var l=a.length-1;switch(r){case 1:break;case 2:case 5:case 6:this.$=[];break;case 3:this.$=a[l-1].concat(a[l]);break;case 4:case 34:case 59:case 60:case 61:case 62:case 86:case 69:case 71:case 74:this.$=a[l];break;case 7:i.addEntity(a[l-4]),i.addEntity(a[l-2]),i.addRelationship(a[l-4],a[l],a[l-2],a[l-3]),this.$=[a[l-4],a[l-2]];break;case 8:i.addEntity(a[l-8]),i.addEntity(a[l-4]),i.addRelationship(a[l-8],a[l],a[l-4],a[l-5]),i.setClass([a[l-8]],a[l-6]),i.setClass([a[l-4]],a[l-2]),this.$=[a[l-8],a[l-4]];break;case 9:i.addEntity(a[l-6]),i.addEntity(a[l-2]),i.addRelationship(a[l-6],a[l],a[l-2],a[l-3]),i.setClass([a[l-6]],a[l-4]),this.$=[a[l-6],a[l-2]];break;case 10:i.addEntity(a[l-6]),i.addEntity(a[l-4]),i.addRelationship(a[l-6],a[l],a[l-4],a[l-5]),i.setClass([a[l-4]],a[l-2]),this.$=[a[l-6],a[l-4]];break;case 11:i.addEntity(a[l-3]),i.addAttributes(a[l-3],a[l-1]),this.$=[a[l-3]];break;case 12:i.addEntity(a[l-5]),i.addAttributes(a[l-5],a[l-1]),i.setClass([a[l-5]],a[l-3]),this.$=[a[l-5]];break;case 13:i.addEntity(a[l-2]),this.$=[a[l-2]];break;case 14:i.addEntity(a[l-4]),i.setClass([a[l-4]],a[l-2]),this.$=[a[l-4]];break;case 15:i.addEntity(a[l]),this.$=[a[l]];break;case 16:i.addEntity(a[l-2]),i.setClass([a[l-2]],a[l]),this.$=[a[l-2]];break;case 17:i.addEntity(a[l-6],a[l-4]),i.addAttributes(a[l-6],a[l-1]),this.$=[a[l-6]];break;case 18:i.addEntity(a[l-8],a[l-6]),i.addAttributes(a[l-8],a[l-1]),i.setClass([a[l-8]],a[l-3]),this.$=[a[l-8]];break;case 19:i.addEntity(a[l-5],a[l-3]),this.$=[a[l-5]];break;case 20:i.addEntity(a[l-7],a[l-5]),i.setClass([a[l-7]],a[l-2]),this.$=[a[l-7]];break;case 21:i.addEntity(a[l-3],a[l-1]);break;case 22:i.addEntity(a[l-5],a[l-3]),i.setClass([a[l-5]],a[l]);break;case 23:case 24:this.$=a[l].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=a[l].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=a[l]:(i.setDirection(a[l].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:a[l-2].id},a[l-1],{text:a[l-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:a[l-1],text:a[l-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:a[l-4],text:a[l-2]};break;case 35:this.$=a[l-1]+" "+a[l];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=a[l-3],i.addClass(a[l-2],a[l-1]);break;case 41:case 42:case 63:case 72:case 47:this.$=[a[l]];break;case 43:case 44:this.$=a[l-2].concat([a[l]]);break;case 45:this.$=a[l-2],i.setClass(a[l-1],a[l]);break;case 46:this.$=a[l-3],i.addCssStyles(a[l-2],a[l-1]);break;case 48:case 73:a[l-2].push(a[l]),this.$=a[l-2];break;case 50:case 70:this.$=a[l-1]+a[l];break;case 58:case 84:case 85:case 75:this.$=a[l].replace(/"/g,"");break;case 64:a[l].push(a[l-1]),this.$=a[l];break;case 65:this.$={type:a[l-1],name:a[l]};break;case 66:this.$={type:a[l-2],name:a[l-1],keys:a[l]};break;case 67:this.$={type:a[l-2],name:a[l-1],comment:a[l]};break;case 68:this.$={type:a[l-3],name:a[l-2],keys:a[l-1],comment:a[l]};break;case 76:this.$={cardA:a[l],relType:a[l-1],cardB:a[l-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,s,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:r,23:a,25:n,27:l,28:13,29:14,30:15,31:16,32:17,34:o,37:c,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},t(e,S,{1:[2,1]}),t(T,[2,3]),t(T,[2,4]),t(T,[2,5]),t(T,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:$,70:O,71:N,72:x,73:C}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(T,[2,26]),t(T,[2,27]),t(T,[2,28]),t(T,[2,29]),t(T,[2,30]),t(T,s,{5:44}),t(A,[2,58]),t(A,[2,59]),t(A,[2,60]),t(A,[2,61]),t(A,[2,62]),t(T,[2,36]),t(T,[2,37]),t(T,[2,38]),t(T,[2,39]),{15:45,43:R,44:I},{15:48,43:R,44:I},{15:49,43:R,44:I},{10:50,43:b,51:f,53:m,54:k,55:E},{10:51,43:b,51:f,53:m,54:k,55:E},{15:52,43:R,44:I},{17:53,18:[1,54],56:55,57:56,61:D},{10:58,43:b,51:f,53:m,54:k,55:E},{68:59,74:[1,60],75:[1,61]},t(v,[2,77]),t(v,[2,78]),t(v,[2,79]),t(v,[2,80]),t(v,[2,81]),t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:r,23:a,25:n,27:l,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:o,37:c,38:u,39:d,40:y,41:p,43:b,46:g,47:_,51:f,53:m,54:k,55:E},{12:L,42:64,44:w,45:K,48:66,49:67,51:M,52:B},t(G,[2,41]),t(G,[2,42]),{15:72,43:R,44:I,45:K},{12:L,42:73,44:w,45:K,48:66,49:67,51:M,52:B},{6:F,9:Y,19:[1,75],35:74,50:P},{12:[1,79],14:[1,80]},t(T,[2,16],{67:35,11:81,16:[1,82],45:K,69:$,70:O,71:N,72:x,73:C}),{18:[1,83]},t(T,[2,13]),{17:84,18:[2,63],56:55,57:56,61:D},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:$,70:O,71:N,72:x,73:C},t(z,[2,82]),t(z,[2,83]),t(T,[2,31]),t(T,S),{6:F,9:Y,35:90,45:U,50:P},{43:[1,92],44:[1,93]},t(Z,[2,47],{49:94,12:L,44:w,51:M,52:B}),t(j,[2,49]),t(j,[2,54]),t(j,[2,55]),t(j,[2,56]),t(j,[2,57]),t(T,[2,45],{45:K}),{6:F,9:Y,35:95,45:U,50:P},t(T,[2,32]),{10:97,36:96,43:b,51:f,53:m,54:k,55:E},t(T,[2,51]),t(T,[2,52]),t(T,[2,53]),{13:98,43:W,53:q,76:Q},{15:102,43:R,44:I},{10:103,43:b,51:f,53:m,54:k,55:E},{17:104,18:[1,105],56:55,57:56,61:D},t(T,[2,11]),{18:[2,64]},t(V,[2,65],{59:106,60:107,63:108,65:X,66:H}),t([18,61,65,66],[2,71]),{61:[2,70]},t(T,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(T,[2,40]),{12:L,44:w,48:113,49:67,51:M,52:B},t(G,[2,43]),t(G,[2,44]),t(j,[2,50]),t(T,[2,46]),{10:115,20:[1,114],43:b,51:f,53:m,54:k,55:E},t(J,[2,34]),t(T,[2,7]),t(T,[2,84]),t(T,[2,85]),t(T,[2,86]),{12:[1,116],45:K},{12:[1,118],14:[1,117]},{18:[1,119]},t(T,[2,14]),t(V,[2,66],{60:120,64:[1,121],66:H}),t(V,[2,67]),t(tt,[2,72]),t(V,[2,75]),t(tt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:D},{15:124,43:R,44:I},t(Z,[2,48],{49:94,12:L,44:w,51:M,52:B}),{6:F,9:Y,35:125,50:P},t(J,[2,35]),{13:126,43:W,53:q,76:Q},{15:127,43:R,44:I},{13:128,43:W,53:q,76:Q},t(T,[2,12]),t(V,[2,68]),{63:129,65:X},{18:[1,130]},t(T,[2,19]),t(T,[2,22],{16:[1,131],45:K}),t(T,[2,33]),t(T,[2,10]),{12:[1,132],45:K},t(T,[2,9]),t(tt,[2,73]),t(T,[2,17]),{17:133,18:[1,134],56:55,57:56,61:D},{13:135,43:W,53:q,76:Q},{18:[1,136]},t(T,[2,20]),t(T,[2,8]),t(T,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:(0,h.K)(function(t,e){if(e.recoverable)this.trace(t);else{var s=Error(t);throw s.hash=e,s}},"parseError"),parse:(0,h.K)(function(t){var e=this,s=[0],i=[],r=[null],a=[],n=this.table,l="",o=0,c=0,u=0,d=a.slice.call(arguments,1),y=Object.create(this.lexer),p={};for(var b in this.yy)Object.prototype.hasOwnProperty.call(this.yy,b)&&(p[b]=this.yy[b]);y.setInput(t,p),p.lexer=y,p.parser=this,void 0===y.yylloc&&(y.yylloc={});var g=y.yylloc;a.push(g);var _=y.options&&y.options.ranges;function f(){var t;return"number"!=typeof(t=i.pop()||y.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.parseError?this.parseError=p.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K)(function(t){s.length=s.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),(0,h.K)(f,"lex");for(var m,k,E,S,T,$,O,N,x,C={};;){if(E=s[s.length-1],this.defaultActions[E]?S=this.defaultActions[E]:(null==m&&(m=f()),S=n[E]&&n[E][m]),void 0===S||!S.length||!S[0]){var A="";for($ in x=[],n[E])this.terminals_[$]&&$>2&&x.push("'"+this.terminals_[$]+"'");A=y.showPosition?"Parse error on line "+(o+1)+":\n"+y.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[m]||m,line:y.yylineno,loc:g,expected:x})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+E+", token: "+m);switch(S[0]){case 1:s.push(m),r.push(y.yytext),a.push(y.yylloc),s.push(S[1]),m=null,k?(m=k,k=null):(c=y.yyleng,l=y.yytext,o=y.yylineno,g=y.yylloc,u>0&&u--);break;case 2:if(O=this.productions_[S[1]][1],C.$=r[r.length-O],C._$={first_line:a[a.length-(O||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(O||1)].first_column,last_column:a[a.length-1].last_column},_&&(C._$.range=[a[a.length-(O||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(C,[l,c,o,p,S[1],r,a].concat(d))))return T;O&&(s=s.slice(0,-1*O*2),r=r.slice(0,-1*O),a=a.slice(0,-1*O)),s.push(this.productions_[S[1]][0]),r.push(C.$),a.push(C._$),N=n[s[s.length-2]][s[s.length-1]],s.push(N);break;case 3:return!0}}return!0},"parse")};function ts(){this.yy={}}return te.lexer={EOF:1,parseError:(0,h.K)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,h.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,h.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,h.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K)(function(){return this._more=!0,this},"more"),reject:(0,h.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,h.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,h.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,h.K)(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var a in r)this[a]=r[a];return!1},"test_match"),next:(0,h.K)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,r=this._currentRules(),a=0;a<r.length;a++)if((s=this._input.match(this.rules[r[a]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[a])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,h.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,h.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,h.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,h.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,h.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,h.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K)(function(t,e,s,i){switch(s){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 28:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:case 22:case 30:case 37:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:case 18:case 40:return 52;case 19:case 39:return 45;case 20:return 14;case 21:case 38:return 12;case 23:return 65;case 24:case 25:case 27:return 61;case 26:this.begin("block_bq");break;case 29:return 66;case 31:return this.popState(),18;case 32:case 81:return e.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:case 49:case 50:case 68:return 69;case 46:case 47:case 48:case 56:case 58:case 70:return 71;case 51:case 52:case 53:case 54:case 55:case 57:case 69:return 70;case 59:case 60:case 62:case 63:case 64:case 67:return 72;case 61:return 54;case 65:return 55;case 66:return 51;case 71:return 73;case 72:case 75:case 76:case 77:return 74;case 73:case 74:return 75;case 78:return 44;case 79:return 50;case 80:return 43;case 82:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}},(0,h.K)(ts,"Parser"),ts.prototype=te,te.Parser=ts,new ts}();p.parser=p;var b=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=o.SV,this.getAccTitle=o.iN,this.setAccDescription=o.EI,this.getAccDescription=o.m7,this.setDiagramTitle=o.ke,this.getDiagramTitle=o.ab,this.getConfig=(0,h.K)(()=>(0,o.D7)().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{(0,h.K)(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,c.R.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:(0,o.D7)().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),c.R.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){let s,i=this.addEntity(t);for(s=e.length-1;s>=0;s--)e[s].keys||(e[s].keys=[]),e[s].comment||(e[s].comment=""),i.attributes.push(e[s]),c.R.debug("Added attribute ",e[s].name)}addRelationship(t,e,s,i){let r,a;if(this.subGraphLookup.has(t))r=t;else{let e=this.addEntity(t);if(!e)return;r=e.id}if(this.subGraphLookup.has(s))a=s;else{let t=this.addEntity(s);if(!t)return;a=t.id}let n={entityA:r,roleA:e,entityB:a,relSpec:i};this.relationships.push(n),c.R.debug("Added new relationship :",n)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(let s of t){let t=this.classes.get(s);t?.styles&&(e=[...e,...t.styles??[]].map(t=>t.trim())),t?.textStyles&&(e=[...e,...t.textStyles??[]].map(t=>t.trim()))}return e}addCssStyles(t,e){for(let s of t){let t=this.entities.get(s),i=this.subGraphLookup.get(s);if(e){if(t)for(let s of e)t.cssStyles.push(s);if(i)for(let t of(i.cssStyles||(i.cssStyles=[]),e))i.cssStyles.push(t)}}}addClass(t,e){t.forEach(t=>{let s=this.classes.get(t);void 0===s&&(s={id:t,styles:[],textStyles:[]},this.classes.set(t,s)),e&&e.forEach(function(t){if(/color/.exec(t)){let e=t.replace("fill","bgFill");s.textStyles.push(e)}s.styles.push(t)})})}addSubGraph(t,e,s){let i=t.text.trim(),r=s.text,a=(0,h.K)(t=>{let e,s=new Set;return{nodeList:t.filter(t=>{if(t?.stmt)return"dir"===t.stmt&&(e=t.value),!1;if("string"!=typeof t)return!1;let i=t.trim();return!(!i||s.has(i))&&(s.add(i),!0)}),dir:e}},"uniq")(e.flat()),n=a.nodeList,l=a.dir;i=i??"subGraph"+this.subCount,r=r||"",r=this.sanitizeText(r),this.subCount=this.subCount+1;let o={id:i,nodes:n,title:r.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(s?.type)};return c.R.info("Adding",o.id,o.nodes,o.dir),o.nodes=this.makeUniq(o,this.subGraphs).nodes,this.subGraphs.push(o),this.subGraphLookup.set(i,o),i}getSubGraphs(){return this.subGraphs}setClass(t,e){for(let s of t){let t=this.entities.get(s);if(t)for(let s of e)t.cssClasses+=" "+s;let i=this.subGraphLookup.get(s);if(i)for(let t of e)i.classes.push(t)}}subgraphNodeCache(t){let e=new Set;for(let s of t)for(let t of s.nodes)e.add(t);return e}makeUniq(t,e){let s=this.subgraphNodeCache(e),i=[];return t.nodes.forEach((e,r)=>{s.has(e)?c.R.warn(`Entity '${e}' already belongs to another subgraph and will be ignored`):i.push(t.nodes[r])}),{nodes:i}}sanitizeText(t){return o.Y2.sanitizeText(t,(0,o.D7)())}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,(0,o.IU)()}getData(){let t=[],e=[],s=(0,o.D7)(),i=this.getSubGraphs(),r=new Map,a=new Map;for(let t=i.length-1;t>=0;t--){let e=i[t];for(let t of(e.nodes.length>0&&a.set(e.id,!0),e.nodes))r.set(t,e.id)}for(let e=i.length-1;e>=0;e--){let a=i[e];t.push({id:a.id,label:a.title,labelStyle:"",labelType:a.labelType,parentId:r.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:s.look})}let n=new Set(i.map(t=>t.id)),c=0;for(let e of this.entities.keys()){if(n.has(e))continue;let s=this.entities.get(e);s&&(s.cssCompiledStyles=this.getCompiledStyles(s.cssClasses.split(" ")),s.colorIndex=c++,t.push({...s,parentId:r.get(e),isGroup:!1}))}let h=0;for(let t of this.relationships){let i={id:(0,l.rY)(t.entityA,t.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:t.entityA,end:t.entityB,label:t.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:t.relSpec.cardB.toLowerCase(),arrowTypeEnd:t.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==t.relSpec.relType?"solid":"dashed",look:s.look,labelType:"markdown"};e.push(i)}return{nodes:t,edges:e,other:{},config:s,direction:this.direction}}},g={};(0,h.V)(g,{draw:()=>_});var _=(0,h.K)(async function(t,e,s,n){c.R.info("REF0:"),c.R.info("Drawing er diagram (unified)",e);let{securityLevel:h,er:d,layout:y}=(0,o.D7)(),p=n.db.getData(),b=(0,i.A)(e,h);p.type=n.type,p.layoutAlgorithm=(0,a.q7)(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=n.db.getDirection();let{config:g}=p,{look:_}=g;"neo"===_?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=e,await (0,a.XX)(p,b);let f=b.selectAll('[id*="-background"]');Array.from(f).length>0&&f.each(function(){let t=(0,u.Ltv)(this),e=t.attr("id").replace("-background",""),s=b.select(`#${CSS.escape(e)}`);if(!s.empty()){let e=s.attr("transform");t.attr("transform",e)}}),l._K.insertTitle(b,"erDiagramTitleText",d?.titleTopMargin??25,n.db.getDiagramTitle()),(0,r.P)(b,8,"erDiagram",d?.useMaxWidth??!0)},"draw"),f=(0,h.K)((t,e)=>{let s=d.A,i=s(t,"r"),r=s(t,"g"),a=s(t,"b");return y.A(i,r,a,e)},"fade"),m=(0,h.K)(t=>{let{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!(0,n.P1)(e,i))return"";let r=(0,n.rq)(t.look),a=(0,n.Ic)(s),l="";for(let t=0;t<(0,n.Hu)(i);t++){let e=i[t],n=a?`fill: ${s[t%s.length]};`:"";l+=`
|
|
2
|
+
|
|
3
|
+
[data-look="${r}"][data-color-id="color-${t}"].node path {
|
|
4
|
+
stroke: ${e};
|
|
5
|
+
${n}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-look="${r}"][data-color-id="color-${t}"].node rect {
|
|
9
|
+
stroke: ${e};
|
|
10
|
+
${n}
|
|
11
|
+
}
|
|
12
|
+
`}return l},"genColor"),k={parser:p,get db(){return new b},renderer:g,styles:(0,h.K)(t=>{let{look:e,theme:s,erEdgeLabelBackground:i,strokeWidth:r}=t;return`
|
|
13
|
+
${m(t)}
|
|
14
|
+
.entityBox {
|
|
15
|
+
fill: ${t.mainBkg};
|
|
16
|
+
stroke: ${t.nodeBorder};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.relationshipLabelBox {
|
|
20
|
+
fill: ${t.tertiaryColor};
|
|
21
|
+
opacity: 0.7;
|
|
22
|
+
background-color: ${t.tertiaryColor};
|
|
23
|
+
rect {
|
|
24
|
+
opacity: 0.5;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.labelBkg {
|
|
29
|
+
background-color: ${n.Fx.has(s)&&i?i:f(t.tertiaryColor,.5)};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.edgeLabel {
|
|
33
|
+
background-color: ${n.Fx.has(s)&&i?i:t.edgeLabelBackground};
|
|
34
|
+
}
|
|
35
|
+
.edgeLabel .label rect {
|
|
36
|
+
fill: ${n.Fx.has(s)&&i?i:t.edgeLabelBackground};
|
|
37
|
+
}
|
|
38
|
+
.edgeLabel .label text {
|
|
39
|
+
fill: ${t.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.edgeLabel .label {
|
|
43
|
+
fill: ${t.nodeBorder};
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.label {
|
|
48
|
+
font-family: ${t.fontFamily};
|
|
49
|
+
color: ${t.nodeTextColor||t.textColor};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.edge-pattern-dashed {
|
|
53
|
+
stroke-dasharray: 8,8;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.node rect,
|
|
57
|
+
.node circle,
|
|
58
|
+
.node ellipse,
|
|
59
|
+
.node polygon
|
|
60
|
+
{
|
|
61
|
+
fill: ${t.mainBkg};
|
|
62
|
+
stroke: ${t.nodeBorder};
|
|
63
|
+
stroke-width: ${"neo"===e?r:"1px"};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.relationshipLine {
|
|
67
|
+
stroke: ${t.lineColor};
|
|
68
|
+
stroke-width: ${"neo"===e?r:"1px"};
|
|
69
|
+
fill: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.marker {
|
|
73
|
+
fill: none !important;
|
|
74
|
+
stroke: ${t.lineColor} !important;
|
|
75
|
+
stroke-width: 1;
|
|
76
|
+
}
|
|
77
|
+
[data-look=neo].labelBkg {
|
|
78
|
+
background-color: ${f(t.tertiaryColor,.5)};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cluster rect {
|
|
82
|
+
fill: ${t.clusterBkg??t.mainBkg};
|
|
83
|
+
stroke: ${t.clusterBorder??t.nodeBorder};
|
|
84
|
+
stroke-width: 1px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cluster text {
|
|
88
|
+
fill: ${t.titleColor??t.textColor};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.cluster-label text {
|
|
92
|
+
fill: ${t.titleColor??t.textColor};
|
|
93
|
+
}
|
|
94
|
+
`},"getStyles")};s.d(e,{diagram:()=>k})}}]);
|