@zettelgeist/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +64 -0
  3. package/dist/bin.js +2211 -0
  4. package/dist/bin.js.map +7 -0
  5. package/dist/templates/export.html +27 -0
  6. package/dist/templates/skill/SKILL.md +220 -0
  7. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js +14 -0
  8. package/dist/viewer-bundle/architecture-YZFGNWBL-W2K3EQOM.js.map +7 -0
  9. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js +8884 -0
  10. package/dist/viewer-bundle/architectureDiagram-Q4EWVU46-LCGRUEWT.js.map +7 -0
  11. package/dist/viewer-bundle/base.css +248 -0
  12. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js +3777 -0
  13. package/dist/viewer-bundle/blockDiagram-DXYQGD6D-KAM7BOAP.js.map +7 -0
  14. package/dist/viewer-bundle/board.css +370 -0
  15. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js +2596 -0
  16. package/dist/viewer-bundle/c4Diagram-AHTNJAMY-C3FIQYXA.js.map +7 -0
  17. package/dist/viewer-bundle/chunk-2QXGXAO5.js +68 -0
  18. package/dist/viewer-bundle/chunk-2QXGXAO5.js.map +7 -0
  19. package/dist/viewer-bundle/chunk-5PZT7VUU.js +67 -0
  20. package/dist/viewer-bundle/chunk-5PZT7VUU.js.map +7 -0
  21. package/dist/viewer-bundle/chunk-5YJCJF2C.js +112 -0
  22. package/dist/viewer-bundle/chunk-5YJCJF2C.js.map +7 -0
  23. package/dist/viewer-bundle/chunk-6LYV7PBV.js +1011 -0
  24. package/dist/viewer-bundle/chunk-6LYV7PBV.js.map +7 -0
  25. package/dist/viewer-bundle/chunk-6VW7D5WX.js +48 -0
  26. package/dist/viewer-bundle/chunk-6VW7D5WX.js.map +7 -0
  27. package/dist/viewer-bundle/chunk-76C5OSD4.js +2048 -0
  28. package/dist/viewer-bundle/chunk-76C5OSD4.js.map +7 -0
  29. package/dist/viewer-bundle/chunk-7NZMPQDX.js +6957 -0
  30. package/dist/viewer-bundle/chunk-7NZMPQDX.js.map +7 -0
  31. package/dist/viewer-bundle/chunk-A634GTZN.js +122 -0
  32. package/dist/viewer-bundle/chunk-A634GTZN.js.map +7 -0
  33. package/dist/viewer-bundle/chunk-AJQJUKMU.js +133 -0
  34. package/dist/viewer-bundle/chunk-AJQJUKMU.js.map +7 -0
  35. package/dist/viewer-bundle/chunk-BM2KPNFW.js +5556 -0
  36. package/dist/viewer-bundle/chunk-BM2KPNFW.js.map +7 -0
  37. package/dist/viewer-bundle/chunk-CIDUOCCG.js +25 -0
  38. package/dist/viewer-bundle/chunk-CIDUOCCG.js.map +7 -0
  39. package/dist/viewer-bundle/chunk-CZHJHAOR.js +6397 -0
  40. package/dist/viewer-bundle/chunk-CZHJHAOR.js.map +7 -0
  41. package/dist/viewer-bundle/chunk-D5RLIWY4.js +125 -0
  42. package/dist/viewer-bundle/chunk-D5RLIWY4.js.map +7 -0
  43. package/dist/viewer-bundle/chunk-DI52DQAC.js +44 -0
  44. package/dist/viewer-bundle/chunk-DI52DQAC.js.map +7 -0
  45. package/dist/viewer-bundle/chunk-EXJQLTIV.js +51 -0
  46. package/dist/viewer-bundle/chunk-EXJQLTIV.js.map +7 -0
  47. package/dist/viewer-bundle/chunk-G3PPZWPW.js +96 -0
  48. package/dist/viewer-bundle/chunk-G3PPZWPW.js.map +7 -0
  49. package/dist/viewer-bundle/chunk-GTW4IDD4.js +30297 -0
  50. package/dist/viewer-bundle/chunk-GTW4IDD4.js.map +7 -0
  51. package/dist/viewer-bundle/chunk-GVE7OA3Z.js +59 -0
  52. package/dist/viewer-bundle/chunk-GVE7OA3Z.js.map +7 -0
  53. package/dist/viewer-bundle/chunk-JBUVKVPY.js +2042 -0
  54. package/dist/viewer-bundle/chunk-JBUVKVPY.js.map +7 -0
  55. package/dist/viewer-bundle/chunk-JQLVOAQB.js +20 -0
  56. package/dist/viewer-bundle/chunk-JQLVOAQB.js.map +7 -0
  57. package/dist/viewer-bundle/chunk-LQMQSYLO.js +101 -0
  58. package/dist/viewer-bundle/chunk-LQMQSYLO.js.map +7 -0
  59. package/dist/viewer-bundle/chunk-MBFAQ3IK.js +34 -0
  60. package/dist/viewer-bundle/chunk-MBFAQ3IK.js.map +7 -0
  61. package/dist/viewer-bundle/chunk-N7G7IIKG.js +25 -0
  62. package/dist/viewer-bundle/chunk-N7G7IIKG.js.map +7 -0
  63. package/dist/viewer-bundle/chunk-NW4YG3NS.js +171 -0
  64. package/dist/viewer-bundle/chunk-NW4YG3NS.js.map +7 -0
  65. package/dist/viewer-bundle/chunk-ODEP5TKB.js +61 -0
  66. package/dist/viewer-bundle/chunk-ODEP5TKB.js.map +7 -0
  67. package/dist/viewer-bundle/chunk-OGKINV23.js +1050 -0
  68. package/dist/viewer-bundle/chunk-OGKINV23.js.map +7 -0
  69. package/dist/viewer-bundle/chunk-OGMSNDVH.js +1994 -0
  70. package/dist/viewer-bundle/chunk-OGMSNDVH.js.map +7 -0
  71. package/dist/viewer-bundle/chunk-QJVSDNAW.js +25 -0
  72. package/dist/viewer-bundle/chunk-QJVSDNAW.js.map +7 -0
  73. package/dist/viewer-bundle/chunk-RBTT26R4.js +2721 -0
  74. package/dist/viewer-bundle/chunk-RBTT26R4.js.map +7 -0
  75. package/dist/viewer-bundle/chunk-RQIPIIE2.js +48 -0
  76. package/dist/viewer-bundle/chunk-RQIPIIE2.js.map +7 -0
  77. package/dist/viewer-bundle/chunk-SRTYTXTX.js +22 -0
  78. package/dist/viewer-bundle/chunk-SRTYTXTX.js.map +7 -0
  79. package/dist/viewer-bundle/chunk-TRL7YIZG.js +1663 -0
  80. package/dist/viewer-bundle/chunk-TRL7YIZG.js.map +7 -0
  81. package/dist/viewer-bundle/chunk-U5T7X4BV.js +172 -0
  82. package/dist/viewer-bundle/chunk-U5T7X4BV.js.map +7 -0
  83. package/dist/viewer-bundle/chunk-UCAW6C6C.js +48 -0
  84. package/dist/viewer-bundle/chunk-UCAW6C6C.js.map +7 -0
  85. package/dist/viewer-bundle/chunk-UEAG4BJQ.js +93 -0
  86. package/dist/viewer-bundle/chunk-UEAG4BJQ.js.map +7 -0
  87. package/dist/viewer-bundle/chunk-UVRE3R6A.js +1039 -0
  88. package/dist/viewer-bundle/chunk-UVRE3R6A.js.map +7 -0
  89. package/dist/viewer-bundle/chunk-VODO7SV4.js +25029 -0
  90. package/dist/viewer-bundle/chunk-VODO7SV4.js.map +7 -0
  91. package/dist/viewer-bundle/chunk-YEU62MVS.js +682 -0
  92. package/dist/viewer-bundle/chunk-YEU62MVS.js.map +7 -0
  93. package/dist/viewer-bundle/chunk-YFQT7PPW.js +987 -0
  94. package/dist/viewer-bundle/chunk-YFQT7PPW.js.map +7 -0
  95. package/dist/viewer-bundle/chunk-Z4G7FG27.js +48 -0
  96. package/dist/viewer-bundle/chunk-Z4G7FG27.js.map +7 -0
  97. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js +2044 -0
  98. package/dist/viewer-bundle/chunk-ZW4Y7DIF.js.map +7 -0
  99. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js +46 -0
  100. package/dist/viewer-bundle/classDiagram-6PBFFD2Q-7VKYXLUX.js.map +7 -0
  101. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js +46 -0
  102. package/dist/viewer-bundle/classDiagram-v2-HSJHXN6E-ACCNN7EN.js.map +7 -0
  103. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js +5009 -0
  104. package/dist/viewer-bundle/cose-bilkent-S5V4N54A-MUJHAA34.js.map +7 -0
  105. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js +739 -0
  106. package/dist/viewer-bundle/dagre-KV5264BT-YC5VV3WF.js.map +7 -0
  107. package/dist/viewer-bundle/dark.css +13 -0
  108. package/dist/viewer-bundle/detail.css +539 -0
  109. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js +214 -0
  110. package/dist/viewer-bundle/diagram-5BDNPKRD-RXFPVFYK.js.map +7 -0
  111. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js +578 -0
  112. package/dist/viewer-bundle/diagram-G4DWMVQ6-KN7CBNBQ.js.map +7 -0
  113. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js +345 -0
  114. package/dist/viewer-bundle/diagram-MMDJMWI5-ZN6TQ7ZC.js.map +7 -0
  115. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js +255 -0
  116. package/dist/viewer-bundle/diagram-TYMM5635-MMTUJ4KA.js.map +7 -0
  117. package/dist/viewer-bundle/docs.css +88 -0
  118. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js +176 -0
  119. package/dist/viewer-bundle/edit-modal-BEGC2AO6.js.map +7 -0
  120. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js +1349 -0
  121. package/dist/viewer-bundle/erDiagram-SMLLAGMA-TBHMLD2E.js.map +7 -0
  122. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js +2501 -0
  123. package/dist/viewer-bundle/flowDiagram-DWJPFMVM-BZHLK6QB.js.map +7 -0
  124. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js +2654 -0
  125. package/dist/viewer-bundle/ganttDiagram-T4ZO3ILL-YBARPTQR.js.map +7 -0
  126. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js +14 -0
  127. package/dist/viewer-bundle/gitGraph-7Q5UKJZL-HENKIQDX.js.map +7 -0
  128. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js +1946 -0
  129. package/dist/viewer-bundle/gitGraphDiagram-UUTBAWPF-M4VV3YVA.js.map +7 -0
  130. package/dist/viewer-bundle/index.html +28 -0
  131. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js +14 -0
  132. package/dist/viewer-bundle/info-OMHHGYJF-E773USRS.js.map +7 -0
  133. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js +59 -0
  134. package/dist/viewer-bundle/infoDiagram-42DDH7IO-C7JGUXKK.js.map +7 -0
  135. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js +1012 -0
  136. package/dist/viewer-bundle/ishikawaDiagram-UXIWVN3A-YBC4X4VB.js.map +7 -0
  137. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js +1303 -0
  138. package/dist/viewer-bundle/journeyDiagram-VCZTEJTY-6WKVEOOO.js.map +7 -0
  139. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js +1131 -0
  140. package/dist/viewer-bundle/kanban-definition-6JOO6SKY-URTTHHO4.js.map +7 -0
  141. package/dist/viewer-bundle/katex-QN5266ZE.js +14318 -0
  142. package/dist/viewer-bundle/katex-QN5266ZE.js.map +7 -0
  143. package/dist/viewer-bundle/light.css +15 -0
  144. package/dist/viewer-bundle/main.js +4816 -0
  145. package/dist/viewer-bundle/main.js.map +7 -0
  146. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js +1708 -0
  147. package/dist/viewer-bundle/mermaid.core-AEBXU2JK.js.map +7 -0
  148. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js +1277 -0
  149. package/dist/viewer-bundle/mindmap-definition-QFDTVHPH-KUMAMRSF.js.map +7 -0
  150. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js +14 -0
  151. package/dist/viewer-bundle/packet-4T2RLAQJ-IRYWWA66.js.map +7 -0
  152. package/dist/viewer-bundle/pico.classless.min.css +4 -0
  153. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js +14 -0
  154. package/dist/viewer-bundle/pie-ZZUOXDRM-JYO4VL5N.js.map +7 -0
  155. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js +238 -0
  156. package/dist/viewer-bundle/pieDiagram-DEJITSTG-QOEHQN3N.js.map +7 -0
  157. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js +12 -0
  158. package/dist/viewer-bundle/prompt-modal-C4LHI7BS.js.map +7 -0
  159. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js +1409 -0
  160. package/dist/viewer-bundle/quadrantDiagram-34T5L4WZ-SJNPUU5N.js.map +7 -0
  161. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js +14 -0
  162. package/dist/viewer-bundle/radar-PYXPWWZC-45BRYQSB.js.map +7 -0
  163. package/dist/viewer-bundle/reason-modal-MK34MQ73.js +68 -0
  164. package/dist/viewer-bundle/reason-modal-MK34MQ73.js.map +7 -0
  165. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js +1311 -0
  166. package/dist/viewer-bundle/requirementDiagram-MS252O5E-UOMT3FCC.js.map +7 -0
  167. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js +1263 -0
  168. package/dist/viewer-bundle/sankeyDiagram-XADWPNL6-LAVJ5C6A.js.map +7 -0
  169. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js +4655 -0
  170. package/dist/viewer-bundle/sequenceDiagram-FGHM5R23-3IWTOUNQ.js.map +7 -0
  171. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js +495 -0
  172. package/dist/viewer-bundle/stateDiagram-FHFEXIEX-S2OVQQON.js.map +7 -0
  173. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js +44 -0
  174. package/dist/viewer-bundle/stateDiagram-v2-QKLJ7IA2-XNZ3XXSV.js.map +7 -0
  175. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js +1646 -0
  176. package/dist/viewer-bundle/timeline-definition-GMOUNBTQ-FHVZ7MHE.js.map +7 -0
  177. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js +14 -0
  178. package/dist/viewer-bundle/treeView-SZITEDCU-RXZXNYAM.js.map +7 -0
  179. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js +14 -0
  180. package/dist/viewer-bundle/treemap-W4RFUUIX-2IGOFSJM.js.map +7 -0
  181. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js +2544 -0
  182. package/dist/viewer-bundle/vennDiagram-DHZGUBPP-HEAOEXEZ.js.map +7 -0
  183. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js +14 -0
  184. package/dist/viewer-bundle/wardley-RL74JXVD-VSPCLOX2.js.map +7 -0
  185. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js +938 -0
  186. package/dist/viewer-bundle/wardleyDiagram-NUSXRM2D-EBY4FG3X.js.map +7 -0
  187. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js +1952 -0
  188. package/dist/viewer-bundle/xychartDiagram-5P7HB3ND-SSMUQEXK.js.map +7 -0
  189. package/package.json +51 -0
