likec4 1.56.0 → 1.57.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 (154) hide show
  1. package/__app__/chunks/AIChat2.mjs +2 -0
  2. package/__app__/chunks/DiagramActorProvider.mjs +4 -4
  3. package/__app__/chunks/EmbedPage.mjs +1 -0
  4. package/__app__/chunks/ExportPage.mjs +2 -0
  5. package/__app__/chunks/LikeC4Diagram.mjs +5 -5
  6. package/__app__/chunks/LikeC4Styles.mjs +11 -11
  7. package/__app__/chunks/Markdown.mjs +1 -0
  8. package/__app__/chunks/NavigationPanel.mjs +1 -1
  9. package/__app__/chunks/ViewReact.mjs +1 -1
  10. package/__app__/chunks/adhoc-editor.mjs +1 -1
  11. package/__app__/chunks/aichat.mjs +1 -0
  12. package/__app__/chunks/box.mjs +1 -0
  13. package/__app__/chunks/create-style-context.mjs +1 -0
  14. package/__app__/chunks/css.mjs +1 -0
  15. package/__app__/chunks/factory.mjs +1 -0
  16. package/__app__/chunks/hooks.mjs +1 -1
  17. package/__app__/chunks/hstack.mjs +1 -0
  18. package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -1
  19. package/__app__/chunks/libs/@floating-ui/core.mjs +1 -1
  20. package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -1
  21. package/__app__/chunks/libs/@floating-ui/react.mjs +1 -1
  22. package/__app__/chunks/libs/@mantine/core.mjs +24 -24
  23. package/__app__/chunks/libs/@mantine/hooks.mjs +1 -1
  24. package/__app__/chunks/libs/@nanostores/react.mjs +1 -1
  25. package/__app__/chunks/libs/@react-hookz/web.mjs +1 -1
  26. package/__app__/chunks/libs/@tabler/icons-react.mjs +347 -4
  27. package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
  28. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
  29. package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
  30. package/__app__/chunks/libs/@tanstack/ai.mjs +2 -0
  31. package/__app__/chunks/libs/@tanstack/history.mjs +1 -1
  32. package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -3
  33. package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -1
  34. package/__app__/chunks/libs/@xstate/react.mjs +1 -1
  35. package/__app__/chunks/libs/@xstate/store.mjs +1 -1
  36. package/__app__/chunks/libs/@xyflow/react.mjs +3 -3
  37. package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -1
  38. package/__app__/chunks/libs/@zag-js/collection.mjs +1 -1
  39. package/__app__/chunks/libs/@zag-js/core.mjs +1 -1
  40. package/__app__/chunks/libs/@zag-js/react.mjs +1 -1
  41. package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -1
  42. package/__app__/chunks/libs/bezier-js.mjs +1 -1
  43. package/__app__/chunks/libs/copy-anything.mjs +1 -0
  44. package/__app__/chunks/libs/d3-path.mjs +1 -1
  45. package/__app__/chunks/libs/d3-shape.mjs +1 -1
  46. package/__app__/chunks/libs/fast-equals.mjs +1 -1
  47. package/__app__/chunks/libs/framer-motion.mjs +3 -3
  48. package/__app__/chunks/libs/html-to-image.mjs +2 -2
  49. package/__app__/chunks/libs/motion-dom.mjs +1 -1
  50. package/__app__/chunks/libs/nanostores.mjs +1 -1
  51. package/__app__/chunks/libs/react-error-boundary.mjs +1 -1
  52. package/__app__/chunks/libs/react-resizable-panels.mjs +1 -1
  53. package/__app__/chunks/libs/remeda.mjs +1 -1
  54. package/__app__/chunks/libs/superjson.mjs +1 -0
  55. package/__app__/chunks/libs/zod.mjs +39 -14
  56. package/__app__/chunks/rolldown-runtime.mjs +1 -1
  57. package/__app__/chunks/styles.css.mjs +1 -1
  58. package/__app__/chunks/txt.mjs +1 -0
  59. package/__app__/chunks/useLikeC4Project.mjs +1 -1
  60. package/__app__/codegen/webcomponent.mjs +221 -69
  61. package/__app__/src/aichat/index.mjs +1 -0
  62. package/__app__/src/main.mjs +45 -1
  63. package/__app__/src/pages/AdHocViewEditor.mjs +1 -1
  64. package/__app__/src/pages/EmbedPage.mjs +1 -1
  65. package/__app__/src/pages/ExportPage.mjs +1 -1
  66. package/__app__/src/pages/ProjectsOverview.mjs +1 -1
  67. package/__app__/src/pages/ViewAsD2.mjs +1 -1
  68. package/__app__/src/pages/ViewAsDot.mjs +1 -1
  69. package/__app__/src/pages/ViewAsMmd.mjs +1 -1
  70. package/__app__/src/pages/ViewAsPuml.mjs +1 -1
  71. package/__app__/src/pages/ViewEditor.mjs +1 -1
  72. package/__app__/src/style.css +1 -1
  73. package/config/schema.json +14 -41
  74. package/dist/chunks/enableServer.mjs +1 -0
  75. package/dist/chunks/index2.d.mts +569 -377
  76. package/dist/chunks/libs/@hono/mcp.mjs +33 -8
  77. package/dist/chunks/libs/@hono/node-server.mjs +1 -1
  78. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +7 -7
  79. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  80. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  81. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  82. package/dist/chunks/libs/ajv.mjs +1 -1
  83. package/dist/chunks/libs/ansi-styles.mjs +1 -1
  84. package/dist/chunks/libs/boxen.mjs +2 -2
  85. package/dist/chunks/libs/chevrotain.mjs +2 -2
  86. package/dist/chunks/libs/conf.mjs +1 -1
  87. package/dist/chunks/libs/langium.d.mts +5 -5
  88. package/dist/chunks/libs/langium.mjs +10 -10
  89. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  90. package/dist/chunks/libs/pako.mjs +3 -1
  91. package/dist/chunks/libs/remeda.mjs +1 -1
  92. package/dist/chunks/libs/ts-graphviz.mjs +1 -4
  93. package/dist/chunks/libs/unctx.mjs +1 -0
  94. package/dist/chunks/libs/vscode-languageserver.mjs +1 -1
  95. package/dist/chunks/libs/zod.d.mts +60 -25
  96. package/dist/chunks/node.mjs +62 -45
  97. package/dist/chunks/plugin.mjs +234 -41
  98. package/dist/chunks/sequence-view.mjs +1 -1
  99. package/dist/cli/index.mjs +142 -139
  100. package/dist/index.d.mts +1 -130
  101. package/dist/model/index.d.mts +1 -1
  102. package/dist/vite-plugin/index.d.mts +53 -2
  103. package/dist/vite-plugin/internal/index.d.mts +331 -3
  104. package/dist/vite-plugin/internal/index.mjs +1 -1
  105. package/package.json +65 -51
  106. package/react/index.d.mts +82 -50
  107. package/react/index.mjs +34017 -32421
  108. package/vite-plugin-modules.d.ts +4 -0
  109. package/__app__/chunks/ColorSchemeToggle.mjs +0 -1
  110. package/__app__/chunks/Fallback.mjs +0 -1
  111. package/__app__/chunks/Header.mjs +0 -13
  112. package/__app__/chunks/IconRenderer.mjs +0 -1
  113. package/__app__/chunks/LikeC4ModelContext.mjs +0 -1
  114. package/__app__/chunks/LikeC4ModelContext2.mjs +0 -1
  115. package/__app__/chunks/StaticLikeC4Diagram.mjs +0 -1
  116. package/__app__/chunks/__root.mjs +0 -1
  117. package/__app__/chunks/libs/motion.mjs +0 -1
  118. package/__app__/chunks/libs/xstate.mjs +0 -1
  119. package/__app__/chunks/safeCtx.mjs +0 -1
  120. package/__app__/chunks/searchParams.mjs +0 -1
  121. package/__app__/chunks/single-index.mjs +0 -1
  122. package/__app__/chunks/styled-system.mjs +0 -1
  123. package/__app__/chunks/useUpdateEffect.mjs +0 -1
  124. package/__app__/src/routeTree.gen.mjs +0 -1
  125. package/__app__/src/routes/__root.mjs +0 -1
  126. package/__app__/src/routes/_single/adhoc.mjs +0 -1
  127. package/__app__/src/routes/_single/embed._viewId.mjs +0 -1
  128. package/__app__/src/routes/_single/export._viewId.mjs +0 -1
  129. package/__app__/src/routes/_single/route.mjs +0 -1
  130. package/__app__/src/routes/_single/single-index.mjs +0 -1
  131. package/__app__/src/routes/_single/view._viewId.d2.mjs +0 -1
  132. package/__app__/src/routes/_single/view._viewId.dot.mjs +0 -1
  133. package/__app__/src/routes/_single/view._viewId.index.mjs +0 -1
  134. package/__app__/src/routes/_single/view._viewId.mjs +0 -1
  135. package/__app__/src/routes/_single/view._viewId.mmd.mjs +0 -1
  136. package/__app__/src/routes/_single/view._viewId.puml.mjs +0 -1
  137. package/__app__/src/routes/_single/webcomponent._.mjs +0 -33
  138. package/__app__/src/routes/index.mjs +0 -1
  139. package/__app__/src/routes/project._projectId/-components.mjs +0 -1
  140. package/__app__/src/routes/project._projectId/adhoc.mjs +0 -1
  141. package/__app__/src/routes/project._projectId/embed._viewId.mjs +0 -1
  142. package/__app__/src/routes/project._projectId/export._viewId.mjs +0 -1
  143. package/__app__/src/routes/project._projectId/index.mjs +0 -1
  144. package/__app__/src/routes/project._projectId/route.mjs +0 -1
  145. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +0 -1
  146. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +0 -1
  147. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +0 -1
  148. package/__app__/src/routes/project._projectId/view._viewId.mjs +0 -1
  149. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +0 -1
  150. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +0 -1
  151. package/__app__/src/routes/projects.mjs +0 -1
  152. package/dist/chunks/libs/ts-graphviz.d.mts +0 -12
  153. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.d.mts +0 -269
  154. package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +0 -59
