@digipair/skill-web-chatbot 0.91.0-0 → 0.92.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 (136) hide show
  1. package/SAP-icons.cjs.js +2489 -0
  2. package/SAP-icons.cjs2.js +2489 -0
  3. package/SAP-icons.esm.js +2482 -0
  4. package/SAP-icons.esm2.js +2482 -0
  5. package/Tableau10-558cc280.cjs.js +9 -0
  6. package/Tableau10-558cc280.esm.js +7 -0
  7. package/arc-d1f6357e.cjs.js +88 -0
  8. package/arc-d1f6357e.esm.js +86 -0
  9. package/array-2ff2c7a6.cjs.js +7 -0
  10. package/array-2ff2c7a6.esm.js +5 -0
  11. package/blockDiagram-5dc23a45.cjs.js +2921 -0
  12. package/blockDiagram-5dc23a45.esm.js +2919 -0
  13. package/c4Diagram-1e775db3.cjs.js +4387 -0
  14. package/c4Diagram-1e775db3.esm.js +4385 -0
  15. package/channel-ebbc4130.cjs.js +9 -0
  16. package/channel-ebbc4130.esm.js +7 -0
  17. package/classDiagram-f52caa06.cjs.js +209 -0
  18. package/classDiagram-f52caa06.esm.js +207 -0
  19. package/classDiagram-v2-640c694e.cjs.js +401 -0
  20. package/classDiagram-v2-640c694e.esm.js +399 -0
  21. package/clone-afc2f047.cjs.js +10 -0
  22. package/clone-afc2f047.esm.js +8 -0
  23. package/createText-03b82060.cjs.js +2936 -0
  24. package/createText-03b82060.esm.js +2933 -0
  25. package/edges-16357fde.cjs.js +1998 -0
  26. package/edges-16357fde.esm.js +1981 -0
  27. package/erDiagram-c7ff1bec.cjs.js +1807 -0
  28. package/erDiagram-c7ff1bec.esm.js +1805 -0
  29. package/flowDb-9a89ea33.cjs.js +5542 -0
  30. package/flowDb-9a89ea33.esm.js +5538 -0
  31. package/flowDiagram-aadb13b0.cjs.js +1351 -0
  32. package/flowDiagram-aadb13b0.esm.js +1349 -0
  33. package/flowDiagram-v2-f2119625.cjs.js +31 -0
  34. package/flowDiagram-v2-f2119625.esm.js +29 -0
  35. package/flowchart-elk-definition-cf813a97.cjs.js +50257 -0
  36. package/flowchart-elk-definition-cf813a97.esm.js +50255 -0
  37. package/ganttDiagram-3c2fde2b.cjs.js +3710 -0
  38. package/ganttDiagram-3c2fde2b.esm.js +3708 -0
  39. package/gitGraphDiagram-c3a0619c.cjs.js +3820 -0
  40. package/gitGraphDiagram-c3a0619c.esm.js +3818 -0
  41. package/graph-0ee63739.cjs.js +961 -0
  42. package/graph-0ee63739.esm.js +938 -0
  43. package/index-bb6d8841.cjs.js +648 -0
  44. package/index-bb6d8841.esm.js +646 -0
  45. package/index.cjs.d.ts +1 -0
  46. package/index.cjs.js +17 -0
  47. package/index.cjs2.js +60723 -0
  48. package/index.esm.js +1 -0
  49. package/index.esm2.js +60574 -0
  50. package/infoDiagram-2f5c50c0.cjs.js +460 -0
  51. package/infoDiagram-2f5c50c0.esm.js +458 -0
  52. package/init-f9637058.cjs.js +17 -0
  53. package/init-f9637058.esm.js +15 -0
  54. package/journeyDiagram-14fe341a.cjs.js +1061 -0
  55. package/journeyDiagram-14fe341a.esm.js +1059 -0
  56. package/katex-d90b6d29.cjs.js +25690 -0
  57. package/katex-d90b6d29.esm.js +25688 -0
  58. package/layout-fd473db2.cjs.js +1626 -0
  59. package/layout-fd473db2.esm.js +1619 -0
  60. package/libs/engine/src/index.d.ts +2 -0
  61. package/libs/engine/src/lib/alias.interface.d.ts +9 -0
  62. package/libs/engine/src/lib/engine.d.ts +13 -0
  63. package/libs/engine/src/lib/pins-settings.interface.d.ts +15 -0
  64. package/libs/skill-web-chatbot/src/lib/chat.element.d.ts +28 -0
  65. package/libs/skill-web-chatbot/src/lib/common.data.d.ts +1 -0
  66. package/libs/skill-web-chatbot/src/lib/config.d.ts +9 -0
  67. package/libs/skill-web-chatbot/src/lib/digipair-full.data.d.ts +1 -0
  68. package/libs/skill-web-chatbot/src/lib/digipair-full.element.d.ts +36 -0
  69. package/libs/skill-web-chatbot/src/lib/digipair.data.d.ts +1 -0
  70. package/libs/skill-web-chatbot/src/lib/digipair.element.d.ts +44 -0
  71. package/libs/skill-web-chatbot/src/lib/inputs.element.d.ts +10 -0
  72. package/libs/skill-web-chatbot/src/lib/message.interface.d.ts +10 -0
  73. package/libs/skill-web-chatbot/src/lib/pins/chatbot.actions.d.ts +1 -0
  74. package/libs/skill-web-chatbot/src/lib/tools/css-selector.d.ts +1 -0
  75. package/line-24d93f1b.cjs.js +34 -0
  76. package/line-24d93f1b.esm.js +32 -0
  77. package/linear-9bcf74c4.cjs.js +537 -0
  78. package/linear-9bcf74c4.esm.js +531 -0
  79. package/mindmap-definition-9399c7e6.cjs.js +20489 -0
  80. package/mindmap-definition-9399c7e6.esm.js +20487 -0
  81. package/ordinal-5695958c.cjs.js +331 -0
  82. package/ordinal-5695958c.esm.js +329 -0
  83. package/package.json +7 -22
  84. package/path-428ebac9.cjs.js +317 -0
  85. package/path-428ebac9.esm.js +314 -0
  86. package/pieDiagram-828dae43.cjs.js +951 -0
  87. package/pieDiagram-828dae43.esm.js +949 -0
  88. package/quadrantDiagram-5fa00455.cjs.js +2410 -0
  89. package/quadrantDiagram-5fa00455.esm.js +2408 -0
  90. package/requirementDiagram-03163dc4.cjs.js +2267 -0
  91. package/requirementDiagram-03163dc4.esm.js +2265 -0
  92. package/sankeyDiagram-52ec8976.cjs.js +1848 -0
  93. package/sankeyDiagram-52ec8976.esm.js +1846 -0
  94. package/sequenceDiagram-b517d154.cjs.js +5949 -0
  95. package/sequenceDiagram-b517d154.esm.js +5947 -0
  96. package/stateDiagram-fca82b5b.cjs.js +283 -0
  97. package/stateDiagram-fca82b5b.esm.js +281 -0
  98. package/stateDiagram-v2-ed04200a.cjs.js +373 -0
  99. package/stateDiagram-v2-ed04200a.esm.js +371 -0
  100. package/styles-11e81fdd.cjs.js +3944 -0
  101. package/styles-11e81fdd.esm.js +3940 -0
  102. package/styles-cacbff60.cjs.js +2120 -0
  103. package/styles-cacbff60.esm.js +2111 -0
  104. package/styles-e75131e4.cjs.js +671 -0
  105. package/styles-e75131e4.esm.js +661 -0
  106. package/svgDrawCommon-ecc5f780.cjs.js +68 -0
  107. package/svgDrawCommon-ecc5f780.esm.js +60 -0
  108. package/timeline-definition-4ee9bff4.cjs.js +1161 -0
  109. package/timeline-definition-4ee9bff4.esm.js +1159 -0
  110. package/xychartDiagram-e5e6b652.cjs.js +3150 -0
  111. package/xychartDiagram-e5e6b652.esm.js +3148 -0
  112. package/.swcrc +0 -28
  113. package/README.md +0 -7
  114. package/eslint.config.mjs +0 -22
  115. package/rollup.config.cjs +0 -28
  116. package/src/digipair__engine.d.ts +0 -2
  117. package/src/handlebars.d.ts +0 -1
  118. package/src/index.html +0 -18
  119. package/src/lib/chat.element.ts +0 -603
  120. package/src/lib/common.data.ts +0 -1
  121. package/src/lib/config.ts +0 -30
  122. package/src/lib/digipair-full.data.ts +0 -101
  123. package/src/lib/digipair-full.element.ts +0 -358
  124. package/src/lib/digipair.data.ts +0 -103
  125. package/src/lib/digipair.element.ts +0 -446
  126. package/src/lib/inputs.element.ts +0 -46
  127. package/src/lib/mermaid.d.ts +0 -1
  128. package/src/lib/message.interface.ts +0 -10
  129. package/src/lib/pins/chatbot.actions.ts +0 -32
  130. package/src/lib/tools/css-selector.ts +0 -12
  131. package/tsconfig.json +0 -13
  132. package/tsconfig.lib.json +0 -19
  133. /package/{src/index.d.ts → index.d.ts} +0 -0
  134. /package/{src/index.ts → libs/skill-web-chatbot/src/index.d.ts} +0 -0
  135. /package/{src/schema.fr.json → schema.fr.json} +0 -0
  136. /package/{src/schema.json → schema.json} +0 -0
