aitu-app 0.5.14 → 0.5.15

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.

Potentially problematic release.


This version of aitu-app might be problematic. Click here for more details.

Files changed (110) hide show
  1. package/README.md +3 -2
  2. package/assets/{ChatMessagesArea-CkUX81uB.js → ChatMessagesArea-CJPMwgOQ.js} +3 -3
  3. package/assets/{ToolboxDrawer-By1XMh8B.js → ToolboxDrawer-BZkRey45.js} +1 -1
  4. package/assets/{ai-analyze-Db-iXol6.js → ai-analyze-CKKkojLn.js} +1 -1
  5. package/assets/{arc-ajYHRRnk.js → arc-DpZjyIR9.js} +1 -1
  6. package/assets/{arc-BZXVqUcI.js → arc-amy12ZHI.js} +1 -1
  7. package/assets/{batch-image-generation-Baqb01Lm.js → batch-image-generation-CqSButZp.js} +1 -1
  8. package/assets/{blockDiagram-38ab4fdb-BT3H_WVv.js → blockDiagram-38ab4fdb-Bb_sM5Hm.js} +1 -1
  9. package/assets/{blockDiagram-38ab4fdb-u0xYP3Lt.js → blockDiagram-38ab4fdb-DO5SLxgD.js} +1 -1
  10. package/assets/{c4Diagram-3d4e48cf-CBvM6zjM.js → c4Diagram-3d4e48cf-D1hzTotE.js} +1 -1
  11. package/assets/{c4Diagram-3d4e48cf-WOIEVidH.js → c4Diagram-3d4e48cf-IYlxbdWH.js} +1 -1
  12. package/assets/channel-DuH6cax_.js +1 -0
  13. package/assets/channel-V941kNNl.js +1 -0
  14. package/assets/{classDiagram-70f12bd4-Cl9U1r5F.js → classDiagram-70f12bd4-CMCkiBrF.js} +1 -1
  15. package/assets/{classDiagram-70f12bd4-BMutcvFi.js → classDiagram-70f12bd4-C_DG-_VE.js} +1 -1
  16. package/assets/{classDiagram-v2-f2320105-C0agtbR4.js → classDiagram-v2-f2320105-DdbTRsFm.js} +1 -1
  17. package/assets/{classDiagram-v2-f2320105-tCBzATK6.js → classDiagram-v2-f2320105-Y5yPoT7w.js} +1 -1
  18. package/assets/clone-BoLnjeh7.js +1 -0
  19. package/assets/clone-DufRhyQM.js +1 -0
  20. package/assets/{createText-2e5e7dd3-CZ9_fscE.js → createText-2e5e7dd3-DWMoiN14.js} +1 -1
  21. package/assets/{createText-2e5e7dd3-idrqgJjU.js → createText-2e5e7dd3-Q_TpnKHS.js} +1 -1
  22. package/assets/{edges-e0da2a9e-C-RyePMV.js → edges-e0da2a9e-Br_hn5Hn.js} +1 -1
  23. package/assets/{edges-e0da2a9e-DJXAjJSL.js → edges-e0da2a9e-DMfYzMhl.js} +1 -1
  24. package/assets/{erDiagram-9861fffd-x2Kcy95-.js → erDiagram-9861fffd-8s6fny9G.js} +1 -1
  25. package/assets/{erDiagram-9861fffd-DWJR_3zL.js → erDiagram-9861fffd-CslzjwB2.js} +1 -1
  26. package/assets/{flowDb-956e92f1-CF6y18Tn.js → flowDb-956e92f1-BsxQxnaW.js} +1 -1
  27. package/assets/{flowDb-956e92f1-BgKjOIdz.js → flowDb-956e92f1-Bsz7tEUu.js} +1 -1
  28. package/assets/{flowDiagram-66a62f08-CSAllSFf.js → flowDiagram-66a62f08-C0iQ7Eg0.js} +1 -1
  29. package/assets/{flowDiagram-66a62f08-BPPw0wPU.js → flowDiagram-66a62f08-DLXaK0x0.js} +1 -1
  30. package/assets/flowDiagram-v2-96b9c2cf-Be_fSVIi.js +1 -0
  31. package/assets/flowDiagram-v2-96b9c2cf-C-_-kXrI.js +1 -0
  32. package/assets/{flowchart-elk-definition-4a651766-DWFN9DN3.js → flowchart-elk-definition-4a651766-2JQap1Bs.js} +1 -1
  33. package/assets/{flowchart-elk-definition-4a651766-9XSRJbsr.js → flowchart-elk-definition-4a651766-UQLaW6cl.js} +1 -1
  34. package/assets/{ganttDiagram-c361ad54-D9tbz9tQ.js → ganttDiagram-c361ad54-Cfdrec1H.js} +1 -1
  35. package/assets/{ganttDiagram-c361ad54-ot5pUYpT.js → ganttDiagram-c361ad54-hShkYpY_.js} +1 -1
  36. package/assets/{gitGraphDiagram-72cf32ee-C6qFzgGh.js → gitGraphDiagram-72cf32ee-CJw4loHZ.js} +1 -1
  37. package/assets/{gitGraphDiagram-72cf32ee-BFV3Mt8C.js → gitGraphDiagram-72cf32ee-D6obWSUI.js} +1 -1
  38. package/assets/{graph-BxwlF7JS.js → graph-CUK2kA3Q.js} +1 -1
  39. package/assets/{graph-D-2Ldvxg.js → graph-DvHs9g2k.js} +1 -1
  40. package/assets/{grid-image-cM9AmYC8.js → grid-image-DioDaenp.js} +1 -1
  41. package/assets/{has-CgdIPiQG.js → has-C9yYx3eK.js} +1 -1
  42. package/assets/{hasIn-4iY02rGN.js → hasIn-DZErb2GY.js} +1 -1
  43. package/assets/{index-3862675e-CVZnpwDN.js → index-3862675e-CmpgM8FI.js} +1 -1
  44. package/assets/{index-3862675e-DqdI9cab.js → index-3862675e-DIpatAx8.js} +1 -1
  45. package/assets/{index-DBWqXBIQ.js → index-6dh_xpWk.js} +1 -1
  46. package/assets/{index-DWUAFoZG.js → index-BBCAc4Al.js} +9 -9
  47. package/assets/{index-BicRPzXC.js → index-BENzx6Jm.js} +1 -1
  48. package/assets/{index-BwSGXyRr.js → index-CMnHM-d8.js} +4 -4
  49. package/assets/{index-e05Rs4M6.js → index-D6IbVyW6.js} +1 -1
  50. package/assets/{index-CkpXFt8n.js → index-DDjAsbde.js} +1 -1
  51. package/assets/{index-Dn0YtZ2R.js → index-Dg-P8uA3.js} +1 -1
  52. package/assets/{index-CrxF9gFe.js → index-JzVvCLEO.js} +1 -1
  53. package/assets/{infoDiagram-f8f76790-FKC1Sy9Y.js → infoDiagram-f8f76790-DVba3P4U.js} +1 -1
  54. package/assets/{infoDiagram-f8f76790-CnrpwoOt.js → infoDiagram-f8f76790-n-jV57cF.js} +1 -1
  55. package/assets/{inspiration-board-B_-BBBHt.js → inspiration-board--PQTKq9U.js} +1 -1
  56. package/assets/{isEmpty-Dj2GV0v-.js → isEmpty-CRiX5iwN.js} +1 -1
  57. package/assets/{journeyDiagram-49397b02-B7fP21sU.js → journeyDiagram-49397b02-DxSFNQYs.js} +1 -1
  58. package/assets/{journeyDiagram-49397b02-Dp3X9XWq.js → journeyDiagram-49397b02-WGL-3jNv.js} +1 -1
  59. package/assets/{layout-BD3yCK_X.js → layout-25V5jGUW.js} +1 -1
  60. package/assets/{layout-DHHYqX7p.js → layout-CawIP_cF.js} +1 -1
  61. package/assets/{line-B3bNrkzn.js → line-D5ZQcCU6.js} +1 -1
  62. package/assets/{line-B86HLuqu.js → line-DuKdCx_E.js} +1 -1
  63. package/assets/{linear-wCAlMhOS.js → linear-3V_n7zlW.js} +1 -1
  64. package/assets/{linear-DU2Ciymb.js → linear-BlVhwFrV.js} +1 -1
  65. package/assets/{mermaid.core-DfVvnpgz.js → mermaid.core--Np12uGY.js} +4 -4
  66. package/assets/{mindmap-definition-fc14e90a-D1sxE3xG.js → mindmap-definition-fc14e90a-C96nL64E.js} +1 -1
  67. package/assets/{mindmap-definition-fc14e90a-YuSOJC7P.js → mindmap-definition-fc14e90a-UZifAYnn.js} +1 -1
  68. package/assets/{photo-wall-splitter-BVU2e0aS.js → photo-wall-splitter-DZyQuDUg.js} +1 -1
  69. package/assets/{pick-Cvlwra4g.js → pick-B51S9oWq.js} +1 -1
  70. package/assets/{pieDiagram-8a3498a8-B6mJUqro.js → pieDiagram-8a3498a8-B_UU-v6b.js} +1 -1
  71. package/assets/{pieDiagram-8a3498a8-B91bWgo_.js → pieDiagram-8a3498a8-DXEMg8-z.js} +1 -1
  72. package/assets/{quadrantDiagram-120e2f19-BxS8fQEz.js → quadrantDiagram-120e2f19-BpCIEZWH.js} +1 -1
  73. package/assets/{quadrantDiagram-120e2f19-DwudONqx.js → quadrantDiagram-120e2f19-THiHerb8.js} +1 -1
  74. package/assets/{requirementDiagram-deff3bca-DygaMIoy.js → requirementDiagram-deff3bca-BLEvJckC.js} +1 -1
  75. package/assets/{requirementDiagram-deff3bca-v9xlgfS8.js → requirementDiagram-deff3bca-qJ4hHh6O.js} +1 -1
  76. package/assets/{sankeyDiagram-04a897e0-BXCiXiyw.js → sankeyDiagram-04a897e0-C5moR6iD.js} +1 -1
  77. package/assets/{sankeyDiagram-04a897e0-BV23dp4l.js → sankeyDiagram-04a897e0-Clk-gmpQ.js} +1 -1
  78. package/assets/{sequenceDiagram-704730f1-CObRpNi4.js → sequenceDiagram-704730f1-Ch9GmBP7.js} +1 -1
  79. package/assets/{sequenceDiagram-704730f1-Ck69A6wI.js → sequenceDiagram-704730f1-DRHB_a_K.js} +1 -1
  80. package/assets/{settings-dialog-BlCO49C4.js → settings-dialog-Cgmye4jO.js} +1 -1
  81. package/assets/{stateDiagram-587899a1-J_G6I0oo.js → stateDiagram-587899a1-Bu42pkUv.js} +1 -1
  82. package/assets/{stateDiagram-587899a1-z-tKclr3.js → stateDiagram-587899a1-bnuzZWVC.js} +1 -1
  83. package/assets/{stateDiagram-v2-d93cdb3a-DsThtOzP.js → stateDiagram-v2-d93cdb3a-3bX_yI1j.js} +1 -1
  84. package/assets/{stateDiagram-v2-d93cdb3a-XIvq5t8a.js → stateDiagram-v2-d93cdb3a-DLzO3ON3.js} +1 -1
  85. package/assets/{styles-6aaf32cf-1fjuNMUk.js → styles-6aaf32cf-CyzTJ9FB.js} +1 -1
  86. package/assets/{styles-6aaf32cf-DT2rVNfQ.js → styles-6aaf32cf-qL7GgrGp.js} +1 -1
  87. package/assets/{styles-9a916d00-fLeUSina.js → styles-9a916d00-DYu1WXui.js} +1 -1
  88. package/assets/{styles-9a916d00-q64Umkis.js → styles-9a916d00-Dv_u24Fv.js} +1 -1
  89. package/assets/{styles-c10674c1-CtYpjMYU.js → styles-c10674c1-C8mVn82x.js} +1 -1
  90. package/assets/{styles-c10674c1-BWlxVc3Q.js → styles-c10674c1-CBAvChyC.js} +1 -1
  91. package/assets/{svgDrawCommon-08f97a94-C_DhKfny.js → svgDrawCommon-08f97a94-Cma2KGuK.js} +1 -1
  92. package/assets/{svgDrawCommon-08f97a94-DSBqmUv2.js → svgDrawCommon-08f97a94-p3hABH7b.js} +1 -1
  93. package/assets/{timeline-definition-85554ec2-dTkYwoLF.js → timeline-definition-85554ec2-SwmuytFv.js} +1 -1
  94. package/assets/{timeline-definition-85554ec2-AKpzwLPN.js → timeline-definition-85554ec2-XppLsb9g.js} +1 -1
  95. package/assets/{ttd-dialog-CxiaIUuJ.js → ttd-dialog-DeYFjfFN.js} +5 -5
  96. package/assets/{upload-4sxUU7q_.js → upload-B0RQ9yYL.js} +1 -1
  97. package/assets/{video-recovery-service-BckHbSyK.js → video-recovery-service-XnlUYAOr.js} +1 -1
  98. package/assets/{xychartDiagram-e933f94c-DCmvL0ag.js → xychartDiagram-e933f94c-C8xFRDll.js} +1 -1
  99. package/assets/{xychartDiagram-e933f94c-aqOiXp_u.js → xychartDiagram-e933f94c-CedgK1zZ.js} +1 -1
  100. package/index.html +2 -2
  101. package/package.json +1 -1
  102. package/sw.js +1 -1
  103. package/version.json +3 -7
  104. package/versions.html +374 -0
  105. package/assets/channel-BP25wTsw.js +0 -1
  106. package/assets/channel-HzrLNFUg.js +0 -1
  107. package/assets/clone-B69pF7Y_.js +0 -1
  108. package/assets/clone-oX7o-l4R.js +0 -1
  109. package/assets/flowDiagram-v2-96b9c2cf-B-UGyXRi.js +0 -1
  110. package/assets/flowDiagram-v2-96b9c2cf-Cm596kxZ.js +0 -1
