likec4 1.59.2 → 1.59.4

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 (69) hide show
  1. package/__app__/src/chunks/AIChat.mjs +118 -123
  2. package/__app__/src/chunks/LikeC4Styles.mjs +828 -686
  3. package/__app__/src/chunks/ProjectsOverview.mjs +82 -82
  4. package/__app__/src/chunks/es.mjs +1 -1
  5. package/__app__/src/chunks/hooks.mjs +164 -135
  6. package/__app__/src/chunks/libs/@floating-ui.mjs +649 -335
  7. package/__app__/src/chunks/libs/@mantine.mjs +2934 -2040
  8. package/__app__/src/chunks/libs/@tanstack-ai.mjs +28 -28
  9. package/__app__/src/chunks/libs/@tanstack.mjs +46 -51
  10. package/__app__/src/chunks/libs/@xstate/react.mjs +59 -40
  11. package/__app__/src/chunks/libs/@xyflow/react.mjs +535 -448
  12. package/__app__/src/chunks/libs/bezier-js.mjs +10 -9
  13. package/__app__/src/chunks/libs/d3.mjs +20 -45
  14. package/__app__/src/chunks/libs/fast-equals.mjs +62 -50
  15. package/__app__/src/chunks/libs/framer.mjs +300 -279
  16. package/__app__/src/chunks/libs/zod.mjs +17 -14
  17. package/__app__/src/chunks/rolldown-runtime.mjs +2 -2
  18. package/__app__/src/chunks/styled-system.mjs +2580 -132
  19. package/__app__/src/main.mjs +24925 -23485
  20. package/__app__/src/style.css +1 -1
  21. package/config/schema.json +49 -0
  22. package/dist/app/render-view-client.css +1 -0
  23. package/dist/app/render-view-client.js +739 -0
  24. package/dist/chunks/enableServer.mjs +1 -1
  25. package/dist/chunks/filenames.mjs +7 -6
  26. package/dist/chunks/index.d.mts +18 -1
  27. package/dist/chunks/index2.d.mts +79 -26
  28. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  29. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +5 -5
  30. package/dist/chunks/libs/@chevrotain/types.d.mts +108 -0
  31. package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
  32. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  33. package/dist/chunks/libs/birpc.mjs +1 -1
  34. package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
  35. package/dist/chunks/libs/chevrotain.mjs +16 -16
  36. package/dist/chunks/libs/json5.mjs +3 -3
  37. package/dist/chunks/libs/langium.d.mts +1777 -16
  38. package/dist/chunks/libs/langium.mjs +11 -11
  39. package/dist/chunks/libs/merge-error-cause.mjs +2 -2
  40. package/dist/chunks/libs/p-queue.mjs +1 -1
  41. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  42. package/dist/chunks/libs/pako.mjs +2 -2
  43. package/dist/chunks/libs/picomatch.mjs +1 -1
  44. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  45. package/dist/chunks/libs/remeda.mjs +1 -1
  46. package/dist/chunks/libs/ufo.mjs +1 -1
  47. package/dist/chunks/libs/unstorage.mjs +1 -1
  48. package/dist/chunks/libs/zod.d.mts +1717 -17
  49. package/dist/chunks/libs/zod.mjs +4 -4
  50. package/dist/chunks/node.mjs +68 -57
  51. package/dist/chunks/rolldown-runtime.mjs +1 -1
  52. package/dist/chunks/sequence-view.mjs +1 -1
  53. package/dist/chunks/vite-plugin.mjs +168 -54
  54. package/dist/cli/index.d.mts +1 -1
  55. package/dist/cli/index.mjs +291 -165
  56. package/dist/config/index.d.mts +7 -1
  57. package/dist/config/index.mjs +1 -1
  58. package/dist/index.d.mts +3 -3
  59. package/dist/index.mjs +1 -1
  60. package/dist/model/index.d.mts +4 -4
  61. package/dist/vite-plugin/index.d.mts +2 -2
  62. package/dist/vite-plugin/internal/index.d.mts +72 -35
  63. package/dist/vite-plugin/internal/index.mjs +125 -44
  64. package/package.json +47 -47
  65. package/react/index.d.mts +22767 -1432
  66. package/react/index.mjs +38152 -32309
  67. package/vite-plugin-modules.d.ts +21 -1
  68. package/dist/chunks/dist.mjs +0 -10
  69. package/dist/chunks/logger.mjs +0 -1
@@ -1,32 +1,32 @@
1
1
  import { i as e } from "./rolldown-runtime.mjs";
2
- import { l as t } from "./libs/@tanstack.mjs";
2
+ import { c as t } from "./libs/@tanstack.mjs";
3
3
  import { C as n, F as r, N as i, O as a, _ as o, b as s, c, j as l, k as u, m as d, t as f, v as p, y as m } from "./hooks.mjs";
