@bkm016/basalt 0.0.0-stage → 0.1.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.
Files changed (252) hide show
  1. package/README.md +275 -2
  2. package/chunk-0hbjv3y6.js +11 -0
  3. package/chunk-0rya8cxe.js +3 -0
  4. package/chunk-0szjy61m.js +2 -0
  5. package/chunk-0tdv0t5q.js +3 -0
  6. package/chunk-1egbcp85.js +59 -0
  7. package/chunk-1fv27j4b.js +3 -0
  8. package/chunk-1yzt0qm0.js +2 -0
  9. package/chunk-2zqny2sy.js +2 -0
  10. package/chunk-32at88hc.js +3 -0
  11. package/chunk-356q8e0y.js +10 -0
  12. package/chunk-3jz9g8ab.js +10 -0
  13. package/chunk-3p7q2pyp.js +3 -0
  14. package/chunk-501zkf9b.js +3 -0
  15. package/chunk-58vz2qsq.js +2 -0
  16. package/chunk-5fdgy0q2.js +16 -0
  17. package/chunk-5wp4egky.js +7 -0
  18. package/chunk-665jzf2w.js +25 -0
  19. package/chunk-6gyhajhx.js +3 -0
  20. package/chunk-7yw8aa5j.js +31 -0
  21. package/chunk-8wjgbd9k.js +3 -0
  22. package/chunk-913tfr9c.js +2 -0
  23. package/chunk-97kjn55j.js +2 -0
  24. package/chunk-9y69ywyg.js +3 -0
  25. package/chunk-a6r4z44b.js +2 -0
  26. package/chunk-agntrqs9.js +2 -0
  27. package/chunk-b9bg5fhd.js +2 -0
  28. package/chunk-bj14jshr.js +3 -0
  29. package/chunk-c25s4w6a.js +5 -0
  30. package/chunk-d48bfd2e.js +3 -0
  31. package/chunk-d913kpyw.js +3 -0
  32. package/chunk-dakrpbe6.js +3 -0
  33. package/chunk-g2k3yhgh.js +12 -0
  34. package/chunk-hat3s3pr.js +3 -0
  35. package/chunk-hcn9cf6v.js +2 -0
  36. package/chunk-j2x0g1vg.js +2 -0
  37. package/chunk-k0t23cmx.js +2 -0
  38. package/chunk-k7w7ac9q.js +18 -0
  39. package/chunk-kgdrjqsy.js +3 -0
  40. package/chunk-kjr81mrd.js +9 -0
  41. package/chunk-m38ber71.js +2 -0
  42. package/chunk-n6e43rvk.js +3 -0
  43. package/chunk-qbf8x2ft.js +5 -0
  44. package/chunk-qcwnkr5y.js +2 -0
  45. package/chunk-qffb7een.js +3 -0
  46. package/chunk-qnr1f5pj.js +3 -0
  47. package/chunk-r9aatvwm.js +3 -0
  48. package/chunk-rad3dm0q.js +2 -0
  49. package/chunk-rjdhaasf.js +3 -0
  50. package/chunk-rm3kcxq9.js +20 -0
  51. package/chunk-rv06x0kn.js +7 -0
  52. package/chunk-sf13azm4.js +12 -0
  53. package/chunk-sytpmbfp.js +471 -0
  54. package/chunk-t057xfrt.js +5 -0
  55. package/chunk-tjpvayr1.js +2 -0
  56. package/chunk-tnrqkc7b.js +8 -0
  57. package/chunk-v9fea96h.js +3 -0
  58. package/chunk-ve7qx8wm.js +3 -0
  59. package/chunk-vkkj4awb.js +2 -0
  60. package/chunk-wc5j0hfw.js +39 -0
  61. package/chunk-wd9zxhza.js +2 -0
  62. package/chunk-wx7kdf0b.js +2 -0
  63. package/chunk-x9982ek7.js +25 -0
  64. package/chunk-xhk54h2q.js +7 -0
  65. package/chunk-xsbxykr4.js +2 -0
  66. package/chunk-y69ewdn2.js +3 -0
  67. package/chunk-y8ced1jm.js +5 -0
  68. package/chunk-y9xe9ct2.js +2 -0
  69. package/chunk-yb1jxgnk.js +2 -0
  70. package/chunk-zt1wvkyf.js +3 -0
  71. package/compiled.js +3773 -0
  72. package/icon-dp9pmcvp.png +0 -0
  73. package/package.json +20 -4
  74. package/ui-test-worker.js +226 -0
  75. package/web/KaTeX_AMS-Regular-n7eqehx2.woff2 +0 -0
  76. package/web/KaTeX_Caligraphic-Bold-20r3b6fv.woff2 +0 -0
  77. package/web/KaTeX_Caligraphic-Regular-kkjm8f18.woff2 +0 -0
  78. package/web/KaTeX_Fraktur-Bold-pz5vg4t0.woff2 +0 -0
  79. package/web/KaTeX_Fraktur-Regular-a1e9wkwk.woff2 +0 -0
  80. package/web/KaTeX_Main-Bold-mcp098h8.woff2 +0 -0
  81. package/web/KaTeX_Main-BoldItalic-fy74z249.woff2 +0 -0
  82. package/web/KaTeX_Main-Italic-hw2gxy7f.woff2 +0 -0
  83. package/web/KaTeX_Main-Regular-xvp1b75c.woff2 +0 -0
  84. package/web/KaTeX_Math-BoldItalic-mf5nf33d.woff2 +0 -0
  85. package/web/KaTeX_Math-Italic-ap60jrna.woff2 +0 -0
  86. package/web/KaTeX_SansSerif-Bold-we3bymb6.woff2 +0 -0
  87. package/web/KaTeX_SansSerif-Italic-ent92bjx.woff2 +0 -0
  88. package/web/KaTeX_SansSerif-Regular-0573pbz9.woff2 +0 -0
  89. package/web/KaTeX_Script-Regular-z2rtj6vq.woff2 +0 -0
  90. package/web/KaTeX_Size1-Regular-dfr3w1hv.woff2 +0 -0
  91. package/web/KaTeX_Size2-Regular-kted78zb.woff2 +0 -0
  92. package/web/KaTeX_Size3-Regular-e6k1k5jk.woff2 +0 -0
  93. package/web/KaTeX_Size4-Regular-abedc1pd.woff2 +0 -0
  94. package/web/KaTeX_Typewriter-Regular-scw9zx1z.woff2 +0 -0
  95. package/web/apple-touch-icon-7dkm33qp.png +0 -0
  96. package/web/apple-touch-icon.png +0 -0
  97. package/web/chunk-00mq7bhx.js +1 -0
  98. package/web/chunk-0atfn8jf.js +1 -0
  99. package/web/chunk-0k0hvh59.js +40 -0
  100. package/web/chunk-0mrkjnte.js +1 -0
  101. package/web/chunk-0pbjgdgp.js +2 -0
  102. package/web/chunk-0s80zw00.js +1 -0
  103. package/web/chunk-0xck277j.js +140 -0
  104. package/web/chunk-1t760bg0.js +1 -0
  105. package/web/chunk-1v3d60pp.js +217 -0
  106. package/web/chunk-1x8fn8w9.js +1 -0
  107. package/web/chunk-20q90epj.js +2 -0
  108. package/web/chunk-24mfx6w1.js +2 -0
  109. package/web/chunk-29e1trsq.js +78 -0
  110. package/web/chunk-2j4m0bh1.js +2 -0
  111. package/web/chunk-310yey4q.js +1 -0
  112. package/web/chunk-32ezm0ry.js +1136 -0
  113. package/web/chunk-3ahpr030.js +2 -0
  114. package/web/chunk-3bqh2dkw.js +7 -0
  115. package/web/chunk-3cfabjey.js +370 -0
  116. package/web/chunk-3hvgs5aw.js +1 -0
  117. package/web/chunk-3kh6zefg.js +1 -0
  118. package/web/chunk-3pf33xsm.js +98 -0
  119. package/web/chunk-3pm4645m.js +2 -0
  120. package/web/chunk-401v5ht6.js +8 -0
  121. package/web/chunk-4b5mt5pd.js +70 -0
  122. package/web/chunk-4gavbw65.js +1 -0
  123. package/web/chunk-4rm1vy7w.js +1 -0
  124. package/web/chunk-4wd9r73y.js +1 -0
  125. package/web/chunk-4y2td14d.js +24 -0
  126. package/web/chunk-54thej0t.js +2 -0
  127. package/web/chunk-55kw67nv.js +1 -0
  128. package/web/chunk-59kqahb3.js +1 -0
  129. package/web/chunk-5hex8g0y.js +24 -0
  130. package/web/chunk-5r5kv4gh.js +1 -0
  131. package/web/chunk-6atq9qtt.js +7 -0
  132. package/web/chunk-6beqrmtq.js +1 -0
  133. package/web/chunk-6m69hczt.js +2 -0
  134. package/web/chunk-6r912gfj.js +34 -0
  135. package/web/chunk-74j07k8k.js +2 -0
  136. package/web/chunk-7f0m2yrd.js +169 -0
  137. package/web/chunk-8g239029.js +1 -0
  138. package/web/chunk-942prjb6.js +332 -0
  139. package/web/chunk-95q1bwxn.js +1 -0
  140. package/web/chunk-9s7c178f.js +1 -0
  141. package/web/chunk-9v1f6yc8.js +1 -0
  142. package/web/chunk-a3xt6840.js +38 -0
  143. package/web/chunk-ad6x47yy.js +1 -0
  144. package/web/chunk-b5brnfv9.js +2 -0
  145. package/web/chunk-benmmqt2.js +1 -0
  146. package/web/chunk-bgqdcnke.js +1 -0
  147. package/web/chunk-bhe4jzha.js +1 -0
  148. package/web/chunk-bwyw10wx.js +39 -0
  149. package/web/chunk-c85wxnpw.js +292 -0
  150. package/web/chunk-canbct9d.js +55 -0
  151. package/web/chunk-cg3jterp.js +2 -0
  152. package/web/chunk-d18r4m14.js +141 -0
  153. package/web/chunk-d4d3mnak.js +84 -0
  154. package/web/chunk-dmqtdeb4.js +1 -0
  155. package/web/chunk-dy2gm1fs.js +1 -0
  156. package/web/chunk-e5rmr47n.js +2 -0
  157. package/web/chunk-ea9swkkt.js +1 -0
  158. package/web/chunk-ejd43q75.js +19 -0
  159. package/web/chunk-eqegxtdt.js +1 -0
  160. package/web/chunk-ev1g5cqw.js +2 -0
  161. package/web/chunk-ezyvv4ab.js +3 -0
  162. package/web/chunk-f91wzwtk.js +1 -0
  163. package/web/chunk-fdkp6tzq.js +36 -0
  164. package/web/chunk-g1ev11wx.js +1 -0
  165. package/web/chunk-g9qv15hq.js +41 -0
  166. package/web/chunk-ghxe4gam.js +2 -0
  167. package/web/chunk-gmfp7fg4.js +1 -0
  168. package/web/chunk-gxay64d5.js +1 -0
  169. package/web/chunk-gxn0bey7.js +142 -0
  170. package/web/chunk-haphmhz8.js +200 -0
  171. package/web/chunk-hejz98gw.js +1 -0
  172. package/web/chunk-hfaffkrh.js +1 -0
  173. package/web/chunk-hp167dbv.js +1 -0
  174. package/web/chunk-hryhthxr.js +16 -0
  175. package/web/chunk-j2vt8c8v.js +1 -0
  176. package/web/chunk-jg6nzn6q.js +1 -0
  177. package/web/chunk-jtwhjp20.js +303 -0
  178. package/web/chunk-jvhmna7z.js +89 -0
  179. package/web/chunk-ka3q31t1.js +1 -0
  180. package/web/chunk-kbtbbarw.js +2 -0
  181. package/web/chunk-ktqt87qw.js +1 -0
  182. package/web/chunk-kx2xk3bb.js +1 -0
  183. package/web/chunk-m2d1sp30.js +1 -0
  184. package/web/chunk-mdsgekpk.js +1 -0
  185. package/web/chunk-mq92vqb1.js +2 -0
  186. package/web/chunk-n1dmrz44.js +2 -0
  187. package/web/chunk-n5fn9khr.js +1 -0
  188. package/web/chunk-n90cqdvg.js +2 -0
  189. package/web/chunk-nerx2q12.js +139 -0
  190. package/web/chunk-ngpq43vn.js +1 -0
  191. package/web/chunk-nj0cv1cq.js +257 -0
  192. package/web/chunk-nzey7cpv.js +1 -0
  193. package/web/chunk-p8y0hjx9.js +2 -0
  194. package/web/chunk-pxe3vna4.js +1 -0
  195. package/web/chunk-pz934t6t.js +30 -0
  196. package/web/chunk-r1dnh0s8.js +1 -0
  197. package/web/chunk-r5eakmw6.js +1 -0
  198. package/web/chunk-rkesqprv.js +1 -0
  199. package/web/chunk-rsn8j7xv.js +120 -0
  200. package/web/chunk-rtf2zzzv.js +1 -0
  201. package/web/chunk-ry9256r7.js +1 -0
  202. package/web/chunk-rykfak98.js +2 -0
  203. package/web/chunk-rz6wwdd5.js +106 -0
  204. package/web/chunk-s8vapqgr.js +12 -0
  205. package/web/chunk-sc63gh9d.js +2 -0
  206. package/web/chunk-srrfphes.js +1 -0
  207. package/web/chunk-svdzmaxb.js +2 -0
  208. package/web/chunk-svmhj9hd.js +1 -0
  209. package/web/chunk-t6agpn2z.js +1 -0
  210. package/web/chunk-tfyxp2qs.js +89 -0
  211. package/web/chunk-ts7zrf5b.js +2 -0
  212. package/web/chunk-ttg6tbwx.js +2 -0
  213. package/web/chunk-v47rhg7b.js +1 -0
  214. package/web/chunk-v5cnt7c8.js +1 -0
  215. package/web/chunk-v6v831tc.js +214 -0
  216. package/web/chunk-vadqkz3x.js +99 -0
  217. package/web/chunk-vfqdy860.js +1 -0
  218. package/web/chunk-vfqe8298.js +1 -0
  219. package/web/chunk-vqjs551t.js +7 -0
  220. package/web/chunk-wtawdeej.css +1 -0
  221. package/web/chunk-x3zwjkwg.js +62 -0
  222. package/web/chunk-x59p8sg2.js +1 -0
  223. package/web/chunk-x9q4kh67.js +4 -0
  224. package/web/chunk-xet1jjy9.js +1 -0
  225. package/web/chunk-xzp7jf7e.js +2 -0
  226. package/web/chunk-y7z144e3.js +1 -0
  227. package/web/chunk-ydgqrfvw.js +2 -0
  228. package/web/chunk-ydtrc1ay.js +2 -0
  229. package/web/chunk-yj1a2d37.js +1 -0
  230. package/web/chunk-ykxpb3wv.js +2 -0
  231. package/web/chunk-ytpwz01r.js +291 -0
  232. package/web/chunk-z09emmrb.js +1 -0
  233. package/web/chunk-z1jtv4c0.js +2 -0
  234. package/web/chunk-zakv2xdf.js +1 -0
  235. package/web/chunk-zbj1trar.js +2 -0
  236. package/web/chunk-zk2f7x5e.js +4 -0
  237. package/web/icon-192.png +0 -0
  238. package/web/icon-512.png +0 -0
  239. package/web/icon-maskable-512.png +0 -0
  240. package/web/icon-yx2p2pye.svg +13 -0
  241. package/web/icon.svg +13 -0
  242. package/web/index.html +23 -0
  243. package/web/install.ps1 +91 -0
  244. package/web/install.sh +177 -0
  245. package/web/inter-latin-wght-normal-an0py913.woff2 +0 -0
  246. package/web/jetbrains-mono-latin-wght-normal-hj2e42wt.woff2 +0 -0
  247. package/web/manifest-txf6vfbq.webmanifest +35 -0
  248. package/web/manifest.webmanifest +35 -0
  249. package/web/source-serif-4-latin-wght-italic-ta5tqqvz.woff2 +0 -0
  250. package/web/source-serif-4-latin-wght-normal-1yyvbhsz.woff2 +0 -0
  251. package/web/sw.js +90 -0
  252. package/worker.js +2 -0