@@ -1 +1 @@
1
- import{aJ as C,aK as Ze,aA as y,aL as m,aM as qe,aN as Xe,az as Te,aO as Je,aP as Ee,aQ as G,ax as X,aR as Qe,aS as me,aT as We,aU as I,aG as Oe,aV as D,as as ve,aW as ze,aX as Z,aY as Ve,aZ as ke,a_ as $,aF as en,a$ as nn,ay as rn,b0 as re,b1 as tn,b2 as sn,aE as an,aD as we,aB as un,b3 as j,av as fn,b4 as on,aH as M,ad as te,b5 as ie}from"./mermaid.core-DfVvnpgz.js";var dn="[object Symbol]";function J(e){return typeof e=="symbol"||C(e)&&Ze(e)==dn}function Le(e,n){for(var r=-1,t=e==null?0:e.length,i=Array(t);++r<t;)i[r]=n(e[r],r,e);return i}var se=m?m.prototype:void 0,ae=se?se.toString:void 0;function Pe(e){if(typeof e=="string")return e;if(y(e))return Le(e,Pe)+"";if(J(e))return ae?ae.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function hn(){}function $e(e,n){for(var r=-1,t=e==null?0:e.length;++r<t&&n(e[r],r,e)!==!1;);return e}function gn(e,n,r,t){for(var i=e.length,s=r+-1;++s<i;)if(n(e[s],s,e))return s;return-1}function ln(e){return e!==e}function cn(e,n,r){for(var t=r-1,i=e.length;++t<i;)if(e[t]===n)return t;return-1}function _n(e,n,r){return n===n?cn(e,n,r):gn(e,ln,r)}function pn(e,n){var r=e==null?0:e.length;return!!r&&_n(e,n,0)>-1}function T(e){return Te(e)?qe(e):Xe(e)}var bn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yn=/^\w*$/;function Q(e,n){if(y(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||J(e)?!0:yn.test(e)||!bn.test(e)||n!=null&&e in Object(n)}var An=500;function Tn(e){var n=Je(e,function(t){return r.size===An&&r.clear(),t}),r=n.cache;return n}var En=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mn=/\\(\\)?/g,On=Tn(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(En,function(r,t,i,s){n.push(i?s.replace(mn,"$1"):t||r)}),n});function vn(e){return e==null?"":Pe(e)}function Ce(e,n){return y(e)?e:Q(e,n)?[e]:On(vn(e))}function U(e){if(typeof e=="string"||J(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Ie(e,n){n=Ce(n,e);for(var r=0,t=n.length;e!=null&&r<t;)e=e[U(n[r++])];return r&&r==t?e:void 0}function wn(e,n,r){var t=e==null?void 0:Ie(e,n);return t===void 0?r:t}function W(e,n){for(var r=-1,t=n.length,i=e.length;++r<t;)e[i+r]=n[r];return e}var ue=m?m.isConcatSpreadable:void 0;function Ln(e){return y(e)||Ee(e)||!!(ue&&e&&e[ue])}function Pn(e,n,r,t,i){var s=-1,a=e.length;for(r||(r=Ln),i||(i=[]);++s<a;){var u=e[s];r(u)?W(i,u):t||(i[i.length]=u)}return i}function $n(e,n,r,t){var i=-1,s=e==null?0:e.length;for(t&&s&&(r=e[++i]);++i<s;)r=n(r,e[i],i,e);return r}function Cn(e,n){return e&&G(n,T(n),e)}function In(e,n){return e&&G(n,X(n),e)}function Se(e,n){for(var r=-1,t=e==null?0:e.length,i=0,s=[];++r<t;){var a=e[r];n(a,r,e)&&(s[i++]=a)}return s}function Fe(){return[]}var Sn=Object.prototype,Fn=Sn.propertyIsEnumerable,fe=Object.getOwnPropertySymbols,z=fe?function(e){return e==null?[]:(e=Object(e),Se(fe(e),function(n){return Fn.call(e,n)}))}:Fe;function Nn(e,n){return G(e,z(e),n)}var Mn=Object.getOwnPropertySymbols,Ne=Mn?function(e){for(var n=[];e;)W(n,z(e)),e=Qe(e);return n}:Fe;function Rn(e,n){return G(e,Ne(e),n)}function Me(e,n,r){var t=n(e);return y(e)?t:W(t,r(e))}function q(e){return Me(e,T,z)}function xn(e){return Me(e,X,Ne)}var Dn=Object.prototype,Gn=Dn.hasOwnProperty;function Un(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Gn.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function jn(e,n){var r=n?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Bn=/\w*$/;function Kn(e){var n=new e.constructor(e.source,Bn.exec(e));return n.lastIndex=e.lastIndex,n}var oe=m?m.prototype:void 0,de=oe?oe.valueOf:void 0;function Hn(e){return de?Object(de.call(e)):{}}var Yn="[object Boolean]",Zn="[object Date]",qn="[object Map]",Xn="[object Number]",Jn="[object RegExp]",Qn="[object Set]",Wn="[object String]",zn="[object Symbol]",Vn="[object ArrayBuffer]",kn="[object DataView]",er="[object Float32Array]",nr="[object Float64Array]",rr="[object Int8Array]",tr="[object Int16Array]",ir="[object Int32Array]",sr="[object Uint8Array]",ar="[object Uint8ClampedArray]",ur="[object Uint16Array]",fr="[object Uint32Array]";function or(e,n,r){var t=e.constructor;switch(n){case Vn:return me(e);case Yn:case Zn:return new t(+e);case kn:return jn(e,r);case er:case nr:case rr:case tr:case ir:case sr:case ar:case ur:case fr:return We(e,r);case qn:return new t;case Xn:case Wn:return new t(e);case Jn:return Kn(e);case Qn:return new t;case zn:return Hn(e)}}var dr="[object Map]";function hr(e){return C(e)&&I(e)==dr}var he=D&&D.isMap,gr=he?Oe(he):hr,lr="[object Set]";function cr(e){return C(e)&&I(e)==lr}var ge=D&&D.isSet,_r=ge?Oe(ge):cr,pr=1,br=2,yr=4,Re="[object Arguments]",Ar="[object Array]",Tr="[object Boolean]",Er="[object Date]",mr="[object Error]",xe="[object Function]",Or="[object GeneratorFunction]",vr="[object Map]",wr="[object Number]",De="[object Object]",Lr="[object RegExp]",Pr="[object Set]",$r="[object String]",Cr="[object Symbol]",Ir="[object WeakMap]",Sr="[object ArrayBuffer]",Fr="[object DataView]",Nr="[object Float32Array]",Mr="[object Float64Array]",Rr="[object Int8Array]",xr="[object Int16Array]",Dr="[object Int32Array]",Gr="[object Uint8Array]",Ur="[object Uint8ClampedArray]",jr="[object Uint16Array]",Br="[object Uint32Array]",d={};d[Re]=d[Ar]=d[Sr]=d[Fr]=d[Tr]=d[Er]=d[Nr]=d[Mr]=d[Rr]=d[xr]=d[Dr]=d[vr]=d[wr]=d[De]=d[Lr]=d[Pr]=d[$r]=d[Cr]=d[Gr]=d[Ur]=d[jr]=d[Br]=!0;d[mr]=d[xe]=d[Ir]=!1;function B(e,n,r,t,i,s){var a,u=n&pr,f=n&br,l=n&yr;if(a!==void 0)return a;if(!ve(e))return e;var g=y(e);if(g){if(a=Un(e),!u)return ze(e,a)}else{var o=I(e),h=o==xe||o==Or;if(Z(e))return Ve(e,u);if(o==De||o==Re||h&&!i){if(a=f||h?{}:ke(e),!u)return f?Rn(e,In(a,e)):Nn(e,Cn(a,e))}else{if(!d[o])return i?e:{};a=or(e,o,u)}}s||(s=new $);var A=s.get(e);if(A)return A;s.set(e,a),_r(e)?e.forEach(function(c){a.add(B(c,n,r,c,e,s))}):gr(e)&&e.forEach(function(c,_){a.set(_,B(c,n,r,_,e,s))});var p=l?f?xn:q:f?X:T,b=g?void 0:p(e);return $e(b||e,function(c,_){b&&(_=c,c=e[_]),en(a,_,B(c,n,r,_,e,s))}),a}var Kr="__lodash_hash_undefined__";function Hr(e){return this.__data__.set(e,Kr),this}function Yr(e){return this.__data__.has(e)}function S(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new nn;++n<r;)this.add(e[n])}S.prototype.add=S.prototype.push=Hr;S.prototype.has=Yr;function Zr(e,n){for(var r=-1,t=e==null?0:e.length;++r<t;)if(n(e[r],r,e))return!0;return!1}function Ge(e,n){return e.has(n)}var qr=1,Xr=2;function Ue(e,n,r,t,i,s){var a=r&qr,u=e.length,f=n.length;if(u!=f&&!(a&&f>u))return!1;var l=s.get(e),g=s.get(n);if(l&&g)return l==n&&g==e;var o=-1,h=!0,A=r&Xr?new S:void 0;for(s.set(e,n),s.set(n,e);++o<u;){var p=e[o],b=n[o];if(t)var c=a?t(b,p,o,n,e,s):t(p,b,o,e,n,s);if(c!==void 0){if(c)continue;h=!1;break}if(A){if(!Zr(n,function(_,O){if(!Ge(A,O)&&(p===_||i(p,_,r,t,s)))return A.push(O)})){h=!1;break}}else if(!(p===b||i(p,b,r,t,s))){h=!1;break}}return s.delete(e),s.delete(n),h}function Jr(e){var n=-1,r=Array(e.size);return e.forEach(function(t,i){r[++n]=[i,t]}),r}function V(e){var n=-1,r=Array(e.size);return e.forEach(function(t){r[++n]=t}),r}var Qr=1,Wr=2,zr="[object Boolean]",Vr="[object Date]",kr="[object Error]",et="[object Map]",nt="[object Number]",rt="[object RegExp]",tt="[object Set]",it="[object String]",st="[object Symbol]",at="[object ArrayBuffer]",ut="[object DataView]",le=m?m.prototype:void 0,K=le?le.valueOf:void 0;function ft(e,n,r,t,i,s,a){switch(r){case ut:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case at:return!(e.byteLength!=n.byteLength||!s(new re(e),new re(n)));case zr:case Vr:case nt:return rn(+e,+n);case kr:return e.name==n.name&&e.message==n.message;case rt:case it:return e==n+"";case et:var u=Jr;case tt:var f=t&Qr;if(u||(u=V),e.size!=n.size&&!f)return!1;var l=a.get(e);if(l)return l==n;t|=Wr,a.set(e,n);var g=Ue(u(e),u(n),t,i,s,a);return a.delete(e),g;case st:if(K)return K.call(e)==K.call(n)}return!1}var ot=1,dt=Object.prototype,ht=dt.hasOwnProperty;function gt(e,n,r,t,i,s){var a=r&ot,u=q(e),f=u.length,l=q(n),g=l.length;if(f!=g&&!a)return!1;for(var o=f;o--;){var h=u[o];if(!(a?h in n:ht.call(n,h)))return!1}var A=s.get(e),p=s.get(n);if(A&&p)return A==n&&p==e;var b=!0;s.set(e,n),s.set(n,e);for(var c=a;++o<f;){h=u[o];var _=e[h],O=n[h];if(t)var ne=a?t(O,_,h,n,e,s):t(_,O,h,e,n,s);if(!(ne===void 0?_===O||i(_,O,r,t,s):ne)){b=!1;break}c||(c=h=="constructor")}if(b&&!c){var F=e.constructor,N=n.constructor;F!=N&&"constructor"in e&&"constructor"in n&&!(typeof F=="function"&&F instanceof F&&typeof N=="function"&&N instanceof N)&&(b=!1)}return s.delete(e),s.delete(n),b}var lt=1,ce="[object Arguments]",_e="[object Array]",R="[object Object]",ct=Object.prototype,pe=ct.hasOwnProperty;function _t(e,n,r,t,i,s){var a=y(e),u=y(n),f=a?_e:I(e),l=u?_e:I(n);f=f==ce?R:f,l=l==ce?R:l;var g=f==R,o=l==R,h=f==l;if(h&&Z(e)){if(!Z(n))return!1;a=!0,g=!1}if(h&&!g)return s||(s=new $),a||tn(e)?Ue(e,n,r,t,i,s):ft(e,n,f,r,t,i,s);if(!(r&lt)){var A=g&&pe.call(e,"__wrapped__"),p=o&&pe.call(n,"__wrapped__");if(A||p){var b=A?e.value():e,c=p?n.value():n;return s||(s=new $),i(b,c,r,t,s)}}return h?(s||(s=new $),gt(e,n,r,t,i,s)):!1}function k(e,n,r,t,i){return e===n?!0:e==null||n==null||!C(e)&&!C(n)?e!==e&&n!==n:_t(e,n,r,t,k,i)}var pt=1,bt=2;function yt(e,n,r,t){var i=r.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var u=a[0],f=e[u],l=a[1];if(a[2]){if(f===void 0&&!(u in e))return!1}else{var g=new $,o;if(!(o===void 0?k(l,f,pt|bt,t,g):o))return!1}}return!0}function je(e){return e===e&&!ve(e)}function At(e){for(var n=T(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,je(i)]}return n}function Be(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function Tt(e){var n=At(e);return n.length==1&&n[0][2]?Be(n[0][0],n[0][1]):function(r){return r===e||yt(r,e,n)}}function Et(e,n){return e!=null&&n in Object(e)}function Ke(e,n,r){n=Ce(n,e);for(var t=-1,i=n.length,s=!1;++t<i;){var a=U(n[t]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++t!=i?s:(i=e==null?0:e.length,!!i&&sn(i)&&an(a,i)&&(y(e)||Ee(e)))}function mt(e,n){return e!=null&&Ke(e,n,Et)}var Ot=1,vt=2;function wt(e,n){return Q(e)&&je(n)?Be(U(e),n):function(r){var t=wn(r,e);return t===void 0&&t===n?mt(r,e):k(n,t,Ot|vt)}}function Lt(e){return function(n){return n==null?void 0:n[e]}}function Pt(e){return function(n){return Ie(n,e)}}function $t(e){return Q(e)?Lt(U(e)):Pt(e)}function He(e){return typeof e=="function"?e:e==null?we:typeof e=="object"?y(e)?wt(e[0],e[1]):Tt(e):$t(e)}function Ct(e,n){return e&&un(e,n,T)}function It(e,n){return function(r,t){if(r==null)return r;if(!Te(r))return e(r,t);for(var i=r.length,s=-1,a=Object(r);++s<i&&t(a[s],s,a)!==!1;);return r}}var ee=It(Ct);function St(e){return typeof e=="function"?e:we}function v(e,n){var r=y(e)?$e:ee;return r(e,St(n))}function Ft(e,n){var r=[];return ee(e,function(t,i,s){n(t,i,s)&&r.push(t)}),r}function x(e,n){var r=y(e)?Se:Ft;return r(e,He(n))}var Nt=Object.prototype,Mt=Nt.hasOwnProperty;function Rt(e,n){return e!=null&&Mt.call(e,n)}function E(e,n){return e!=null&&Ke(e,n,Rt)}function xt(e,n){return Le(n,function(r){return e[r]})}function H(e){return e==null?[]:xt(e,T(e))}function L(e){return e===void 0}function Dt(e,n,r,t,i){return i(e,function(s,a,u){r=t?(t=!1,s):n(r,s,a,u)}),r}function Gt(e,n,r){var t=y(e)?$n:Dt,i=arguments.length<3;return t(e,He(n),r,i,ee)}var Ut=1/0,jt=j&&1/V(new j([,-0]))[1]==Ut?function(e){return new j(e)}:hn,Bt=200;function Kt(e,n,r){var t=-1,i=pn,s=e.length,a=!0,u=[],f=u;if(s>=Bt){var l=jt(e);if(l)return V(l);a=!1,i=Ge,f=new S}else f=u;e:for(;++t<s;){var g=e[t],o=g;if(g=g!==0?g:0,a&&o===o){for(var h=f.length;h--;)if(f[h]===o)continue e;u.push(g)}else i(f,o,r)||(f!==u&&f.push(o),u.push(g))}return u}var Ht=fn(function(e){return Kt(Pn(e,1,on,!0))}),Yt="\0",w="\0",be="";class Ye{constructor(n={}){this._isDirected=E(n,"directed")?n.directed:!0,this._isMultigraph=E(n,"multigraph")?n.multigraph:!1,this._isCompound=E(n,"compound")?n.compound:!1,this._label=void 0,this._defaultNodeLabelFn=M(void 0),this._defaultEdgeLabelFn=M(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[w]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(n){return this._label=n,this}graph(){return this._label}setDefaultNodeLabel(n){return te(n)||(n=M(n)),this._defaultNodeLabelFn=n,this}nodeCount(){return this._nodeCount}nodes(){return T(this._nodes)}sources(){var n=this;return x(this.nodes(),function(r){return ie(n._in[r])})}sinks(){var n=this;return x(this.nodes(),function(r){return ie(n._out[r])})}setNodes(n,r){var t=arguments,i=this;return v(n,function(s){t.length>1?i.setNode(s,r):i.setNode(s)}),this}setNode(n,r){return E(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]=w,this._children[n]={},this._children[w][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)}node(n){return this._nodes[n]}hasNode(n){return E(this._nodes,n)}removeNode(n){var r=this;if(E(this._nodes,n)){var t=function(i){r.removeEdge(r._edgeObjs[i])};delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],v(this.children(n),function(i){r.setParent(i)}),delete this._children[n]),v(T(this._in[n]),t),delete this._in[n],delete this._preds[n],v(T(this._out[n]),t),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this}setParent(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(L(r))r=w;else{r+="";for(var t=r;!L(t);t=this.parent(t))if(t===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this}_removeFromParentsChildList(n){delete this._children[this._parent[n]][n]}parent(n){if(this._isCompound){var r=this._parent[n];if(r!==w)return r}}children(n){if(L(n)&&(n=w),this._isCompound){var r=this._children[n];if(r)return T(r)}else{if(n===w)return this.nodes();if(this.hasNode(n))return[]}}predecessors(n){var r=this._preds[n];if(r)return T(r)}successors(n){var r=this._sucs[n];if(r)return T(r)}neighbors(n){var r=this.predecessors(n);if(r)return Ht(r,this.successors(n))}isLeaf(n){var r;return this.isDirected()?r=this.successors(n):r=this.neighbors(n),r.length===0}filterNodes(n){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var t=this;v(this._nodes,function(a,u){n(u)&&r.setNode(u,a)}),v(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,t.edge(a))});var i={};function s(a){var u=t.parent(a);return u===void 0||r.hasNode(u)?(i[a]=u,u):u in i?i[u]:s(u)}return this._isCompound&&v(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(n){return te(n)||(n=M(n)),this._defaultEdgeLabelFn=n,this}edgeCount(){return this._edgeCount}edges(){return H(this._edgeObjs)}setPath(n,r){var t=this,i=arguments;return Gt(n,function(s,a){return i.length>1?t.setEdge(s,a,r):t.setEdge(s,a),a}),this}setEdge(){var n,r,t,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(n=a.v,r=a.w,t=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(n=a,r=arguments[1],t=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),n=""+n,r=""+r,L(t)||(t=""+t);var u=P(this._isDirected,n,r,t);if(E(this._edgeLabels,u))return s&&(this._edgeLabels[u]=i),this;if(!L(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(r),this._edgeLabels[u]=s?i:this._defaultEdgeLabelFn(n,r,t);var f=Zt(this._isDirected,n,r,t);return n=f.v,r=f.w,Object.freeze(f),this._edgeObjs[u]=f,ye(this._preds[r],n),ye(this._sucs[n],r),this._in[r][u]=f,this._out[n][u]=f,this._edgeCount++,this}edge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t);return this._edgeLabels[i]}hasEdge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t);return E(this._edgeLabels,i)}removeEdge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t),s=this._edgeObjs[i];return s&&(n=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ae(this._preds[r],n),Ae(this._sucs[n],r),delete this._in[r][i],delete this._out[n][i],this._edgeCount--),this}inEdges(n,r){var t=this._in[n];if(t){var i=H(t);return r?x(i,function(s){return s.v===r}):i}}outEdges(n,r){var t=this._out[n];if(t){var i=H(t);return r?x(i,function(s){return s.w===r}):i}}nodeEdges(n,r){var t=this.inEdges(n,r);if(t)return t.concat(this.outEdges(n,r))}}Ye.prototype._nodeCount=0;Ye.prototype._edgeCount=0;function ye(e,n){e[n]?e[n]++:e[n]=1}function Ae(e,n){--e[n]||delete e[n]}function P(e,n,r,t){var i=""+n,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+be+s+be+(L(t)?Yt:t)}function Zt(e,n,r,t){var i=""+n,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var u={v:i,w:s};return t&&(u.name=t),u}function Y(e,n){return P(e,n.v,n.w,n.name)}export{Ye as G,J as a,B as b,Pn as c,He as d,gn as e,v as f,ee as g,E as h,L as i,Le as j,T as k,St as l,Ct as m,Ce as n,Ie as o,mt as p,vn as q,x as r,Gt as s,U as t,H as v};
1
+ import{aJ as C,aK as Ze,aA as y,aL as m,aM as qe,aN as Xe,az as Te,aO as Je,aP as Ee,aQ as G,ax as X,aR as Qe,aS as me,aT as We,aU as I,aG as Oe,aV as D,as as ve,aW as ze,aX as Z,aY as Ve,aZ as ke,a_ as $,aF as en,a$ as nn,ay as rn,b0 as re,b1 as tn,b2 as sn,aE as an,aD as we,aB as un,b3 as j,av as fn,b4 as on,aH as M,ad as te,b5 as ie}from"./mermaid.core--Np12uGY.js";var dn="[object Symbol]";function J(e){return typeof e=="symbol"||C(e)&&Ze(e)==dn}function Le(e,n){for(var r=-1,t=e==null?0:e.length,i=Array(t);++r<t;)i[r]=n(e[r],r,e);return i}var se=m?m.prototype:void 0,ae=se?se.toString:void 0;function Pe(e){if(typeof e=="string")return e;if(y(e))return Le(e,Pe)+"";if(J(e))return ae?ae.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function hn(){}function $e(e,n){for(var r=-1,t=e==null?0:e.length;++r<t&&n(e[r],r,e)!==!1;);return e}function gn(e,n,r,t){for(var i=e.length,s=r+-1;++s<i;)if(n(e[s],s,e))return s;return-1}function ln(e){return e!==e}function cn(e,n,r){for(var t=r-1,i=e.length;++t<i;)if(e[t]===n)return t;return-1}function _n(e,n,r){return n===n?cn(e,n,r):gn(e,ln,r)}function pn(e,n){var r=e==null?0:e.length;return!!r&&_n(e,n,0)>-1}function T(e){return Te(e)?qe(e):Xe(e)}var bn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yn=/^\w*$/;function Q(e,n){if(y(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||J(e)?!0:yn.test(e)||!bn.test(e)||n!=null&&e in Object(n)}var An=500;function Tn(e){var n=Je(e,function(t){return r.size===An&&r.clear(),t}),r=n.cache;return n}var En=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mn=/\\(\\)?/g,On=Tn(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(En,function(r,t,i,s){n.push(i?s.replace(mn,"$1"):t||r)}),n});function vn(e){return e==null?"":Pe(e)}function Ce(e,n){return y(e)?e:Q(e,n)?[e]:On(vn(e))}function U(e){if(typeof e=="string"||J(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Ie(e,n){n=Ce(n,e);for(var r=0,t=n.length;e!=null&&r<t;)e=e[U(n[r++])];return r&&r==t?e:void 0}function wn(e,n,r){var t=e==null?void 0:Ie(e,n);return t===void 0?r:t}function W(e,n){for(var r=-1,t=n.length,i=e.length;++r<t;)e[i+r]=n[r];return e}var ue=m?m.isConcatSpreadable:void 0;function Ln(e){return y(e)||Ee(e)||!!(ue&&e&&e[ue])}function Pn(e,n,r,t,i){var s=-1,a=e.length;for(r||(r=Ln),i||(i=[]);++s<a;){var u=e[s];r(u)?W(i,u):t||(i[i.length]=u)}return i}function $n(e,n,r,t){var i=-1,s=e==null?0:e.length;for(t&&s&&(r=e[++i]);++i<s;)r=n(r,e[i],i,e);return r}function Cn(e,n){return e&&G(n,T(n),e)}function In(e,n){return e&&G(n,X(n),e)}function Se(e,n){for(var r=-1,t=e==null?0:e.length,i=0,s=[];++r<t;){var a=e[r];n(a,r,e)&&(s[i++]=a)}return s}function Fe(){return[]}var Sn=Object.prototype,Fn=Sn.propertyIsEnumerable,fe=Object.getOwnPropertySymbols,z=fe?function(e){return e==null?[]:(e=Object(e),Se(fe(e),function(n){return Fn.call(e,n)}))}:Fe;function Nn(e,n){return G(e,z(e),n)}var Mn=Object.getOwnPropertySymbols,Ne=Mn?function(e){for(var n=[];e;)W(n,z(e)),e=Qe(e);return n}:Fe;function Rn(e,n){return G(e,Ne(e),n)}function Me(e,n,r){var t=n(e);return y(e)?t:W(t,r(e))}function q(e){return Me(e,T,z)}function xn(e){return Me(e,X,Ne)}var Dn=Object.prototype,Gn=Dn.hasOwnProperty;function Un(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Gn.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function jn(e,n){var r=n?me(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Bn=/\w*$/;function Kn(e){var n=new e.constructor(e.source,Bn.exec(e));return n.lastIndex=e.lastIndex,n}var oe=m?m.prototype:void 0,de=oe?oe.valueOf:void 0;function Hn(e){return de?Object(de.call(e)):{}}var Yn="[object Boolean]",Zn="[object Date]",qn="[object Map]",Xn="[object Number]",Jn="[object RegExp]",Qn="[object Set]",Wn="[object String]",zn="[object Symbol]",Vn="[object ArrayBuffer]",kn="[object DataView]",er="[object Float32Array]",nr="[object Float64Array]",rr="[object Int8Array]",tr="[object Int16Array]",ir="[object Int32Array]",sr="[object Uint8Array]",ar="[object Uint8ClampedArray]",ur="[object Uint16Array]",fr="[object Uint32Array]";function or(e,n,r){var t=e.constructor;switch(n){case Vn:return me(e);case Yn:case Zn:return new t(+e);case kn:return jn(e,r);case er:case nr:case rr:case tr:case ir:case sr:case ar:case ur:case fr:return We(e,r);case qn:return new t;case Xn:case Wn:return new t(e);case Jn:return Kn(e);case Qn:return new t;case zn:return Hn(e)}}var dr="[object Map]";function hr(e){return C(e)&&I(e)==dr}var he=D&&D.isMap,gr=he?Oe(he):hr,lr="[object Set]";function cr(e){return C(e)&&I(e)==lr}var ge=D&&D.isSet,_r=ge?Oe(ge):cr,pr=1,br=2,yr=4,Re="[object Arguments]",Ar="[object Array]",Tr="[object Boolean]",Er="[object Date]",mr="[object Error]",xe="[object Function]",Or="[object GeneratorFunction]",vr="[object Map]",wr="[object Number]",De="[object Object]",Lr="[object RegExp]",Pr="[object Set]",$r="[object String]",Cr="[object Symbol]",Ir="[object WeakMap]",Sr="[object ArrayBuffer]",Fr="[object DataView]",Nr="[object Float32Array]",Mr="[object Float64Array]",Rr="[object Int8Array]",xr="[object Int16Array]",Dr="[object Int32Array]",Gr="[object Uint8Array]",Ur="[object Uint8ClampedArray]",jr="[object Uint16Array]",Br="[object Uint32Array]",d={};d[Re]=d[Ar]=d[Sr]=d[Fr]=d[Tr]=d[Er]=d[Nr]=d[Mr]=d[Rr]=d[xr]=d[Dr]=d[vr]=d[wr]=d[De]=d[Lr]=d[Pr]=d[$r]=d[Cr]=d[Gr]=d[Ur]=d[jr]=d[Br]=!0;d[mr]=d[xe]=d[Ir]=!1;function B(e,n,r,t,i,s){var a,u=n&pr,f=n&br,l=n&yr;if(a!==void 0)return a;if(!ve(e))return e;var g=y(e);if(g){if(a=Un(e),!u)return ze(e,a)}else{var o=I(e),h=o==xe||o==Or;if(Z(e))return Ve(e,u);if(o==De||o==Re||h&&!i){if(a=f||h?{}:ke(e),!u)return f?Rn(e,In(a,e)):Nn(e,Cn(a,e))}else{if(!d[o])return i?e:{};a=or(e,o,u)}}s||(s=new $);var A=s.get(e);if(A)return A;s.set(e,a),_r(e)?e.forEach(function(c){a.add(B(c,n,r,c,e,s))}):gr(e)&&e.forEach(function(c,_){a.set(_,B(c,n,r,_,e,s))});var p=l?f?xn:q:f?X:T,b=g?void 0:p(e);return $e(b||e,function(c,_){b&&(_=c,c=e[_]),en(a,_,B(c,n,r,_,e,s))}),a}var Kr="__lodash_hash_undefined__";function Hr(e){return this.__data__.set(e,Kr),this}function Yr(e){return this.__data__.has(e)}function S(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new nn;++n<r;)this.add(e[n])}S.prototype.add=S.prototype.push=Hr;S.prototype.has=Yr;function Zr(e,n){for(var r=-1,t=e==null?0:e.length;++r<t;)if(n(e[r],r,e))return!0;return!1}function Ge(e,n){return e.has(n)}var qr=1,Xr=2;function Ue(e,n,r,t,i,s){var a=r&qr,u=e.length,f=n.length;if(u!=f&&!(a&&f>u))return!1;var l=s.get(e),g=s.get(n);if(l&&g)return l==n&&g==e;var o=-1,h=!0,A=r&Xr?new S:void 0;for(s.set(e,n),s.set(n,e);++o<u;){var p=e[o],b=n[o];if(t)var c=a?t(b,p,o,n,e,s):t(p,b,o,e,n,s);if(c!==void 0){if(c)continue;h=!1;break}if(A){if(!Zr(n,function(_,O){if(!Ge(A,O)&&(p===_||i(p,_,r,t,s)))return A.push(O)})){h=!1;break}}else if(!(p===b||i(p,b,r,t,s))){h=!1;break}}return s.delete(e),s.delete(n),h}function Jr(e){var n=-1,r=Array(e.size);return e.forEach(function(t,i){r[++n]=[i,t]}),r}function V(e){var n=-1,r=Array(e.size);return e.forEach(function(t){r[++n]=t}),r}var Qr=1,Wr=2,zr="[object Boolean]",Vr="[object Date]",kr="[object Error]",et="[object Map]",nt="[object Number]",rt="[object RegExp]",tt="[object Set]",it="[object String]",st="[object Symbol]",at="[object ArrayBuffer]",ut="[object DataView]",le=m?m.prototype:void 0,K=le?le.valueOf:void 0;function ft(e,n,r,t,i,s,a){switch(r){case ut:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case at:return!(e.byteLength!=n.byteLength||!s(new re(e),new re(n)));case zr:case Vr:case nt:return rn(+e,+n);case kr:return e.name==n.name&&e.message==n.message;case rt:case it:return e==n+"";case et:var u=Jr;case tt:var f=t&Qr;if(u||(u=V),e.size!=n.size&&!f)return!1;var l=a.get(e);if(l)return l==n;t|=Wr,a.set(e,n);var g=Ue(u(e),u(n),t,i,s,a);return a.delete(e),g;case st:if(K)return K.call(e)==K.call(n)}return!1}var ot=1,dt=Object.prototype,ht=dt.hasOwnProperty;function gt(e,n,r,t,i,s){var a=r&ot,u=q(e),f=u.length,l=q(n),g=l.length;if(f!=g&&!a)return!1;for(var o=f;o--;){var h=u[o];if(!(a?h in n:ht.call(n,h)))return!1}var A=s.get(e),p=s.get(n);if(A&&p)return A==n&&p==e;var b=!0;s.set(e,n),s.set(n,e);for(var c=a;++o<f;){h=u[o];var _=e[h],O=n[h];if(t)var ne=a?t(O,_,h,n,e,s):t(_,O,h,e,n,s);if(!(ne===void 0?_===O||i(_,O,r,t,s):ne)){b=!1;break}c||(c=h=="constructor")}if(b&&!c){var F=e.constructor,N=n.constructor;F!=N&&"constructor"in e&&"constructor"in n&&!(typeof F=="function"&&F instanceof F&&typeof N=="function"&&N instanceof N)&&(b=!1)}return s.delete(e),s.delete(n),b}var lt=1,ce="[object Arguments]",_e="[object Array]",R="[object Object]",ct=Object.prototype,pe=ct.hasOwnProperty;function _t(e,n,r,t,i,s){var a=y(e),u=y(n),f=a?_e:I(e),l=u?_e:I(n);f=f==ce?R:f,l=l==ce?R:l;var g=f==R,o=l==R,h=f==l;if(h&&Z(e)){if(!Z(n))return!1;a=!0,g=!1}if(h&&!g)return s||(s=new $),a||tn(e)?Ue(e,n,r,t,i,s):ft(e,n,f,r,t,i,s);if(!(r&lt)){var A=g&&pe.call(e,"__wrapped__"),p=o&&pe.call(n,"__wrapped__");if(A||p){var b=A?e.value():e,c=p?n.value():n;return s||(s=new $),i(b,c,r,t,s)}}return h?(s||(s=new $),gt(e,n,r,t,i,s)):!1}function k(e,n,r,t,i){return e===n?!0:e==null||n==null||!C(e)&&!C(n)?e!==e&&n!==n:_t(e,n,r,t,k,i)}var pt=1,bt=2;function yt(e,n,r,t){var i=r.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var u=a[0],f=e[u],l=a[1];if(a[2]){if(f===void 0&&!(u in e))return!1}else{var g=new $,o;if(!(o===void 0?k(l,f,pt|bt,t,g):o))return!1}}return!0}function je(e){return e===e&&!ve(e)}function At(e){for(var n=T(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,je(i)]}return n}function Be(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function Tt(e){var n=At(e);return n.length==1&&n[0][2]?Be(n[0][0],n[0][1]):function(r){return r===e||yt(r,e,n)}}function Et(e,n){return e!=null&&n in Object(e)}function Ke(e,n,r){n=Ce(n,e);for(var t=-1,i=n.length,s=!1;++t<i;){var a=U(n[t]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++t!=i?s:(i=e==null?0:e.length,!!i&&sn(i)&&an(a,i)&&(y(e)||Ee(e)))}function mt(e,n){return e!=null&&Ke(e,n,Et)}var Ot=1,vt=2;function wt(e,n){return Q(e)&&je(n)?Be(U(e),n):function(r){var t=wn(r,e);return t===void 0&&t===n?mt(r,e):k(n,t,Ot|vt)}}function Lt(e){return function(n){return n==null?void 0:n[e]}}function Pt(e){return function(n){return Ie(n,e)}}function $t(e){return Q(e)?Lt(U(e)):Pt(e)}function He(e){return typeof e=="function"?e:e==null?we:typeof e=="object"?y(e)?wt(e[0],e[1]):Tt(e):$t(e)}function Ct(e,n){return e&&un(e,n,T)}function It(e,n){return function(r,t){if(r==null)return r;if(!Te(r))return e(r,t);for(var i=r.length,s=-1,a=Object(r);++s<i&&t(a[s],s,a)!==!1;);return r}}var ee=It(Ct);function St(e){return typeof e=="function"?e:we}function v(e,n){var r=y(e)?$e:ee;return r(e,St(n))}function Ft(e,n){var r=[];return ee(e,function(t,i,s){n(t,i,s)&&r.push(t)}),r}function x(e,n){var r=y(e)?Se:Ft;return r(e,He(n))}var Nt=Object.prototype,Mt=Nt.hasOwnProperty;function Rt(e,n){return e!=null&&Mt.call(e,n)}function E(e,n){return e!=null&&Ke(e,n,Rt)}function xt(e,n){return Le(n,function(r){return e[r]})}function H(e){return e==null?[]:xt(e,T(e))}function L(e){return e===void 0}function Dt(e,n,r,t,i){return i(e,function(s,a,u){r=t?(t=!1,s):n(r,s,a,u)}),r}function Gt(e,n,r){var t=y(e)?$n:Dt,i=arguments.length<3;return t(e,He(n),r,i,ee)}var Ut=1/0,jt=j&&1/V(new j([,-0]))[1]==Ut?function(e){return new j(e)}:hn,Bt=200;function Kt(e,n,r){var t=-1,i=pn,s=e.length,a=!0,u=[],f=u;if(s>=Bt){var l=jt(e);if(l)return V(l);a=!1,i=Ge,f=new S}else f=u;e:for(;++t<s;){var g=e[t],o=g;if(g=g!==0?g:0,a&&o===o){for(var h=f.length;h--;)if(f[h]===o)continue e;u.push(g)}else i(f,o,r)||(f!==u&&f.push(o),u.push(g))}return u}var Ht=fn(function(e){return Kt(Pn(e,1,on,!0))}),Yt="\0",w="\0",be="";class Ye{constructor(n={}){this._isDirected=E(n,"directed")?n.directed:!0,this._isMultigraph=E(n,"multigraph")?n.multigraph:!1,this._isCompound=E(n,"compound")?n.compound:!1,this._label=void 0,this._defaultNodeLabelFn=M(void 0),this._defaultEdgeLabelFn=M(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[w]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(n){return this._label=n,this}graph(){return this._label}setDefaultNodeLabel(n){return te(n)||(n=M(n)),this._defaultNodeLabelFn=n,this}nodeCount(){return this._nodeCount}nodes(){return T(this._nodes)}sources(){var n=this;return x(this.nodes(),function(r){return ie(n._in[r])})}sinks(){var n=this;return x(this.nodes(),function(r){return ie(n._out[r])})}setNodes(n,r){var t=arguments,i=this;return v(n,function(s){t.length>1?i.setNode(s,r):i.setNode(s)}),this}setNode(n,r){return E(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]=w,this._children[n]={},this._children[w][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)}node(n){return this._nodes[n]}hasNode(n){return E(this._nodes,n)}removeNode(n){var r=this;if(E(this._nodes,n)){var t=function(i){r.removeEdge(r._edgeObjs[i])};delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],v(this.children(n),function(i){r.setParent(i)}),delete this._children[n]),v(T(this._in[n]),t),delete this._in[n],delete this._preds[n],v(T(this._out[n]),t),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this}setParent(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(L(r))r=w;else{r+="";for(var t=r;!L(t);t=this.parent(t))if(t===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this}_removeFromParentsChildList(n){delete this._children[this._parent[n]][n]}parent(n){if(this._isCompound){var r=this._parent[n];if(r!==w)return r}}children(n){if(L(n)&&(n=w),this._isCompound){var r=this._children[n];if(r)return T(r)}else{if(n===w)return this.nodes();if(this.hasNode(n))return[]}}predecessors(n){var r=this._preds[n];if(r)return T(r)}successors(n){var r=this._sucs[n];if(r)return T(r)}neighbors(n){var r=this.predecessors(n);if(r)return Ht(r,this.successors(n))}isLeaf(n){var r;return this.isDirected()?r=this.successors(n):r=this.neighbors(n),r.length===0}filterNodes(n){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var t=this;v(this._nodes,function(a,u){n(u)&&r.setNode(u,a)}),v(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,t.edge(a))});var i={};function s(a){var u=t.parent(a);return u===void 0||r.hasNode(u)?(i[a]=u,u):u in i?i[u]:s(u)}return this._isCompound&&v(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(n){return te(n)||(n=M(n)),this._defaultEdgeLabelFn=n,this}edgeCount(){return this._edgeCount}edges(){return H(this._edgeObjs)}setPath(n,r){var t=this,i=arguments;return Gt(n,function(s,a){return i.length>1?t.setEdge(s,a,r):t.setEdge(s,a),a}),this}setEdge(){var n,r,t,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(n=a.v,r=a.w,t=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(n=a,r=arguments[1],t=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),n=""+n,r=""+r,L(t)||(t=""+t);var u=P(this._isDirected,n,r,t);if(E(this._edgeLabels,u))return s&&(this._edgeLabels[u]=i),this;if(!L(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(r),this._edgeLabels[u]=s?i:this._defaultEdgeLabelFn(n,r,t);var f=Zt(this._isDirected,n,r,t);return n=f.v,r=f.w,Object.freeze(f),this._edgeObjs[u]=f,ye(this._preds[r],n),ye(this._sucs[n],r),this._in[r][u]=f,this._out[n][u]=f,this._edgeCount++,this}edge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t);return this._edgeLabels[i]}hasEdge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t);return E(this._edgeLabels,i)}removeEdge(n,r,t){var i=arguments.length===1?Y(this._isDirected,arguments[0]):P(this._isDirected,n,r,t),s=this._edgeObjs[i];return s&&(n=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ae(this._preds[r],n),Ae(this._sucs[n],r),delete this._in[r][i],delete this._out[n][i],this._edgeCount--),this}inEdges(n,r){var t=this._in[n];if(t){var i=H(t);return r?x(i,function(s){return s.v===r}):i}}outEdges(n,r){var t=this._out[n];if(t){var i=H(t);return r?x(i,function(s){return s.w===r}):i}}nodeEdges(n,r){var t=this.inEdges(n,r);if(t)return t.concat(this.outEdges(n,r))}}Ye.prototype._nodeCount=0;Ye.prototype._edgeCount=0;function ye(e,n){e[n]?e[n]++:e[n]=1}function Ae(e,n){--e[n]||delete e[n]}function P(e,n,r,t){var i=""+n,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+be+s+be+(L(t)?Yt:t)}function Zt(e,n,r,t){var i=""+n,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var u={v:i,w:s};return t&&(u.name=t),u}function Y(e,n){return P(e,n.v,n.w,n.name)}export{Ye as G,J as a,B as b,Pn as c,He as d,gn as e,v as f,ee as g,E as h,L as i,Le as j,T as k,St as l,Ct as m,Ce as n,Ie as o,mt as p,vn as q,x as r,Gt as s,U as t,H as v};
@@ -1 +1 @@
1
- import{G as s,t as g,m as M,n as f,o as G,p as E}from"./index-DWUAFoZG.js";function S(){var e;return f.get().imageModelName||((e=G[0])==null?void 0:e.id)||"gemini-2.5-flash-image-vip"}function w(t,e){const a=E.zh;return a(t,e.rows,e.cols)}function v(t,e){const{theme:a,rows:n=s.gridConfig.rows,cols:I=s.gridConfig.cols,layoutStyle:m=s.layoutStyle,imageSize:y=s.imageSize,referenceImages:l,model:T}=t,h=T||S();if(!a||typeof a!="string")return{success:!1,error:"缺少必填参数 theme(主题描述)",type:"error"};const c=Math.min(Math.max(2,n),5),i=Math.min(Math.max(2,I),5),o={rows:c,cols:i},u=w(a,o),d=l==null?void 0:l.map((r,k)=>({type:"url",url:r,name:`reference-${k+1}`}));try{let r;if(e!=null&&e.retryTaskId){if(g.retryTask(e.retryTaskId),r=g.getTask(e.retryTaskId),!r)throw new Error(`重试任务不存在: ${e.retryTaskId}`)}else r=g.createTask({prompt:u,size:y,model:h,uploadedImages:d&&d.length>0?d:void 0,gridImageRows:c,gridImageCols:i,gridImageLayoutStyle:m,originalTheme:a,batchId:e==null?void 0:e.batchId,globalIndex:(e==null?void 0:e.globalIndex)||1,autoInsertToCanvas:!0},M.IMAGE);return{success:!0,data:{taskId:r.id,theme:a,gridConfig:o,layoutStyle:m,prompt:u.substring(0,100)+"..."},type:"image",taskId:r.id,task:r}}catch(r){return console.error("[GridImage] Failed to create task:",r),{success:!1,error:r.message||"创建宫格图任务失败",type:"error"}}}export{v as createGridImageTask};
1
+ import{G as s,t as g,m as M,n as f,o as G,p as E}from"./index-BBCAc4Al.js";function S(){var e;return f.get().imageModelName||((e=G[0])==null?void 0:e.id)||"gemini-2.5-flash-image-vip"}function w(t,e){const a=E.zh;return a(t,e.rows,e.cols)}function v(t,e){const{theme:a,rows:n=s.gridConfig.rows,cols:I=s.gridConfig.cols,layoutStyle:m=s.layoutStyle,imageSize:y=s.imageSize,referenceImages:l,model:T}=t,h=T||S();if(!a||typeof a!="string")return{success:!1,error:"缺少必填参数 theme(主题描述)",type:"error"};const c=Math.min(Math.max(2,n),5),i=Math.min(Math.max(2,I),5),o={rows:c,cols:i},u=w(a,o),d=l==null?void 0:l.map((r,k)=>({type:"url",url:r,name:`reference-${k+1}`}));try{let r;if(e!=null&&e.retryTaskId){if(g.retryTask(e.retryTaskId),r=g.getTask(e.retryTaskId),!r)throw new Error(`重试任务不存在: ${e.retryTaskId}`)}else r=g.createTask({prompt:u,size:y,model:h,uploadedImages:d&&d.length>0?d:void 0,gridImageRows:c,gridImageCols:i,gridImageLayoutStyle:m,originalTheme:a,batchId:e==null?void 0:e.batchId,globalIndex:(e==null?void 0:e.globalIndex)||1,autoInsertToCanvas:!0},M.IMAGE);return{success:!0,data:{taskId:r.id,theme:a,gridConfig:o,layoutStyle:m,prompt:u.substring(0,100)+"..."},type:"image",taskId:r.id,task:r}}catch(r){return console.error("[GridImage] Failed to create task:",r),{success:!1,error:r.message||"创建宫格图任务失败",type:"error"}}}export{v as createGridImageTask};
@@ -1 +1 @@
1
- import{h as t}from"./hasIn-4iY02rGN.js";var n=Object.prototype,o=n.hasOwnProperty;function s(r,a){return r!=null&&o.call(r,a)}function h(r,a){return r!=null&&t(r,a,s)}export{h};
1
+ import{h as t}from"./hasIn-DZErb2GY.js";var n=Object.prototype,o=n.hasOwnProperty;function s(r,a){return r!=null&&o.call(r,a)}function h(r,a){return r!=null&&t(r,a,s)}export{h};
@@ -1 +1 @@
1
- import{ak as e,al as t,am as f,an as g,ao as d,d as h,g as m}from"./index-DWUAFoZG.js";function A(n,a,u){var s=n==null?void 0:e(n,a);return s===void 0?u:s}function v(n,a){return n!=null&&a in Object(n)}function x(n,a,u){a=t(a,n);for(var s=-1,r=a.length,l=!1;++s<r;){var i=f(a[s]);if(!(l=n!=null&&u(n,i)))break;n=n[i]}return l||++s!=r?l:(r=n==null?0:n.length,!!r&&g(r)&&d(i,r)&&(h(n)||m(n)))}function P(n,a){return n!=null&&x(n,a,v)}export{P as a,A as g,x as h};
1
+ import{ak as e,al as t,am as f,an as g,ao as d,d as h,g as m}from"./index-BBCAc4Al.js";function A(n,a,u){var s=n==null?void 0:e(n,a);return s===void 0?u:s}function v(n,a){return n!=null&&a in Object(n)}function x(n,a,u){a=t(a,n);for(var s=-1,r=a.length,l=!1;++s<r;){var i=f(a[s]);if(!(l=n!=null&&u(n,i)))break;n=n[i]}return l||++s!=r?l:(r=n==null?0:n.length,!!r&&g(r)&&d(i,r)&&(h(n)||m(n)))}function P(n,a){return n!=null&&x(n,a,v)}export{P as a,A as g,x as h};
@@ -1 +1 @@
1
- import{i as N,G as A}from"./graph-D-2Ldvxg.js";import{m as $,l as H}from"./layout-DHHYqX7p.js";import{c as V}from"./clone-oX7o-l4R.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as p,f as J,h as Y,j as Z}from"./edges-e0da2a9e-C-RyePMV.js";import{l as s,g as T,v as S,d as L}from"./mermaid.core-DfVvnpgz.js";import{c as I}from"./createText-2e5e7dd3-idrqgJjU.js";function m(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},B=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||B(e.v,t)||B(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=B(a.v,n),u=B(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",m(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,m(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",m(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",m(u)),s.debug("Old graph after copy",m(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,x=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-x/2).attr("y",t.y-t.height/2-w).attr("width",x).attr("height",t.height+h);const{subGraphTitleTopMargin:b}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+b})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+b})`);const y=i.node().getBBox();return t.width=y.width,t.height=y.height,t.intersect=function(c){return p(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return p(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,x=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w).attr("width",x+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",x+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:b}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+b})`);const y=i.node().getBBox();return t.height=y.height,t.intersect=function(c){return p(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return p(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",m(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),x=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",v,i),t.setNode(i.id,v),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,v))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const v=await M(x,o.graph,n,r,t.node(c),a),E=v.elem;W(o,E),o.diff=v.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(x,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",m(t));let b=0;const{subGraphTitleTotalMargin:y}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=y,O(o)):t.children(c).length>0?(o.height+=y,dt(f,o),l[o.id].node=o):(o.y+=y/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=y/2);const v=K(h,c,o,l,n,t,r);Q(o,v)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(b=o.diff)}),{elem:u,diff:b}},vt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(m(t))),st(t),s.warn("Graph after:",JSON.stringify(m(t)));const a=T();await M(e,t,r,i,void 0,a)};export{vt as r};
1
+ import{i as N,G as A}from"./graph-DvHs9g2k.js";import{m as $,l as H}from"./layout-CawIP_cF.js";import{c as V}from"./clone-BoLnjeh7.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as p,f as J,h as Y,j as Z}from"./edges-e0da2a9e-Br_hn5Hn.js";import{l as s,g as T,v as S,d as L}from"./mermaid.core--Np12uGY.js";import{c as I}from"./createText-2e5e7dd3-Q_TpnKHS.js";function m(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},B=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||B(e.v,t)||B(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=B(a.v,n),u=B(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",m(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,m(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",m(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",m(u)),s.debug("Old graph after copy",m(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,x=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-x/2).attr("y",t.y-t.height/2-w).attr("width",x).attr("height",t.height+h);const{subGraphTitleTopMargin:b}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+b})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+b})`);const y=i.node().getBBox();return t.width=y.width,t.height=y.height,t.intersect=function(c){return p(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return p(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,x=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w).attr("width",x+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",x+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:b}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+b})`);const y=i.node().getBBox();return t.height=y.height,t.intersect=function(c){return p(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return p(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",m(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),x=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",v,i),t.setNode(i.id,v),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,v))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const v=await M(x,o.graph,n,r,t.node(c),a),E=v.elem;W(o,E),o.diff=v.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(x,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",m(t));let b=0;const{subGraphTitleTotalMargin:y}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=y,O(o)):t.children(c).length>0?(o.height+=y,dt(f,o),l[o.id].node=o):(o.y+=y/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=y/2);const v=K(h,c,o,l,n,t,r);Q(o,v)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(b=o.diff)}),{elem:u,diff:b}},vt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(m(t))),st(t),s.warn("Graph after:",JSON.stringify(m(t)));const a=T();await M(e,t,r,i,void 0,a)};export{vt as r};
@@ -1 +1 @@
1
- import{G as A}from"./graph-BxwlF7JS.js";import{m as $,l as H}from"./layout-BD3yCK_X.js";import{a4 as N}from"./index-DWUAFoZG.js";import{c as V}from"./clone-B69pF7Y_.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as p,f as J,h as Y,j as Z}from"./edges-e0da2a9e-DJXAjJSL.js";import{l as s,g as T,v as S,d as L}from"./index-BwSGXyRr.js";import{c as I}from"./createText-2e5e7dd3-CZ9_fscE.js";function m(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},B=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||B(e.v,t)||B(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=B(a.v,n),u=B(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",m(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,m(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",m(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",m(u)),s.debug("Old graph after copy",m(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,x=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-x/2).attr("y",t.y-t.height/2-w).attr("width",x).attr("height",t.height+h);const{subGraphTitleTopMargin:b}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+b})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+b})`);const y=i.node().getBBox();return t.width=y.width,t.height=y.height,t.intersect=function(c){return p(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return p(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,x=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w).attr("width",x+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",x+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:b}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+b})`);const y=i.node().getBBox();return t.height=y.height,t.intersect=function(c){return p(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return p(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",m(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),x=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",v,i),t.setNode(i.id,v),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,v))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const v=await M(x,o.graph,n,r,t.node(c),a),E=v.elem;W(o,E),o.diff=v.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(x,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",m(t));let b=0;const{subGraphTitleTotalMargin:y}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=y,O(o)):t.children(c).length>0?(o.height+=y,dt(f,o),l[o.id].node=o):(o.y+=y/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=y/2);const v=K(h,c,o,l,n,t,r);Q(o,v)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(b=o.diff)}),{elem:u,diff:b}},bt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(m(t))),st(t),s.warn("Graph after:",JSON.stringify(m(t)));const a=T();await M(e,t,r,i,void 0,a)};export{bt as r};
1
+ import{G as A}from"./graph-CUK2kA3Q.js";import{m as $,l as H}from"./layout-25V5jGUW.js";import{a4 as N}from"./index-BBCAc4Al.js";import{c as V}from"./clone-DufRhyQM.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as p,f as J,h as Y,j as Z}from"./edges-e0da2a9e-DMfYzMhl.js";import{l as s,g as T,v as S,d as L}from"./index-CMnHM-d8.js";import{c as I}from"./createText-2e5e7dd3-DWMoiN14.js";function m(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},B=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||B(e.v,t)||B(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=B(a.v,n),u=B(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",m(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,m(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",m(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",m(u)),s.debug("Old graph after copy",m(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,x=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-x/2).attr("y",t.y-t.height/2-w).attr("width",x).attr("height",t.height+h);const{subGraphTitleTopMargin:b}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+b})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+b})`);const y=i.node().getBBox();return t.width=y.width,t.height=y.height,t.intersect=function(c){return p(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return p(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,x=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w).attr("width",x+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-x/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",x+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:b}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+b})`);const y=i.node().getBBox();return t.height=y.height,t.intersect=function(c){return p(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return p(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",m(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),x=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",v,i),t.setNode(i.id,v),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,v))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const v=await M(x,o.graph,n,r,t.node(c),a),E=v.elem;W(o,E),o.diff=v.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(x,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",m(t));let b=0;const{subGraphTitleTotalMargin:y}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=y,O(o)):t.children(c).length>0?(o.height+=y,dt(f,o),l[o.id].node=o):(o.y+=y/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=y/2);const v=K(h,c,o,l,n,t,r);Q(o,v)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(b=o.diff)}),{elem:u,diff:b}},bt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(m(t))),st(t),s.warn("Graph after:",JSON.stringify(m(t)));const a=T();await M(e,t,r,i,void 0,a)};export{bt as r};
@@ -1,4 +1,4 @@
1
- import{r as c,aF as q,a_ as qn,az as ke,aD as k,aA as Ee,aB as K,a$ as Ge,at as Ae,b0 as In,b1 as pn,ax as Sn,aH as Et,b2 as Tt,b3 as jt,aT as Xn,ap as mn,b4 as Jn,aR as Qn,aL as Dt,aE as kt,aG as Vt,b5 as Rn,b6 as An,as as Zn,b7 as et,ay as wn,b8 as xt,b9 as Kn,ba as Rt,bb as At,bc as Mn,bd as Kt}from"./index-DWUAFoZG.js";import{p as Mt}from"./pick-Cvlwra4g.js";import{g as pe}from"./hasIn-4iY02rGN.js";/**
1
+ import{r as c,aF as q,a_ as qn,az as ke,aD as k,aA as Ee,aB as K,a$ as Ge,at as Ae,b0 as In,b1 as pn,ax as Sn,aH as Et,b2 as Tt,b3 as jt,aT as Xn,ap as mn,b4 as Jn,aR as Qn,aL as Dt,aE as kt,aG as Vt,b5 as Rn,b6 as An,as as Zn,b7 as et,ay as wn,b8 as xt,b9 as Kn,ba as Rt,bb as At,bc as Mn,bd as Kt}from"./index-BBCAc4Al.js";import{p as Mt}from"./pick-B51S9oWq.js";import{g as pe}from"./hasIn-DZErb2GY.js";/**
2
2
  * tdesign v1.16.3
3
3
  * (c) 2026 tdesign
4
4
  * @license MIT