@@ -0,0 +1,1039 @@
1
+ import {
2
+ require_dist
3
+ } from "./chunk-G3PPZWPW.js";
4
+ import {
5
+ assignWithDepth_default,
6
+ common_default,
7
+ detectType,
8
+ directiveRegex,
9
+ sanitizeDirective
10
+ } from "./chunk-7NZMPQDX.js";
11
+ import {
12
+ Stack_default,
13
+ Uint8Array_default,
14
+ arrayLikeKeys_default,
15
+ baseFor_default,
16
+ baseGetTag_default,
17
+ eq_default,
18
+ getNative_default,
19
+ identity_default,
20
+ isArguments_default,
21
+ isArrayLike_default,
22
+ isArray_default,
23
+ isBuffer_default,
24
+ isFunction_default,
25
+ isIndex_default,
26
+ isObjectLike_default,
27
+ isObject_default,
28
+ isPrototype_default,
29
+ isTypedArray_default,
30
+ memoize_default,
31
+ overArg_default,
32
+ root_default
33
+ } from "./chunk-YEU62MVS.js";
34
+ import {
35
+ __name,
36
+ basisClosed_default,
37
+ basisOpen_default,
38
+ basis_default,
39
+ bumpX,
40
+ bumpY,
41
+ bundle_default,
42
+ cardinalClosed_default,
43
+ cardinalOpen_default,
44
+ cardinal_default,
45
+ catmullRomClosed_default,
46
+ catmullRomOpen_default,
47
+ catmullRom_default,
48
+ linearClosed_default,
49
+ linear_default,
50
+ log,
51
+ monotoneX,
52
+ monotoneY,
53
+ natural_default,
54
+ select_default,
55
+ stepAfter,
56
+ stepBefore,
57
+ step_default
58
+ } from "./chunk-CZHJHAOR.js";
59
+ import {
60
+ __toESM
61
+ } from "./chunk-DI52DQAC.js";
62
+
63
+ // ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5PVQY5BW.mjs
64
+ var import_sanitize_url = __toESM(require_dist(), 1);
65
+
66
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js
67
+ var defineProperty = function() {
68
+ try {
69
+ var func = getNative_default(Object, "defineProperty");
70
+ func({}, "", {});
71
+ return func;
72
+ } catch (e) {
73
+ }
74
+ }();
75
+ var defineProperty_default = defineProperty;
76
+
77
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js
78
+ function baseAssignValue(object, key, value) {
79
+ if (key == "__proto__" && defineProperty_default) {
80
+ defineProperty_default(object, key, {
81
+ "configurable": true,
82
+ "enumerable": true,
83
+ "value": value,
84
+ "writable": true
85
+ });
86
+ } else {
87
+ object[key] = value;
88
+ }
89
+ }
90
+ var baseAssignValue_default = baseAssignValue;
91
+
92
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js
93
+ function assignMergeValue(object, key, value) {
94
+ if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
95
+ baseAssignValue_default(object, key, value);
96
+ }
97
+ }
98
+ var assignMergeValue_default = assignMergeValue;
99
+
100
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js
101
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
102
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
103
+ var moduleExports = freeModule && freeModule.exports === freeExports;
104
+ var Buffer = moduleExports ? root_default.Buffer : void 0;
105
+ var allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
106
+ function cloneBuffer(buffer, isDeep) {
107
+ if (isDeep) {
108
+ return buffer.slice();
109
+ }
110
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
111
+ buffer.copy(result);
112
+ return result;
113
+ }
114
+ var cloneBuffer_default = cloneBuffer;
115
+
116
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js
117
+ function cloneArrayBuffer(arrayBuffer) {
118
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
119
+ new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
120
+ return result;
121
+ }
122
+ var cloneArrayBuffer_default = cloneArrayBuffer;
123
+
124
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js
125
+ function cloneTypedArray(typedArray, isDeep) {
126
+ var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
127
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
128
+ }
129
+ var cloneTypedArray_default = cloneTypedArray;
130
+
131
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js
132
+ function copyArray(source, array) {
133
+ var index = -1, length = source.length;
134
+ array || (array = Array(length));
135
+ while (++index < length) {
136
+ array[index] = source[index];
137
+ }
138
+ return array;
139
+ }
140
+ var copyArray_default = copyArray;
141
+
142
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js
143
+ var objectCreate = Object.create;
144
+ var baseCreate = /* @__PURE__ */ function() {
145
+ function object() {
146
+ }
147
+ return function(proto) {
148
+ if (!isObject_default(proto)) {
149
+ return {};
150
+ }
151
+ if (objectCreate) {
152
+ return objectCreate(proto);
153
+ }
154
+ object.prototype = proto;
155
+ var result = new object();
156
+ object.prototype = void 0;
157
+ return result;
158
+ };
159
+ }();
160
+ var baseCreate_default = baseCreate;
161
+
162
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js
163
+ var getPrototype = overArg_default(Object.getPrototypeOf, Object);
164
+ var getPrototype_default = getPrototype;
165
+
166
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js
167
+ function initCloneObject(object) {
168
+ return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
169
+ }
170
+ var initCloneObject_default = initCloneObject;
171
+
172
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js
173
+ function isArrayLikeObject(value) {
174
+ return isObjectLike_default(value) && isArrayLike_default(value);
175
+ }
176
+ var isArrayLikeObject_default = isArrayLikeObject;
177
+
178
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js
179
+ var objectTag = "[object Object]";
180
+ var funcProto = Function.prototype;
181
+ var objectProto = Object.prototype;
182
+ var funcToString = funcProto.toString;
183
+ var hasOwnProperty = objectProto.hasOwnProperty;
184
+ var objectCtorString = funcToString.call(Object);
185
+ function isPlainObject(value) {
186
+ if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag) {
187
+ return false;
188
+ }
189
+ var proto = getPrototype_default(value);
190
+ if (proto === null) {
191
+ return true;
192
+ }
193
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
194
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
195
+ }
196
+ var isPlainObject_default = isPlainObject;
197
+
198
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js
199
+ function safeGet(object, key) {
200
+ if (key === "constructor" && typeof object[key] === "function") {
201
+ return;
202
+ }
203
+ if (key == "__proto__") {
204
+ return;
205
+ }
206
+ return object[key];
207
+ }
208
+ var safeGet_default = safeGet;
209
+
210
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js
211
+ var objectProto2 = Object.prototype;
212
+ var hasOwnProperty2 = objectProto2.hasOwnProperty;
213
+ function assignValue(object, key, value) {
214
+ var objValue = object[key];
215
+ if (!(hasOwnProperty2.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
216
+ baseAssignValue_default(object, key, value);
217
+ }
218
+ }
219
+ var assignValue_default = assignValue;
220
+
221
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js
222
+ function copyObject(source, props, object, customizer) {
223
+ var isNew = !object;
224
+ object || (object = {});
225
+ var index = -1, length = props.length;
226
+ while (++index < length) {
227
+ var key = props[index];
228
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
229
+ if (newValue === void 0) {
230
+ newValue = source[key];
231
+ }
232
+ if (isNew) {
233
+ baseAssignValue_default(object, key, newValue);
234
+ } else {
235
+ assignValue_default(object, key, newValue);
236
+ }
237
+ }
238
+ return object;
239
+ }
240
+ var copyObject_default = copyObject;
241
+
242
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js
243
+ function nativeKeysIn(object) {
244
+ var result = [];
245
+ if (object != null) {
246
+ for (var key in Object(object)) {
247
+ result.push(key);
248
+ }
249
+ }
250
+ return result;
251
+ }
252
+ var nativeKeysIn_default = nativeKeysIn;
253
+
254
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js
255
+ var objectProto3 = Object.prototype;
256
+ var hasOwnProperty3 = objectProto3.hasOwnProperty;
257
+ function baseKeysIn(object) {
258
+ if (!isObject_default(object)) {
259
+ return nativeKeysIn_default(object);
260
+ }
261
+ var isProto = isPrototype_default(object), result = [];
262
+ for (var key in object) {
263
+ if (!(key == "constructor" && (isProto || !hasOwnProperty3.call(object, key)))) {
264
+ result.push(key);
265
+ }
266
+ }
267
+ return result;
268
+ }
269
+ var baseKeysIn_default = baseKeysIn;
270
+
271
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js
272
+ function keysIn(object) {
273
+ return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
274
+ }
275
+ var keysIn_default = keysIn;
276
+
277
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js
278
+ function toPlainObject(value) {
279
+ return copyObject_default(value, keysIn_default(value));
280
+ }
281
+ var toPlainObject_default = toPlainObject;
282
+
283
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js
284
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
285
+ var objValue = safeGet_default(object, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue);
286
+ if (stacked) {
287
+ assignMergeValue_default(object, key, stacked);
288
+ return;
289
+ }
290
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
291
+ var isCommon = newValue === void 0;
292
+ if (isCommon) {
293
+ var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
294
+ newValue = srcValue;
295
+ if (isArr || isBuff || isTyped) {
296
+ if (isArray_default(objValue)) {
297
+ newValue = objValue;
298
+ } else if (isArrayLikeObject_default(objValue)) {
299
+ newValue = copyArray_default(objValue);
300
+ } else if (isBuff) {
301
+ isCommon = false;
302
+ newValue = cloneBuffer_default(srcValue, true);
303
+ } else if (isTyped) {
304
+ isCommon = false;
305
+ newValue = cloneTypedArray_default(srcValue, true);
306
+ } else {
307
+ newValue = [];
308
+ }
309
+ } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
310
+ newValue = objValue;
311
+ if (isArguments_default(objValue)) {
312
+ newValue = toPlainObject_default(objValue);
313
+ } else if (!isObject_default(objValue) || isFunction_default(objValue)) {
314
+ newValue = initCloneObject_default(srcValue);
315
+ }
316
+ } else {
317
+ isCommon = false;
318
+ }
319
+ }
320
+ if (isCommon) {
321
+ stack.set(srcValue, newValue);
322
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
323
+ stack["delete"](srcValue);
324
+ }
325
+ assignMergeValue_default(object, key, newValue);
326
+ }
327
+ var baseMergeDeep_default = baseMergeDeep;
328
+
329
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js
330
+ function baseMerge(object, source, srcIndex, customizer, stack) {
331
+ if (object === source) {
332
+ return;
333
+ }
334
+ baseFor_default(source, function(srcValue, key) {
335
+ stack || (stack = new Stack_default());
336
+ if (isObject_default(srcValue)) {
337
+ baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
338
+ } else {
339
+ var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
340
+ if (newValue === void 0) {
341
+ newValue = srcValue;
342
+ }
343
+ assignMergeValue_default(object, key, newValue);
344
+ }
345
+ }, keysIn_default);
346
+ }
347
+ var baseMerge_default = baseMerge;
348
+
349
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.js
350
+ function apply(func, thisArg, args) {
351
+ switch (args.length) {
352
+ case 0:
353
+ return func.call(thisArg);
354
+ case 1:
355
+ return func.call(thisArg, args[0]);
356
+ case 2:
357
+ return func.call(thisArg, args[0], args[1]);
358
+ case 3:
359
+ return func.call(thisArg, args[0], args[1], args[2]);
360
+ }
361
+ return func.apply(thisArg, args);
362
+ }
363
+ var apply_default = apply;
364
+
365
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js
366
+ var nativeMax = Math.max;
367
+ function overRest(func, start, transform) {
368
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
369
+ return function() {
370
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
371
+ while (++index < length) {
372
+ array[index] = args[start + index];
373
+ }
374
+ index = -1;
375
+ var otherArgs = Array(start + 1);
376
+ while (++index < start) {
377
+ otherArgs[index] = args[index];
378
+ }
379
+ otherArgs[start] = transform(array);
380
+ return apply_default(func, this, otherArgs);
381
+ };
382
+ }
383
+ var overRest_default = overRest;
384
+
385
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.js
386
+ function constant(value) {
387
+ return function() {
388
+ return value;
389
+ };
390
+ }
391
+ var constant_default = constant;
392
+
393
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js
394
+ var baseSetToString = !defineProperty_default ? identity_default : function(func, string) {
395
+ return defineProperty_default(func, "toString", {
396
+ "configurable": true,
397
+ "enumerable": false,
398
+ "value": constant_default(string),
399
+ "writable": true
400
+ });
401
+ };
402
+ var baseSetToString_default = baseSetToString;
403
+
404
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js
405
+ var HOT_COUNT = 800;
406
+ var HOT_SPAN = 16;
407
+ var nativeNow = Date.now;
408
+ function shortOut(func) {
409
+ var count = 0, lastCalled = 0;
410
+ return function() {
411
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
412
+ lastCalled = stamp;
413
+ if (remaining > 0) {
414
+ if (++count >= HOT_COUNT) {
415
+ return arguments[0];
416
+ }
417
+ } else {
418
+ count = 0;
419
+ }
420
+ return func.apply(void 0, arguments);
421
+ };
422
+ }
423
+ var shortOut_default = shortOut;
424
+
425
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js
426
+ var setToString = shortOut_default(baseSetToString_default);
427
+ var setToString_default = setToString;
428
+
429
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js
430
+ function baseRest(func, start) {
431
+ return setToString_default(overRest_default(func, start, identity_default), func + "");
432
+ }
433
+ var baseRest_default = baseRest;
434
+
435
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js
436
+ function isIterateeCall(value, index, object) {
437
+ if (!isObject_default(object)) {
438
+ return false;
439
+ }
440
+ var type = typeof index;
441
+ if (type == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type == "string" && index in object) {
442
+ return eq_default(object[index], value);
443
+ }
444
+ return false;
445
+ }
446
+ var isIterateeCall_default = isIterateeCall;
447
+
448
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js
449
+ function createAssigner(assigner) {
450
+ return baseRest_default(function(object, sources) {
451
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
452
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
453
+ if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
454
+ customizer = length < 3 ? void 0 : customizer;
455
+ length = 1;
456
+ }
457
+ object = Object(object);
458
+ while (++index < length) {
459
+ var source = sources[index];
460
+ if (source) {
461
+ assigner(object, source, index, customizer);
462
+ }
463
+ }
464
+ return object;
465
+ });
466
+ }
467
+ var createAssigner_default = createAssigner;
468
+
469
+ // ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/merge.js
470
+ var merge = createAssigner_default(function(object, source, srcIndex) {
471
+ baseMerge_default(object, source, srcIndex);
472
+ });
473
+ var merge_default = merge;
474
+
475
+ // ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5PVQY5BW.mjs
476
+ var ZERO_WIDTH_SPACE = "\u200B";
477
+ var d3CurveTypes = {
478
+ curveBasis: basis_default,
479
+ curveBasisClosed: basisClosed_default,
480
+ curveBasisOpen: basisOpen_default,
481
+ curveBumpX: bumpX,
482
+ curveBumpY: bumpY,
483
+ curveBundle: bundle_default,
484
+ curveCardinalClosed: cardinalClosed_default,
485
+ curveCardinalOpen: cardinalOpen_default,
486
+ curveCardinal: cardinal_default,
487
+ curveCatmullRomClosed: catmullRomClosed_default,
488
+ curveCatmullRomOpen: catmullRomOpen_default,
489
+ curveCatmullRom: catmullRom_default,
490
+ curveLinear: linear_default,
491
+ curveLinearClosed: linearClosed_default,
492
+ curveMonotoneX: monotoneX,
493
+ curveMonotoneY: monotoneY,
494
+ curveNatural: natural_default,
495
+ curveStep: step_default,
496
+ curveStepAfter: stepAfter,
497
+ curveStepBefore: stepBefore
498
+ };
499
+ var directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
500
+ var detectInit = /* @__PURE__ */ __name(function(text, config) {
501
+ const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/);
502
+ let results = {};
503
+ if (Array.isArray(inits)) {
504
+ const args = inits.map((init) => init.args);
505
+ sanitizeDirective(args);
506
+ results = assignWithDepth_default(results, [...args]);
507
+ } else {
508
+ results = inits.args;
509
+ }
510
+ if (!results) {
511
+ return;
512
+ }
513
+ let type = detectType(text, config);
514
+ const prop = "config";
515
+ if (results[prop] !== void 0) {
516
+ if (type === "flowchart-v2") {
517
+ type = "flowchart";
518
+ }
519
+ results[type] = results[prop];
520
+ delete results[prop];
521
+ }
522
+ return results;
523
+ }, "detectInit");
524
+ var detectDirective = /* @__PURE__ */ __name(function(text, type = null) {
525
+ try {
526
+ const commentWithoutDirectives = new RegExp(
527
+ `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
528
+ `,
529
+ "ig"
530
+ );
531
+ text = text.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
532
+ log.debug(
533
+ `Detecting diagram directive${type !== null ? " type:" + type : ""} based on the text:${text}`
534
+ );
535
+ let match;
536
+ const result = [];
537
+ while ((match = directiveRegex.exec(text)) !== null) {
538
+ if (match.index === directiveRegex.lastIndex) {
539
+ directiveRegex.lastIndex++;
540
+ }
541
+ if (match && !type || type && match[1]?.match(type) || type && match[2]?.match(type)) {
542
+ const type2 = match[1] ? match[1] : match[2];
543
+ const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;
544
+ result.push({ type: type2, args });
545
+ }
546
+ }
547
+ if (result.length === 0) {
548
+ return { type: text, args: null };
549
+ }
550
+ return result.length === 1 ? result[0] : result;
551
+ } catch (error) {
552
+ log.error(
553
+ `ERROR: ${error.message} - Unable to parse directive type: '${type}' based on the text: '${text}'`
554
+ );
555
+ return { type: void 0, args: null };
556
+ }
557
+ }, "detectDirective");
558
+ var removeDirectives = /* @__PURE__ */ __name(function(text) {
559
+ return text.replace(directiveRegex, "");
560
+ }, "removeDirectives");
561
+ var isSubstringInArray = /* @__PURE__ */ __name(function(str, arr) {
562
+ for (const [i, element] of arr.entries()) {
563
+ if (element.match(str)) {
564
+ return i;
565
+ }
566
+ }
567
+ return -1;
568
+ }, "isSubstringInArray");
569
+ function interpolateToCurve(interpolate, defaultCurve) {
570
+ if (!interpolate) {
571
+ return defaultCurve;
572
+ }
573
+ const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
574
+ return d3CurveTypes[curveName] ?? defaultCurve;
575
+ }
576
+ __name(interpolateToCurve, "interpolateToCurve");
577
+ function formatUrl(linkStr, config) {
578
+ const url = linkStr.trim();
579
+ if (!url) {
580
+ return void 0;
581
+ }
582
+ if (config.securityLevel !== "loose") {
583
+ return (0, import_sanitize_url.sanitizeUrl)(url);
584
+ }
585
+ return url;
586
+ }
587
+ __name(formatUrl, "formatUrl");
588
+ var runFunc = /* @__PURE__ */ __name((functionName, ...params) => {
589
+ const arrPaths = functionName.split(".");
590
+ const len = arrPaths.length - 1;
591
+ const fnName = arrPaths[len];
592
+ let obj = window;
593
+ for (let i = 0; i < len; i++) {
594
+ obj = obj[arrPaths[i]];
595
+ if (!obj) {
596
+ log.error(`Function name: ${functionName} not found in window`);
597
+ return;
598
+ }
599
+ }
600
+ obj[fnName](...params);
601
+ }, "runFunc");
602
+ function distance(p1, p2) {
603
+ if (!p1 || !p2) {
604
+ return 0;
605
+ }
606
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
607
+ }
608
+ __name(distance, "distance");
609
+ function traverseEdge(points) {
610
+ let prevPoint;
611
+ let totalDistance = 0;
612
+ points.forEach((point) => {
613
+ totalDistance += distance(point, prevPoint);
614
+ prevPoint = point;
615
+ });
616
+ const remainingDistance = totalDistance / 2;
617
+ return calculatePoint(points, remainingDistance);
618
+ }
619
+ __name(traverseEdge, "traverseEdge");
620
+ function calcLabelPosition(points) {
621
+ if (points.length === 1) {
622
+ return points[0];
623
+ }
624
+ return traverseEdge(points);
625
+ }
626
+ __name(calcLabelPosition, "calcLabelPosition");
627
+ var roundNumber = /* @__PURE__ */ __name((num, precision = 2) => {
628
+ const factor = Math.pow(10, precision);
629
+ return Math.round(num * factor) / factor;
630
+ }, "roundNumber");
631
+ var calculatePoint = /* @__PURE__ */ __name((points, distanceToTraverse) => {
632
+ let prevPoint = void 0;
633
+ let remainingDistance = distanceToTraverse;
634
+ for (const point of points) {
635
+ if (prevPoint) {
636
+ const vectorDistance = distance(point, prevPoint);
637
+ if (vectorDistance === 0) {
638
+ return prevPoint;
639
+ }
640
+ if (vectorDistance < remainingDistance) {
641
+ remainingDistance -= vectorDistance;
642
+ } else {
643
+ const distanceRatio = remainingDistance / vectorDistance;
644
+ if (distanceRatio <= 0) {
645
+ return prevPoint;
646
+ }
647
+ if (distanceRatio >= 1) {
648
+ return { x: point.x, y: point.y };
649
+ }
650
+ if (distanceRatio > 0 && distanceRatio < 1) {
651
+ return {
652
+ x: roundNumber((1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, 5),
653
+ y: roundNumber((1 - distanceRatio) * prevPoint.y + distanceRatio * point.y, 5)
654
+ };
655
+ }
656
+ }
657
+ }
658
+ prevPoint = point;
659
+ }
660
+ throw new Error("Could not find a suitable point for the given distance");
661
+ }, "calculatePoint");
662
+ var calcCardinalityPosition = /* @__PURE__ */ __name((isRelationTypePresent, points, initialPosition) => {
663
+ log.info(`our points ${JSON.stringify(points)}`);
664
+ if (points[0] !== initialPosition) {
665
+ points = points.reverse();
666
+ }
667
+ const distanceToCardinalityPoint = 25;
668
+ const center = calculatePoint(points, distanceToCardinalityPoint);
669
+ const d = isRelationTypePresent ? 10 : 5;
670
+ const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
671
+ const cardinalityPosition = { x: 0, y: 0 };
672
+ cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
673
+ cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
674
+ return cardinalityPosition;
675
+ }, "calcCardinalityPosition");
676
+ function calcTerminalLabelPosition(terminalMarkerSize, position, _points) {
677
+ const points = structuredClone(_points);
678
+ log.info("our points", points);
679
+ if (position !== "start_left" && position !== "start_right") {
680
+ points.reverse();
681
+ }
682
+ const distanceToCardinalityPoint = 25 + terminalMarkerSize;
683
+ const center = calculatePoint(points, distanceToCardinalityPoint);
684
+ const d = 10 + terminalMarkerSize * 0.5;
685
+ const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
686
+ const cardinalityPosition = { x: 0, y: 0 };
687
+ if (position === "start_left") {
688
+ cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;
689
+ cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;
690
+ } else if (position === "end_right") {
691
+ cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;
692
+ cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;
693
+ } else if (position === "end_left") {
694
+ cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;
695
+ cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;
696
+ } else {
697
+ cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
698
+ cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
699
+ }
700
+ return cardinalityPosition;
701
+ }
702
+ __name(calcTerminalLabelPosition, "calcTerminalLabelPosition");
703
+ function getStylesFromArray(arr) {
704
+ let style = "";
705
+ let labelStyle = "";
706
+ for (const element of arr) {
707
+ if (element !== void 0) {
708
+ if (element.startsWith("color:") || element.startsWith("text-align:")) {
709
+ labelStyle = labelStyle + element + ";";
710
+ } else {
711
+ style = style + element + ";";
712
+ }
713
+ }
714
+ }
715
+ return { style, labelStyle };
716
+ }
717
+ __name(getStylesFromArray, "getStylesFromArray");
718
+ var cnt = 0;
719
+ var generateId = /* @__PURE__ */ __name(() => {
720
+ cnt++;
721
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
722
+ }, "generateId");
723
+ function makeRandomHex(length) {
724
+ let result = "";
725
+ const characters = "0123456789abcdef";
726
+ const charactersLength = characters.length;
727
+ for (let i = 0; i < length; i++) {
728
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
729
+ }
730
+ return result;
731
+ }
732
+ __name(makeRandomHex, "makeRandomHex");
733
+ var random = /* @__PURE__ */ __name((options) => {
734
+ return makeRandomHex(options.length);
735
+ }, "random");
736
+ var getTextObj = /* @__PURE__ */ __name(function() {
737
+ return {
738
+ x: 0,
739
+ y: 0,
740
+ fill: void 0,
741
+ anchor: "start",
742
+ style: "#666",
743
+ width: 100,
744
+ height: 100,
745
+ textMargin: 0,
746
+ rx: 0,
747
+ ry: 0,
748
+ valign: void 0,
749
+ text: ""
750
+ };
751
+ }, "getTextObj");
752
+ var drawSimpleText = /* @__PURE__ */ __name(function(elem, textData) {
753
+ const nText = textData.text.replace(common_default.lineBreakRegex, " ");
754
+ const [, _fontSizePx] = parseFontSize(textData.fontSize);
755
+ const textElem = elem.append("text");
756
+ textElem.attr("x", textData.x);
757
+ textElem.attr("y", textData.y);
758
+ textElem.style("text-anchor", textData.anchor);
759
+ textElem.style("font-family", textData.fontFamily);
760
+ textElem.style("font-size", _fontSizePx);
761
+ textElem.style("font-weight", textData.fontWeight);
762
+ textElem.attr("fill", textData.fill);
763
+ if (textData.class !== void 0) {
764
+ textElem.attr("class", textData.class);
765
+ }
766
+ const span = textElem.append("tspan");
767
+ span.attr("x", textData.x + textData.textMargin * 2);
768
+ span.attr("fill", textData.fill);
769
+ span.text(nText);
770
+ return textElem;
771
+ }, "drawSimpleText");
772
+ var wrapLabel = memoize_default(
773
+ (label, maxWidth, config) => {
774
+ if (!label) {
775
+ return label;
776
+ }
777
+ config = Object.assign(
778
+ { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" },
779
+ config
780
+ );
781
+ if (common_default.lineBreakRegex.test(label)) {
782
+ return label;
783
+ }
784
+ const words = label.split(" ").filter(Boolean);
785
+ const completedLines = [];
786
+ let nextLine = "";
787
+ words.forEach((word, index) => {
788
+ const wordLength = calculateTextWidth(`${word} `, config);
789
+ const nextLineLength = calculateTextWidth(nextLine, config);
790
+ if (wordLength > maxWidth) {
791
+ const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config);
792
+ completedLines.push(nextLine, ...hyphenatedStrings);
793
+ nextLine = remainingWord;
794
+ } else if (nextLineLength + wordLength >= maxWidth) {
795
+ completedLines.push(nextLine);
796
+ nextLine = word;
797
+ } else {
798
+ nextLine = [nextLine, word].filter(Boolean).join(" ");
799
+ }
800
+ const currentWord = index + 1;
801
+ const isLastWord = currentWord === words.length;
802
+ if (isLastWord) {
803
+ completedLines.push(nextLine);
804
+ }
805
+ });
806
+ return completedLines.filter((line) => line !== "").join(config.joinWith);
807
+ },
808
+ (label, maxWidth, config) => `${label}${maxWidth}${config.fontSize}${config.fontWeight}${config.fontFamily}${config.joinWith}`
809
+ );
810
+ var breakString = memoize_default(
811
+ (word, maxWidth, hyphenCharacter = "-", config) => {
812
+ config = Object.assign(
813
+ { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
814
+ config
815
+ );
816
+ const characters = [...word];
817
+ const lines = [];
818
+ let currentLine = "";
819
+ characters.forEach((character, index) => {
820
+ const nextLine = `${currentLine}${character}`;
821
+ const lineWidth = calculateTextWidth(nextLine, config);
822
+ if (lineWidth >= maxWidth) {
823
+ const currentCharacter = index + 1;
824
+ const isLastLine = characters.length === currentCharacter;
825
+ const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
826
+ lines.push(isLastLine ? nextLine : hyphenatedNextLine);
827
+ currentLine = "";
828
+ } else {
829
+ currentLine = nextLine;
830
+ }
831
+ });
832
+ return { hyphenatedStrings: lines, remainingWord: currentLine };
833
+ },
834
+ (word, maxWidth, hyphenCharacter = "-", config) => `${word}${maxWidth}${hyphenCharacter}${config.fontSize}${config.fontWeight}${config.fontFamily}`
835
+ );
836
+ function calculateTextHeight(text, config) {
837
+ return calculateTextDimensions(text, config).height;
838
+ }
839
+ __name(calculateTextHeight, "calculateTextHeight");
840
+ function calculateTextWidth(text, config) {
841
+ return calculateTextDimensions(text, config).width;
842
+ }
843
+ __name(calculateTextWidth, "calculateTextWidth");
844
+ var calculateTextDimensions = memoize_default(
845
+ (text, config) => {
846
+ const { fontSize = 12, fontFamily = "Arial", fontWeight = 400 } = config;
847
+ if (!text) {
848
+ return { width: 0, height: 0 };
849
+ }
850
+ const [, _fontSizePx] = parseFontSize(fontSize);
851
+ const fontFamilies = ["sans-serif", fontFamily];
852
+ const lines = text.split(common_default.lineBreakRegex);
853
+ const dims = [];
854
+ const body = select_default("body");
855
+ if (!body.remove) {
856
+ return { width: 0, height: 0, lineHeight: 0 };
857
+ }
858
+ const g = body.append("svg");
859
+ for (const fontFamily2 of fontFamilies) {
860
+ let cHeight = 0;
861
+ const dim = { width: 0, height: 0, lineHeight: 0 };
862
+ for (const line of lines) {
863
+ const textObj = getTextObj();
864
+ textObj.text = line || ZERO_WIDTH_SPACE;
865
+ const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
866
+ const bBox = (textElem._groups || textElem)[0][0].getBBox();
867
+ if (bBox.width === 0 && bBox.height === 0) {
868
+ throw new Error("svg element not in render tree");
869
+ }
870
+ dim.width = Math.round(Math.max(dim.width, bBox.width));
871
+ cHeight = Math.round(bBox.height);
872
+ dim.height += cHeight;
873
+ dim.lineHeight = Math.round(Math.max(dim.lineHeight, cHeight));
874
+ }
875
+ dims.push(dim);
876
+ }
877
+ g.remove();
878
+ const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
879
+ return dims[index];
880
+ },
881
+ (text, config) => `${text}${config.fontSize}${config.fontWeight}${config.fontFamily}`
882
+ );
883
+ var InitIDGenerator = class {
884
+ constructor(deterministic = false, seed) {
885
+ this.count = 0;
886
+ this.count = seed ? seed.length : 0;
887
+ this.next = deterministic ? () => this.count++ : () => Date.now();
888
+ }
889
+ static {
890
+ __name(this, "InitIDGenerator");
891
+ }
892
+ };
893
+ var decoder;
894
+ var entityDecode = /* @__PURE__ */ __name(function(html) {
895
+ decoder = decoder || document.createElement("div");
896
+ html = escape(html).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
897
+ decoder.innerHTML = html;
898
+ return unescape(decoder.textContent);
899
+ }, "entityDecode");
900
+ function isDetailedError(error) {
901
+ return "str" in error;
902
+ }
903
+ __name(isDetailedError, "isDetailedError");
904
+ var insertTitle = /* @__PURE__ */ __name((parent, cssClass, titleTopMargin, title) => {
905
+ if (!title) {
906
+ return;
907
+ }
908
+ const bounds = parent.node()?.getBBox();
909
+ if (!bounds) {
910
+ return;
911
+ }
912
+ parent.append("text").text(title).attr("text-anchor", "middle").attr("x", bounds.x + bounds.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
913
+ }, "insertTitle");
914
+ var parseFontSize = /* @__PURE__ */ __name((fontSize) => {
915
+ if (typeof fontSize === "number") {
916
+ return [fontSize, fontSize + "px"];
917
+ }
918
+ const fontSizeNumber = parseInt(fontSize ?? "", 10);
919
+ if (Number.isNaN(fontSizeNumber)) {
920
+ return [void 0, void 0];
921
+ } else if (fontSize === String(fontSizeNumber)) {
922
+ return [fontSizeNumber, fontSize + "px"];
923
+ } else {
924
+ return [fontSizeNumber, fontSize];
925
+ }
926
+ }, "parseFontSize");
927
+ function cleanAndMerge(defaultData, data) {
928
+ return merge_default({}, defaultData, data);
929
+ }
930
+ __name(cleanAndMerge, "cleanAndMerge");
931
+ var utils_default = {
932
+ assignWithDepth: assignWithDepth_default,
933
+ wrapLabel,
934
+ calculateTextHeight,
935
+ calculateTextWidth,
936
+ calculateTextDimensions,
937
+ cleanAndMerge,
938
+ detectInit,
939
+ detectDirective,
940
+ isSubstringInArray,
941
+ interpolateToCurve,
942
+ calcLabelPosition,
943
+ calcCardinalityPosition,
944
+ calcTerminalLabelPosition,
945
+ formatUrl,
946
+ getStylesFromArray,
947
+ generateId,
948
+ random,
949
+ runFunc,
950
+ entityDecode,
951
+ insertTitle,
952
+ isLabelCoordinateInPath,
953
+ parseFontSize,
954
+ InitIDGenerator
955
+ };
956
+ var encodeEntities = /* @__PURE__ */ __name(function(text) {
957
+ let txt = text;
958
+ txt = txt.replace(/style.*:\S*#.*;/g, function(s) {
959
+ return s.substring(0, s.length - 1);
960
+ });
961
+ txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) {
962
+ return s.substring(0, s.length - 1);
963
+ });
964
+ txt = txt.replace(/#\w+;/g, function(s) {
965
+ const innerTxt = s.substring(1, s.length - 1);
966
+ const isInt = /^\+?\d+$/.test(innerTxt);
967
+ if (isInt) {
968
+ return "\uFB02\xB0\xB0" + innerTxt + "\xB6\xDF";
969
+ } else {
970
+ return "\uFB02\xB0" + innerTxt + "\xB6\xDF";
971
+ }
972
+ });
973
+ return txt;
974
+ }, "encodeEntities");
975
+ var decodeEntities = /* @__PURE__ */ __name(function(text) {
976
+ return text.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";");
977
+ }, "decodeEntities");
978
+ var getEdgeId = /* @__PURE__ */ __name((from, to, {
979
+ counter = 0,
980
+ prefix,
981
+ suffix
982
+ }, id) => {
983
+ if (id) {
984
+ return id;
985
+ }
986
+ return `${prefix ? `${prefix}_` : ""}${from}_${to}_${counter}${suffix ? `_${suffix}` : ""}`;
987
+ }, "getEdgeId");
988
+ function handleUndefinedAttr(attrValue) {
989
+ return attrValue ?? null;
990
+ }
991
+ __name(handleUndefinedAttr, "handleUndefinedAttr");
992
+ function isLabelCoordinateInPath(point, dAttr) {
993
+ const roundedX = Math.round(point.x);
994
+ const roundedY = Math.round(point.y);
995
+ const sanitizedD = dAttr.replace(
996
+ /(\d+\.\d+)/g,
997
+ (match) => Math.round(parseFloat(match)).toString()
998
+ );
999
+ return sanitizedD.includes(roundedX.toString()) || sanitizedD.includes(roundedY.toString());
1000
+ }
1001
+ __name(isLabelCoordinateInPath, "isLabelCoordinateInPath");
1002
+
1003
+ export {
1004
+ baseAssignValue_default,
1005
+ cloneBuffer_default,
1006
+ cloneArrayBuffer_default,
1007
+ cloneTypedArray_default,
1008
+ copyArray_default,
1009
+ getPrototype_default,
1010
+ initCloneObject_default,
1011
+ isArrayLikeObject_default,
1012
+ assignValue_default,
1013
+ copyObject_default,
1014
+ keysIn_default,
1015
+ overRest_default,
1016
+ constant_default,
1017
+ setToString_default,
1018
+ baseRest_default,
1019
+ isIterateeCall_default,
1020
+ merge_default,
1021
+ ZERO_WIDTH_SPACE,
1022
+ removeDirectives,
1023
+ interpolateToCurve,
1024
+ getStylesFromArray,
1025
+ generateId,
1026
+ random,
1027
+ wrapLabel,
1028
+ calculateTextHeight,
1029
+ calculateTextWidth,
1030
+ isDetailedError,
1031
+ parseFontSize,
1032
+ cleanAndMerge,
1033
+ utils_default,
1034
+ encodeEntities,
1035
+ decodeEntities,
1036
+ getEdgeId,
1037
+ handleUndefinedAttr
1038
+ };
1039
+ //# sourceMappingURL=chunk-UVRE3R6A.js.map