@@ -0,0 +1 @@
1
+ import{wo}from"./chunk-32ezm0ry.js";export{wo as QuestionDock};
@@ -0,0 +1 @@
1
+ import{Si}from"./chunk-gxn0bey7.js";export{Si as createArchitectureServices};
@@ -0,0 +1,98 @@
1
+ import{e,r,Y,u,d,D,b,oo,O,s,he,ge}from"./chunk-jtwhjp20.js";import{fe}from"./chunk-b5brnfv9.js";import{oe}from"./chunk-kbtbbarw.js";var _e=new Uint8Array(16);function ee(){return crypto.getRandomValues(_e)}var x=[];for(let t=0;t<256;++t)x.push((t+256).toString(16).slice(1));function ue(t,i=0){return(x[t[i+0]]+x[t[i+1]]+x[t[i+2]]+x[t[i+3]]+"-"+x[t[i+4]]+x[t[i+5]]+"-"+x[t[i+6]]+x[t[i+7]]+"-"+x[t[i+8]]+x[t[i+9]]+"-"+x[t[i+10]]+x[t[i+11]]+x[t[i+12]]+x[t[i+13]]+x[t[i+14]]+x[t[i+15]]).toLowerCase()}function Se(t,i,p){if(!i&&!t&&crypto.randomUUID)return crypto.randomUUID();return xe(t,i,p)}function xe(t,i,p){t=t||{};let h=t.random??t.rng?.()??ee();if(h.length<16)throw Error("Random bytes length must be >= 16");if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,i){if(p=p||0,p<0||p+16>i.length)throw RangeError(`UUID byte range ${p}:${p+15} is out of buffer bounds`);for(let n=0;n<16;++n)i[p+n]=h[n];return i}return ue(h)}var te=Se;var ne=function(){var t=e(function(w,c,o,l){for(o=o||{},l=w.length;l--;o[w[l]]=c);return o},"o"),i=[1,4],p=[1,13],h=[1,12],n=[1,15],f=[1,16],k=[1,20],_=[1,19],N=[6,7,8],U=[1,26],M=[1,24],P=[1,25],m=[6,7,11],V=[1,6,13,15,16,19,22],ie=[1,33],re=[1,34],F=[1,6,7,11,13,15,16,19,22],z={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:e(function(c,o,l,g,E,a,G){var y=a.length-1;switch(E){case 6:case 7:return g;case 8:g.getLogger().trace("Stop NL ");break;case 9:g.getLogger().trace("Stop EOF ");break;case 11:g.getLogger().trace("Stop NL2 ");break;case 12:g.getLogger().trace("Stop EOF2 ");break;case 15:g.getLogger().info("Node: ",a[y].id),g.addNode(a[y-1].length,a[y].id,a[y].descr,a[y].type);break;case 16:g.getLogger().trace("Icon: ",a[y]),g.decorateNode({icon:a[y]});break;case 17:case 21:g.decorateNode({class:a[y]});break;case 18:g.getLogger().trace("SPACELIST");break;case 19:g.getLogger().trace("Node: ",a[y].id),g.addNode(0,a[y].id,a[y].descr,a[y].type);break;case 20:g.decorateNode({icon:a[y]});break;case 25:g.getLogger().trace("node found ..",a[y-2]),this.$={id:a[y-1],descr:a[y-1],type:g.getType(a[y-2],a[y])};break;case 26:this.$={id:a[y],descr:a[y],type:g.nodeType.DEFAULT};break;case 27:g.getLogger().trace("node found ..",a[y-3]),this.$={id:a[y-3],descr:a[y-1],type:g.getType(a[y-2],a[y])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:p,7:[1,10],9:9,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:_},t(N,[2,3]),{1:[2,2]},t(N,[2,4]),t(N,[2,5]),{1:[2,6],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:_},{6:p,9:22,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:_},{6:U,7:M,10:23,11:P},t(m,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:_}),t(m,[2,18]),t(m,[2,19]),t(m,[2,20]),t(m,[2,21]),t(m,[2,23]),t(m,[2,24]),t(m,[2,26],{19:[1,30]}),{20:[1,31]},{6:U,7:M,10:32,11:P},{1:[2,7],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:_},t(V,[2,14],{7:ie,11:re}),t(F,[2,8]),t(F,[2,9]),t(F,[2,10]),t(m,[2,15]),t(m,[2,16]),t(m,[2,17]),{20:[1,35]},{21:[1,36]},t(V,[2,13],{7:ie,11:re}),t(F,[2,11]),t(F,[2,12]),{21:[1,37]},t(m,[2,25]),t(m,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(c,o){if(o.recoverable)this.trace(c);else{var l=Error(c);throw l.hash=o,l}},"parseError"),parse:e(function(c){var o=this,l=[0],g=[],E=[null],a=[],G=this.table,y="",H=0,se=0,ae=0,ye=2,ce=1,ke=a.slice.call(arguments,1),S=Object.create(this.lexer),R={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))R.yy[q]=this.yy[q];if(S.setInput(c,R.yy),R.yy.lexer=S,R.yy.parser=this,typeof S.yylloc>"u")S.yylloc={};var J=S.yylloc;a.push(J);var be=S.options&&S.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Ee(T){l.length=l.length-2*T,E.length=E.length-T,a.length=a.length-T}e(Ee,"popStack");function le(){var T=g.pop()||S.lex()||ce;if(typeof T!=="number"){if(T instanceof Array)g=T,T=g.pop();T=o.symbols_[T]||T}return T}e(le,"lex");var L,K,A,v,we,Q,B={},W,I,de,X;while(!0){if(A=l[l.length-1],this.defaultActions[A])v=this.defaultActions[A];else{if(L===null||typeof L>"u")L=le();v=G[A]&&G[A][L]}if(typeof v>"u"||!v.length||!v[0]){var Z="";X=[];for(W in G[A])if(this.terminals_[W]&&W>ye)X.push("'"+this.terminals_[W]+"'");if(S.showPosition)Z="Parse error on line "+(H+1)+`:
2
+ `+S.showPosition()+`
3
+ Expecting `+X.join(", ")+", got '"+(this.terminals_[L]||L)+"'";else Z="Parse error on line "+(H+1)+": Unexpected "+(L==ce?"end of input":"'"+(this.terminals_[L]||L)+"'");this.parseError(Z,{text:S.match,token:this.terminals_[L]||L,line:S.yylineno,loc:J,expected:X})}if(v[0]instanceof Array&&v.length>1)throw Error("Parse Error: multiple actions possible at state: "+A+", token: "+L);switch(v[0]){case 1:if(l.push(L),E.push(S.yytext),a.push(S.yylloc),l.push(v[1]),L=null,!K){if(se=S.yyleng,y=S.yytext,H=S.yylineno,J=S.yylloc,ae>0)ae--}else L=K,K=null;break;case 2:if(I=this.productions_[v[1]][1],B.$=E[E.length-I],B._$={first_line:a[a.length-(I||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(I||1)].first_column,last_column:a[a.length-1].last_column},be)B._$.range=[a[a.length-(I||1)].range[0],a[a.length-1].range[1]];if(Q=this.performAction.apply(B,[y,se,H,R.yy,v[1],E,a].concat(ke)),typeof Q<"u")return Q;if(I)l=l.slice(0,-1*I*2),E=E.slice(0,-1*I),a=a.slice(0,-1*I);l.push(this.productions_[v[1]][0]),E.push(B.$),a.push(B._$),de=G[l[l.length-2]][l[l.length-1]],l.push(de);break;case 3:return!0}}return!0},"parse")},me=function(){var w={EOF:1,parseError:e(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw Error(o)},"parseError"),setInput:e(function(c,o){if(this.yy=o||this.yy||{},this._input=c,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:e(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var o=c.match(/(?:\r\n?|\n).*/g);if(o)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),c},"input"),unput:e(function(c){var o=c.length,l=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var g=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),l.length-1)this.yylineno-=l.length-1;var E=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:l?(l.length===g.length?this.yylloc.first_column:0)+g[g.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges)this.yylloc.range=[E[0],E[0]+this.yyleng-o];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(c){this.unput(this.match.slice(c))},"less"),pastInput:e(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var c=this.match;if(c.length<20)c+=this._input.substr(0,20-c.length);return(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var c=this.pastInput(),o=Array(c.length+1).join("-");return c+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:e(function(c,o){var l,g,E;if(this.options.backtrack_lexer){if(E={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)E.yylloc.range=this.yylloc.range.slice(0)}if(g=c[0].match(/(?:\r\n?|\n).*/g),g)this.yylineno+=g.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,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(c[0].length),this.matched+=c[0],l=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(l)return l;else if(this._backtrack){for(var a in E)this[a]=E[a];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var c,o,l,g;if(!this._more)this.yytext="",this.match="";var E=this._currentRules();for(var a=0;a<E.length;a++)if(l=this._input.match(this.rules[E[a]]),l&&(!o||l[0].length>o[0].length)){if(o=l,g=a,this.options.backtrack_lexer)if(c=this.test_match(l,E[a]),c!==!1)return c;else if(this._backtrack){o=!1;continue}else return!1;else if(!this.options.flex)break}if(o){if(c=this.test_match(o,E[g]),c!==!1)return c;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:e(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:e(function(o){this.conditionStack.push(o)},"begin"),popState:e(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(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:e(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:e(function(o){this.begin(o)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(o,l,g,E){var a=E;switch(g){case 0:return o.getLogger().trace("Found comment",l.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:o.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return o.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:o.getLogger().trace("end icon"),this.popState();break;case 10:return o.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return o.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return o.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return o.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:o.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return o.getLogger().trace("description:",l.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),o.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),o.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),o.getLogger().trace("node end ...",l.yytext),"NODE_DEND";break;case 30:return this.popState(),o.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),o.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),o.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),o.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),o.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return o.getLogger().trace("Long description:",l.yytext),20;break;case 36:return o.getLogger().trace("Long description:",l.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();z.lexer=me;function j(){this.yy={}}return e(j,"Parser"),j.prototype=z,z.Parser=j,new j}();ne.parser=ne;var Ne=ne,pe=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Le=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{e(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(t){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<t)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(t,i,p,h){r.info("addNode",t,i,p,h);let n=!1;if(this.nodes.length===0)this.baseLevel=t,t=0,n=!0;else if(this.baseLevel!==void 0)t=t-this.baseLevel,n=!1;let f=s(),k=f.mindmap?.padding??D.mindmap.padding;switch(h){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:k*=2;break}let _={id:this.count++,nodeId:O(i,f),level:t,descr:O(p,f),type:h,children:[],width:f.mindmap?.maxNodeWidth??D.mindmap.maxNodeWidth,padding:k,isRoot:n},N=this.getParent(t);if(N)N.children.push(_),this.nodes.push(_);else if(n)this.nodes.push(_);else throw Error(`There can be only one root. No parent could be found for ("${_.descr}")`)}getType(t,i){switch(r.debug("In get type",t,i),t){case"[":return this.nodeType.RECT;case"(":return i===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}decorateNode(t){if(!t)return;let i=s(),p=this.nodes[this.nodes.length-1];if(t.icon)p.icon=O(t.icon,i);if(t.class)p.class=O(t.class,i)}type2Str(t){switch(t){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(t,i,p=0,h=!1){if(t.level===0)t.section=void 0;else t.section=h?(p-1)%(pe-1):i;if(t.children)for(let[n,f]of t.children.entries()){let k=t.level===0?n%(pe-1):i;this.assignSections(f,k,p+1,h)}}flattenNodes(t,i){let p=s(),h=["mindmap-node"];if(t.isRoot===!0)h.push("section-root","section--1");else if(t.section!==void 0)h.push(`section-${t.section}`);if(t.class)h.push(t.class);let n=h.join(" "),f=e((_)=>{let U=(p.theme?.toLowerCase()??"").includes("redux");switch(_){case C.CIRCLE:return"mindmapCircle";case C.RECT:return"rect";case C.ROUNDED_RECT:return"rounded";case C.CLOUD:return"cloud";case C.BANG:return"bang";case C.HEXAGON:return"hexagon";case C.DEFAULT:return U?"rounded":"defaultMindmapNode";case C.NO_BORDER:default:return"rect"}},"getShapeFromType"),k={id:t.id.toString(),domId:"node_"+t.id.toString(),label:t.descr,labelType:"markdown",isGroup:!1,shape:f(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:n,cssStyles:[],centerLabel:!0,look:p.look,icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(i.push(k),t.children)for(let _ of t.children)this.flattenNodes(_,i)}generateEdges(t,i){if(!t.children)return;let p=s();for(let h of t.children){let n="edge";if(h.section!==void 0)n+=` section-edge-${h.section}`;let f=t.level+1;n+=` edge-depth-${f}`;let k={id:`edge_${t.id}_${h.id}`,start:t.id.toString(),end:h.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:p.look,classes:n,depth:t.level,section:h.section};i.push(k),this.generateEdges(h,i)}}getData(){let t=this.getMindmap(),i=s(),h=oo().layout!==void 0,n=i;if(!h)n.layout="cose-bilkent";if(!t)return{nodes:[],edges:[],config:n};r.debug("getData: mindmapRoot",t,i),this.assignSections(t,void 0,0,i.mindmap?.colorBy==="depth");let f=[],k=[];this.flattenNodes(t,f),this.generateEdges(t,k),r.debug(`getData: processed ${f.length} nodes and ${k.length} edges`);let _=new Map;for(let N of f)_.set(N.id,{shape:N.shape,width:N.width,height:N.height,padding:N.padding});return{nodes:f,edges:k,config:n,rootNode:t,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(_),type:"mindmap",diagramId:"mindmap-"+te()}}getLogger(){return r}},De=e(async(t,i,p,h)=>{r.debug(`Rendering mindmap diagram
7
+ `+t);let n=h.db,f=n.getData(),k=fe(i,f.config.securityLevel);if(f.type=h.type,f.layoutAlgorithm=ge(f.config.layout,{fallback:"cose-bilkent"}),f.diagramId=i,!n.getMindmap())return;f.nodes.forEach((m)=>{if(m.shape==="rounded")m.radius=15,m.taper=15,m.stroke="none",m.width=0,m.padding=15;else if(m.shape==="circle")m.padding=10;else if(m.shape==="rect")m.width=0,m.padding=10;else if(m.shape==="hexagon")m.width=0,m.height=0}),await he(f,k);let{themeVariables:N}=b(),{useGradient:U,gradientStart:M,gradientStop:P}=N;if(U&&M&&P){let m=k.attr("id"),V=k.append("defs").append("linearGradient").attr("id",`${m}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");V.append("stop").attr("offset","0%").attr("stop-color",M).attr("stop-opacity",1),V.append("stop").attr("offset","100%").attr("stop-color",P).attr("stop-opacity",1)}oe(k,f.config.mindmap?.padding??D.mindmap.padding,"mindmapDiagram",f.config.mindmap?.useMaxWidth??D.mindmap.useMaxWidth)},"draw"),ve={draw:De},Te=e((t)=>{let{theme:i,look:p}=t,h="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)if(t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],Y(t["lineColor"+n]))t["lineColor"+n]=u(t["lineColor"+n],20);else t["lineColor"+n]=d(t["lineColor"+n],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){let f=""+(p==="neo"?Math.max(10-(n-1)*2,2):17-3*n),k=i==="redux"||i==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(i==="neutral"?1:n)];h+=`
8
+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
9
+ fill: ${t["cScale"+n]};
10
+ }
11
+ .section-${n-1} text {
12
+ fill: ${t["cScaleLabel"+n]};
13
+ }
14
+ .section-${n-1} span {
15
+ color: ${t["cScaleLabel"+n]};
16
+ }
17
+ .node-icon-${n-1} {
18
+ font-size: 40px;
19
+ color: ${t["cScaleLabel"+n]};
20
+ }
21
+ .section-edge-${n-1}{
22
+ stroke: ${t["cScale"+n]};
23
+ }
24
+ .edge-depth-${n-1}{
25
+ stroke-width: ${f};
26
+ }
27
+ .section-${n-1} line {
28
+ stroke: ${t["cScaleInv"+n]} ;
29
+ stroke-width: 3;
30
+ }
31
+
32
+ .disabled, .disabled circle, .disabled text {
33
+ fill: lightgray;
34
+ }
35
+ .disabled text {
36
+ fill: #efefef;
37
+ }
38
+ [data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
39
+ fill: ${i==="redux"||i==="redux-dark"||i==="neutral"?t.mainBkg:t["cScale"+n]};
40
+ stroke: ${i==="redux"||i==="redux-dark"?t.nodeBorder:t["cScale"+n]};
41
+ stroke-width: ${t.strokeWidth??2}px;
42
+ }
43
+ [data-look="neo"].section-edge-${n-1}{
44
+ stroke: ${i?.includes("redux")||i==="neo-dark"?t.nodeBorder:t["cScale"+n]};
45
+ }
46
+ [data-look="neo"].mindmap-node.section-${n-1} text, [data-look="neo"].mindmap-node.section-${n-1} span {
47
+ fill: ${k};
48
+ color: ${k};
49
+ }
50
+ `}return h},"genSections"),Oe=e((t,i,p)=>{let h="";for(let n=0;n<t;n++)h+=`
51
+ [data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
52
+ stroke: url(${i}-gradient);
53
+ fill: ${p};
54
+ }
55
+ .section-${n-1} line {
56
+ stroke-width: 0;
57
+ }`;return h},"genGradient"),Ie=e((t)=>{let{theme:i}=t,p=t.svgId,h=i?.includes("redux")?t.nodeBorder:t["cScaleLabel"+(i==="neutral"?1:0)],n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${p}-drop-shadow)`):"none";return`
58
+ .edge {
59
+ stroke-width: 3;
60
+ }
61
+ ${Te(t)}
62
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
63
+ fill: ${t.git0};
64
+ }
65
+ .section-root text {
66
+ fill: ${t.gitBranchLabel0};
67
+ }
68
+ .section-root span {
69
+ color: ${i?.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
70
+ }
71
+ .icon-container {
72
+ height:100%;
73
+ display: flex;
74
+ justify-content: center;
75
+ align-items: center;
76
+ }
77
+ .edge {
78
+ fill: none;
79
+ }
80
+ .mindmap-node-label {
81
+ dy: 1em;
82
+ alignment-baseline: middle;
83
+ text-anchor: middle;
84
+ dominant-baseline: middle;
85
+ text-align: center;
86
+ }
87
+ [data-look="neo"].mindmap-node {
88
+ filter: ${n};
89
+ }
90
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
91
+ fill: ${i?.includes("redux")?t.mainBkg:t.git0};
92
+ }
93
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan, [data-look="neo"].mindmap-node.section-root span {
94
+ fill: ${h};
95
+ color: ${h};
96
+ }
97
+ ${t.useGradient&&p&&t.mainBkg?Oe(t.THEME_COLOR_LIMIT,p,t.mainBkg):""}
98
+ `},"getStyles"),Ce=Ie,It={get db(){return new Le},renderer:ve,parser:Ne,styles:Ce};export{It as diagram};
@@ -0,0 +1,2 @@
1
+ import{Rt,fn,Dt,ra}from"./chunk-0mrkjnte.js";import{Nt}from"./chunk-ry9256r7.js";import{$t,Cr,Fn,$e,Sr}from"./chunk-jtwhjp20.js";function s(r,n){return r==null||n==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function x(r,n){return r==null||n==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function nr(r){let n,e,t;if(r.length!==2)n=s,e=(f,c)=>s(r(f),c),t=(f,c)=>r(f)-c;else n=r===s||r===x?r:O,e=r,t=r;function o(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<0)i=l+1;else p=l}while(i<p)}return i}function a(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<=0)i=l+1;else p=l}while(i<p)}return i}function u(f,c,i=0,p=f.length){let l=o(f,c,i,p-1);return l>i&&t(f[l-1],c)>-t(f[l],c)?l-1:l}return{left:o,center:u,right:a}}function O(){return 0}function y(r){return r===null?NaN:+r}var V=nr(s),{right:T,left:or}=V,ur=nr(y).center,z=T;var E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function g(r,n,e){let t=(n-r)/Math.max(0,e),o=Math.floor(Math.log10(t)),a=t/Math.pow(10,o),u=a>=E?10:a>=G?5:a>=H?2:1,f,c,i;if(o<0){if(i=Math.pow(10,-o)/u,f=Math.round(r*i),c=Math.round(n*i),f/i<r)++f;if(c/i>n)--c;i=-i}else{if(i=Math.pow(10,o)*u,f=Math.round(r/i),c=Math.round(n/i),f*i<r)++f;if(c*i>n)--c}if(c<f&&0.5<=e&&e<2)return g(r,n,e*2);return[f,c,i]}function v(r,n,e){if(n=+n,r=+r,e=+e,!(e>0))return[];if(r===n)return[r];let t=n<r,[o,a,u]=t?g(n,r,e):g(r,n,e);if(!(a>=o))return[];let f=a-o+1,c=Array(f);if(t)if(u<0)for(let i=0;i<f;++i)c[i]=(a-i)/-u;else for(let i=0;i<f;++i)c[i]=(a-i)*u;else if(u<0)for(let i=0;i<f;++i)c[i]=(o+i)/-u;else for(let i=0;i<f;++i)c[i]=(o+i)*u;return c}function M(r,n,e){return n=+n,r=+r,e=+e,g(r,n,e)[2]}function Pr(r,n,e){n=+n,r=+r,e=+e;let t=n<r,o=t?M(n,r,e):M(r,n,e);return(t?-1:1)*(o<0?1/-o:o)}function N(r,n){if(!n)n=[];var e=r?Math.min(n.length,r.length):0,t=n.slice(),o;return function(a){for(o=0;o<e;++o)t[o]=r[o]*(1-a)+n[o]*a;return t}}function B(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r,n){var e=n?n.length:0,t=r?Math.min(e,r.length):0,o=Array(t),a=Array(e),u;for(u=0;u<t;++u)o[u]=h(r[u],n[u]);for(;u<e;++u)a[u]=n[u];return function(f){for(u=0;u<t;++u)a[u]=o[u](f);return a}}function w(r,n){var e=new Date;return r=+r,n=+n,function(t){return e.setTime(r*(1-t)+n*t),e}}function k(r,n){var e={},t={},o;if(r===null||typeof r!=="object")r={};if(n===null||typeof n!=="object")n={};for(o in n)if(o in r)e[o]=h(r[o],n[o]);else t[o]=n[o];return function(a){for(o in e)t[o]=e[o](a);return t}}function h(r,n){var e=typeof n,t;return n==null||e==="boolean"?Cr(n):(e==="number"?$e:e==="string"?(t=$t(n))?(n=t,Fn):Sr:n instanceof $t?Fn:n instanceof Date?w:B(n)?N:Array.isArray(n)?P:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?k:$e)(r,n)}function A(r,n){return r=+r,n=+n,function(e){return Math.round(r*(1-e)+n*e)}}function R(r){return Math.max(0,-Rt(Math.abs(r)))}function S(r,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rt(n)/3)))*3-Rt(Math.abs(r)))}function j(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,Rt(n)-Rt(r))+1}function F(r){return function(){return r}}function q(r){return+r}var C=[0,1];function d(r){return r}function D(r,n){return(n-=r=+r)?function(e){return(e-r)/n}:F(isNaN(n)?NaN:0.5)}function J(r,n){var e;if(r>n)e=r,r=n,n=e;return function(t){return Math.max(r,Math.min(n,t))}}function K(r,n,e){var t=r[0],o=r[1],a=n[0],u=n[1];if(o<t)t=D(o,t),a=e(u,a);else t=D(t,o),a=e(a,u);return function(f){return a(t(f))}}function Q(r,n,e){var t=Math.min(r.length,n.length)-1,o=Array(t),a=Array(t),u=-1;if(r[t]<r[0])r=r.slice().reverse(),n=n.slice().reverse();while(++u<t)o[u]=D(r[u],r[u+1]),a[u]=e(n[u],n[u+1]);return function(f){var c=z(r,f,1,t)-1;return a[c](o[c](f))}}function na(r,n){return n.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function U(){var r=C,n=C,e=h,t,o,a,u=d,f,c,i;function p(){var m=Math.min(r.length,n.length);if(u!==d)u=J(r[0],r[m-1]);return f=m>2?Q:K,c=i=null,l}function l(m){return m==null||isNaN(m=+m)?a:(c||(c=f(r.map(t),n,e)))(t(u(m)))}return l.invert=function(m){return u(o((i||(i=f(n,r.map(t),$e)))(m)))},l.domain=function(m){return arguments.length?(r=Array.from(m,q),p()):r.slice()},l.range=function(m){return arguments.length?(n=Array.from(m),p()):n.slice()},l.rangeRound=function(m){return n=Array.from(m),e=A,p()},l.clamp=function(m){return arguments.length?(u=m?!0:d,p()):u!==d},l.interpolate=function(m){return arguments.length?(e=m,p()):e},l.unknown=function(m){return arguments.length?(a=m,l):a},function(m,L){return t=m,o=L,p()}}function Or(){return U()(d,d)}function I(r,n,e,t){var o=Pr(r,n,e),a;switch(t=fn(t==null?",f":t),t.type){case"s":{var u=Math.max(Math.abs(r),Math.abs(n));if(t.precision==null&&!isNaN(a=S(o,u)))t.precision=a;return ra(t,u)}case"":case"e":case"g":case"p":case"r":{if(t.precision==null&&!isNaN(a=j(o,Math.max(Math.abs(r),Math.abs(n)))))t.precision=a-(t.type==="e");break}case"f":case"%":{if(t.precision==null&&!isNaN(a=R(o)))t.precision=a-(t.type==="%")*2;break}}return Dt(t)}function W(r){var n=r.domain;return r.ticks=function(e){var t=n();return v(t[0],t[t.length-1],e==null?10:e)},r.tickFormat=function(e,t){var o=n();return I(o[0],o[o.length-1],e==null?10:e,t)},r.nice=function(e){if(e==null)e=10;var t=n(),o=0,a=t.length-1,u=t[o],f=t[a],c,i,p=10;if(f<u)i=u,u=f,f=i,i=o,o=a,a=i;while(p-- >0){if(i=M(u,f,e),i===c)return t[o]=u,t[a]=f,n(t);else if(i>0)u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i;else if(i<0)u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i;else break;c=i}return r},r}function xt(){var r=Or();return r.copy=function(){return na(r,xt())},Nt.apply(r,arguments),W(r)}
2
+ export{nr,Pr,na,Or,xt};
@@ -0,0 +1,8 @@
1
+ import{e}from"./chunk-jtwhjp20.js";import"./chunk-ghxe4gam.js";import{Ei,Ai}from"./chunk-v6v831tc.js";import"./chunk-hryhthxr.js";import"./chunk-ydgqrfvw.js";import"./chunk-b5brnfv9.js";import"./chunk-kbtbbarw.js";var r=e((t)=>`${Ei(t)}
2
+ .swimlane.cluster:not([data-color-id]) rect {
3
+ stroke: ${t.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,"getStyles"),o=r,D=Ai({styles:o});export{D as diagram};
@@ -0,0 +1,70 @@
1
+ import{e,y,B,C,S,E,T,A,I,L,s,q,Ge,m}from"./chunk-jtwhjp20.js";var dt=function(){var t=e(function(z,i,a,n){for(a=a||{},n=z.length;n--;a[z[n]]=i);return a},"o"),f=[1,4],l=[1,14],o=[1,12],h=[1,13],p=[6,7,8],k=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],b=[1,23],M=[1,24],P=[1,6,7,11,13,14],U={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(i,a,n,c,g,r,N){var v=r.length-1;switch(g){case 6:case 7:return c;case 15:c.addNode(r[v-1].length,r[v].trim());break;case 16:c.addNode(0,r[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:l,7:[1,10],9:9,12:11,13:o,14:h},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:l,12:15,13:o,14:h},{6:l,9:16,12:11,13:o,14:h},{6:k,7:d,10:17,11:x},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:k,7:d,10:22,11:x},{1:[2,7],6:l,12:15,13:o,14:h},t(_,[2,14],{7:b,11:M}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(u,[2,15]),t(_,[2,13],{7:b,11:M}),t(P,[2,11]),t(P,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(i,a){if(a.recoverable)this.trace(i);else{var n=Error(i);throw n.hash=a,n}},"parseError"),parse:e(function(i){var a=this,n=[0],c=[],g=[null],r=[],N=this.table,v="",W=0,D=0,R=0,F=2,X=1,rt=r.slice.call(arguments,1),w=Object.create(this.lexer),O={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))O.yy[K]=this.yy[K];if(w.setInput(i,O.yy),O.yy.lexer=w,O.yy.parser=this,typeof w.yylloc>"u")w.yylloc={};var Q=w.yylloc;r.push(Q);var lt=w.options&&w.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(G){n.length=n.length-2*G,g.length=g.length-G,r.length=r.length-G}e(xt,"popStack");function yt(){var G=c.pop()||w.lex()||X;if(typeof G!=="number"){if(G instanceof Array)c=G,G=c.pop();G=a.symbols_[G]||G}return G}e(yt,"lex");var j,ot,J,H,Vt,ht,tt={},st,Y,ft,nt;while(!0){if(J=n[n.length-1],this.defaultActions[J])H=this.defaultActions[J];else{if(j===null||typeof j>"u")j=yt();H=N[J]&&N[J][j]}if(typeof H>"u"||!H.length||!H[0]){var ct="";nt=[];for(st in N[J])if(this.terminals_[st]&&st>F)nt.push("'"+this.terminals_[st]+"'");if(w.showPosition)ct="Parse error on line "+(W+1)+`:
2
+ `+w.showPosition()+`
3
+ Expecting `+nt.join(", ")+", got '"+(this.terminals_[j]||j)+"'";else ct="Parse error on line "+(W+1)+": Unexpected "+(j==X?"end of input":"'"+(this.terminals_[j]||j)+"'");this.parseError(ct,{text:w.match,token:this.terminals_[j]||j,line:w.yylineno,loc:Q,expected:nt})}if(H[0]instanceof Array&&H.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+j);switch(H[0]){case 1:if(n.push(j),g.push(w.yytext),r.push(w.yylloc),n.push(H[1]),j=null,!ot){if(D=w.yyleng,v=w.yytext,W=w.yylineno,Q=w.yylloc,R>0)R--}else j=ot,ot=null;break;case 2:if(Y=this.productions_[H[1]][1],tt.$=g[g.length-Y],tt._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},lt)tt._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,D,W,O.yy,H[1],g,r].concat(rt)),typeof ht<"u")return ht;if(Y)n=n.slice(0,-1*Y*2),g=g.slice(0,-1*Y),r=r.slice(0,-1*Y);n.push(this.productions_[H[1]][0]),g.push(tt.$),r.push(tt._$),ft=N[n[n.length-2]][n[n.length-1]],n.push(ft);break;case 3:return!0}}return!0},"parse")},Z=function(){var z={EOF:1,parseError:e(function(a,n){if(this.yy.parser)this.yy.parser.parseError(a,n);else throw Error(a)},"parseError"),setInput:e(function(i,a){if(this.yy=a||this.yy||{},this._input=i,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:e(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);if(a)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),i},"input"),unput:e(function(i){var a=i.length,n=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var c=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),n.length-1)this.yylineno-=n.length-1;var g=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:n?(n.length===c.length?this.yylloc.first_column:0)+c[c.length-n.length].length-n[0].length:this.yylloc.first_column-a},this.options.ranges)this.yylloc.range=[g[0],g[0]+this.yyleng-a];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(i){this.unput(this.match.slice(i))},"less"),pastInput:e(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var i=this.pastInput(),a=Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
+ `+a+"^"},"showPosition"),test_match:e(function(i,a){var n,c,g;if(this.options.backtrack_lexer){if(g={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)g.yylloc.range=this.yylloc.range.slice(0)}if(c=i[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],n=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(n)return n;else if(this._backtrack){for(var r in g)this[r]=g[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,a,n,c;if(!this._more)this.yytext="",this.match="";var g=this._currentRules();for(var r=0;r<g.length;r++)if(n=this._input.match(this.rules[g[r]]),n&&(!a||n[0].length>a[0].length)){if(a=n,c=r,this.options.backtrack_lexer)if(i=this.test_match(n,g[r]),i!==!1)return i;else if(this._backtrack){a=!1;continue}else return!1;else if(!this.options.flex)break}if(a){if(i=this.test_match(a,g[c]),i!==!1)return i;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:e(function(){var a=this.next();if(a)return a;else return this.lex()},"lex"),begin:e(function(a){this.conditionStack.push(a)},"begin"),popState:e(function(){var a=this.conditionStack.length-1;if(a>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(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:e(function(a){if(a=this.conditionStack.length-1-Math.abs(a||0),a>=0)return this.conditionStack[a];else return"INITIAL"},"topState"),pushState:e(function(a){this.begin(a)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(a,n,c,g){var r=g;switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return z}();U.lexer=Z;function V(){this.yy={}}return e(V,"Parser"),V.prototype=U,U.Parser=V,new V}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,C()}getRoot(){return this.root}addNode(t,f){let l=y.sanitizeText(f,s());if(!this.root){this.root={text:l,children:[]},this.stack=[{level:0,node:this.root}],I(l);return}this.baseLevel??=t;let o=t-this.baseLevel+1;if(o<=0)o=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=o)this.stack.pop();let h=this.stack[this.stack.length-1].node,p={text:l,children:[]};h.children.push(p),this.stack.push({level:o,node:p})}getAccTitle(){return E()}setAccTitle(t){S(t)}getAccDescription(){return A()}setAccDescription(t){T(t)}getDiagramTitle(){return L()}setDiagramTitle(t){I(t)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=e((t,f,l)=>{let o=t.node().getBBox(),h=o.width+f*2,p=o.height+f*2;B(t,p,h,l),t.attr("viewBox",`${o.x-f} ${o.y-f} ${h} ${p}`)},"applyPaddedViewBox"),Lt=e((t,f,l,o)=>{let p=o.db.getRoot();if(!p)return;let k=s(),{look:d,handDrawnSeed:x,themeVariables:u}=k,_=Ge(k.fontSize)[0]??Et,b=d==="handDrawn",M=p.children??[],P=k.ishikawa?.diagramPadding??20,U=k.ishikawa?.useMaxWidth??!1,Z=q(f),V=Z.append("g").attr("class","ishikawa"),z=b?m.svg(Z.node()):void 0,i=z?{roughSvg:z,seed:x??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,a=`ishikawa-arrow-${f}`;if(!b)V.append("defs").append("marker").attr("id",a).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let n=0,c=et,g=b?void 0:it(V,n,c,n,c,"ishikawa-spine");if(Tt(V,n,c,p.text,_,i),!M.length){if(b)it(V,n,c,n,c,"ishikawa-spine",i);kt(Z,P,U);return}n-=20;let r=M.filter((w,O)=>O%2===0),N=M.filter((w,O)=>O%2===1),v=mt(r),W=mt(N),D=v.total+W.total,R=et,F=et;if(D>0){let w=et*2,O=et*0.3;R=Math.max(O,w*(v.total/D)),F=Math.max(O,w*(W.total/D))}let X=_*2;if(R=Math.max(R,v.max*X),F=Math.max(F,W.max*X),c=Math.max(R,et),g)g.attr("y1",c).attr("y2",c);V.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);let rt=Math.ceil(M.length/2);for(let w=0;w<rt;w++){let O=V.append("g").attr("class","ishikawa-pair");for(let[K,Q,lt]of[[M[w*2],-1,R],[M[w*2+1],1,F]])if(K)Bt(O,K,n,c,Q,lt,_,i);n=O.selectAll("text").nodes().reduce((K,Q)=>Math.min(K,Q.getBBox().x),1/0)}if(b)it(V,n,c,0,c,"ishikawa-spine",i);else{g.attr("x1",n);let w=`url(#${a})`;V.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",w)}kt(Z,P,U)},"draw"),mt=e((t)=>{let f=e((l)=>l.children.reduce((o,h)=>o+1+f(h),0),"countDescendants");return t.reduce((l,o)=>{let h=f(o);return l.total+=h,l.max=Math.max(l.max,h),l},{total:0,max:0})},"sideStats"),Tt=e((t,f,l,o,h,p)=>{let k=Math.max(6,Math.floor(110/(h*0.6))),d=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${f},${l})`),x=at(d,_t(o,k),0,0,"ishikawa-head-label","start",h),u=x.node().getBBox(),_=Math.max(60,u.width+6),b=Math.max(40,u.height*2+40),M=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(p){let P=p.roughSvg.path(M,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>P,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",M);x.attr("transform",`translate(${(_-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Mt=e((t,f)=>{let l=[],o=[],h=e((p,k,d)=>{let x=f===-1?[...p].reverse():p;for(let u of x){let _=l.length,b=u.children??[];if(l.push({depth:d,text:_t(u.text,15),parentIndex:k,childCount:b.length}),d%2===0){if(o.push(_),b.length)h(b,_,d+1)}else{if(b.length)h(b,_,d+1);o.push(_)}}},"walk");return h(t,-1,2),{entries:l,yOrder:o}},"flattenTree"),Pt=e((t,f,l,o,h,p,k)=>{let d=t.append("g").attr("class","ishikawa-label-group"),u=at(d,f,l,o+11*h,"ishikawa-label cause","middle",p).node().getBBox();if(k){let _=k.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:k.seed,fill:k.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:k.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ut=e((t,f,l,o,h,p)=>{let k=Math.sqrt(o*o+h*h);if(k===0)return;let d=o/k,x=h/k,u=6,_=-x*u,b=d*u,M=f,P=l,U=`M ${M} ${P} L ${M-d*u*2+_} ${P-x*u*2+b} L ${M-d*u*2-_} ${P-x*u*2-b} Z`,Z=p.roughSvg.path(U,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});t.append(()=>Z)},"drawArrowMarker"),Bt=e((t,f,l,o,h,p,k,d)=>{let x=f.children??[],u=p*(x.length?1:0.2),_=-pt*u,b=gt*u*h,M=l+_,P=o+b;if(it(t,l,o,M,P,"ishikawa-branch",d),d)ut(t,l,o,l-M,o-P,d);if(Pt(t,f.text,M,P,h,k,d),!x.length)return;let{entries:U,yOrder:Z}=Mt(x,h),V=U.length,z=Array(V);for(let[g,r]of Z.entries())z[r]=o+b*((g+1)/(V+1));let i=new Map;i.set(-1,{x0:l,y0:o,x1:M,y1:P,childCount:x.length,childrenDrawn:0});let a=-pt,n=gt*h,c=h<0?"ishikawa-label up":"ishikawa-label down";for(let[g,r]of U.entries()){let N=z[g],v=i.get(r.parentIndex),W=t.append("g").attr("class","ishikawa-sub-group"),D=0,R=0,F=0;if(r.depth%2===0){let X=v.y1-v.y0;if(D=wt(v.x0,v.x1,X?(N-v.y0)/X:0.5),R=N,F=D-(r.childCount>0?At+r.childCount*It:$t),it(W,D,N,F,N,"ishikawa-sub-branch",d),d)ut(W,D,N,1,0,d);at(W,r.text,F,N,"ishikawa-label align","end",k)}else{let X=v.childrenDrawn++;if(D=wt(v.x0,v.x1,(v.childCount-X)/(v.childCount+1)),R=v.y0,F=D+a*((N-R)/n),it(W,D,R,F,N,"ishikawa-sub-branch",d),d)ut(W,D,R,D-F,R-N,d);at(W,r.text,F,N,c,"end",k)}if(r.childCount>0)i.set(g,{x0:D,y0:R,x1:F,y1:N,childCount:r.childCount,childrenDrawn:0})}},"drawBranch"),Nt=e((t)=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=e((t,f)=>{if(t.length<=f)return t;let l=[];for(let o of t.split(/\s+/)){let h=l.length-1;if(h>=0&&l[h].length+1+o.length<=f)l[h]+=" "+o;else l.push(o)}return l.join(`
7
+ `)},"wrapText"),at=e((t,f,l,o,h,p,k)=>{let d=Nt(f),x=k*1.05,u=t.append("text").attr("class",h).attr("text-anchor",p).attr("x",l).attr("y",o-(d.length-1)*x/2);for(let[_,b]of d.entries())u.append("tspan").attr("x",l).attr("dy",_===0?0:x).text(b);return u},"drawMultilineText"),wt=e((t,f,l)=>t+(f-t)*l,"lerp"),it=e((t,f,l,o,h,p,k)=>{if(k){let d=k.roughSvg.line(f,l,o,h,{roughness:1.5,seed:k.seed,stroke:k.lineColor,strokeWidth:2});t.append(()=>d).attr("class",p);return}return t.append("line").attr("class",p).attr("x1",f).attr("y1",l).attr("x2",o).attr("y2",h)},"drawLine"),Dt={draw:Lt},Ot=e((t)=>`
8
+ .ishikawa .ishikawa-spine,
9
+ .ishikawa .ishikawa-branch,
10
+ .ishikawa .ishikawa-sub-branch {
11
+ stroke: ${t.lineColor};
12
+ stroke-width: 2;
13
+ fill: none;
14
+ }
15
+
16
+ .ishikawa .ishikawa-sub-branch {
17
+ stroke-width: 1;
18
+ }
19
+
20
+ .ishikawa .ishikawa-arrow {
21
+ fill: ${t.lineColor};
22
+ }
23
+
24
+ .ishikawa .ishikawa-head {
25
+ fill: ${t.mainBkg};
26
+ stroke: ${t.lineColor};
27
+ stroke-width: 2;
28
+ }
29
+
30
+ .ishikawa .ishikawa-label-box {
31
+ fill: ${t.mainBkg};
32
+ stroke: ${t.lineColor};
33
+ stroke-width: 2;
34
+ }
35
+
36
+ .ishikawa text {
37
+ font-family: ${t.fontFamily};
38
+ font-size: ${t.fontSize};
39
+ fill: ${t.textColor};
40
+ }
41
+
42
+ .ishikawa .ishikawa-head-label {
43
+ font-weight: 600;
44
+ text-anchor: middle;
45
+ dominant-baseline: middle;
46
+ font-size: 14px;
47
+ }
48
+
49
+ .ishikawa .ishikawa-label {
50
+ text-anchor: end;
51
+ }
52
+
53
+ .ishikawa .ishikawa-label.cause {
54
+ text-anchor: middle;
55
+ dominant-baseline: middle;
56
+ }
57
+
58
+ .ishikawa .ishikawa-label.align {
59
+ text-anchor: end;
60
+ dominant-baseline: middle;
61
+ }
62
+
63
+ .ishikawa .ishikawa-label.up {
64
+ dominant-baseline: baseline;
65
+ }
66
+
67
+ .ishikawa .ishikawa-label.down {
68
+ dominant-baseline: hanging;
69
+ }
70
+ `,"getStyles"),Ct=Ot,Gt={parser:vt,get db(){return new St},renderer:Dt,styles:Ct};export{Gt as diagram};