@@ -3,9 +3,8 @@ import { ComponentName } from "likec4:app-config";
3
3
  import { createRoot } from "react-dom/client";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
7
- /** A special constant with type `never` */
8
- const NEVER = Object.freeze({ status: "aborted" });
6
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
7
+ var _a;
9
8
  function $constructor(name, initializer, params) {
10
9
  function init(inst, def) {
11
10
  if (!inst._zod) Object.defineProperty(inst, "_zod", {
@@ -50,14 +49,15 @@ var $ZodAsyncError = class extends Error {
50
49
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
51
50
  }
52
51
  };
53
- const globalConfig = {};
52
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
53
+ const globalConfig = globalThis.__zod_globalConfig;
54
54
  function config(newConfig) {
55
55
  if (newConfig) Object.assign(globalConfig, newConfig);
56
56
  return globalConfig;
57
57
  }
58
58
 
59
59
  //#endregion
60
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
60
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
61
61
  function jsonStringifyReplacer(_, value) {
62
62
  if (typeof value === "bigint") return value.toString();
63
63
  return value;
@@ -77,7 +77,7 @@ function cleanRegex(source) {
77
77
  const end = source.endsWith("$") ? source.length - 1 : source.length;
78
78
  return source.slice(start, end);
79
79
  }
80
- const EVALUATING = Symbol("evaluating");
80
+ const EVALUATING = /* @__PURE__ */ Symbol("evaluating");
81
81
  function defineLazy(object, key, getter) {
82
82
  let value = void 0;
83
83
  Object.defineProperty(object, key, {
@@ -99,15 +99,6 @@ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace
99
99
  function isObject(data) {
100
100
  return typeof data === "object" && data !== null && !Array.isArray(data);
101
101
  }
102
- const allowsEval = cached(() => {
103
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
104
- try {
105
- new Function("");
106
- return true;
107
- } catch (_) {
108
- return false;
109
- }
110
- });
111
102
  function isPlainObject(o) {
112
103
  if (isObject(o) === false) return false;
113
104
  const ctor = o.constructor;
@@ -121,6 +112,8 @@ function isPlainObject(o) {
121
112
  function shallowClone(o) {
122
113
  if (isPlainObject(o)) return { ...o };
123
114
  if (Array.isArray(o)) return [...o];
115
+ if (o instanceof Map) return new Map(o);
116
+ if (o instanceof Set) return new Set(o);
124
117
  return o;
125
118
  }
126
119
  function escapeRegex(str) {
@@ -163,6 +156,11 @@ function aborted(x, startIndex = 0) {
163
156
  for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
164
157
  return false;
165
158
  }
159
+ function explicitlyAborted(x, startIndex = 0) {
160
+ if (x.aborted === true) return true;
161
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
162
+ return false;
163
+ }
166
164
  function prefixIssues(path, issues) {
167
165
  return issues.map((iss) => {
168
166
  var _a;
@@ -175,19 +173,16 @@ function unwrapMessage(message) {
175
173
  return typeof message === "string" ? message : message?.message;
176
174
  }
177
175
  function finalizeIssue(iss, ctx, config) {
178
- const full = {
179
- ...iss,
180
- path: iss.path ?? []
181
- };
182
- if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
183
- delete full.inst;
184
- delete full.continue;
185
- if (!ctx?.reportInput) delete full.input;
186
- return full;
176
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
177
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
178
+ rest.path ?? (rest.path = []);
179
+ rest.message = message;
180
+ if (ctx?.reportInput) rest.input = _input;
181
+ return rest;
187
182
  }
188
183
 
189
184
  //#endregion
190
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
185
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
191
186
  const initializer = (inst, def) => {
192
187
  inst.name = "$ZodError";
193
188
  Object.defineProperty(inst, "_zod", {
@@ -208,9 +203,12 @@ const $ZodError = $constructor("$ZodError", initializer);
208
203
  const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
209
204
 
210
205
  //#endregion
211
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
206
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
212
207
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
213
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
208
+ const ctx = _ctx ? {
209
+ ..._ctx,
210
+ async: false
211
+ } : { async: false };
214
212
  const result = schema._zod.run({
215
213
  value,
216
214
  issues: []
@@ -225,7 +223,10 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
225
223
  };
226
224
  const parse = /* @__PURE__ */ _parse($ZodRealError);
227
225
  const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
228
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
226
+ const ctx = _ctx ? {
227
+ ..._ctx,
228
+ async: true
229
+ } : { async: true };
229
230
  let result = schema._zod.run({
230
231
  value,
231
232
  issues: []
@@ -259,7 +260,10 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
259
260
  };
260
261
  const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
261
262
  const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
262
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
263
+ const ctx = _ctx ? {
264
+ ..._ctx,
265
+ async: true
266
+ } : { async: true };
263
267
  let result = schema._zod.run({
264
268
  value,
265
269
  issues: []
@@ -276,25 +280,25 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
276
280
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
277
281
 
278
282
  //#endregion
279
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
283
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
280
284
  const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
281
285
  const date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
282
286
  const string$1 = (params) => {
283
287
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
284
288
  return new RegExp(`^${regex}$`);
285
289
  };
286
- const boolean$1 = /^(?:true|false)$/i;
290
+ const boolean = /^(?:true|false)$/i;
287
291
 
288
292
  //#endregion
289
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
293
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
290
294
  const version = {
291
295
  major: 4,
292
- minor: 3,
293
- patch: 6
296
+ minor: 4,
297
+ patch: 3
294
298
  };
295
299
 
296
300
  //#endregion
297
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
301
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
298
302
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
299
303
  var _a;
300
304
  inst ?? (inst = {});
@@ -315,6 +319,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
315
319
  let asyncResult;
316
320
  for (const ch of checks) {
317
321
  if (ch._zod.def.when) {
322
+ if (explicitlyAborted(payload)) continue;
318
323
  if (!ch._zod.def.when(payload)) continue;
319
324
  } else if (isAborted) continue;
320
325
  const currLen = payload.issues.length;
@@ -402,7 +407,7 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
402
407
  });
403
408
  const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
404
409
  $ZodType.init(inst, def);
405
- inst._zod.pattern = boolean$1;
410
+ inst._zod.pattern = boolean;
406
411
  inst._zod.parse = (payload, _ctx) => {
407
412
  if (def.coerce) try {
408
413
  payload.value = Boolean(payload.value);
@@ -418,13 +423,23 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
418
423
  return payload;
419
424
  };
420
425
  });
421
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
426
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
427
+ const isPresent = key in input;
422
428
  if (result.issues.length) {
423
- if (isOptionalOut && !(key in input)) return;
429
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
424
430
  final.issues.push(...prefixIssues(key, result.issues));
425
431
  }
432
+ if (!isPresent && !isOptionalIn) {
433
+ if (!result.issues.length) final.issues.push({
434
+ code: "invalid_type",
435
+ expected: "nonoptional",
436
+ input: void 0,
437
+ path: [key]
438
+ });
439
+ return;
440
+ }
426
441
  if (result.value === void 0) {
427
- if (key in input) final.value[key] = void 0;
442
+ if (isPresent) final.value[key] = void 0;
428
443
  } else final.value[key] = result.value;
429
444
  }
430
445
  function normalizeDef(def) {
@@ -444,8 +459,10 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
444
459
  const keySet = def.keySet;
445
460
  const _catchall = def.catchall._zod;
446
461
  const t = _catchall.def.type;
462
+ const isOptionalIn = _catchall.optin === "optional";
447
463
  const isOptionalOut = _catchall.optout === "optional";
448
464
  for (const key in input) {
465
+ if (key === "__proto__") continue;
449
466
  if (keySet.has(key)) continue;
450
467
  if (t === "never") {
451
468
  unrecognized.push(key);
@@ -455,8 +472,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
455
472
  value: input[key],
456
473
  issues: []
457
474
  }, ctx);
458
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
459
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
475
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
476
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
460
477
  }
461
478
  if (unrecognized.length) payload.issues.push({
462
479
  code: "unrecognized_keys",
@@ -492,13 +509,13 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
492
509
  }
493
510
  return propValues;
494
511
  });
495
- const isObject$2 = isObject;
512
+ const isObject$1 = isObject;
496
513
  const catchall = def.catchall;
497
514
  let value;
498
515
  inst._zod.parse = (payload, ctx) => {
499
516
  value ?? (value = _normalized.value);
500
517
  const input = payload.value;
501
- if (!isObject$2(input)) {
518
+ if (!isObject$1(input)) {
502
519
  payload.issues.push({
503
520
  expected: "object",
504
521
  code: "invalid_type",
@@ -512,13 +529,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
512
529
  const shape = value.shape;
513
530
  for (const key of value.keys) {
514
531
  const el = shape[key];
532
+ const isOptionalIn = el._zod.optin === "optional";
515
533
  const isOptionalOut = el._zod.optout === "optional";
516
534
  const r = el._zod.run({
517
535
  value: input[key],
518
536
  issues: []
519
537
  }, ctx);
520
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
521
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
538
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
539
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
522
540
  }
523
541
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
524
542
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
@@ -543,7 +561,7 @@ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
543
561
  };
544
562
  });
545
563
  function handleOptionalResult(result, input) {
546
- if (result.issues.length && input === void 0) return {
564
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
547
565
  issues: [],
548
566
  value: void 0
549
567
  };
@@ -562,9 +580,10 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
562
580
  });
563
581
  inst._zod.parse = (payload, ctx) => {
564
582
  if (def.innerType._zod.optin === "optional") {
583
+ const input = payload.value;
565
584
  const result = def.innerType._zod.run(payload, ctx);
566
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
567
- return handleOptionalResult(result, payload.value);
585
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
586
+ return handleOptionalResult(result, input);
568
587
  }
569
588
  if (payload.value === void 0) return payload;
570
589
  return def.innerType._zod.run(payload, ctx);
@@ -592,9 +611,80 @@ function handleDefaultResult(payload, def) {
592
611
  if (payload.value === void 0) payload.value = def.defaultValue;
593
612
  return payload;
594
613
  }
614
+ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
615
+ $ZodType.init(inst, def);
616
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
617
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
618
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
619
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
620
+ inst._zod.parse = (payload, ctx) => {
621
+ if (ctx.direction === "backward") {
622
+ const right = def.out._zod.run(payload, ctx);
623
+ if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
624
+ return handlePipeResult(right, def.in, ctx);
625
+ }
626
+ const left = def.in._zod.run(payload, ctx);
627
+ if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
628
+ return handlePipeResult(left, def.out, ctx);
629
+ };
630
+ });
631
+ function handlePipeResult(left, next, ctx) {
632
+ if (left.issues.length) {
633
+ left.aborted = true;
634
+ return left;
635
+ }
636
+ return next._zod.run({
637
+ value: left.value,
638
+ issues: left.issues,
639
+ fallback: left.fallback
640
+ }, ctx);
641
+ }
642
+ const $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
643
+ $ZodType.init(inst, def);
644
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
645
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
646
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
647
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
648
+ inst._zod.parse = (payload, ctx) => {
649
+ if ((ctx.direction || "forward") === "forward") {
650
+ const left = def.in._zod.run(payload, ctx);
651
+ if (left instanceof Promise) return left.then((left) => handleCodecAResult(left, def, ctx));
652
+ return handleCodecAResult(left, def, ctx);
653
+ } else {
654
+ const right = def.out._zod.run(payload, ctx);
655
+ if (right instanceof Promise) return right.then((right) => handleCodecAResult(right, def, ctx));
656
+ return handleCodecAResult(right, def, ctx);
657
+ }
658
+ };
659
+ });
660
+ function handleCodecAResult(result, def, ctx) {
661
+ if (result.issues.length) {
662
+ result.aborted = true;
663
+ return result;
664
+ }
665
+ if ((ctx.direction || "forward") === "forward") {
666
+ const transformed = def.transform(result.value, result);
667
+ if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
668
+ return handleCodecTxResult(result, transformed, def.out, ctx);
669
+ } else {
670
+ const transformed = def.reverseTransform(result.value, result);
671
+ if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
672
+ return handleCodecTxResult(result, transformed, def.in, ctx);
673
+ }
674
+ }
675
+ function handleCodecTxResult(left, value, nextSchema, ctx) {
676
+ if (left.issues.length) {
677
+ left.aborted = true;
678
+ return left;
679
+ }
680
+ return nextSchema._zod.run({
681
+ value,
682
+ issues: left.issues
683
+ }, ctx);
684
+ }
595
685
 
596
686
  //#endregion
597
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
687
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
598
688
  /* @__NO_SIDE_EFFECTS__ */
599
689
  function _string(Class, params) {
600
690
  return new Class({
@@ -603,15 +693,70 @@ function _string(Class, params) {
603
693
  });
604
694
  }
605
695
  /* @__NO_SIDE_EFFECTS__ */
606
- function _boolean(Class, params) {
607
- return new Class({
608
- type: "boolean",
609
- ...normalizeParams(params)
696
+ function _stringbool(Classes, _params) {
697
+ const params = normalizeParams(_params);
698
+ let truthyArray = params.truthy ?? [
699
+ "true",
700
+ "1",
701
+ "yes",
702
+ "on",
703
+ "y",
704
+ "enabled"
705
+ ];
706
+ let falsyArray = params.falsy ?? [
707
+ "false",
708
+ "0",
709
+ "no",
710
+ "off",
711
+ "n",
712
+ "disabled"
713
+ ];
714
+ if (params.case !== "sensitive") {
715
+ truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
716
+ falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
717
+ }
718
+ const truthySet = new Set(truthyArray);
719
+ const falsySet = new Set(falsyArray);
720
+ const _Codec = Classes.Codec ?? $ZodCodec;
721
+ const _Boolean = Classes.Boolean ?? $ZodBoolean;
722
+ const codec = new _Codec({
723
+ type: "pipe",
724
+ in: new (Classes.String ?? $ZodString)({
725
+ type: "string",
726
+ error: params.error
727
+ }),
728
+ out: new _Boolean({
729
+ type: "boolean",
730
+ error: params.error
731
+ }),
732
+ transform: ((input, payload) => {
733
+ let data = input;
734
+ if (params.case !== "sensitive") data = data.toLowerCase();
735
+ if (truthySet.has(data)) return true;
736
+ else if (falsySet.has(data)) return false;
737
+ else {
738
+ payload.issues.push({
739
+ code: "invalid_value",
740
+ expected: "stringbool",
741
+ values: [...truthySet, ...falsySet],
742
+ input: payload.value,
743
+ inst: codec,
744
+ continue: false
745
+ });
746
+ return {};
747
+ }
748
+ }),
749
+ reverseTransform: ((input, _payload) => {
750
+ if (input === true) return truthyArray[0] || "true";
751
+ else return falsyArray[0] || "false";
752
+ }),
753
+ error: params.error
610
754
  });
755
+ return codec;
611
756
  }
612
757
 
613
758
  //#endregion
614
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js
759
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
615
760
  const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
616
761
  if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
617
762
  $ZodType.init(inst, def);
@@ -652,10 +797,6 @@ const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def
652
797
  $ZodBoolean.init(inst, def);
653
798
  ZodMiniType.init(inst, def);
654
799
  });
655
- /* @__NO_SIDE_EFFECTS__ */
656
- function boolean(params) {
657
- return _boolean(ZodMiniBoolean, params);
658
- }
659
800
  const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
660
801
  $ZodObject.init(inst, def);
661
802
  ZodMiniType.init(inst, def);
@@ -706,13 +847,27 @@ function _default(innerType, defaultValue) {
706
847
  }
707
848
  });
708
849
  }
850
+ const ZodMiniPipe = /* @__PURE__ */ $constructor("ZodMiniPipe", (inst, def) => {
851
+ $ZodPipe.init(inst, def);
852
+ ZodMiniType.init(inst, def);
853
+ });
854
+ const ZodMiniCodec = /* @__PURE__ */ $constructor("ZodMiniCodec", (inst, def) => {
855
+ ZodMiniPipe.init(inst, def);
856
+ $ZodCodec.init(inst, def);
857
+ });
858
+ const stringbool = (...args) => _stringbool({
859
+ Codec: ZodMiniCodec,
860
+ Boolean: ZodMiniBoolean,
861
+ String: ZodMiniString
862
+ }, ...args);
709
863
 
710
864
  //#endregion
711
865
  //#region codegen/webcomponent.tsx
712
866
  const propsSchema = /* @__PURE__ */ object({
713
867
  viewId: /* @__PURE__ */ _default(/* @__PURE__ */ string(), "index"),
714
- browser: /* @__PURE__ */ _default(/* @__PURE__ */ boolean(), true),
715
- dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"]))
868
+ browser: /* @__PURE__ */ _default(stringbool(), true),
869
+ dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"])),
870
+ colorScheme: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["light", "dark"]))
716
871
  });
717
872
  var LikeC4View = class extends HTMLElement {
718
873
  shadow;
@@ -729,14 +884,9 @@ var LikeC4View = class extends HTMLElement {
729
884
  updateHostCss() {
730
885
  const hostCss = `
731
886
  :host {
732
- display: block;
733
- position: relative;
887
+ display: contents;
734
888
  background-color: transparent;
735
- width: 100%;
736
- height: 100%;
737
- box-sizing: border-box;
738
- overflow: hidden;
739
- border: 0px solid transparent;
889
+ margin: 0;
740
890
  padding: 0;
741
891
  }`;
742
892
  if (hostCss !== this.lastHostCss) {
@@ -760,13 +910,15 @@ var LikeC4View = class extends HTMLElement {
760
910
  static observedAttributes = [
761
911
  "view-id",
762
912
  "browser",
763
- "dynamic-variant"
913
+ "dynamic-variant",
914
+ "color-scheme"
764
915
  ];
765
916
  getProps() {
766
917
  const props = propsSchema.safeParse({
767
918
  viewId: this.getAttribute("view-id"),
768
919
  browser: this.getAttribute("browser") ?? void 0,
769
- dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0
920
+ dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0,
921
+ colorScheme: this.getAttribute("color-scheme") ?? void 0
770
922
  });
771
923
  if (!props.success) {
772
924
  console.error("Invalid props", props.error);
@@ -0,0 +1 @@
1
+ import{n as e,t}from"../../chunks/aichat.mjs";export{t as AIChat,e as SemanticLayoutLog};