4
- import { B as h, Et as g, J as ee, N as te, Xt as ne, Z as _, g as re, ht as v, mt as ie, r as ae, v as y, x as b } from "./libs/@mantine.mjs";
5
- import { C as x, N as S, _ as C, x as w } from "./styled-system.mjs";
6
- import { i as oe, m as se } from "./libs/framer.mjs";
7
- import { a as T, c as E, i as ce, n as D, o as O, r as k, s as A, t as j } from "./libs/zod.mjs";
8
- import { a as M, i as le, n as ue, r as de, t as fe } from "./libs/@tanstack-ai.mjs";
9
- import { createContext as pe, use as me, useEffect as he, useRef as N, useState as P } from "react";
4
+ import { At as h, C as g, F as _, H as v, Z as ee, _t as te, b as y, et as b, nn as ne, r as re, v as ie, vt as x } from "./libs/@mantine.mjs";
5
+ import { C as S, L as C, T as w, y as T } from "./styled-system.mjs";
6
+ import { i as ae, m as oe } from "./libs/framer.mjs";
7
+ import { a as E, c as D, i as se, n as O, o as k, r as A, s as j, t as M } from "./libs/zod.mjs";
8
+ import { a as N, i as ce, n as le, r as ue, t as de } from "./libs/@tanstack-ai.mjs";
9
+ import { createContext as fe, use as pe, useEffect as me, useRef as P, useState as he } from "react";
10
10
  import { c as F } from "react/compiler-runtime";
11
11
  import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
12
- import { RichText as ge, nonNullable as z, nonexhaustive as _e } from "@likec4/core";
13
- import { ElementShapes as ve } from "@likec4/core/styles";
14
- import { AIAdapter as ye } from "likec4:rpc";
15
- //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/computed/index.js
12
+ import { RichText as ge, nonNullable as _e, nonexhaustive as ve } from "@likec4/core";
13
+ import { ElementShapes as ye } from "@likec4/core/styles";
14
+ import { AIAdapter as be } from "likec4:rpc";
15
+ //#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.js
16
16
  var computedStore = (e, t, n) => {
17
17
  Array.isArray(e) || (e = [e]);
18
18
  let r, i, set = () => {
19
19
  if (i === s.epoch) return;
20
20
  i = s.epoch;
21
21
  let n = e.map((e) => e.get());
22
- if (!r || n.some((e, t) => e !== r[t])) {
22
+ if (!r?.every((t, r) => e[r].eq(t, n[r]))) {
23
23
  r = n;
24
24
  let e = t(...n);
25
25
  e && e.then && e.t ? e.then((e) => {
26
26
  r === n && a.set(e);
27
27
  }) : (a.set(e), i = s.epoch);
28
28
  }
29
- }, a = /* @__PURE__ */ m(void 0), o = a.get;
29
+ }, a = /* @__PURE__ */ m(), o = a.get;
30
30
  a.get = () => (set(), o());
31
31
  let c, l = n ? () => {
32
32
  clearTimeout(c), c = setTimeout(set);
@@ -37,16 +37,16 @@ var computedStore = (e, t, n) => {
37
37
  for (let e of t) e();
38
38
  };
39
39
  }), a;
40
- }, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0), B = pe(null);
40
+ }, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0), z = fe(null);
41
41
  function useChatContext() {
42
- return z(me(B), "useChatContext: ChatProvider is not provided");
42
+ return _e(pe(z), "useChatContext: ChatProvider is not provided");
43
43
  }
44
44
  //#endregion
45
45
  //#region src/aichat/ChatInput.tsx
46
46
  function ChatInput() {
47
- let e = F(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] = P(""), l = N(null), t0;
47
+ let e = F(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] = he(""), l = P(null), t0;
48
48
  e[0] !== n || e[1] !== t || e[2] !== s ? (t0 = () => {
49
- !s.trim() || n || (t(s), c(""));
49
+ s.trim() && !n && (t(s), c(""));
50
50
  }, e[0] = n, e[1] = t, e[2] = s, e[3] = t0) : t0 = e[3];
51
51
  let u = t0, t1;
52
52
  e[4] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (e) => c(e.target.value), e[4] = t1) : t1 = e[4];
@@ -55,7 +55,7 @@ function ChatInput() {
55
55
  e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey && (e.preventDefault(), u());
56
56
  }, e[5] = u, e[6] = t2);
57
57
  let d;
