@bkm016/basalt 0.1.11 → 0.1.12

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.
Files changed (207) hide show
  1. package/{chunk-755sy11p.js → chunk-01nve4qy.js} +1 -1
  2. package/{chunk-jtsve11b.js → chunk-0fc9apfn.js} +9 -9
  3. package/{chunk-d5j74pcp.js → chunk-1h34mzh7.js} +4 -4
  4. package/{chunk-fgwda4m0.js → chunk-1xfv4bd7.js} +1 -1
  5. package/{chunk-mbpb5c7w.js → chunk-2fyjph3f.js} +1 -1
  6. package/{chunk-13gvs0ax.js → chunk-2kxnw7vs.js} +1 -1
  7. package/{chunk-95964592.js → chunk-37zystxb.js} +11 -11
  8. package/{chunk-h1kb8b49.js → chunk-3pf1d62g.js} +2 -2
  9. package/{chunk-29qrxygd.js → chunk-5wnmbc1b.js} +2 -2
  10. package/{chunk-c71173py.js → chunk-6mges89p.js} +4 -4
  11. package/{chunk-d0a1jxk5.js → chunk-6sz5q3df.js} +2 -2
  12. package/chunk-7er5pz7s.js +479 -0
  13. package/{chunk-gbjn6d81.js → chunk-7g5smgjj.js} +1 -1
  14. package/chunk-7m3jagqn.js +2 -0
  15. package/{chunk-wnzvnskb.js → chunk-85v69h91.js} +2 -2
  16. package/{chunk-38g3gctw.js → chunk-9c4gdg1q.js} +2 -2
  17. package/{chunk-en218k4y.js → chunk-cbgpymt4.js} +1 -1
  18. package/{chunk-a1rb1a48.js → chunk-cdw03j4t.js} +2 -2
  19. package/chunk-ch1r3ted.js +2 -0
  20. package/{chunk-dfh9m9n7.js → chunk-db7ws33a.js} +2 -2
  21. package/{chunk-1n7dat03.js → chunk-ejjem0tc.js} +3 -3
  22. package/{chunk-c4qr1f41.js → chunk-eq4wqxzt.js} +2 -2
  23. package/{chunk-zc9ar0r4.js → chunk-eyrtbbdd.js} +1 -1
  24. package/{chunk-r4ttdkrz.js → chunk-fhxy6y34.js} +2 -2
  25. package/{chunk-zyyzk5ha.js → chunk-fy82qxa1.js} +1 -1
  26. package/{chunk-xtq1xpq0.js → chunk-hc300148.js} +1 -1
  27. package/{chunk-vtqr7dm8.js → chunk-j64dc767.js} +2 -2
  28. package/{chunk-msm9hmk9.js → chunk-jpnf71q7.js} +2 -2
  29. package/{chunk-q9f4xb0w.js → chunk-kpe7pnhy.js} +4 -4
  30. package/{chunk-a98wma9j.js → chunk-ksk49hv0.js} +1 -1
  31. package/{chunk-bdjr0kfr.js → chunk-m4bg1apa.js} +5 -5
  32. package/{chunk-dq01v5eq.js → chunk-nhm9z3d8.js} +1 -1
  33. package/{chunk-30rjf7my.js → chunk-ntks40jd.js} +2 -2
  34. package/{chunk-a1352w87.js → chunk-nw1xpt3s.js} +1 -1
  35. package/{chunk-xh444pfn.js → chunk-p2pmdbt2.js} +8 -8
  36. package/{chunk-hb4f2v34.js → chunk-qfcr5g35.js} +2 -2
  37. package/{chunk-n2jcx65v.js → chunk-qs8zzg50.js} +2 -2
  38. package/{chunk-qaeyhe65.js → chunk-r4gm8ngh.js} +1 -1
  39. package/{chunk-pz2afna8.js → chunk-rks90mh1.js} +1 -1
  40. package/{chunk-asyr3gnq.js → chunk-rwks9zaw.js} +2 -2
  41. package/{chunk-v3ee9z3f.js → chunk-t7te60m7.js} +1 -1
  42. package/{chunk-4dw43syb.js → chunk-tv52xajf.js} +1 -1
  43. package/{chunk-c0zfefq8.js → chunk-v7wcchy2.js} +1 -1
  44. package/{chunk-tevejprz.js → chunk-vjne04dp.js} +3 -3
  45. package/{chunk-ax04trym.js → chunk-w0rr66z7.js} +1 -1
  46. package/{chunk-gkf5jwvj.js → chunk-w6f2r052.js} +1 -1
  47. package/{chunk-jymx3a77.js → chunk-wqqjzsjt.js} +310 -278
  48. package/{chunk-c6q04xrd.js → chunk-xef4642x.js} +1 -1
  49. package/compiled.js +7 -7
  50. package/package.json +1 -1
  51. package/ui-test-worker.js +2 -2
  52. package/web/{chunk-jhpg2kcf.js → chunk-04drx71p.js} +1 -1
  53. package/web/chunk-0rdgt4jb.css +1 -0
  54. package/web/{chunk-cbwvfedy.js → chunk-19zd0tye.js} +3 -3
  55. package/web/chunk-1m0kp0g3.js +8 -0
  56. package/web/{chunk-j4gvtszc.js → chunk-1zwc09e8.js} +2 -2
  57. package/web/{chunk-a3pye9ag.js → chunk-2cyzaqjy.js} +3 -3
  58. package/web/{chunk-8csw0mvf.js → chunk-2jfesv7m.js} +2 -2
  59. package/web/chunk-3j2tcphs.js +1 -0
  60. package/web/chunk-3k9h7a73.js +1142 -0
  61. package/web/chunk-3m1bb2fw.js +1 -0
  62. package/web/{chunk-4rwwtfnd.js → chunk-3n9ypydh.js} +2 -2
  63. package/web/{chunk-90fkdzx3.js → chunk-3psgr0q8.js} +13 -13
  64. package/web/{chunk-nafe18y9.js → chunk-3qxxrwsp.js} +6 -6
  65. package/web/{chunk-hjyev38w.js → chunk-3rkkp6ed.js} +4 -4
  66. package/web/{chunk-v3dn9bfw.js → chunk-4f6a8dsk.js} +1 -1
  67. package/web/chunk-55nvm2mj.js +1 -0
  68. package/web/chunk-5dkqfnh7.js +2 -0
  69. package/web/{chunk-96xhmmqz.js → chunk-5g8md2wg.js} +4 -4
  70. package/web/{chunk-mpdeqzc9.js → chunk-5np514v5.js} +8 -8
  71. package/web/{chunk-1zfxaafq.js → chunk-60mym60n.js} +1 -1
  72. package/web/{chunk-nhx8pw7p.js → chunk-6f2sz84q.js} +2 -2
  73. package/web/{chunk-q8v5j963.js → chunk-7adsmqv6.js} +2 -2
  74. package/web/{chunk-27812gqr.js → chunk-7ksg3ccg.js} +3 -3
  75. package/web/chunk-7ky5nrrr.js +1 -0
  76. package/web/{chunk-pq56b3mq.js → chunk-7tkgbbf9.js} +2 -2
  77. package/web/{chunk-tpdcrrf1.js → chunk-7v85yvb2.js} +1 -1
  78. package/web/{chunk-dk0fnj87.js → chunk-7vgh17es.js} +1 -1
  79. package/web/{chunk-rqympya7.js → chunk-80z8s8zb.js} +1 -1
  80. package/web/{chunk-36dc7tcg.js → chunk-81s15c2e.js} +2 -2
  81. package/web/{chunk-mykbcvqz.js → chunk-8539865x.js} +1 -1
  82. package/web/{chunk-wbwets5x.js → chunk-8cnjd0f2.js} +17 -17
  83. package/web/{chunk-48479gnx.js → chunk-8sdjgv3k.js} +1 -1
  84. package/web/chunk-9bxtzwtc.js +1 -0
  85. package/web/{chunk-drchr3yn.js → chunk-aa46mrgh.js} +1 -1
  86. package/web/{chunk-8151c970.js → chunk-act3rr85.js} +1 -1
  87. package/web/{chunk-94denx9h.js → chunk-aebrw6cv.js} +3 -3
  88. package/web/{chunk-3a57m7xm.js → chunk-aeymdtm1.js} +2 -2
  89. package/web/{chunk-3020mmp1.js → chunk-ar6jnhm5.js} +1 -1
  90. package/web/{chunk-e763h2px.js → chunk-b5zf1hs3.js} +66 -66
  91. package/web/{chunk-5ahx98zj.js → chunk-b99k8q22.js} +8 -8
  92. package/web/chunk-bcjgzwef.js +1 -0
  93. package/web/{chunk-f79ajymt.js → chunk-bra33pt0.js} +2 -2
  94. package/web/{chunk-57pyz29y.js → chunk-bygwbpvq.js} +2 -2
  95. package/web/{chunk-3ftb27f3.js → chunk-c3fty2c2.js} +5 -5
  96. package/web/{chunk-d3f763n7.js → chunk-cxpnj495.js} +1 -1
  97. package/web/{chunk-8z7texmv.js → chunk-d1btrqmw.js} +1 -1
  98. package/web/{chunk-jqqbkdtw.js → chunk-d57fm7k0.js} +2 -2
  99. package/web/{chunk-1t38sgrk.js → chunk-d73zkc4q.js} +4 -4
  100. package/web/chunk-d94t9z70.js +1 -0
  101. package/web/{chunk-2ds0a2z1.js → chunk-dndd757x.js} +3 -3
  102. package/web/{chunk-d4519smc.js → chunk-e94pd9rr.js} +10 -10
  103. package/web/{chunk-qykt7avq.js → chunk-enwfd8d5.js} +2 -2
  104. package/web/chunk-fr4fft89.js +1 -0
  105. package/web/{chunk-g0rtcedn.js → chunk-g488hxx0.js} +3 -3
  106. package/web/{chunk-b6sqwmq7.js → chunk-g4zm0crw.js} +1 -1
  107. package/web/{chunk-086dshck.js → chunk-gckmcef6.js} +1 -1
  108. package/web/{chunk-0hvxb5d5.js → chunk-gkmaryr4.js} +1 -1
  109. package/web/chunk-gnb09wmx.js +1 -0
  110. package/web/chunk-gx340asc.js +1 -0
  111. package/web/chunk-h0c42zy3.js +1 -0
  112. package/web/chunk-h24ybwp6.js +1 -0
  113. package/web/{chunk-m24yb8md.js → chunk-h754ntg7.js} +1 -1
  114. package/web/{chunk-3b4wqmnh.js → chunk-hn8m1vsg.js} +7 -7
  115. package/web/{chunk-2f2agfpj.js → chunk-hqxc9m07.js} +7 -7
  116. package/web/chunk-hrgqc1vr.js +1 -0
  117. package/web/{chunk-793m5jjh.js → chunk-hva7xyne.js} +2 -2
  118. package/web/{chunk-yrh86m0n.js → chunk-hxbfkdjd.js} +1 -1
  119. package/web/chunk-j9c8fa82.js +1 -0
  120. package/web/{chunk-4gc663j0.js → chunk-jeafmjsm.js} +1 -1
  121. package/web/chunk-jyf7a7yp.js +2 -0
  122. package/web/chunk-jz5mmp64.js +1 -0
  123. package/web/{chunk-s0xy00v5.js → chunk-k0cg4n2k.js} +2 -2
  124. package/web/{chunk-g31dbnzm.js → chunk-k4dnjf8n.js} +4 -4
  125. package/web/{chunk-59nk506k.js → chunk-kerfb21g.js} +1 -1
  126. package/web/chunk-m0136xav.js +1 -0
  127. package/web/chunk-m6vyvgm5.js +1 -0
  128. package/web/{chunk-0y971zgq.js → chunk-mxkbmgcv.js} +2 -2
  129. package/web/{chunk-0fy590s0.js → chunk-my0ec787.js} +1 -1
  130. package/web/chunk-mzzaet63.js +1 -0
  131. package/web/{chunk-xjc5fmcr.js → chunk-n9v14vyd.js} +18 -18
  132. package/web/{chunk-cpshsp24.js → chunk-ncfzmf2g.js} +1 -1
  133. package/web/chunk-ny436sqg.js +1 -0
  134. package/web/chunk-ph75hddv.js +1 -0
  135. package/web/chunk-phdfyqaa.js +1 -0
  136. package/web/chunk-phxa5krt.js +1 -0
  137. package/web/{chunk-b3j07x0n.js → chunk-pjpre6de.js} +2 -2
  138. package/web/chunk-q1zxvjhs.js +2 -0
  139. package/web/{chunk-n33753da.js → chunk-qdd3bx8q.js} +1 -1
  140. package/web/{chunk-ydtrc1ay.js → chunk-qh62nkem.js} +2 -2
  141. package/web/{chunk-05mvzx00.js → chunk-qp3tjhaq.js} +1 -1
  142. package/web/chunk-r4zbw4zj.js +2 -0
  143. package/web/{chunk-g4as4zzd.js → chunk-r6kk4vp1.js} +4 -4
  144. package/web/{chunk-ppjw1mps.js → chunk-rdr6wt22.js} +4 -4
  145. package/web/chunk-ry4ycah9.js +1 -0
  146. package/web/{chunk-47mbbmst.js → chunk-sdr5wa4z.js} +3 -3
  147. package/web/chunk-sqm16fat.js +1 -0
  148. package/web/{chunk-zv73g4qq.js → chunk-td83xf12.js} +2 -2
  149. package/web/chunk-tj1fn8v2.js +1 -0
  150. package/web/{chunk-q65zxczs.js → chunk-v0wtk059.js} +4 -4
  151. package/web/{chunk-enryqmj7.js → chunk-v1hfbjz9.js} +4 -4
  152. package/web/chunk-v1qt3gq4.js +1 -0
  153. package/web/{chunk-2tsxj613.js → chunk-v34mr9ky.js} +9 -9
  154. package/web/{chunk-tgkdyxbn.js → chunk-v854w9yn.js} +1 -1
  155. package/web/{chunk-dtrh40vr.js → chunk-ve56gxq0.js} +1 -1
  156. package/web/chunk-w573ym17.js +1 -0
  157. package/web/{chunk-9kkzmss7.js → chunk-w9gnqkez.js} +3 -3
  158. package/web/{chunk-kfbgvh0c.js → chunk-wqzbxzk3.js} +1 -1
  159. package/web/{chunk-hm8thq7c.js → chunk-wvrs986a.js} +2 -2
  160. package/web/chunk-x0mjydtp.js +1 -0
  161. package/web/{chunk-7dycbjxn.js → chunk-xpecre7w.js} +4 -4
  162. package/web/{chunk-zdhyq3ch.js → chunk-xvfeq8v2.js} +7 -7
  163. package/web/{chunk-2weaa3gn.js → chunk-y2rzeb4v.js} +2 -2
  164. package/web/{chunk-tggja45g.js → chunk-yf8ykk4v.js} +4 -4
  165. package/web/{chunk-gyhr27dm.js → chunk-yjs6jmdb.js} +1 -1
  166. package/web/{chunk-dsbyfvwz.js → chunk-ym7kv2hs.js} +1 -1
  167. package/web/chunk-zhybh04p.js +1 -0
  168. package/web/index.html +1 -1
  169. package/worker.js +1 -1
  170. package/chunk-7zkswxvk.js +0 -2
  171. package/chunk-m1eam0s5.js +0 -2
  172. package/chunk-zq32mwxj.js +0 -479
  173. package/web/chunk-32zmk3f5.js +0 -1
  174. package/web/chunk-3d3wnh8a.js +0 -2
  175. package/web/chunk-6cjm2yr7.js +0 -1
  176. package/web/chunk-7ycxz39p.js +0 -1
  177. package/web/chunk-9wr33d0t.js +0 -1
  178. package/web/chunk-a4tdrxdh.js +0 -1
  179. package/web/chunk-a9fvsyc1.js +0 -1
  180. package/web/chunk-apvbvg4d.js +0 -1
  181. package/web/chunk-bkxcc7v5.js +0 -1
  182. package/web/chunk-bve354k7.js +0 -1
  183. package/web/chunk-cwpxakby.js +0 -1
  184. package/web/chunk-jd7npyv9.js +0 -8
  185. package/web/chunk-jzz5htxp.js +0 -1
  186. package/web/chunk-ka3q31t1.js +0 -1
  187. package/web/chunk-kahab58k.js +0 -1139
  188. package/web/chunk-krgvx75q.js +0 -1
  189. package/web/chunk-m7k4wr3k.js +0 -1
  190. package/web/chunk-mdj3r75b.js +0 -1
  191. package/web/chunk-nbcpbqq4.js +0 -1
  192. package/web/chunk-p1yc8hwn.js +0 -2
  193. package/web/chunk-p29brxyt.js +0 -1
  194. package/web/chunk-p8fbes0t.js +0 -1
  195. package/web/chunk-r6q1301x.js +0 -1
  196. package/web/chunk-r8kghrkb.js +0 -1
  197. package/web/chunk-rhxn7mxg.js +0 -1
  198. package/web/chunk-svqshmpg.js +0 -1
  199. package/web/chunk-swzxq7r3.css +0 -1
  200. package/web/chunk-t18tn37m.js +0 -2
  201. package/web/chunk-tbsaseer.js +0 -1
  202. package/web/chunk-v0zfnvc1.js +0 -1
  203. package/web/chunk-vj31fs16.js +0 -1
  204. package/web/chunk-vr79r8vh.js +0 -1
  205. package/web/chunk-wb9tax0m.js +0 -1
  206. package/web/chunk-x9eghjjd.js +0 -1
  207. package/web/chunk-z3ky5ews.js +0 -2