@@ -0,0 +1,646 @@
1
+ import { b as v, Z as Ze } from './graph-0ee63739.esm.js';
2
+ import { m as m$1, Y as Yt } from './layout-fd473db2.esm.js';
3
+ import { a } from './clone-afc2f047.esm.js';
4
+ import { h as hr, f as fr, d as dr, x as xr, t as tr, p as pr, u as ur, g as gr, o as or, m as m$2, y as yr, R, B as Bt } from './edges-16357fde.esm.js';
5
+ import { c as L, V as Vn, e as La, b as bt$1 } from './index.esm2.js';
6
+ import { U as Ur } from './createText-03b82060.esm.js';
7
+
8
+ function _array_like_to_array(arr, len) {
9
+ if (len == null || len > arr.length) len = arr.length;
10
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
11
+ return arr2;
12
+ }
13
+ function _array_without_holes(arr) {
14
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
15
+ }
16
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
+ try {
18
+ var info = gen[key](arg);
19
+ var value = info.value;
20
+ } catch (error) {
21
+ reject(error);
22
+ return;
23
+ }
24
+ if (info.done) {
25
+ resolve(value);
26
+ } else {
27
+ Promise.resolve(value).then(_next, _throw);
28
+ }
29
+ }
30
+ function _async_to_generator(fn) {
31
+ return function() {
32
+ var self = this, args = arguments;
33
+ return new Promise(function(resolve, reject) {
34
+ var gen = fn.apply(self, args);
35
+ function _next(value) {
36
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
+ }
38
+ function _throw(err) {
39
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
40
+ }
41
+ _next(undefined);
42
+ });
43
+ };
44
+ }
45
+ function _iterable_to_array(iter) {
46
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
47
+ }
48
+ function _non_iterable_spread() {
49
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
50
+ }
51
+ function _to_consumable_array(arr) {
52
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
53
+ }
54
+ function _unsupported_iterable_to_array(o, minLen) {
55
+ if (!o) return;
56
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
57
+ var n = Object.prototype.toString.call(o).slice(8, -1);
58
+ if (n === "Object" && o.constructor) n = o.constructor.name;
59
+ if (n === "Map" || n === "Set") return Array.from(n);
60
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
61
+ }
62
+ function _ts_generator(thisArg, body) {
63
+ var f, y, t, g, _ = {
64
+ label: 0,
65
+ sent: function() {
66
+ if (t[0] & 1) throw t[1];
67
+ return t[1];
68
+ },
69
+ trys: [],
70
+ ops: []
71
+ };
72
+ return g = {
73
+ next: verb(0),
74
+ "throw": verb(1),
75
+ "return": verb(2)
76
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
+ return this;
78
+ }), g;
79
+ function verb(n) {
80
+ return function(v) {
81
+ return step([
82
+ n,
83
+ v
84
+ ]);
85
+ };
86
+ }
87
+ function step(op) {
88
+ if (f) throw new TypeError("Generator is already executing.");
89
+ while(_)try {
90
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
91
+ if (y = 0, t) op = [
92
+ op[0] & 2,
93
+ t.value
94
+ ];
95
+ switch(op[0]){
96
+ case 0:
97
+ case 1:
98
+ t = op;
99
+ break;
100
+ case 4:
101
+ _.label++;
102
+ return {
103
+ value: op[1],
104
+ done: false
105
+ };
106
+ case 5:
107
+ _.label++;
108
+ y = op[1];
109
+ op = [
110
+ 0
111
+ ];
112
+ continue;
113
+ case 7:
114
+ op = _.ops.pop();
115
+ _.trys.pop();
116
+ continue;
117
+ default:
118
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
119
+ _ = 0;
120
+ continue;
121
+ }
122
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
123
+ _.label = op[1];
124
+ break;
125
+ }
126
+ if (op[0] === 6 && _.label < t[1]) {
127
+ _.label = t[1];
128
+ t = op;
129
+ break;
130
+ }
131
+ if (t && _.label < t[2]) {
132
+ _.label = t[2];
133
+ _.ops.push(op);
134
+ break;
135
+ }
136
+ if (t[2]) _.ops.pop();
137
+ _.trys.pop();
138
+ continue;
139
+ }
140
+ op = body.call(thisArg, _);
141
+ } catch (e) {
142
+ op = [
143
+ 6,
144
+ e
145
+ ];
146
+ y = 0;
147
+ } finally{
148
+ f = t = 0;
149
+ }
150
+ if (op[0] & 5) throw op[1];
151
+ return {
152
+ value: op[0] ? op[1] : void 0,
153
+ done: true
154
+ };
155
+ }
156
+ }
157
+ function m(e) {
158
+ var t = {
159
+ options: {
160
+ directed: e.isDirected(),
161
+ multigraph: e.isMultigraph(),
162
+ compound: e.isCompound()
163
+ },
164
+ nodes: tt(e),
165
+ edges: et(e)
166
+ };
167
+ return v(e.graph()) || (t.value = a(e.graph())), t;
168
+ }
169
+ function tt(e) {
170
+ return m$1(e.nodes(), function(t) {
171
+ var n = e.node(t), r = e.parent(t), i = {
172
+ v: t
173
+ };
174
+ return v(n) || (i.value = n), v(r) || (i.parent = r), i;
175
+ });
176
+ }
177
+ function et(e) {
178
+ return m$1(e.edges(), function(t) {
179
+ var n = e.edge(t), r = {
180
+ v: t.v,
181
+ w: t.w
182
+ };
183
+ return v(t.name) || (r.name = t.name), v(n) || (r.value = n), r;
184
+ });
185
+ }
186
+ var l = {}, g = {}, P = {};
187
+ var nt = function() {
188
+ g = {}, P = {}, l = {};
189
+ }, B = function(e, t) {
190
+ return L.trace("In isDescendant", t, " ", e, " = ", g[t].includes(e)), !!g[t].includes(e);
191
+ }, it = function(e, t) {
192
+ return L.info("Descendants of ", t, " is ", g[t]), L.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) : (L.debug("Tilt, ", t, ",not in descendants"), !1);
193
+ }, k = function(e, t, n, r) {
194
+ L.warn("Copying children of ", e, "root", r, "data", t.node(e), r);
195
+ var i = t.children(e) || [];
196
+ e !== r && i.push(e), L.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach(function(a) {
197
+ if (t.children(a).length > 0) k(a, t, n, r);
198
+ else {
199
+ var d = t.node(a);
200
+ L.info("cp ", a, " to ", r, " with parent ", e), n.setNode(a, d), r !== t.parent(a) && (L.warn("Setting parent", a, t.parent(a)), n.setParent(a, t.parent(a))), e !== r && a !== e ? (L.debug("Setting parent", a, e), n.setParent(a, e)) : (L.info("In copy ", e, "root", r, "data", t.node(e), r), L.debug("Not Setting parent for node=", a, "cluster!==rootId", e !== r, "node!==clusterId", a !== e));
201
+ var u = t.edges(a);
202
+ L.debug("Copying Edges", u), u.forEach(function(f) {
203
+ L.info("Edge", f);
204
+ var h = t.edge(f.v, f.w, f.name);
205
+ L.info("Edge data", h, r);
206
+ try {
207
+ it(f, r) ? (L.info("Copying as ", f.v, f.w, h, f.name), n.setEdge(f.v, f.w, h, f.name), L.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : L.info("Skipping copy of edge ", f.v, "-->", f.w, " rootId: ", r, " clusterId:", e);
208
+ } catch (w) {
209
+ L.error(w);
210
+ }
211
+ });
212
+ }
213
+ L.debug("Removing node", a), t.removeNode(a);
214
+ });
215
+ }, $ = function(e, t) {
216
+ var n = t.children(e);
217
+ var r = _to_consumable_array(n);
218
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
219
+ try {
220
+ for(var _iterator = n[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
221
+ var i = _step.value;
222
+ P[i] = e, r = _to_consumable_array(r).concat(_to_consumable_array($(i, t)));
223
+ }
224
+ } catch (err) {
225
+ _didIteratorError = true;
226
+ _iteratorError = err;
227
+ } finally{
228
+ try {
229
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
230
+ _iterator.return();
231
+ }
232
+ } finally{
233
+ if (_didIteratorError) {
234
+ throw _iteratorError;
235
+ }
236
+ }
237
+ }
238
+ return r;
239
+ }, C = function(e, t) {
240
+ L.trace("Searching", e);
241
+ var n = t.children(e);
242
+ if (L.trace("Searching children of id ", e, n), n.length < 1) return L.trace("This is a valid node", e), e;
243
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
244
+ try {
245
+ for(var _iterator = n[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
246
+ var r = _step.value;
247
+ var i = C(r, t);
248
+ if (i) return L.trace("Found replacement for", e, " => ", i), i;
249
+ }
250
+ } catch (err) {
251
+ _didIteratorError = true;
252
+ _iteratorError = err;
253
+ } finally{
254
+ try {
255
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
256
+ _iterator.return();
257
+ }
258
+ } finally{
259
+ if (_didIteratorError) {
260
+ throw _iteratorError;
261
+ }
262
+ }
263
+ }
264
+ }, X = function(e) {
265
+ return !l[e] || !l[e].externalConnections ? e : l[e] ? l[e].id : e;
266
+ }, st = function(e, t) {
267
+ if (!e || t > 10) {
268
+ L.debug("Opting out, no graph ");
269
+ return;
270
+ } else L.debug("Opting in, graph ");
271
+ e.nodes().forEach(function(n) {
272
+ e.children(n).length > 0 && (L.warn("Cluster identified", n, " Replacement id in edges: ", C(n, e)), g[n] = $(n, e), l[n] = {
273
+ id: C(n, e),
274
+ clusterData: e.node(n)
275
+ });
276
+ }), e.nodes().forEach(function(n) {
277
+ var r = e.children(n), i = e.edges();
278
+ r.length > 0 ? (L.debug("Cluster identified", n, g), i.forEach(function(a) {
279
+ if (a.v !== n && a.w !== n) {
280
+ var d = B(a.v, n), u = B(a.w, n);
281
+ d ^ u && (L.warn("Edge: ", a, " leaves cluster ", n), L.warn("Descendants of XXX ", n, ": ", g[n]), l[n].externalConnections = !0);
282
+ }
283
+ })) : L.debug("Not a cluster ", n, g);
284
+ });
285
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
286
+ try {
287
+ for(var _iterator = Object.keys(l)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
288
+ var n = _step.value;
289
+ var r = l[n].id, i = e.parent(r);
290
+ i !== n && l[i] && !l[i].externalConnections && (l[n].id = i);
291
+ }
292
+ } catch (err) {
293
+ _didIteratorError = true;
294
+ _iteratorError = err;
295
+ } finally{
296
+ try {
297
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
298
+ _iterator.return();
299
+ }
300
+ } finally{
301
+ if (_didIteratorError) {
302
+ throw _iteratorError;
303
+ }
304
+ }
305
+ }
306
+ e.edges().forEach(function(n) {
307
+ var r = e.edge(n);
308
+ L.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), L.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
309
+ var i = n.v, a = n.w;
310
+ if (L.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]) {
311
+ L.warn("Fixing and trixing link to self - removing XXX", n.v, n.w, n.name), L.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);
312
+ var d = n.w + "---" + n.v;
313
+ e.setNode(d, {
314
+ domId: d,
315
+ id: d,
316
+ labelStyle: "",
317
+ labelText: r.label,
318
+ padding: 0,
319
+ shape: "labelRect",
320
+ style: ""
321
+ });
322
+ var u = structuredClone(r), f = structuredClone(r);
323
+ 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");
324
+ } else if (l[n.v] || l[n.w]) {
325
+ if (L.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) {
326
+ var d1 = e.parent(i);
327
+ l[d1].externalConnections = !0, r.fromCluster = n.v;
328
+ }
329
+ if (a !== n.w) {
330
+ var d2 = e.parent(a);
331
+ l[d2].externalConnections = !0, r.toCluster = n.w;
332
+ }
333
+ L.warn("Fix Replacing with XXX", i, a, n.name), e.setEdge(i, a, r, n.name);
334
+ }
335
+ }), L.warn("Adjusted Graph", m(e)), F(e, 0), L.trace(l);
336
+ }, F = function(e, t) {
337
+ if (L.warn("extractor - ", t, m(e), e.children("D")), t > 10) {
338
+ L.error("Bailing out");
339
+ return;
340
+ }
341
+ var n = e.nodes(), r = !1;
342
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
343
+ try {
344
+ for(var _iterator = n[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
345
+ var i = _step.value;
346
+ var a = e.children(i);
347
+ r = r || a.length > 0;
348
+ }
349
+ } catch (err) {
350
+ _didIteratorError = true;
351
+ _iteratorError = err;
352
+ } finally{
353
+ try {
354
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
355
+ _iterator.return();
356
+ }
357
+ } finally{
358
+ if (_didIteratorError) {
359
+ throw _iteratorError;
360
+ }
361
+ }
362
+ }
363
+ if (!r) {
364
+ L.debug("Done, no node has children", e.nodes());
365
+ return;
366
+ }
367
+ L.debug("Nodes = ", n, t);
368
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
369
+ try {
370
+ for(var _iterator1 = n[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
371
+ var i1 = _step1.value;
372
+ if (L.debug("Extracting node", i1, l, l[i1] && !l[i1].externalConnections, !e.parent(i1), e.node(i1), e.children("D"), " Depth ", t), !l[i1]) L.debug("Not a cluster", i1, t);
373
+ else if (!l[i1].externalConnections && // !graph.parent(node) &&
374
+ e.children(i1) && e.children(i1).length > 0) {
375
+ L.warn("Cluster without external connections, without a parent and with children", i1, t);
376
+ var d = e.graph().rankdir === "TB" ? "LR" : "TB";
377
+ l[i1] && l[i1].clusterData && l[i1].clusterData.dir && (d = l[i1].clusterData.dir, L.warn("Fixing dir", l[i1].clusterData.dir, d));
378
+ var u = new Ze({
379
+ multigraph: !0,
380
+ compound: !0
381
+ }).setGraph({
382
+ rankdir: d,
383
+ // Todo: set proper spacing
384
+ nodesep: 50,
385
+ ranksep: 50,
386
+ marginx: 8,
387
+ marginy: 8
388
+ }).setDefaultEdgeLabel(function() {
389
+ return {};
390
+ });
391
+ L.warn("Old graph before copy", m(e)), k(i1, e, u, i1), e.setNode(i1, {
392
+ clusterNode: !0,
393
+ id: i1,
394
+ clusterData: l[i1].clusterData,
395
+ labelText: l[i1].labelText,
396
+ graph: u
397
+ }), L.warn("New graph after copy node: (", i1, ")", m(u)), L.debug("Old graph after copy", m(e));
398
+ } else L.warn("Cluster ** ", i1, " **not meeting the criteria !externalConnections:", !l[i1].externalConnections, " no parent: ", !e.parent(i1), " children ", e.children(i1) && e.children(i1).length > 0, e.children("D"), t), L.debug(l);
399
+ }
400
+ } catch (err) {
401
+ _didIteratorError1 = true;
402
+ _iteratorError1 = err;
403
+ } finally{
404
+ try {
405
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
406
+ _iterator1.return();
407
+ }
408
+ } finally{
409
+ if (_didIteratorError1) {
410
+ throw _iteratorError1;
411
+ }
412
+ }
413
+ }
414
+ n = e.nodes(), L.warn("New list of nodes", n);
415
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
416
+ try {
417
+ for(var _iterator2 = n[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
418
+ var i2 = _step2.value;
419
+ var a1 = e.node(i2);
420
+ L.warn(" Now next level", i2, a1), a1.clusterNode && F(a1.graph, t + 1);
421
+ }
422
+ } catch (err) {
423
+ _didIteratorError2 = true;
424
+ _iteratorError2 = err;
425
+ } finally{
426
+ try {
427
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
428
+ _iterator2.return();
429
+ }
430
+ } finally{
431
+ if (_didIteratorError2) {
432
+ throw _iteratorError2;
433
+ }
434
+ }
435
+ }
436
+ }, G = function(e, t) {
437
+ if (t.length === 0) return [];
438
+ var n = Object.assign(t);
439
+ return t.forEach(function(r) {
440
+ var i = e.children(r), a = G(e, i);
441
+ n = _to_consumable_array(n).concat(_to_consumable_array(a));
442
+ }), n;
443
+ }, rt = function(e) {
444
+ return G(e, e.children());
445
+ }, at = function(e, t) {
446
+ L.info("Creating subgraph rect for ", t.id, t);
447
+ var n = Vn(), r = e.insert("g").attr("class", "cluster" + (t.class ? " " + t.class : "")).attr("id", t.id), i = r.insert("rect", ":first-child"), a = La(n.flowchart.htmlLabels), d = r.insert("g").attr("class", "cluster-label"), u = t.labelType === "markdown" ? Ur(d, t.labelText, {
448
+ style: t.labelStyle,
449
+ useHtmlLabels: a
450
+ }) : d.node().appendChild(R(t.labelText, t.labelStyle, void 0, !0));
451
+ var f = u.getBBox();
452
+ if (La(n.flowchart.htmlLabels)) {
453
+ var c = u.children[0], o = bt$1(u);
454
+ f = c.getBoundingClientRect(), o.attr("width", f.width), o.attr("height", f.height);
455
+ }
456
+ var h = 0 * t.padding, w = h / 2, x = t.width <= f.width + h ? f.width + h : t.width;
457
+ t.width <= f.width + h ? t.diff = (f.width - t.width) / 2 - t.padding / 2 : t.diff = -t.padding / 2, L.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);
458
+ var _D = tr(n), v = _D.subGraphTitleTopMargin;
459
+ a ? d.attr("transform", // This puts the label on top of the box instead of inside it
460
+ "translate(".concat(t.x - f.width / 2, ", ").concat(t.y - t.height / 2 + v, ")")) : d.attr("transform", // This puts the label on top of the box instead of inside it
461
+ "translate(".concat(t.x, ", ").concat(t.y - t.height / 2 + v, ")"));
462
+ var y = i.node().getBBox();
463
+ return t.width = y.width, t.height = y.height, t.intersect = function at(c) {
464
+ return Bt(t, c);
465
+ }, r;
466
+ }, ct = function(e, t) {
467
+ var 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;
468
+ 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");
469
+ var d = r.node().getBBox();
470
+ return t.width = d.width, t.height = d.height, t.intersect = function ct(u) {
471
+ return Bt(t, u);
472
+ }, n;
473
+ }, ot = function(e, t) {
474
+ var n = Vn(), 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(R(t.labelText, t.labelStyle, void 0, !0));
475
+ var f = u.getBBox();
476
+ if (La(n.flowchart.htmlLabels)) {
477
+ var c = u.children[0], o = bt$1(u);
478
+ f = c.getBoundingClientRect(), o.attr("width", f.width), o.attr("height", f.height);
479
+ }
480
+ f = u.getBBox();
481
+ var h = 0 * t.padding, w = h / 2, x = t.width <= f.width + t.padding ? f.width + t.padding : t.width;
482
+ 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);
483
+ var _D = tr(n), v = _D.subGraphTitleTopMargin;
484
+ a.attr("transform", "translate(".concat(t.x - f.width / 2, ", ").concat(t.y - t.height / 2 - t.padding / 3 + (La(n.flowchart.htmlLabels) ? 5 : 3) + v, ")"));
485
+ var y = i.node().getBBox();
486
+ return t.height = y.height, t.intersect = function ot(c) {
487
+ return Bt(t, c);
488
+ }, r;
489
+ }, lt = function(e, t) {
490
+ var 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;
491
+ 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);
492
+ var d = r.node().getBBox();
493
+ return t.width = d.width, t.height = d.height, t.diff = -t.padding / 2, t.intersect = function lt(u) {
494
+ return Bt(t, u);
495
+ }, n;
496
+ }, ft = {
497
+ rect: at,
498
+ roundedWithTitle: ot,
499
+ noteGroup: ct,
500
+ divider: lt
501
+ };
502
+ var j = {};
503
+ var dt = function(e, t) {
504
+ L.trace("Inserting cluster");
505
+ var n = t.shape || "rect";
506
+ j[t.id] = ft[n](e, t);
507
+ }, ut = function() {
508
+ j = {};
509
+ }, M = function() {
510
+ var _ref = _async_to_generator(function(e, t, n, r, i, a) {
511
+ var d, u, f, h, w, x, v, _D, y;
512
+ return _ts_generator(this, function(_state) {
513
+ switch(_state.label){
514
+ case 0:
515
+ L.info("Graph in recursive render: XXX", m(t), i);
516
+ d = t.graph().rankdir;
517
+ L.trace("Dir in recursive render - dir:", d);
518
+ u = e.insert("g").attr("class", "root");
519
+ t.nodes() ? L.info("Recursive render XXX", t.nodes()) : L.info("No nodes found for", t), t.edges().length > 0 && L.trace("Recursive edges", t.edge(t.edges()[0]));
520
+ 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");
521
+ return [
522
+ 4,
523
+ Promise.all(t.nodes().map(function() {
524
+ var _ref = _async_to_generator(function(c) {
525
+ var o, b, b1, E;
526
+ return _ts_generator(this, function(_state) {
527
+ switch(_state.label){
528
+ case 0:
529
+ o = t.node(c);
530
+ if (i !== void 0) {
531
+ b = JSON.parse(JSON.stringify(i.clusterData));
532
+ L.info("Setting data for cluster XXX (", c, ") ", b, i), t.setNode(i.id, b), t.parent(c) || (L.trace("Setting parent", c, i.id), t.setParent(c, i.id, b));
533
+ }
534
+ if (!(L.info("(Insert) Node XXX" + c + ": " + JSON.stringify(t.node(c))), o && o.clusterNode)) return [
535
+ 3,
536
+ 2
537
+ ];
538
+ L.info("Cluster identified", c, o.width, t.node(c));
539
+ return [
540
+ 4,
541
+ M(x, o.graph, n, r, t.node(c), a)
542
+ ];
543
+ case 1:
544
+ b1 = _state.sent(), E = b1.elem;
545
+ m$2(o, E), o.diff = b1.diff || 0, L.info("Node bounds (abc123)", c, o, o.width, o.x, o.y), yr(E, o), L.warn("Recursive render complete ", E, o);
546
+ return [
547
+ 3,
548
+ 6
549
+ ];
550
+ case 2:
551
+ if (!(t.children(c).length > 0)) return [
552
+ 3,
553
+ 3
554
+ ];
555
+ (L.info("Cluster - the non recursive path XXX", c, o.id, o, t), L.info(C(o.id, t)), l[o.id] = {
556
+ id: C(o.id, t),
557
+ node: o
558
+ });
559
+ return [
560
+ 3,
561
+ 5
562
+ ];
563
+ case 3:
564
+ L.info("Node - the non recursive path", c, o.id, o);
565
+ return [
566
+ 4,
567
+ or(x, t.node(c), d)
568
+ ];
569
+ case 4:
570
+ _state.sent();
571
+ _state.label = 5;
572
+ case 5:
573
+ _state.label = 6;
574
+ case 6:
575
+ return [
576
+ 2
577
+ ];
578
+ }
579
+ });
580
+ });
581
+ return function(c) {
582
+ return _ref.apply(this, arguments);
583
+ };
584
+ }()))
585
+ ];
586
+ case 1:
587
+ _state.sent(), t.edges().forEach(function(c) {
588
+ var o = t.edge(c.v, c.w, c.name);
589
+ L.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c)), L.info("Edge " + c.v + " -> " + c.w + ": ", c, " ", JSON.stringify(t.edge(c))), L.info("Fix", l, "ids:", c.v, c.w, "Translating: ", l[c.v], l[c.w]), xr(w, o);
590
+ }), t.edges().forEach(function(c) {
591
+ L.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c));
592
+ }), L.info("#############################################"), L.info("### Layout ###"), L.info("#############################################"), L.info(t), Yt(t), L.info("Graph after layout:", m(t));
593
+ v = 0;
594
+ _D = tr(a), y = _D.subGraphTitleTotalMargin;
595
+ return [
596
+ 2,
597
+ (rt(t).forEach(function(c) {
598
+ var o = t.node(c);
599
+ L.info("Position " + c + ": " + JSON.stringify(t.node(c))), L.info("Position " + c + ": (" + o.x, "," + o.y, ") width: ", o.width, " height: ", o.height), o && o.clusterNode ? (o.y += y, pr(o)) : t.children(c).length > 0 ? (o.height += y, dt(f, o), l[o.id].node = o) : (o.y += y / 2, pr(o));
600
+ }), t.edges().forEach(function(c) {
601
+ var o = t.edge(c);
602
+ L.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(o), o), o.points.forEach(function(E) {
603
+ return E.y += y / 2;
604
+ });
605
+ var b = ur(h, c, o, l, n, t, r);
606
+ gr(o, b);
607
+ }), t.nodes().forEach(function(c) {
608
+ var o = t.node(c);
609
+ L.info(c, o.type, o.diff), o.type === "group" && (v = o.diff);
610
+ }), {
611
+ elem: u,
612
+ diff: v
613
+ })
614
+ ];
615
+ }
616
+ });
617
+ });
618
+ return function M(e, t, n, r, i, a) {
619
+ return _ref.apply(this, arguments);
620
+ };
621
+ }(), bt = function() {
622
+ var _ref = _async_to_generator(function(e, t, n, r, i) {
623
+ var a;
624
+ return _ts_generator(this, function(_state) {
625
+ switch(_state.label){
626
+ case 0:
627
+ hr(e, n, r, i), fr(), dr(), ut(), nt(), L.warn("Graph at first:", JSON.stringify(m(t))), st(t), L.warn("Graph after:", JSON.stringify(m(t)));
628
+ a = Vn();
629
+ return [
630
+ 4,
631
+ M(e, t, r, i, void 0, a)
632
+ ];
633
+ case 1:
634
+ _state.sent();
635
+ return [
636
+ 2
637
+ ];
638
+ }
639
+ });
640
+ });
641
+ return function bt(e, t, n, r, i) {
642
+ return _ref.apply(this, arguments);
643
+ };
644
+ }();
645
+
646
+ export { bt as b };
package/index.cjs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/index.cjs.js ADDED
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = require('./index.cjs2.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'ChatbotElement', {
10
+ enumerable: true,
11
+ get: function () { return index.ChatbotElement; }
12
+ });
13
+ Object.defineProperty(exports, 'DigipairFullElement', {
14
+ enumerable: true,
15
+ get: function () { return index.DigipairFullElement; }
16
+ });
17
+ exports.config = index.config;