58
- e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ L(te, {
58
+ e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ L(_, {
59
59
  flex: 1,
60
60
  className: "chat-input",
61
61
  placeholder: "Your question...",
@@ -77,14 +77,14 @@ function ChatInput() {
77
77
  children: "Clear"
78
78
  }), e[11] = i, e[12] = n, e[13] = r.length, e[14] = f) : f = e[14];
79
79
  let p;
80
- e[15] !== n || e[16] !== o ? (p = n && /* @__PURE__ */ L(v, {
80
+ e[15] !== n || e[16] !== o ? (p = n && /* @__PURE__ */ L(x, {
81
81
  color: "red",
82
82
  variant: "light",
83
83
  onClick: () => o(),
84
84
  children: /* @__PURE__ */ L(a, {})
85
85
  }), e[15] = n, e[16] = o, e[17] = p) : p = e[17];
86
86
  let m;
87
- return e[18] !== d || e[19] !== f || e[20] !== p ? (m = /* @__PURE__ */ R(w, { children: [
87
+ return e[18] !== d || e[19] !== f || e[20] !== p ? (m = /* @__PURE__ */ R(S, { children: [
88
88
  d,
89
89
  f,
90
90
  p
@@ -101,7 +101,7 @@ function ChatMessages() {
101
101
  color: "red",
102
102
  title: "Oops, something went wrong",
103
103
  withCloseButton: !1,
104
- children: /* @__PURE__ */ R(C, {
104
+ children: /* @__PURE__ */ R(T, {
105
105
  fontSize: "sm",
106
106
  fontFamily: "mono",
107
107
  whiteSpace: "pre",
@@ -117,18 +117,18 @@ function _temp(e) {
117
117
  }
118
118
  var ChatMessage = (e) => {
119
119
  let t = F(4), { message: n } = e, r = n.role, i;
120
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = S({
120
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = C({
121
121
  color: "text.bright",
122
122
  alignSelf: "flex-end",
123
123
  paddingInline: "2",
124
124
  paddingBlock: "1",
125
125
  marginInlineEnd: "2",
126
126
  rounded: "sm",
127
- backgroundColor: "default.hover",
127
+ backgroundColor: "surface.hover",
128
128
  whiteSpace: "pre-wrap"
129
129
  }), t[0] = i) : i = t[0];
130
130
  let a = r === "user" ? UserMessageTextPart : MarkdownTextPart, o;
131
- return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ L(fe, {
131
+ return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ L(de, {
132
132
  message: n,
133
133
  userClassName: i,
134
134
  textPartRenderer: a
@@ -144,15 +144,15 @@ var ChatMessage = (e) => {
144
144
  textScale: .95,
145
145
  value: r
146
146
  }), t[2] = r, t[3] = i), i;
147
- }, V = /* @__PURE__ */ m(""), H = /* @__PURE__ */ m("closed"), be = /* @__PURE__ */ batched([V, H], (e, t) => ({
147
+ }, B = /* @__PURE__ */ m(""), V = /* @__PURE__ */ m("closed"), xe = /* @__PURE__ */ batched([B, V], (e, t) => ({
148
148
  log: e,
149
149
  status: t
150
150
  }));
151
151
  function useSemanticLayoutLog() {
152
- return o(be);
152
+ return o(xe);
153
153
  }
154
154
  function closeSemanticLayoutLog() {
155
- H.set("closed"), V.set("");
155
+ V.set("closed"), B.set("");
156
156
  }
157
157
  //#endregion
158
158
  //#region src/aichat/SemanticLayoutLog.tsx
@@ -160,17 +160,17 @@ function SemanticLayoutLog() {
160
160
  let e = F(6), { log: t, status: n } = useSemanticLayoutLog();
161
161
  if (n === "closed") return null;
162
162
  let r = n === "completed", i;
163
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(ae, {
163
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(re, {
164
164
  order: 4,
165
165
  children: "Semantic Layout"
166
166
  }), e[0] = i) : i = e[0];
167
167
  let a = t || "Waiting for response...", o;
168
- e[1] === a ? o = e[2] : (o = /* @__PURE__ */ L(C, {
168
+ e[1] === a ? o = e[2] : (o = /* @__PURE__ */ L(T, {
169
169
  whiteSpace: "pre-wrap",
170
170
  children: a
171
171
  }), e[1] = a, e[2] = o);
172
172
  let s;
173
- return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ L(b, {
173
+ return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ L(g, {
174
174
  size: "xl",
175
175
  opened: !0,
176
176
  onClose: closeSemanticLayoutLog,
@@ -183,57 +183,57 @@ function SemanticLayoutLog() {
183
183
  }
184
184
  //#endregion
185
185
  //#region ../vite-plugin/src/ai/tools.ts
186
- var U = A({
187
- id: E().meta({ description: "Node ID" }),
188
- title: E(),
189
- shape: j(ve),
190
- color: E().meta({ description: "Node color, from theme or custom" }),
191
- icon: E().nullish(),
192
- parentId: E().nullish().meta({ description: "Parent node ID (if node is nested)" }),
193
- children: D(E()).nullish().meta({ description: "Nested node IDs (if node is compound)" }),
194
- x: O(),
195
- y: O(),
196
- width: O(),
197
- height: O(),
198
- modelFqn: E().nullish().meta({ description: "Model element FQN (if node has reference)" })
199
- }), xe = M({
186
+ var H = j({
187
+ id: D().meta({ description: "Node ID" }),
188
+ title: D(),
189
+ shape: M(ye),
190
+ color: D().meta({ description: "Node color, from theme or custom" }),
191
+ icon: D().nullish(),
192
+ parentId: D().nullish().meta({ description: "Parent node ID (if node is nested)" }),
193
+ children: O(D()).nullish().meta({ description: "Nested node IDs (if node is compound)" }),
194
+ x: k(),
195
+ y: k(),
196
+ width: k(),
197
+ height: k(),
198
+ modelFqn: D().nullish().meta({ description: "Model element FQN (if node has reference)" })
199
+ }), Se = N({
200
200
  name: "read_ui",
201
201
  description: "Read current UI state. Use arguments to include additional data.",
202
202
  needsApproval: !1,
203
- inputSchema: A({
204
- selectedNode: k().default(!1).meta({ description: "Include selected node (if any)" }),
205
- nodes: k().default(!1).meta({ description: "Include all nodes from the view" })
203
+ inputSchema: j({
204
+ selectedNode: A().default(!1).meta({ description: "Include selected node (if any)" }),
205
+ nodes: A().default(!1).meta({ description: "Include all nodes from the view" })
206
206
  }),
207
- outputSchema: A({
208
- projectId: E(),
209
- editMode: k().meta({ description: "Whether the UI is in edit mode" }),
210
- view: A({
211
- id: E(),
212
- title: E(),
213
- type: j([
207
+ outputSchema: j({
208
+ projectId: D(),
209
+ editMode: A().meta({ description: "Whether the UI is in edit mode" }),
210
+ view: j({
211
+ id: D(),
212
+ title: D(),
213
+ type: M([
214
214
  "element",
215
215
  "deployment",
216
216
  "dynamic"
217
217
  ]).meta({ description: "Type of the current view" })
218
218
  }).meta({ description: "Current view" }),
219
- nodes: D(U).nullish(),
220
- selectedNode: U.nullish()
219
+ nodes: O(H).nullish(),
220
+ selectedNode: H.nullish()
221
221
  })
222
- }), Se = M({
222
+ }), Ce = j({
223
+ type: E("focus"),
224
+ elementId: D().meta({ description: "Element ID (FQN)" })
225
+ }).meta({ description: "Focus UI on an element by its FQN" }), we = j({ type: E("fitview") }).meta({ description: "Zoom out to fit all elements in the viewport, and clear any selection/focus" }), Te = N({
223
226
  name: "update_ui",
224
227
  description: "Update UI state by executing a command.",
225
228
  needsApproval: !1,
226
- inputSchema: A({ command: ce("type", [A({
227
- type: T("focus"),
228
- elementId: E().meta({ description: "Element ID (FQN)" })
229
- }).meta({ description: "Focus UI on an element by its FQN" }), A({ type: T("fitview") }).meta({ description: "Zoom out to fit all elements in the viewport, and clear any selection/focus" })]) }),
230
- outputSchema: A({})
231
- }), Ce = M({
229
+ inputSchema: j({ command: se("type", [Ce, we]) }),
230
+ outputSchema: j({})
231
+ }), Ee = N({
232
232
  name: "navigate_to",
233
233
  description: "Navigates UI to another view",
234
234
  needsApproval: !1,
235
- inputSchema: A({ viewId: E().meta({ description: "View ID" }) }),
236
- outputSchema: A({})
235
+ inputSchema: j({ viewId: D().meta({ description: "View ID" }) }),
236
+ outputSchema: j({})
237
237
  }), DoubleIndexedKV = class {
238
238
  constructor() {
239
239
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
@@ -321,7 +321,7 @@ var CustomTransformerRegistry = class {
321
321
  findByName(e) {
322
322
  return this.transfomers[e];
323
323
  }
324
- }, we = /* @__PURE__ */ e((e) => Object.prototype.toString.call(e).slice(8, -1), "getType"), isUndefined = (e) => e === void 0, isNull = (e) => e === null, W = /* @__PURE__ */ e((e) => typeof e != "object" || !e || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, "isPlainObject"), isEmptyObject = (e) => W(e) && Object.keys(e).length === 0, G = /* @__PURE__ */ e((e) => Array.isArray(e), "isArray"), isString = (e) => typeof e == "string", isNumber = (e) => typeof e == "number" && !isNaN(e), isBoolean = (e) => typeof e == "boolean", isRegExp = (e) => e instanceof RegExp, isMap = (e) => e instanceof Map, isSet = (e) => e instanceof Set, isSymbol = (e) => we(e) === "Symbol", isDate = (e) => e instanceof Date && !isNaN(e.valueOf()), isError = (e) => e instanceof Error, isNaNValue = (e) => typeof e == "number" && isNaN(e), isPrimitive = (e) => isBoolean(e) || isNull(e) || isUndefined(e) || isNumber(e) || isString(e) || isSymbol(e), isBigint = (e) => typeof e == "bigint", isInfinite = (e) => e === Infinity || e === -Infinity, isTypedArray = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), isURL = (e) => e instanceof URL, escapeKey = (e) => e.replace(/\\/g, "\\\\").replace(/\./g, "\\."), stringifyPath = (e) => e.map(String).map(escapeKey).join("."), parsePath = (e, t) => {
324
+ }, De = /* @__PURE__ */ e((e) => Object.prototype.toString.call(e).slice(8, -1), "getType"), isUndefined = (e) => e === void 0, isNull = (e) => e === null, U = /* @__PURE__ */ e((e) => typeof e != "object" || !e || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null || Object.getPrototypeOf(e) === Object.prototype, "isPlainObject"), isEmptyObject = (e) => U(e) && Object.keys(e).length === 0, W = /* @__PURE__ */ e((e) => Array.isArray(e), "isArray"), isString = (e) => typeof e == "string", isNumber = (e) => typeof e == "number" && !isNaN(e), isBoolean = (e) => typeof e == "boolean", isRegExp = (e) => e instanceof RegExp, isMap = (e) => e instanceof Map, isSet = (e) => e instanceof Set, isSymbol = (e) => De(e) === "Symbol", isDate = (e) => e instanceof Date && !isNaN(e.valueOf()), isError = (e) => e instanceof Error, isNaNValue = (e) => typeof e == "number" && isNaN(e), isPrimitive = (e) => isBoolean(e) || isNull(e) || isUndefined(e) || isNumber(e) || isString(e) || isSymbol(e), isBigint = (e) => typeof e == "bigint", isInfinite = (e) => e === Infinity || e === -Infinity, isTypedArray = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), isURL = (e) => e instanceof URL, escapeKey = (e) => e.replace(/\\/g, "\\\\").replace(/\./g, "\\."), stringifyPath = (e) => e.map(String).map(escapeKey).join("."), parsePath = (e, t) => {
325
325
  let n = [], r = "";
326
326
  for (let i = 0; i < e.length; i++) {
327
327
  let a = e.charAt(i);
@@ -330,7 +330,8 @@ var CustomTransformerRegistry = class {
330
330
  if (t === "\\") {
331
331
  r += "\\", i++;
332
332
  continue;
333
- } else if (t !== ".") throw Error("invalid path");
333
+ }
334
+ if (t !== ".") throw Error("invalid path");
334
335
  }
335
336
  if (a === "\\" && e.charAt(i + 1) === ".") {
336
337
  r += ".", i++;
@@ -355,7 +356,7 @@ function simpleTransformation(e, t, n, r) {
355
356
  untransform: r
356
357
  };
357
358
  }
358
- var K = [
359
+ var G = [
359
360
  simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
360
361
  simpleTransformation(isBigint, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
361
362
  simpleTransformation(isDate, "Date", (e) => e.toISOString(), (e) => new Date(e)),
@@ -391,11 +392,11 @@ function compositeTransformation(e, t, n, r) {
391
392
  untransform: r
392
393
  };
393
394
  }
394
- var q = compositeTransformation((e, t) => isSymbol(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
395
+ var K = compositeTransformation((e, t) => isSymbol(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
395
396
  let r = n.symbolRegistry.getValue(t[1]);
396
397
  if (!r) throw Error("Trying to deserialize unknown symbol");
397
398
  return r;
398
- }), Te = [
399
+ }), q = [
399
400
  Int8Array,
400
401
  Uint8Array,
401
402
  Int16Array,
@@ -406,7 +407,7 @@ var q = compositeTransformation((e, t) => isSymbol(e) ? !!t.symbolRegistry.getId
406
407
  Float64Array,
407
408
  Uint8ClampedArray
408
409
  ].reduce((e, t) => (e[t.name] = t, e), {}), J = compositeTransformation(isTypedArray, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
409
- let n = Te[t[1]];
410
+ let n = q[t[1]];
410
411
  if (!n) throw Error("Trying to deserialize unknown typed array");
411
412
  return new n(e);
412
413
  });
@@ -428,29 +429,29 @@ var Y = compositeTransformation(isInstanceOfRegisteredClass, (e, t) => ["class",
428
429
  let r = n.customTransformerRegistry.findByName(t[1]);
429
430
  if (!r) throw Error("Trying to deserialize unknown custom value");
430
431
  return r.deserialize(e);
431
- }), Ee = [
432
+ }), Oe = [
432
433
  Y,
433
- q,
434
+ K,
434
435
  X,
435
436
  J
436
437
  ], transformValue = (e, t) => {
437
- let n = findArr(Ee, (n) => n.isApplicable(e, t));
438
+ let n = findArr(Oe, (n) => n.isApplicable(e, t));
438
439
  if (n) return {
439
440
  value: n.transform(e, t),
440
441
  type: n.annotation(e, t)
441
442
  };
442
- let r = findArr(K, (n) => n.isApplicable(e, t));
443
+ let r = findArr(G, (n) => n.isApplicable(e, t));
443
444
  if (r) return {
444
445
  value: r.transform(e, t),
445
446
  type: r.annotation
446
447
  };
447
448
  }, Z = {};
448
- K.forEach((e) => {
449
+ G.forEach((e) => {
449
450
  Z[e.annotation] = e;
450
451
  });
451
452
  var untransformValue = (e, t, n) => {
452
- if (G(t)) switch (t[0]) {
453
- case "symbol": return q.untransform(e, t, n);
453
+ if (W(t)) switch (t[0]) {
454
+ case "symbol": return K.untransform(e, t, n);
454
455
  case "class": return Y.untransform(e, t, n);
455
456
  case "custom": return X.untransform(e, t, n);
456
457
  case "typed-array": return J.untransform(e, t, n);
@@ -483,9 +484,7 @@ var getDeep = (e, t) => {
483
484
  case "key":
484
485
  e = o;
485
486
  break;
486
- case "value":
487
- e = e.get(o);
488
- break;
487
+ case "value": e = e.get(o);
489
488
  }
490
489
  } else e = e[r];
491
490
  }
@@ -495,10 +494,10 @@ var getDeep = (e, t) => {
495
494
  let r = e;
496
495
  for (let e = 0; e < t.length - 1; e++) {
497
496
  let n = t[e];
498
- if (G(r)) {
497
+ if (W(r)) {
499
498
  let e = +n;
500
499
  r = r[e];
501
- } else if (W(r)) r = r[n];
500
+ } else if (U(r)) r = r[n];
502
501
  else if (isSet(r)) {
503
502
  let e = +n;
504
503
  r = getNthKey(r, e);
@@ -509,14 +508,12 @@ var getDeep = (e, t) => {
509
508
  case "key":
510
509
  r = o;
511
510
  break;
512
- case "value":
513
- r = r.get(o);
514
- break;
511
+ case "value": r = r.get(o);
515
512
  }
516
513
  }
517
514
  }
518
515
  let i = t[t.length - 1];
519
- if (G(r) ? r[+i] = n(r[+i]) : W(r) && (r[i] = n(r[i])), isSet(r)) {
516
+ if (W(r) ? r[+i] = n(r[+i]) : U(r) && (r[i] = n(r[i])), isSet(r)) {
520
517
  let e = getNthKey(r, +i), t = n(e);
521
518
  e !== t && (r.delete(e), r.add(t));
522
519
  }
@@ -528,9 +525,7 @@ var getDeep = (e, t) => {
528
525
  r.set(e, r.get(a)), e !== a && r.delete(a);
529
526
  break;
530
527
  }
531
- case "value":
532
- r.set(a, n(r.get(a)));
533
- break;
528
+ case "value": r.set(a, n(r.get(a)));
534
529
  }
535
530
  }
536
531
  return e;
@@ -538,7 +533,7 @@ var getDeep = (e, t) => {
538
533
  function traverse(e, t, n, r = []) {
539
534
  if (!e) return;
540
535
  let i = enableLegacyPaths(n);
541
- if (!G(e)) {
536
+ if (!W(e)) {
542
537
  forEach(e, (e, a) => traverse(e, t, n, [...r, ...parsePath(a, i)]));
543
538
  return;
544
539
  }
@@ -560,7 +555,7 @@ function applyReferentialEqualityAnnotations(e, t, n) {
560
555
  e = setDeep(e, t, () => i);
561
556
  });
562
557
  }
563
- if (G(t)) {
558
+ if (W(t)) {
564
559
  let [n, i] = t;
565
560
  n.forEach((t) => {
566
561
  e = setDeep(e, parsePath(t, r), () => e);
@@ -568,7 +563,7 @@ function applyReferentialEqualityAnnotations(e, t, n) {
568
563
  } else forEach(t, apply);
569
564
  return e;
570
565
  }
571
- var isDeep = (e, t) => W(e) || G(e) || isMap(e) || isSet(e) || isError(e) || isInstanceOfRegisteredClass(e, t);
566
+ var isDeep = (e, t) => U(e) || W(e) || isMap(e) || isSet(e) || isError(e) || isInstanceOfRegisteredClass(e, t);
572
567
  function addIdentity(e, t, n) {
573
568
  let r = n.get(e);
574
569
  r ? r.push(t) : n.set(e, [t]);
@@ -597,11 +592,11 @@ var walker = (e, t, n, r, i = [], a = [], o = /* @__PURE__ */ new Map()) => {
597
592
  return s || o.set(e, r), r;
598
593
  }
599
594
  if (includes(a, e)) return { transformedValue: null };
600
- let c = transformValue(e, n), l = c?.value ?? e, u = G(l) ? [] : {}, d = {};
595
+ let c = transformValue(e, n), l = c?.value ?? e, u = W(l) ? [] : {}, d = {};
601
596
  forEach(l, (s, c) => {
602
597
  if (c === "__proto__" || c === "constructor" || c === "prototype") throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);
603
598
  let l = walker(s, t, n, r, [...i, c], [...a, e], o);
604
- u[c] = l.transformedValue, G(l.annotations) ? d[escapeKey(c)] = l.annotations : W(l.annotations) && forEach(l.annotations, (e, t) => {
599
+ u[c] = l.transformedValue, W(l.annotations) ? d[escapeKey(c)] = l.annotations : U(l.annotations) && forEach(l.annotations, (e, t) => {
605
600
  d[escapeKey(c) + "." + t] = e;
606
601
  });
607
602
  });
@@ -697,7 +692,7 @@ var SuperJSON = class {
697
692
  }
698
693
  };
699
694
  SuperJSON.defaultInstance = new SuperJSON(), SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance), SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance), SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance), SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance), SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance), SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance), SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance), SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance), SuperJSON.serialize, SuperJSON.deserialize;
700
- var De = SuperJSON.stringify, Oe = SuperJSON.parse;
695
+ var ke = SuperJSON.stringify, Ae = SuperJSON.parse;
701
696
  SuperJSON.registerClass, SuperJSON.registerCustom, SuperJSON.registerSymbol, SuperJSON.allowErrorProps;
702
697
  //#endregion
703
698
  //#region src/aichat/useChat.tsx
@@ -761,10 +756,10 @@ function useChatTools() {
761
756
  case "fitview":
762
757
  o.fitDiagram();
763
758
  break bb50;
764
- default: _e(t);
759
+ default: ve(t);
765
760
  }
766
761
  return {};
767
- }, e[9] = o, e[10] = t3), s = de(Ce.client(t1), xe.client(t2), Se.client(t3)), e[0] = o, e[1] = a, e[2] = n, e[3] = s;
762
+ }, e[9] = o, e[10] = t3), s = ue(Ee.client(t1), Se.client(t2), Te.client(t3)), e[0] = o, e[1] = a, e[2] = n, e[3] = s;
768
763
  } else s = e[3];
769
764
  return s;
770
765
  }
@@ -773,7 +768,7 @@ var Q = {
773
768
  read() {
774
769
  try {
775
770
  let e = sessionStorage.getItem(this.key);
776
- return e ? Oe(e) : [];
771
+ return e ? Ae(e) : [];
777
772
  } catch {
778
773
  return [];
779
774
  }
@@ -784,14 +779,14 @@ var Q = {
784
779
  sessionStorage.removeItem(this.key);
785
780
  return;
786
781
  }
787
- sessionStorage.setItem(this.key, De(e));
782
+ sessionStorage.setItem(this.key, ke(e));
788
783
  } catch {}
789
784
  }
790
785
  };
791
786
  function useChat(e) {
792
787
  let t = F(7), n;
793
788
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {
794
- connection: le("/__likec4_ai"),
789
+ connection: ce("/__likec4_ai"),
795
790
  initialMessages: Q.read()
796
791
  }, t[0] = n) : n = t[0];
797
792
  let r = n, i = useChatTools(), a;
@@ -800,10 +795,10 @@ function useChat(e) {
800
795
  ...e,
801
796
  tools: i
802
797
  }, t[1] = e, t[2] = i, t[3] = a) : a = t[3];
803
- let o = ue(a), t3, s;
798
+ let o = le(a), t3, s;
804
799
  return t[4] === o.messages ? (t3 = t[5], s = t[6]) : (t3 = () => {
805
800
  Q.write(o.messages);
806
- }, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s), he(t3, s), o;
801
+ }, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s), me(t3, s), o;
807
802
  }
808
803
  //#endregion
809
804
  //#region src/aichat/AIChat.tsx
@@ -826,7 +821,7 @@ var $ = {
826
821
  }
827
822
  };
828
823
  function AIChatComponent() {
829
- let e = N(null);
824
+ let e = P(null);
830
825
  e.current ||= $.read() ?? {
831
826
  right: 16,
832
827
  bottom: 100
@@ -840,10 +835,10 @@ function AIChatComponent() {
840
835
  key: "likec4.ai.chat.collapsed",
841
836
  defaultValue: !0
842
837
  });
843
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(se, { children: [!t && /* @__PURE__ */ L(h, {
838
+ return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(oe, { children: [!t && /* @__PURE__ */ L(v, {
844
839
  w: 300,
845
840
  pos: "fixed",
846
- className: S({
841
+ className: C({
847
842
  rounded: "md",
848
843
  padding: "xs",
849
844
  shadow: "md",
@@ -855,7 +850,7 @@ function AIChatComponent() {
855
850
  initialPosition: e.current,
856
851
  onPositionChange,
857
852
  children: /* @__PURE__ */ L(AIChatWindowContent, { onClose: () => n(!0) })
858
- }), t && /* @__PURE__ */ L(oe.div, {
853
+ }), t && /* @__PURE__ */ L(ae.div, {
859
854
  initial: {
860
855
  opacity: .1,
861
856
  translateX: "10%"
@@ -874,11 +869,11 @@ function AIChatComponent() {
874
869
  bottom: 60,
875
870
  zIndex: 1e3
876
871
  },
877
- children: /* @__PURE__ */ L(re, {
872
+ children: /* @__PURE__ */ L(ie, {
878
873
  label: "Show AI Assistant",
879
874
  color: "dark",
880
875
  fz: "xs",
881
- children: /* @__PURE__ */ L(v, {
876
+ children: /* @__PURE__ */ L(x, {
882
877
  size: "lg",
883
878
  variant: "gradient",
884
879
  onClick: () => n(!1),
@@ -888,7 +883,7 @@ function AIChatComponent() {
888
883
  }, "collapsed")] }), /* @__PURE__ */ L(SemanticLayoutLog, {})] });
889
884
  }
890
885
  function AIChatWindowContent(e) {
891
- let t = F(15), { onClose: r } = e, i = N(null), t1;
886
+ let t = F(15), { onClose: r } = e, i = P(null), t1;
892
887
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
893
888
  i.current?.scrollIntoView();
894
889
  }, t[0] = t1) : t1 = t[0];
@@ -899,21 +894,21 @@ function AIChatWindowContent(e) {
899
894
  let o;
900
895
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (o = { onChunk: a }, t[2] = o) : o = t[2];
901
896
  let s = useChat(o), c;
902
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(C, {
897
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ R(S, { children: [/* @__PURE__ */ L(T, {
903
898
  textStyle: "likec4.panel",
904
- noUserSelect: !0,
899
+ nouserselect: !0,
905
900
  children: "AI Assistant"
906
- }), /* @__PURE__ */ L(_, {
901
+ }), /* @__PURE__ */ L(b, {
907
902
  size: "xs",
908
903
  radius: "sm",
909
904
  variant: "light",
910
- children: ye
905
+ children: be
911
906
  })] }), t[3] = c) : c = t[3];
912
907
  let l;
913
- t[4] === r ? l = t[5] : (l = /* @__PURE__ */ R(w, {
908
+ t[4] === r ? l = t[5] : (l = /* @__PURE__ */ R(S, {
914
909
  cursor: "move",
915
910
  justify: "space-between",
916
- children: [c, /* @__PURE__ */ L(ie, {
911
+ children: [c, /* @__PURE__ */ L(te, {
917
912
  size: "sm",
918
913
  onClick: (e) => {
919
914
  e.stopPropagation(), r();
@@ -921,24 +916,24 @@ function AIChatWindowContent(e) {
921
916
  })]
922
917
  }), t[4] = r, t[5] = l);
923
918
  let u;
924
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { content: S({ display: "contents" }) }, t[6] = u) : u = t[6];
919
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { content: C({ display: "contents" }) }, t[6] = u) : u = t[6];
925
920
  let d;
926
921
  t[7] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ L(ChatMessages, {}), t[7] = d) : d = t[7];
927
922
  let f, p;
928
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(g, {
923
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(h, {
929
924
  scrollbars: "y",
930
925
  w: "100%",
931
926
  flex: 1,
932
927
  mih: 250,
933
928
  mah: 350,
934
929
  classNames: u,
935
- children: /* @__PURE__ */ R(x, { children: [d, /* @__PURE__ */ L("div", {
930
+ children: /* @__PURE__ */ R(w, { children: [d, /* @__PURE__ */ L("div", {
936
931
  ref: i,
937
932
  style: { height: 2 }
938
933
  })] })
939
934
  }), p = /* @__PURE__ */ L(ChatInput, {}), t[8] = f, t[9] = p) : (f = t[8], p = t[9]);
940
935
  let m;
941
- t[10] === l ? m = t[11] : (m = /* @__PURE__ */ R(x, {
936
+ t[10] === l ? m = t[11] : (m = /* @__PURE__ */ R(w, {
942
937
  w: "100%",
943
938
  children: [
944
939
  l,
@@ -946,11 +941,11 @@ function AIChatWindowContent(e) {
946
941
  p
947
942
  ]
948
943
  }), t[10] = l, t[11] = m);
949
- let h;
950
- return t[12] !== s || t[13] !== m ? (h = /* @__PURE__ */ L(B, {
944
+ let g;
945
+ return t[12] !== s || t[13] !== m ? (g = /* @__PURE__ */ L(z, {
951
946
  value: s,
952
947
  children: m
953
- }), t[12] = s, t[13] = m, t[14] = h) : h = t[14], h;
948
+ }), t[12] = s, t[13] = m, t[14] = g) : g = t[14], g;
954
949
  }
955
950
  //#endregion
956
951
  export { AIChatComponent as default };