@@ -0,0 +1 @@
1
+ import{ir}from"./chunk-n9v14vyd.js";export{ir as createRailroadPegServices};
@@ -0,0 +1,2 @@
1
+ import{o,r,f,e,n,y,Lt,ot,ie,Ue}from"./chunk-3k9h7a73.js";var Z={running:"运行中",waiting:"等待回答",context_exhausted:"上下文耗尽",done:"完成",error:"失败",failed:"失败",aborted:"已取消",cancelled:"已取消",interrupted:"已中断"},j={running:"warning",waiting:"warning",context_exhausted:"warning",done:"success",error:"danger",failed:"danger",aborted:"neutral",cancelled:"neutral",interrupted:"warning"},I=(i)=>i>=1000?`${(i/1000).toFixed(i>=1e4?0:1)}k`:String(i),ee=(i)=>i>=60000?`${Math.floor(i/60000)} 分 ${Math.round(i%60000/1000)} 秒`:`${Math.round(i/1000)} 秒`;function ae(i){let{Button:S,Panel:B,StatusChip:U,Markdown:A,ModelIcon:Q,cn:l,style:q,useTheme:F}=y();F();let{connection:k,sessionID:w,payload:O,onOpen:_}=i,s=O,[t,L]=r(),[W,D]=r(!1),[v,g]=r(),[P,R]=r(!1),[p,G]=r(!1),[H,J]=r(!1),x=H||s.state==="aborted"||s.state==="cancelled",h=x?"aborted":s.state,c=(s.state==="running"||s.state==="waiting")&&!x;o(()=>{let a,C=!1,M=()=>{k.request(`/api/sessions/${encodeURIComponent(w)}/tasks/${encodeURIComponent(s.childSessionID)}`).then((u)=>{if(!C)L(u),D(!1),g(void 0)}).catch((u)=>{if(!C){if(u instanceof Error&&u.message==="Task is not a direct child"){D(!0),g(void 0);return}g(u instanceof Error?u.message:"任务详情加载失败")}})};if(M(),c)a=setInterval(M,1500);return()=>{if(C=!0,a)clearInterval(a)}},[k,w,s.childSessionID,c]);let K=async()=>{if(P)return;R(!0);try{await k.request(`/api/sessions/${encodeURIComponent(w)}/tasks/${encodeURIComponent(s.childSessionID)}/kill`,{method:"POST"}),J(!0)}catch(a){g(a instanceof Error?a.message:"取消任务失败")}finally{R(!1)}},d=s.summary?.trim()||s.handoff?.conclusion.trim()||"",N=d.length>360||d.split(`
2
+ `).length>8,b=t?.retried??0,m=c&&b>0,V=m?`重试中 (${b})`:Z[h]??h,X=m?"danger":j[h]??"neutral",T=[m&&`已失败重试 ${b} 次`,t&&c&&t.lastTool&&`最近 ${t.lastTool}`,t&&ee(t.elapsedMs),t&&`输入 ${I(t.usage.input)}`,t&&`输出 ${I(t.usage.output)}`,t&&t.usage.cacheRead>0&&`缓存 ${I(t.usage.cacheRead)}`,t&&t.usage.cost>0&&`$${t.usage.cost.toFixed(4)}`].filter((a)=>Boolean(a)),E=m&&t?.lastError?`模型请求异常:${t.lastError}`:void 0,Y=Boolean(d||s.state==="waiting"&&!x||E||v),z=s.model||t?.session.model;return e(B,{className:"my-2 animate-fade",header:n(f,{children:[z?e(Q,{modelID:z,className:"size-3.5 shrink-0",size:14}):e(Ue,{className:l("size-3.5 shrink-0",c?"text-warning":"text-faint")}),e("h4",{className:"truncate font-medium text-ink",title:s.description,children:s.description}),T.length>0&&e("div",{className:l("flex min-w-0 flex-wrap items-center gap-x-2 tabular-nums text-xs",m?"text-danger font-medium":"text-faint"),children:T.map((a)=>e("span",{children:a},a))})]}),actions:n(f,{children:[e(U,{tone:X,pulse:h==="running",children:V}),c&&e(S,{size:"sm",variant:"danger-ghost",className:"h-6 rounded-md px-2 text-xs",disabled:P,onClick:()=>{K()},children:"取消"}),!W&&n(S,{size:"sm",variant:"ghost",className:"h-6 gap-1 rounded-md px-2 text-xs text-faint hover:text-ink",onClick:()=>_(s.childSessionID),children:["进入子会话",e(ot,{className:"size-3.5"})]})]}),children:Y&&n(f,{children:[E&&n("div",{className:"flex items-center gap-2 border-b border-line bg-danger/10 px-4 py-2 text-xs text-danger",children:[n("span",{className:"font-medium",children:["已自动重试 ",b," 次:"]}),e("span",{className:"truncate",title:t?.lastError,children:t?.lastError})]}),s.state==="waiting"&&!x&&n("div",{className:l("px-4 py-3",d&&"border-b border-line"),children:[n("p",{className:"flex items-center gap-1.5 text-xs font-medium text-warning",children:[e(Lt,{className:"size-3.5"}),"子任务向主代理提问,等待回答"]}),s.pendingQuestions&&s.pendingQuestions.length>0&&e("ul",{className:"mt-1.5 flex flex-col gap-1 text-[13px] leading-relaxed text-ink",children:s.pendingQuestions.map((a)=>e("li",{className:"break-words",children:a.text},a.askedAt))})]}),d&&n("div",{className:"px-4 py-3",children:[n("div",{className:l("relative text-[13.5px] leading-[1.65] break-words text-ink/90 overflow-hidden transition-[max-height] duration-300 ease-out-quint [&_p]:my-1.5 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",N&&!p?"max-h-40":"max-h-[1800px]"),children:[e(A,{text:d}),N&&e("div",{className:l("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-panel via-panel/70 to-transparent transition-opacity duration-300",p?"opacity-0":"opacity-100")})]}),N&&n("button",{type:"button",className:q("chat.timelineRow","cursor-pointer select-none"),onClick:()=>G(!p),children:[e("span",{children:p?"收起":"展开全部"}),e(ie,{className:l("size-3.5 transition-transform duration-300 ease-out-quint",p&&"rotate-180")})]})]}),v&&e("p",{role:"status",className:"px-4 py-2.5 text-xs text-danger",children:v})]})})}export{ae as TaskCard};
@@ -1,15 +1,15 @@
1
- import{t,a,de,x,b,F,C,l,p,Ba,Rn,sn,Fa,Tr,Er,Ar,Rr,za,Ua,ja,qa,Va,Wa,Ga,Ha,Ya,Za,Xa,Ka,Qa,Ja,ei,ti,ni,ln,ai,pe,se,le,Ze,Xe,Tt,bt,Et,Gn,Jt,Hn}from"./chunk-e763h2px.js";import{re}from"./chunk-4rwwtfnd.js";import{qe}from"./chunk-m24yb8md.js";import{$t}from"./chunk-3d3wnh8a.js";function Te(e){return Array.isArray(e)}function Ne(e){if(Rn(e))return e;let o=sn(e);if(!Qe(e))return{};if(Te(e)){let i=Array.from(e);if(e.length>0&&typeof e[0]==="string"&&Object.hasOwn(e,"index"))i.index=e.index,i.input=e.input;return i}if(ln(e)){let i=e;return new i.constructor(i.buffer,i.byteOffset,i.length)}if(o==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(o==="[object DataView]"){let i=e,{buffer:g,byteOffset:f,byteLength:r}=i,d=new ArrayBuffer(r),w=new Uint8Array(g,f,r);return new Uint8Array(d).set(w),new DataView(d)}if(o==="[object Boolean]"||o==="[object Number]"||o==="[object String]"){let g=new e.constructor(e.valueOf());if(o==="[object String]")et(g,e);else ge(g,e);return g}if(o==="[object Date]")return new Date(Number(e));if(o==="[object RegExp]"){let i=e,g=new RegExp(i.source,i.flags);return g.lastIndex=i.lastIndex,g}if(o==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(o==="[object Map]"){let i=e,g=new Map;return i.forEach((f,r)=>{g.set(r,f)}),g}if(o==="[object Set]"){let i=e,g=new Set;return i.forEach((f)=>{g.add(f)}),g}if(o==="[object Arguments]"){let i=e,g={};return ge(g,i),g.length=i.length,g[Symbol.iterator]=i[Symbol.iterator],g}let u={};return tt(u,e),ge(u,e),$e(u,e),u}function Qe(e){switch(sn(e)){case Rr:case Va:case Wa:case Ha:case Ar:case Ua:case ti:case ni:case Qa:case Ja:case ei:case ja:case Er:case Ga:case Fa:case qa:case Tr:case za:case Ya:case Za:case Xa:case Ka:return!0;default:return!1}}function ge(e,o){for(let u in o)if(Object.hasOwn(o,u))e[u]=o[u]}function $e(e,o){let u=Object.getOwnPropertySymbols(o);for(let i=0;i<u.length;i++){let g=u[i];if(Object.prototype.propertyIsEnumerable.call(o,g))e[g]=o[g]}}function et(e,o){let u=o.valueOf().length;for(let i in o)if(Object.hasOwn(o,i)&&(Number.isNaN(Number(i))||Number(i)>=u))e[i]=o[i]}function tt(e,o){let u=Object.getPrototypeOf(o);if(u!==null){if(typeof o.constructor==="function")Object.setPrototypeOf(e,u)}}var be=function(){var e=t(function(B,S,n,h){for(n=n||{},h=B.length;h--;n[B[h]]=S);return n},"o"),o=[1,15],u=[1,7],i=[1,13],g=[1,14],f=[1,19],r=[1,16],d=[1,17],w=[1,18],E=[8,30],k=[8,10,21,28,29,30,31,39,43,46],L=[1,23],_=[1,24],T=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],I=[1,49],N={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:t(function(S,n,h,m,D,s,H){var c=s.length-1;switch(D){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",s[c-1]),m.setHierarchy(s[c-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",s[c]),typeof s[c].length==="number"?this.$=s[c]:this.$=[s[c]];break;case 13:m.getLogger().debug("Rule: statement #2: ",s[c-1]),this.$=[s[c-1]].concat(s[c]);break;case 14:m.getLogger().debug("Rule: link: ",s[c],S),this.$={edgeTypeStr:s[c],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",s[c-3],s[c-1],s[c]),this.$={edgeTypeStr:s[c],label:s[c-1]};break;case 18:let V=parseInt(s[c]),j=m.generateId();this.$={id:j,type:"space",label:"",width:V,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",s[c-2],s[c-1],s[c]," typestr: ",s[c-1].edgeTypeStr);let G=m.edgeStrToEdgeData(s[c-1].edgeTypeStr),ie=m.edgeStrToEdgeStartData(s[c-1].edgeTypeStr),q=m.edgeStrToThickness(s[c-1].edgeTypeStr),ae=m.edgeStrToPattern(s[c-1].edgeTypeStr);this.$=[{id:s[c-2].id,label:s[c-2].label,type:s[c-2].type,directions:s[c-2].directions},{id:s[c-2].id+"-"+s[c].id,start:s[c-2].id,end:s[c].id,label:s[c-1].label,type:"edge",thickness:q,pattern:ae,directions:s[c].directions,arrowTypeEnd:G,arrowTypeStart:ie},{id:s[c].id,label:s[c].label,type:m.typeStr2Type(s[c].typeStr),directions:s[c].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[c-1],s[c]),this.$={id:s[c-1].id,label:s[c-1].label,type:m.typeStr2Type(s[c-1].typeStr),directions:s[c-1].directions,widthInColumns:parseInt(s[c],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",s[c]),this.$={id:s[c].id,label:s[c].label,type:m.typeStr2Type(s[c].typeStr),directions:s[c].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",s[c]),this.$={type:"column-setting",columns:s[c]==="auto"?-1:parseInt(s[c])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",s[c-2],s[c-1]);let O=m.generateId();this.$={...s[c-2],type:"composite",children:s[c-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",s[c-2],s[c-1],s[c]);let K=m.generateId();this.$={id:K,type:"composite",label:"",children:s[c-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",s[c]),this.$={id:s[c]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[c-1],s[c]),this.$={id:s[c-1],label:s[c].label,typeStr:s[c].typeStr,directions:s[c].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",s[c]),this.$=[s[c]];break;case 32:m.getLogger().debug("Rule: dirList: ",s[c-1],s[c]),this.$=[s[c-1]].concat(s[c]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",s[c-2],s[c-1],s[c]),this.$={typeStr:s[c-2]+s[c],label:s[c-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[c-3],s[c-2]," #3:",s[c-1],s[c]),this.$={typeStr:s[c-3]+s[c],label:s[c-2],directions:s[c-1]};break;case 35:case 36:this.$={type:"classDef",id:s[c-1].trim(),css:s[c].trim()};break;case 37:this.$={type:"applyClass",id:s[c-1].trim(),styleClass:s[c].trim()};break;case 38:this.$={type:"applyStyles",id:s[c-1].trim(),stylesStr:s[c].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:o,11:3,13:4,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{8:[1,20]},e(E,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:o,21:u,28:i,29:g,31:f,39:r,43:d,46:w}),e(k,[2,16],{14:22,15:L,16:_}),e(k,[2,17]),e(k,[2,18]),e(k,[2,19]),e(k,[2,20]),e(k,[2,21]),e(k,[2,22]),e(T,[2,25],{27:[1,25]}),e(k,[2,26]),{19:26,26:12,31:f},{10:o,11:27,13:4,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(E,[2,13]),{26:35,31:f},{31:[2,14]},{17:[1,36]},e(T,[2,24]),{10:o,11:37,13:4,14:22,15:L,16:_,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(T,[2,23]),{18:[1,45]},{30:[1,46]},e(k,[2,28]),e(k,[2,35]),e(k,[2,36]),e(k,[2,37]),e(k,[2,38]),{36:[1,47]},{33:48,34:I},{15:[1,50]},e(k,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:I,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:t(function(S,n){if(n.recoverable)this.trace(S);else{var h=Error(S);throw h.hash=n,h}},"parseError"),parse:t(function(S){var n=this,h=[0],m=[],D=[null],s=[],H=this.table,c="",V=0,j=0,G=0,ie=2,q=1,ae=s.slice.call(arguments,1),O=Object.create(this.lexer),K={yy:{}};for(var ne in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ne))K.yy[ne]=this.yy[ne];if(O.setInput(S,K.yy),K.yy.lexer=O,K.yy.parser=this,typeof O.yylloc>"u")O.yylloc={};var oe=O.yylloc;s.push(oe);var Ge=O.options&&O.options.ranges;if(typeof K.yy.parseError==="function")this.parseError=K.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Je(P){h.length=h.length-2*P,D.length=D.length-P,s.length=s.length-P}t(Je,"popStack");function _e(){var P=m.pop()||O.lex()||q;if(typeof P!=="number"){if(P instanceof Array)m=P,P=m.pop();P=n.symbols_[P]||P}return P}t(_e,"lex");var A,ce,W,R,At,ue,U={},J,Y,De,Z;while(!0){if(W=h[h.length-1],this.defaultActions[W])R=this.defaultActions[W];else{if(A===null||typeof A>"u")A=_e();R=H[W]&&H[W][A]}if(typeof R>"u"||!R.length||!R[0]){var he="";Z=[];for(J in H[W])if(this.terminals_[J]&&J>ie)Z.push("'"+this.terminals_[J]+"'");if(O.showPosition)he="Parse error on line "+(V+1)+`:
1
+ import{t,a,de,x,b,F,C,l,p,Ba,In,cn,Fa,Er,Ar,Rr,Lr,za,Ua,ja,qa,Va,Wa,Ga,Ha,Ya,Za,Xa,Ka,Qa,Ja,ei,ti,ni,un,ai,pe,se,le,Ze,Xe,Tt,vt,Et,Yn,en,Zn}from"./chunk-b5zf1hs3.js";import{re}from"./chunk-3n9ypydh.js";import{qe}from"./chunk-h754ntg7.js";import{Bt}from"./chunk-r4zbw4zj.js";function Te(e){return Array.isArray(e)}function Ne(e){if(In(e))return e;let o=cn(e);if(!Qe(e))return{};if(Te(e)){let i=Array.from(e);if(e.length>0&&typeof e[0]==="string"&&Object.hasOwn(e,"index"))i.index=e.index,i.input=e.input;return i}if(un(e)){let i=e;return new i.constructor(i.buffer,i.byteOffset,i.length)}if(o==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(o==="[object DataView]"){let i=e,{buffer:g,byteOffset:f,byteLength:r}=i,d=new ArrayBuffer(r),w=new Uint8Array(g,f,r);return new Uint8Array(d).set(w),new DataView(d)}if(o==="[object Boolean]"||o==="[object Number]"||o==="[object String]"){let g=new e.constructor(e.valueOf());if(o==="[object String]")et(g,e);else ge(g,e);return g}if(o==="[object Date]")return new Date(Number(e));if(o==="[object RegExp]"){let i=e,g=new RegExp(i.source,i.flags);return g.lastIndex=i.lastIndex,g}if(o==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(o==="[object Map]"){let i=e,g=new Map;return i.forEach((f,r)=>{g.set(r,f)}),g}if(o==="[object Set]"){let i=e,g=new Set;return i.forEach((f)=>{g.add(f)}),g}if(o==="[object Arguments]"){let i=e,g={};return ge(g,i),g.length=i.length,g[Symbol.iterator]=i[Symbol.iterator],g}let u={};return tt(u,e),ge(u,e),$e(u,e),u}function Qe(e){switch(cn(e)){case Lr:case Va:case Wa:case Ha:case Rr:case Ua:case ti:case ni:case Qa:case Ja:case ei:case ja:case Ar:case Ga:case Fa:case qa:case Er:case za:case Ya:case Za:case Xa:case Ka:return!0;default:return!1}}function ge(e,o){for(let u in o)if(Object.hasOwn(o,u))e[u]=o[u]}function $e(e,o){let u=Object.getOwnPropertySymbols(o);for(let i=0;i<u.length;i++){let g=u[i];if(Object.prototype.propertyIsEnumerable.call(o,g))e[g]=o[g]}}function et(e,o){let u=o.valueOf().length;for(let i in o)if(Object.hasOwn(o,i)&&(Number.isNaN(Number(i))||Number(i)>=u))e[i]=o[i]}function tt(e,o){let u=Object.getPrototypeOf(o);if(u!==null){if(typeof o.constructor==="function")Object.setPrototypeOf(e,u)}}var be=function(){var e=t(function(B,S,n,h){for(n=n||{},h=B.length;h--;n[B[h]]=S);return n},"o"),o=[1,15],u=[1,7],i=[1,13],g=[1,14],f=[1,19],r=[1,16],d=[1,17],w=[1,18],E=[8,30],k=[8,10,21,28,29,30,31,39,43,46],L=[1,23],_=[1,24],T=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],I=[1,49],N={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:t(function(S,n,h,m,D,s,H){var c=s.length-1;switch(D){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",s[c-1]),m.setHierarchy(s[c-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",s[c]),typeof s[c].length==="number"?this.$=s[c]:this.$=[s[c]];break;case 13:m.getLogger().debug("Rule: statement #2: ",s[c-1]),this.$=[s[c-1]].concat(s[c]);break;case 14:m.getLogger().debug("Rule: link: ",s[c],S),this.$={edgeTypeStr:s[c],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",s[c-3],s[c-1],s[c]),this.$={edgeTypeStr:s[c],label:s[c-1]};break;case 18:let V=parseInt(s[c]),j=m.generateId();this.$={id:j,type:"space",label:"",width:V,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",s[c-2],s[c-1],s[c]," typestr: ",s[c-1].edgeTypeStr);let G=m.edgeStrToEdgeData(s[c-1].edgeTypeStr),ie=m.edgeStrToEdgeStartData(s[c-1].edgeTypeStr),q=m.edgeStrToThickness(s[c-1].edgeTypeStr),ae=m.edgeStrToPattern(s[c-1].edgeTypeStr);this.$=[{id:s[c-2].id,label:s[c-2].label,type:s[c-2].type,directions:s[c-2].directions},{id:s[c-2].id+"-"+s[c].id,start:s[c-2].id,end:s[c].id,label:s[c-1].label,type:"edge",thickness:q,pattern:ae,directions:s[c].directions,arrowTypeEnd:G,arrowTypeStart:ie},{id:s[c].id,label:s[c].label,type:m.typeStr2Type(s[c].typeStr),directions:s[c].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[c-1],s[c]),this.$={id:s[c-1].id,label:s[c-1].label,type:m.typeStr2Type(s[c-1].typeStr),directions:s[c-1].directions,widthInColumns:parseInt(s[c],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",s[c]),this.$={id:s[c].id,label:s[c].label,type:m.typeStr2Type(s[c].typeStr),directions:s[c].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",s[c]),this.$={type:"column-setting",columns:s[c]==="auto"?-1:parseInt(s[c])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",s[c-2],s[c-1]);let O=m.generateId();this.$={...s[c-2],type:"composite",children:s[c-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",s[c-2],s[c-1],s[c]);let K=m.generateId();this.$={id:K,type:"composite",label:"",children:s[c-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",s[c]),this.$={id:s[c]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[c-1],s[c]),this.$={id:s[c-1],label:s[c].label,typeStr:s[c].typeStr,directions:s[c].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",s[c]),this.$=[s[c]];break;case 32:m.getLogger().debug("Rule: dirList: ",s[c-1],s[c]),this.$=[s[c-1]].concat(s[c]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",s[c-2],s[c-1],s[c]),this.$={typeStr:s[c-2]+s[c],label:s[c-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[c-3],s[c-2]," #3:",s[c-1],s[c]),this.$={typeStr:s[c-3]+s[c],label:s[c-2],directions:s[c-1]};break;case 35:case 36:this.$={type:"classDef",id:s[c-1].trim(),css:s[c].trim()};break;case 37:this.$={type:"applyClass",id:s[c-1].trim(),styleClass:s[c].trim()};break;case 38:this.$={type:"applyStyles",id:s[c-1].trim(),stylesStr:s[c].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:o,11:3,13:4,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{8:[1,20]},e(E,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:o,21:u,28:i,29:g,31:f,39:r,43:d,46:w}),e(k,[2,16],{14:22,15:L,16:_}),e(k,[2,17]),e(k,[2,18]),e(k,[2,19]),e(k,[2,20]),e(k,[2,21]),e(k,[2,22]),e(T,[2,25],{27:[1,25]}),e(k,[2,26]),{19:26,26:12,31:f},{10:o,11:27,13:4,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(E,[2,13]),{26:35,31:f},{31:[2,14]},{17:[1,36]},e(T,[2,24]),{10:o,11:37,13:4,14:22,15:L,16:_,19:5,20:6,21:u,22:8,23:9,24:10,25:11,26:12,28:i,29:g,31:f,39:r,43:d,46:w},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(T,[2,23]),{18:[1,45]},{30:[1,46]},e(k,[2,28]),e(k,[2,35]),e(k,[2,36]),e(k,[2,37]),e(k,[2,38]),{36:[1,47]},{33:48,34:I},{15:[1,50]},e(k,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:I,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:t(function(S,n){if(n.recoverable)this.trace(S);else{var h=Error(S);throw h.hash=n,h}},"parseError"),parse:t(function(S){var n=this,h=[0],m=[],D=[null],s=[],H=this.table,c="",V=0,j=0,G=0,ie=2,q=1,ae=s.slice.call(arguments,1),O=Object.create(this.lexer),K={yy:{}};for(var ne in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ne))K.yy[ne]=this.yy[ne];if(O.setInput(S,K.yy),K.yy.lexer=O,K.yy.parser=this,typeof O.yylloc>"u")O.yylloc={};var oe=O.yylloc;s.push(oe);var Ge=O.options&&O.options.ranges;if(typeof K.yy.parseError==="function")this.parseError=K.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Je(P){h.length=h.length-2*P,D.length=D.length-P,s.length=s.length-P}t(Je,"popStack");function _e(){var P=m.pop()||O.lex()||q;if(typeof P!=="number"){if(P instanceof Array)m=P,P=m.pop();P=n.symbols_[P]||P}return P}t(_e,"lex");var A,ce,W,R,At,ue,U={},J,Y,De,Z;while(!0){if(W=h[h.length-1],this.defaultActions[W])R=this.defaultActions[W];else{if(A===null||typeof A>"u")A=_e();R=H[W]&&H[W][A]}if(typeof R>"u"||!R.length||!R[0]){var he="";Z=[];for(J in H[W])if(this.terminals_[J]&&J>ie)Z.push("'"+this.terminals_[J]+"'");if(O.showPosition)he="Parse error on line "+(V+1)+`:
2
2
  `+O.showPosition()+`
3
3
  Expecting `+Z.join(", ")+", got '"+(this.terminals_[A]||A)+"'";else he="Parse error on line "+(V+1)+": Unexpected "+(A==q?"end of input":"'"+(this.terminals_[A]||A)+"'");this.parseError(he,{text:O.match,token:this.terminals_[A]||A,line:O.yylineno,loc:oe,expected:Z})}if(R[0]instanceof Array&&R.length>1)throw Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:if(h.push(A),D.push(O.yytext),s.push(O.yylloc),h.push(R[1]),A=null,!ce){if(j=O.yyleng,c=O.yytext,V=O.yylineno,oe=O.yylloc,G>0)G--}else A=ce,ce=null;break;case 2:if(Y=this.productions_[R[1]][1],U.$=D[D.length-Y],U._$={first_line:s[s.length-(Y||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(Y||1)].first_column,last_column:s[s.length-1].last_column},Ge)U._$.range=[s[s.length-(Y||1)].range[0],s[s.length-1].range[1]];if(ue=this.performAction.apply(U,[c,j,V,K.yy,R[1],D,s].concat(ae)),typeof ue<"u")return ue;if(Y)h=h.slice(0,-1*Y*2),D=D.slice(0,-1*Y),s=s.slice(0,-1*Y);h.push(this.productions_[R[1]][0]),D.push(U.$),s.push(U._$),De=H[h[h.length-2]][h[h.length-1]],h.push(De);break;case 3:return!0}}return!0},"parse")},v=function(){var B={EOF:1,parseError:t(function(n,h){if(this.yy.parser)this.yy.parser.parseError(n,h);else throw Error(n)},"parseError"),setInput:t(function(S,n){if(this.yy=n||this.yy||{},this._input=S,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];return this.offset=0,this},"setInput"),input:t(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var n=S.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),S},"input"),unput:t(function(S){var n=S.length,h=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var m=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1)this.yylineno-=h.length-1;var D=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[D[0],D[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(S){this.unput(this.match.slice(S))},"less"),pastInput:t(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var S=this.match;if(S.length<20)S+=this._input.substr(0,20-S.length);return(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var S=this.pastInput(),n=Array(S.length+1).join("-");return S+this.upcomingInput()+`
5
5
  `+n+"^"},"showPosition"),test_match:t(function(S,n){var h,m,D;if(this.options.backtrack_lexer){if(D={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)D.yylloc.range=this.yylloc.range.slice(0)}if(m=S[0].match(/(?:\r\n?|\n).*/g),m)this.yylineno+=m.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],h=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(h)return h;else if(this._backtrack){for(var s in D)this[s]=D[s];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var S,n,h,m;if(!this._more)this.yytext="",this.match="";var D=this._currentRules();for(var s=0;s<D.length;s++)if(h=this._input.match(this.rules[D[s]]),h&&(!n||h[0].length>n[0].length)){if(n=h,m=s,this.options.backtrack_lexer)if(S=this.test_match(h,D[s]),S!==!1)return S;else if(this._backtrack){n=!1;continue}else return!1;else if(!this.options.flex)break}if(n){if(S=this.test_match(n,D[m]),S!==!1)return S;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:t(function(n,h,m,D){var s=D;switch(m){case 0:return n.getLogger().debug("Found block-beta"),10;break;case 1:return n.getLogger().debug("Found id-block"),29;break;case 2:return n.getLogger().debug("Found block"),10;break;case 3:n.getLogger().debug(".",h.yytext);break;case 4:n.getLogger().debug("_",h.yytext);break;case 5:return 5;case 6:return h.yytext=-1,28;break;case 7:return h.yytext=h.yytext.replace(/columns\s+/,""),n.getLogger().debug("COLUMNS (LEX)",h.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:n.getLogger().debug("LEX: POPPING STR:",h.yytext),this.popState();break;case 13:return n.getLogger().debug("LEX: STR end:",h.yytext),"STR";break;case 14:return h.yytext=h.yytext.replace(/space\:/,""),n.getLogger().debug("SPACE NUM (LEX)",h.yytext),21;break;case 15:return h.yytext="1",n.getLogger().debug("COLUMNS (LEX)",h.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),n.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),n.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),n.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),n.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),n.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),n.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),n.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),n.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),n.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),n.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),n.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),n.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return n.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return n.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return n.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return n.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return n.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return n.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return n.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),n.getLogger().debug("LEX ARR START"),37;break;case 74:return n.getLogger().debug("Lex: NODE_ID",h.yytext),31;break;case 75:return n.getLogger().debug("Lex: EOF",h.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:n.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:n.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return n.getLogger().debug("LEX: NODE_DESCR:",h.yytext),"NODE_DESCR";break;case 83:n.getLogger().debug("LEX POPPING"),this.popState();break;case 84:n.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (right): dir:",h.yytext),"DIR";break;case 86:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (left):",h.yytext),"DIR";break;case 87:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (x):",h.yytext),"DIR";break;case 88:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (y):",h.yytext),"DIR";break;case 89:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (up):",h.yytext),"DIR";break;case 90:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (down):",h.yytext),"DIR";break;case 91:return h.yytext="]>",n.getLogger().debug("Lex (ARROW_DIR end):",h.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return n.getLogger().debug("Lex: LINK","#"+h.yytext+"#"),15;break;case 93:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 94:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 95:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 96:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 97:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 98:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return n.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),n.getLogger().debug("Lex: LINK","#"+h.yytext+"#"),15;break;case 102:return this.popState(),n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 103:return this.popState(),n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 104:return n.getLogger().debug("Lex: COLON",h.yytext),h.yytext=h.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return B}();N.lexer=v;function z(){this.yy={}}return t(z,"Parser"),z.prototype=N,N.Parser=z,new z}();be.parser=be;var rt=be,M=new Map,me=[],Se=new Map,Ie="color",Oe="fill",st="bgFill",ve=",",Q=new Map,Le="",it=t((e)=>b.sanitizeText(e,l()),"sanitizeText"),at=t(function(e,o=""){let u=Q.get(e);if(!u)u={id:e,styles:[],textStyles:[]},Q.set(e,u);if(o!==void 0&&o!==null)o.split(ve).forEach((i)=>{let g=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Ie).exec(i)){let r=g.replace(Oe,st).replace(Ie,Oe);u.textStyles.push(r)}u.styles.push(g)})},"addStyleClass"),nt=t(function(e,o=""){let u=M.get(e);if(o!==void 0&&o!==null)u.styles=o.split(ve)},"addStyle2Node"),ot=t(function(e,o){e.split(",").forEach(function(u){let i=M.get(u);if(i===void 0){let g=u.trim();i={id:g,type:"na",children:[]},M.set(g,i)}if(!i.classes)i.classes=[];i.classes.push(o)})},"setCssClass"),Ae=0,ze=t((e,o)=>{let u=e.flat(),i=[],f=u.find((r)=>r?.type==="column-setting")?.columns??-1;for(let r of u){if(typeof f==="number"&&f>0&&r.type!=="column-setting"&&typeof r.widthInColumns==="number"&&r.widthInColumns>f)a.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${f}`);if(r.label)r.label=it(r.label);if(r.type==="classDef"){at(r.id,r.css);continue}if(r.type==="applyClass"){ot(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){if(r?.stylesStr)nt(r.id,r?.stylesStr);continue}if(r.type==="column-setting")o.columns=r.columns??-1;else if(r.type==="edge"){let d=(Se.get(r.id)??0)+1;Se.set(r.id,d),r.id=d+"-"+r.id,me.push(r)}else{if(!r.label)if(r.type==="composite")r.label="";else r.label=r.id;let d=M.get(r.id);if(d===void 0){if(r.type==="composite")r.colorIndex=Ae++;M.set(r.id,r)}else{if(r.type!=="na")d.type=r.type;if(r.label!==r.id)d.label=r.label}if(r.children)ze(r.children,r);if(r.type==="space"){let w=r.width??1;for(let E=0;E<w;E++){let k=Ne(r);k.id=k.id+"-"+E,M.set(k.id,k),i.push(k)}}else if(d===void 0)i.push(r)}}o.children=i},"populateBlockDatabase"),ke=[],X={id:"root",type:"composite",children:[],columns:-1},lt=t(()=>{a.debug("Clear called"),C(),X={id:"root",type:"composite",children:[],columns:-1},M=new Map([["root",X]]),ke=[],Q=new Map,me=[],Se=new Map,Le="",Ae=0},"clear");function Be(e){switch(a.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return a.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}t(Be,"typeStr2Type");function Re(e){switch(a.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}t(Re,"edgeTypeStr2Type");function Pe(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}t(Pe,"edgeStrToEdgeData");function Fe(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}t(Fe,"edgeStrToEdgeStartData");function Me(e){return e.includes("==")?"thick":"normal"}t(Me,"edgeStrToThickness");function Ke(e){if(e.includes(".-"))return"dotted";return"solid"}t(Ke,"edgeStrToPattern");var Ce=0,ct=t(()=>(Ce++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Ce),"generateId"),ut=t((e)=>{X.children=e,ze(e,X),ke=X.children},"setHierarchy"),ht=t((e)=>{let o=M.get(e);if(!o)return-1;if(o.columns)return o.columns;if(!o.children)return-1;return o.children.length},"getColumns"),gt=t(()=>[...M.values()],"getBlocksFlat"),dt=t(()=>ke||[],"getBlocks"),pt=t(()=>me,"getEdges"),ft=t((e)=>M.get(e),"getBlock"),St=t((e)=>{M.set(e.id,e)},"setBlock"),xt=t((e)=>{Le=e},"setDiagramId"),mt=t(()=>Le,"getDiagramId"),Lt=t(()=>a,"getLogger"),kt=t(function(){return Q},"getClasses"),yt={getConfig:t(()=>x().block,"getConfig"),typeStr2Type:Be,edgeTypeStr2Type:Re,edgeStrToEdgeData:Pe,edgeStrToEdgeStartData:Fe,edgeStrToThickness:Me,edgeStrToPattern:Ke,getLogger:Lt,getBlocksFlat:gt,getBlocks:dt,getEdges:pt,setHierarchy:ut,getBlock:ft,setBlock:St,getColumns:ht,getClasses:kt,clear:lt,generateId:ct,setDiagramId:xt,getDiagramId:mt},wt=yt,_t=t((e)=>{let{theme:o,bkgColorArray:u,borderColorArray:i}=e;if(!se(o,i))return"";let g=le(e.look),f=pe(u),r="";for(let d=0;d<Ze(e.THEME_COLOR_LIMIT,i);d++){let w=i[d%i.length],E=f?`fill: ${u[d%u.length]};`:"",k=`[data-look="${g}"][data-color-id="color-${d}"]`;r+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:t(function(n,h,m,D){var s=D;switch(m){case 0:return n.getLogger().debug("Found block-beta"),10;break;case 1:return n.getLogger().debug("Found id-block"),29;break;case 2:return n.getLogger().debug("Found block"),10;break;case 3:n.getLogger().debug(".",h.yytext);break;case 4:n.getLogger().debug("_",h.yytext);break;case 5:return 5;case 6:return h.yytext=-1,28;break;case 7:return h.yytext=h.yytext.replace(/columns\s+/,""),n.getLogger().debug("COLUMNS (LEX)",h.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:n.getLogger().debug("LEX: POPPING STR:",h.yytext),this.popState();break;case 13:return n.getLogger().debug("LEX: STR end:",h.yytext),"STR";break;case 14:return h.yytext=h.yytext.replace(/space\:/,""),n.getLogger().debug("SPACE NUM (LEX)",h.yytext),21;break;case 15:return h.yytext="1",n.getLogger().debug("COLUMNS (LEX)",h.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),n.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),n.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),n.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),n.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),n.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),n.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),n.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),n.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),n.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),n.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),n.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),n.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),n.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return n.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return n.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return n.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return n.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return n.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return n.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return n.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return n.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),n.getLogger().debug("LEX ARR START"),37;break;case 74:return n.getLogger().debug("Lex: NODE_ID",h.yytext),31;break;case 75:return n.getLogger().debug("Lex: EOF",h.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:n.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:n.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return n.getLogger().debug("LEX: NODE_DESCR:",h.yytext),"NODE_DESCR";break;case 83:n.getLogger().debug("LEX POPPING"),this.popState();break;case 84:n.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (right): dir:",h.yytext),"DIR";break;case 86:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (left):",h.yytext),"DIR";break;case 87:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (x):",h.yytext),"DIR";break;case 88:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (y):",h.yytext),"DIR";break;case 89:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (up):",h.yytext),"DIR";break;case 90:return h.yytext=h.yytext.replace(/^,\s*/,""),n.getLogger().debug("Lex (down):",h.yytext),"DIR";break;case 91:return h.yytext="]>",n.getLogger().debug("Lex (ARROW_DIR end):",h.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return n.getLogger().debug("Lex: LINK","#"+h.yytext+"#"),15;break;case 93:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 94:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 95:return n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 96:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 97:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 98:return n.getLogger().debug("Lex: START_LINK",h.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return n.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),n.getLogger().debug("Lex: LINK","#"+h.yytext+"#"),15;break;case 102:return this.popState(),n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 103:return this.popState(),n.getLogger().debug("Lex: LINK",h.yytext),15;break;case 104:return n.getLogger().debug("Lex: COLON",h.yytext),h.yytext=h.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return B}();N.lexer=v;function z(){this.yy={}}return t(z,"Parser"),z.prototype=N,N.Parser=z,new z}();be.parser=be;var rt=be,M=new Map,me=[],Se=new Map,Ie="color",Oe="fill",st="bgFill",ve=",",Q=new Map,Le="",it=t((e)=>b.sanitizeText(e,l()),"sanitizeText"),at=t(function(e,o=""){let u=Q.get(e);if(!u)u={id:e,styles:[],textStyles:[]},Q.set(e,u);if(o!==void 0&&o!==null)o.split(ve).forEach((i)=>{let g=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Ie).exec(i)){let r=g.replace(Oe,st).replace(Ie,Oe);u.textStyles.push(r)}u.styles.push(g)})},"addStyleClass"),nt=t(function(e,o=""){let u=M.get(e);if(o!==void 0&&o!==null)u.styles=o.split(ve)},"addStyle2Node"),ot=t(function(e,o){e.split(",").forEach(function(u){let i=M.get(u);if(i===void 0){let g=u.trim();i={id:g,type:"na",children:[]},M.set(g,i)}if(!i.classes)i.classes=[];i.classes.push(o)})},"setCssClass"),Ae=0,ze=t((e,o)=>{let u=e.flat(),i=[],f=u.find((r)=>r?.type==="column-setting")?.columns??-1;for(let r of u){if(typeof f==="number"&&f>0&&r.type!=="column-setting"&&typeof r.widthInColumns==="number"&&r.widthInColumns>f)a.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${f}`);if(r.label)r.label=it(r.label);if(r.type==="classDef"){at(r.id,r.css);continue}if(r.type==="applyClass"){ot(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){if(r?.stylesStr)nt(r.id,r?.stylesStr);continue}if(r.type==="column-setting")o.columns=r.columns??-1;else if(r.type==="edge"){let d=(Se.get(r.id)??0)+1;Se.set(r.id,d),r.id=d+"-"+r.id,me.push(r)}else{if(!r.label)if(r.type==="composite")r.label="";else r.label=r.id;let d=M.get(r.id);if(d===void 0){if(r.type==="composite")r.colorIndex=Ae++;M.set(r.id,r)}else{if(r.type!=="na")d.type=r.type;if(r.label!==r.id)d.label=r.label}if(r.children)ze(r.children,r);if(r.type==="space"){let w=r.width??1;for(let E=0;E<w;E++){let k=Ne(r);k.id=k.id+"-"+E,M.set(k.id,k),i.push(k)}}else if(d===void 0)i.push(r)}}o.children=i},"populateBlockDatabase"),ke=[],X={id:"root",type:"composite",children:[],columns:-1},lt=t(()=>{a.debug("Clear called"),C(),X={id:"root",type:"composite",children:[],columns:-1},M=new Map([["root",X]]),ke=[],Q=new Map,me=[],Se=new Map,Le="",Ae=0},"clear");function Be(e){switch(a.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return a.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}t(Be,"typeStr2Type");function Re(e){switch(a.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}t(Re,"edgeTypeStr2Type");function Pe(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}t(Pe,"edgeStrToEdgeData");function Fe(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}t(Fe,"edgeStrToEdgeStartData");function Me(e){return e.includes("==")?"thick":"normal"}t(Me,"edgeStrToThickness");function Ke(e){if(e.includes(".-"))return"dotted";return"solid"}t(Ke,"edgeStrToPattern");var Ce=0,ct=t(()=>(Ce++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Ce),"generateId"),ut=t((e)=>{X.children=e,ze(e,X),ke=X.children},"setHierarchy"),ht=t((e)=>{let o=M.get(e);if(!o)return-1;if(o.columns)return o.columns;if(!o.children)return-1;return o.children.length},"getColumns"),gt=t(()=>[...M.values()],"getBlocksFlat"),dt=t(()=>ke||[],"getBlocks"),pt=t(()=>me,"getEdges"),ft=t((e)=>M.get(e),"getBlock"),bt=t((e)=>{M.set(e.id,e)},"setBlock"),St=t((e)=>{Le=e},"setDiagramId"),xt=t(()=>Le,"getDiagramId"),mt=t(()=>a,"getLogger"),Lt=t(function(){return Q},"getClasses"),kt={getConfig:t(()=>x().block,"getConfig"),typeStr2Type:Be,edgeTypeStr2Type:Re,edgeStrToEdgeData:Pe,edgeStrToEdgeStartData:Fe,edgeStrToThickness:Me,edgeStrToPattern:Ke,getLogger:mt,getBlocksFlat:gt,getBlocks:dt,getEdges:pt,setHierarchy:ut,getBlock:ft,setBlock:bt,getColumns:ht,getClasses:Lt,clear:lt,generateId:ct,setDiagramId:St,getDiagramId:xt},yt=kt,wt=t((e)=>{let{theme:o,bkgColorArray:u,borderColorArray:i}=e;if(!se(o,i))return"";let g=le(e.look),f=pe(u),r="";for(let d=0;d<Ze(e.THEME_COLOR_LIMIT,i);d++){let w=i[d%i.length],E=f?`fill: ${u[d%u.length]};`:"",k=`[data-look="${g}"][data-color-id="color-${d}"]`;r+=`
7
7
 
8
8
  ${k}.node rect.composite {
9
9
  stroke: ${w};
10
10
  ${E}
11
11
  }
12
- `}return r},"genColor"),fe=t((e,o)=>{let u=$t,i=u(e,"r"),g=u(e,"g"),f=u(e,"b");return de(i,g,f,o)},"fade"),Dt=t((e)=>`${_t(e)}
12
+ `}return r},"genColor"),fe=t((e,o)=>{let u=Bt,i=u(e,"r"),g=u(e,"g"),f=u(e,"b");return de(i,g,f,o)},"fade"),_t=t((e)=>`${wt(e)}
13
13
  .label {
14
14
  font-family: ${e.fontFamily};
15
15
  color: ${e.nodeTextColor||e.textColor};
@@ -137,4 +137,4 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[A]||A)+"'";else he="Parse er
137
137
  fill: ${e.textColor};
138
138
  }
139
139
  ${qe()}
140
- `,"getStyles"),Nt=Dt;function xe(e,o){if(e===0||!Number.isInteger(e))throw Error("Columns must be an integer !== 0.");if(o<0||!Number.isInteger(o))throw Error("Position must be a non-negative integer."+o);if(e<0)return{px:o,py:0};if(e===1)return{px:0,py:o};let u=o%e,i=Math.floor(o/e);return{px:u,py:i}}t(xe,"calculateBlockPosition");var It=t((e)=>{let o=0,u=0;for(let i of e.children){let{width:g,height:f,x:r,y:d}=i.size??{width:0,height:0,x:0,y:0};if(a.debug("getMaxChildSize abc95 child:",i.id,"width:",g,"height:",f,"x:",r,"y:",d,i.type),i.type==="space")continue;let w=g/(i.widthInColumns??1);if(w>o)o=w;if(f>u)u=f}return{width:o,height:u}},"getMaxChildSize");function ee(e,o,u=0,i=0,g=8){if(a.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",u),!e?.size?.width)e.size={width:u,height:i,x:0,y:0};let f=0,r=0;if(e.children?.length>0){for(let y of e.children)ee(y,o,0,0,g);let d=It(e);f=d.width,r=d.height,a.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",f,r);for(let y of e.children)if(y.size)a.debug(`abc95 Setting size of children of ${e.id} id=${y.id} ${f} ${r} ${JSON.stringify(y.size)}`),y.size.width=f*(y.widthInColumns??1)+g*((y.widthInColumns??1)-1),y.size.height=r,y.size.x=0,y.size.y=0,a.debug(`abc95 updating size of ${e.id} children child:${y.id} maxWidth:${f} maxHeight:${r}`);for(let y of e.children)ee(y,o,f,r,g);let w=e.columns??-1,E=0;for(let y of e.children)E+=y.widthInColumns??1;let k=e.children.length;if(w>0&&w<E)k=w;let L=Math.ceil(E/k),_=k*(f+g)+g,T=L*(r+g)+g;if(_<u){a.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${u} siblingHeight ${i} width ${_}`),_=u,T=i;let y=(u-k*g-g)/k,I=(i-L*g-g)/L;a.debug("Size indata abc88",e.id,"childWidth",y,"maxWidth",f),a.debug("Size indata abc88",e.id,"childHeight",I,"maxHeight",r),a.debug("Size indata abc88 xSize",k,"padding",g);for(let N of e.children)if(N.size)N.size.width=y,N.size.height=I,N.size.x=0,N.size.y=0}if(a.debug(`abc95 (finale calc) ${e.id} xSize ${k} ySize ${L} columns ${w}${e.children.length} width=${Math.max(_,e.size?.width||0)}`),_<(e?.size?.width||0)){_=e?.size?.width||0;let y=w>0?Math.min(e.children.length,w):e.children.length;if(y>0){let I=(_-y*g-g)/y;a.debug("abc95 (growing to fit) width",e.id,_,e.size?.width,I);for(let N of e.children)if(N.size)N.size.width=I}}e.size={width:_,height:T,x:0,y:0}}a.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}t(ee,"setBlockSizes");function ye(e,o,u=8){a.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(a.debug("layoutBlocks columns abc95",e.id,"=>",i,e),e.children&&e.children.length>0){let g=e?.children[0]?.size?.width??0,f=e.children.length*g+(e.children.length-1)*u;a.debug("widthOfChildren 88",f,"posX");let r=new Map;{let L=0;for(let _ of e.children){if(!_.size)continue;let{py:T}=xe(i,L),y=r.get(T)??0;if(_.size.height>y)r.set(T,_.size.height);let I=_?.widthInColumns??1;if(i>0)I=Math.min(I,i-L%i);L+=I}}let d=new Map;{let L=0,_=[...r.keys()].sort((T,y)=>T-y);for(let T of _)d.set(T,L),L+=(r.get(T)??0)+u}let w=0;a.debug("abc91 block?.size?.x",e.id,e?.size?.x);let E=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-u,k=0;for(let L of e.children){let _=e;if(!L.size)continue;let{width:T,height:y}=L.size,{px:I,py:N}=xe(i,w);if(N!=k)k=N,E=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-u,a.debug("New row in layout for block",e.id," and child ",L.id,k);if(a.debug(`abc89 layout blocks (child) id: ${L.id} Pos: ${w} (px, py) ${I},${N} (${_?.size?.x},${_?.size?.y}) parent: ${_.id} width: ${T}${u}`),_.size){let z=T/2;L.size.x=E+u+z,a.debug(`abc91 layout blocks (calc) px, pyid:${L.id} startingPos=X${E} new startingPosX${L.size.x} ${z} padding=${u} width=${T} halfWidth=${z} => x:${L.size.x} y:${L.size.y} ${L.widthInColumns} (width * (child?.w || 1)) / 2 ${T*(L?.widthInColumns??1)/2}`),E=L.size.x+z;let B=d.get(N)??0,S=r.get(N)??y;L.size.y=_.size.y-_.size.height/2+B+S/2+u,a.debug(`abc88 layout blocks (calc) px, pyid:${L.id}startingPosX${E}${u}${z}=>x:${L.size.x}y:${L.size.y}${L.widthInColumns}(width * (child?.w || 1)) / 2${T*(L?.widthInColumns??1)/2}`)}if(L.children)ye(L,o,u);let v=L?.widthInColumns??1;if(i>0)v=Math.min(v,i-w%i);w+=v,a.debug("abc88 columnsPos",L,w)}}a.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}t(ye,"layoutBlocks");function we(e,{minX:o,minY:u,maxX:i,maxY:g}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:f,y:r,width:d,height:w}=e.size;if(f-d/2<o)o=f-d/2;if(r-w/2<u)u=r-w/2;if(f+d/2>i)i=f+d/2;if(r+w/2>g)g=r+w/2}if(e.children)for(let f of e.children)({minX:o,minY:u,maxX:i,maxY:g}=we(f,{minX:o,minY:u,maxX:i,maxY:g}));return{minX:o,minY:u,maxX:i,maxY:g}}t(we,"findBounds");function Ye(e){let o=e.getBlock("root");if(!o)return;let u=l()?.block?.padding??8;ee(o,e,0,0,u),ye(o,e,u),a.debug("getBlocks",JSON.stringify(o,null,2));let{minX:i,minY:g,maxX:f,maxY:r}=we(o),d=r-g,w=f-i;return{x:i,y:g,width:w,height:d}}t(Ye,"layout");function Ee(e,o,u=!1){let i=e,g="default";if((i?.classes?.length||0)>0)g=(i?.classes??[]).join(" ");g=g+" flowchart-label";let f=(i?.classes??[]).flatMap((y)=>o.getClasses().get(y)?.styles??[]),r=0,d="rect",w;switch(i.type){case"round":r=5,d="rect";break;case"composite":r=0,d="composite",w=0;break;case"square":d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"group":d="rect";break;case"doublecircle":d="doublecircle";break;default:d="rect"}let E=ai(i?.styles??[]),k=i.label,L=i.size??{width:0,height:0,x:0,y:0},_=o.getDiagramId();return{labelStyle:E.labelStyle,shape:d,label:k,labelText:k,rx:r,ry:r,class:g,cssClasses:g,cssStyles:i?.styles??[],cssCompiledStyles:f,style:E.style,id:i.id,domId:_?`${_}-${i.id}`:i.id,isGroup:!1,directions:i.directions,width:L.width||void 0,height:L.height||void 0,wrappingWidth:L.width||Number.POSITIVE_INFINITY,x:L.x,y:L.y,positioned:u,intersect:void 0,padding:w??x()?.block?.padding??0,widthInColumns:i.widthInColumns??1,colorIndex:i.colorIndex,look:x().look}}t(Ee,"getNodeFromBlock");async function We(e,o,u){let i=Ee(o,u,!1);if(o.type==="group")return;let g=x(),f=await Tt(e,i,{config:g}),r=f.node()?.getBBox()??{width:0,height:0},d=u.getBlock(i.id);d.size={width:r.width,height:r.height,x:0,y:0,node:f},u.setBlock(d),f.remove()}t(We,"calculateBlockSize");async function Ve(e,o,u){let i=Ee(o,u,!0);if(u.getBlock(i.id).type!=="space"){let f=x(),r=await Tt(e,i,{config:f});if(i.colorIndex!==void 0)Xe(r,i.colorIndex,f.theme,f.themeVariables?.borderColorArray);o.intersect=i?.intersect,bt(i)}}t(Ve,"insertBlockPositioned");async function te(e,o,u,i){for(let g of o)if(await i(e,g,u),g.children)await te(e,g.children,u,i)}t(te,"performOperations");async function Ue(e,o,u){await te(e,o,u,We)}t(Ue,"calculateBlockSizes");async function He(e,o,u){await te(e,o,u,Ve)}t(He,"insertBlocks");async function je(e,o,u,i,g){let f=new re({multigraph:!0,compound:!0});f.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let r of u)if(r.size)f.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(let r of o)if(r.start&&r.end){let d=i.getBlock(r.start),w=i.getBlock(r.end);if(d?.size&&w?.size){let E=d.size,k=w.size,L=[{x:E.x,y:E.y},{x:E.x+(k.x-E.x)/2,y:E.y+(k.y-E.y)/2},{x:k.x,y:k.y}],_=g?`${g}-${r.id}`:r.id,T=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",y=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",I=`${T} ${y} flowchart-link LS-a1 LE-b1`;if(Jt(e,{...r,id:_,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:L,classes:I},{},"block",f.node(r.start),f.node(r.end),g),r.label)await Et(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:L,classes:I}),Gn({...r,x:L[1].x,y:L[1].y},{originalPath:L})}}}t(je,"insertEdges");var Ot=t(function(e,o){return o.db.getClasses()},"getClasses"),Ct=t(async function(e,o,u,i){let{securityLevel:g,block:f}=x(),r=i.db;r.setDiagramId(o);let d;if(g==="sandbox")d=p("#i"+o);let w=g==="sandbox"?p(d.nodes()[0].contentDocument.body):p("body"),E=g==="sandbox"?w.select(`[id="${o}"]`):p(`[id="${o}"]`);Ba(E,x()),Hn(E,["point","circle","cross"],i.type,o);let L=r.getBlocks(),_=r.getBlocksFlat(),T=r.getEdges(),y=E.insert("g").attr("class","block");await Ue(y,L,r);let I=Ye(r);await He(y,L,r),await je(y,T,_,r,o);let N=y.node()?.getBBox(),v=N&&Number.isFinite(N.width)&&Number.isFinite(N.height)?N:I;if(v){let z=Math.max(1,Math.round(0.125*(v.width/v.height))),B=v.height+z+10,S=v.width+10,{useMaxWidth:n}=f;F(E,B,S,!!n),a.debug("Here Bounds",I,v),E.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),vt={draw:Ct,getClasses:Ot},nr={parser:rt,db:wt,renderer:vt,styles:Nt};export{nr as diagram};
140
+ `,"getStyles"),Dt=_t;function xe(e,o){if(e===0||!Number.isInteger(e))throw Error("Columns must be an integer !== 0.");if(o<0||!Number.isInteger(o))throw Error("Position must be a non-negative integer."+o);if(e<0)return{px:o,py:0};if(e===1)return{px:0,py:o};let u=o%e,i=Math.floor(o/e);return{px:u,py:i}}t(xe,"calculateBlockPosition");var Nt=t((e)=>{let o=0,u=0;for(let i of e.children){let{width:g,height:f,x:r,y:d}=i.size??{width:0,height:0,x:0,y:0};if(a.debug("getMaxChildSize abc95 child:",i.id,"width:",g,"height:",f,"x:",r,"y:",d,i.type),i.type==="space")continue;let w=g/(i.widthInColumns??1);if(w>o)o=w;if(f>u)u=f}return{width:o,height:u}},"getMaxChildSize");function ee(e,o,u=0,i=0,g=8){if(a.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",u),!e?.size?.width)e.size={width:u,height:i,x:0,y:0};let f=0,r=0;if(e.children?.length>0){for(let y of e.children)ee(y,o,0,0,g);let d=Nt(e);f=d.width,r=d.height,a.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",f,r);for(let y of e.children)if(y.size)a.debug(`abc95 Setting size of children of ${e.id} id=${y.id} ${f} ${r} ${JSON.stringify(y.size)}`),y.size.width=f*(y.widthInColumns??1)+g*((y.widthInColumns??1)-1),y.size.height=r,y.size.x=0,y.size.y=0,a.debug(`abc95 updating size of ${e.id} children child:${y.id} maxWidth:${f} maxHeight:${r}`);for(let y of e.children)ee(y,o,f,r,g);let w=e.columns??-1,E=0;for(let y of e.children)E+=y.widthInColumns??1;let k=e.children.length;if(w>0&&w<E)k=w;let L=Math.ceil(E/k),_=k*(f+g)+g,T=L*(r+g)+g;if(_<u){a.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${u} siblingHeight ${i} width ${_}`),_=u,T=i;let y=(u-k*g-g)/k,I=(i-L*g-g)/L;a.debug("Size indata abc88",e.id,"childWidth",y,"maxWidth",f),a.debug("Size indata abc88",e.id,"childHeight",I,"maxHeight",r),a.debug("Size indata abc88 xSize",k,"padding",g);for(let N of e.children)if(N.size)N.size.width=y,N.size.height=I,N.size.x=0,N.size.y=0}if(a.debug(`abc95 (finale calc) ${e.id} xSize ${k} ySize ${L} columns ${w}${e.children.length} width=${Math.max(_,e.size?.width||0)}`),_<(e?.size?.width||0)){_=e?.size?.width||0;let y=w>0?Math.min(e.children.length,w):e.children.length;if(y>0){let I=(_-y*g-g)/y;a.debug("abc95 (growing to fit) width",e.id,_,e.size?.width,I);for(let N of e.children)if(N.size)N.size.width=I}}e.size={width:_,height:T,x:0,y:0}}a.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}t(ee,"setBlockSizes");function ye(e,o,u=8){a.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(a.debug("layoutBlocks columns abc95",e.id,"=>",i,e),e.children&&e.children.length>0){let g=e?.children[0]?.size?.width??0,f=e.children.length*g+(e.children.length-1)*u;a.debug("widthOfChildren 88",f,"posX");let r=new Map;{let L=0;for(let _ of e.children){if(!_.size)continue;let{py:T}=xe(i,L),y=r.get(T)??0;if(_.size.height>y)r.set(T,_.size.height);let I=_?.widthInColumns??1;if(i>0)I=Math.min(I,i-L%i);L+=I}}let d=new Map;{let L=0,_=[...r.keys()].sort((T,y)=>T-y);for(let T of _)d.set(T,L),L+=(r.get(T)??0)+u}let w=0;a.debug("abc91 block?.size?.x",e.id,e?.size?.x);let E=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-u,k=0;for(let L of e.children){let _=e;if(!L.size)continue;let{width:T,height:y}=L.size,{px:I,py:N}=xe(i,w);if(N!=k)k=N,E=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-u,a.debug("New row in layout for block",e.id," and child ",L.id,k);if(a.debug(`abc89 layout blocks (child) id: ${L.id} Pos: ${w} (px, py) ${I},${N} (${_?.size?.x},${_?.size?.y}) parent: ${_.id} width: ${T}${u}`),_.size){let z=T/2;L.size.x=E+u+z,a.debug(`abc91 layout blocks (calc) px, pyid:${L.id} startingPos=X${E} new startingPosX${L.size.x} ${z} padding=${u} width=${T} halfWidth=${z} => x:${L.size.x} y:${L.size.y} ${L.widthInColumns} (width * (child?.w || 1)) / 2 ${T*(L?.widthInColumns??1)/2}`),E=L.size.x+z;let B=d.get(N)??0,S=r.get(N)??y;L.size.y=_.size.y-_.size.height/2+B+S/2+u,a.debug(`abc88 layout blocks (calc) px, pyid:${L.id}startingPosX${E}${u}${z}=>x:${L.size.x}y:${L.size.y}${L.widthInColumns}(width * (child?.w || 1)) / 2${T*(L?.widthInColumns??1)/2}`)}if(L.children)ye(L,o,u);let v=L?.widthInColumns??1;if(i>0)v=Math.min(v,i-w%i);w+=v,a.debug("abc88 columnsPos",L,w)}}a.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}t(ye,"layoutBlocks");function we(e,{minX:o,minY:u,maxX:i,maxY:g}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:f,y:r,width:d,height:w}=e.size;if(f-d/2<o)o=f-d/2;if(r-w/2<u)u=r-w/2;if(f+d/2>i)i=f+d/2;if(r+w/2>g)g=r+w/2}if(e.children)for(let f of e.children)({minX:o,minY:u,maxX:i,maxY:g}=we(f,{minX:o,minY:u,maxX:i,maxY:g}));return{minX:o,minY:u,maxX:i,maxY:g}}t(we,"findBounds");function Ye(e){let o=e.getBlock("root");if(!o)return;let u=l()?.block?.padding??8;ee(o,e,0,0,u),ye(o,e,u),a.debug("getBlocks",JSON.stringify(o,null,2));let{minX:i,minY:g,maxX:f,maxY:r}=we(o),d=r-g,w=f-i;return{x:i,y:g,width:w,height:d}}t(Ye,"layout");function Ee(e,o,u=!1){let i=e,g="default";if((i?.classes?.length||0)>0)g=(i?.classes??[]).join(" ");g=g+" flowchart-label";let f=(i?.classes??[]).flatMap((y)=>o.getClasses().get(y)?.styles??[]),r=0,d="rect",w;switch(i.type){case"round":r=5,d="rect";break;case"composite":r=0,d="composite",w=0;break;case"square":d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"block_arrow":d="block_arrow";break;case"odd":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"rect_left_inv_arrow":d="rect_left_inv_arrow";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"group":d="rect";break;case"doublecircle":d="doublecircle";break;default:d="rect"}let E=ai(i?.styles??[]),k=i.label,L=i.size??{width:0,height:0,x:0,y:0},_=o.getDiagramId();return{labelStyle:E.labelStyle,shape:d,label:k,labelText:k,rx:r,ry:r,class:g,cssClasses:g,cssStyles:i?.styles??[],cssCompiledStyles:f,style:E.style,id:i.id,domId:_?`${_}-${i.id}`:i.id,isGroup:!1,directions:i.directions,width:L.width||void 0,height:L.height||void 0,wrappingWidth:L.width||Number.POSITIVE_INFINITY,x:L.x,y:L.y,positioned:u,intersect:void 0,padding:w??x()?.block?.padding??0,widthInColumns:i.widthInColumns??1,colorIndex:i.colorIndex,look:x().look}}t(Ee,"getNodeFromBlock");async function We(e,o,u){let i=Ee(o,u,!1);if(o.type==="group")return;let g=x(),f=await Tt(e,i,{config:g}),r=f.node()?.getBBox()??{width:0,height:0},d=u.getBlock(i.id);d.size={width:r.width,height:r.height,x:0,y:0,node:f},u.setBlock(d),f.remove()}t(We,"calculateBlockSize");async function Ve(e,o,u){let i=Ee(o,u,!0);if(u.getBlock(i.id).type!=="space"){let f=x(),r=await Tt(e,i,{config:f});if(i.colorIndex!==void 0)Xe(r,i.colorIndex,f.theme,f.themeVariables?.borderColorArray);o.intersect=i?.intersect,vt(i)}}t(Ve,"insertBlockPositioned");async function te(e,o,u,i){for(let g of o)if(await i(e,g,u),g.children)await te(e,g.children,u,i)}t(te,"performOperations");async function Ue(e,o,u){await te(e,o,u,We)}t(Ue,"calculateBlockSizes");async function He(e,o,u){await te(e,o,u,Ve)}t(He,"insertBlocks");async function je(e,o,u,i,g){let f=new re({multigraph:!0,compound:!0});f.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let r of u)if(r.size)f.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(let r of o)if(r.start&&r.end){let d=i.getBlock(r.start),w=i.getBlock(r.end);if(d?.size&&w?.size){let E=d.size,k=w.size,L=[{x:E.x,y:E.y},{x:E.x+(k.x-E.x)/2,y:E.y+(k.y-E.y)/2},{x:k.x,y:k.y}],_=g?`${g}-${r.id}`:r.id,T=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",y=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",I=`${T} ${y} flowchart-link LS-a1 LE-b1`;if(en(e,{...r,id:_,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:L,classes:I},{},"block",f.node(r.start),f.node(r.end),g),r.label)await Et(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:L,classes:I}),Yn({...r,x:L[1].x,y:L[1].y},{originalPath:L})}}}t(je,"insertEdges");var It=t(function(e,o){return o.db.getClasses()},"getClasses"),Ot=t(async function(e,o,u,i){let{securityLevel:g,block:f}=x(),r=i.db;r.setDiagramId(o);let d;if(g==="sandbox")d=p("#i"+o);let w=g==="sandbox"?p(d.nodes()[0].contentDocument.body):p("body"),E=g==="sandbox"?w.select(`[id="${o}"]`):p(`[id="${o}"]`);Ba(E,x()),Zn(E,["point","circle","cross"],i.type,o);let L=r.getBlocks(),_=r.getBlocksFlat(),T=r.getEdges(),y=E.insert("g").attr("class","block");await Ue(y,L,r);let I=Ye(r);await He(y,L,r),await je(y,T,_,r,o);let N=y.node()?.getBBox(),v=N&&Number.isFinite(N.width)&&Number.isFinite(N.height)?N:I;if(v){let z=Math.max(1,Math.round(0.125*(v.width/v.height))),B=v.height+z+10,S=v.width+10,{useMaxWidth:n}=f;F(E,B,S,!!n),a.debug("Here Bounds",I,v),E.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),Ct={draw:Ot,getClasses:It},ar={parser:rt,db:yt,renderer:Ct,styles:Dt};export{ar as diagram};