likec4 1.56.0 → 1.58.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 (207) hide show
  1. package/__app__/codegen/react.mjs +7 -8
  2. package/__app__/codegen/webcomponent.mjs +77 -736
  3. package/__app__/src/aichat/index.mjs +8 -0
  4. package/__app__/src/chunks/AIChat.mjs +959 -0
  5. package/__app__/src/chunks/DiagramActorProvider.mjs +7638 -0
  6. package/__app__/src/chunks/LikeC4Styles.mjs +1866 -0
  7. package/__app__/src/chunks/Markdown.mjs +146 -0
  8. package/__app__/src/chunks/NavigationPanel.mjs +61 -0
  9. package/__app__/src/chunks/ProjectsOverview.mjs +540 -0
  10. package/__app__/src/chunks/adhoc-editor.mjs +3386 -0
  11. package/__app__/src/chunks/es.mjs +439 -0
  12. package/__app__/src/chunks/hooks.mjs +145 -0
  13. package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +1894 -0
  14. package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
  15. package/__app__/src/chunks/libs/@mantine.mjs +12070 -0
  16. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +252 -0
  17. package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
  18. package/__app__/src/chunks/libs/@tanstack.mjs +2718 -0
  19. package/__app__/src/chunks/libs/@xstate/react.mjs +1982 -0
  20. package/__app__/src/chunks/libs/@xyflow/react.mjs +5256 -0
  21. package/__app__/src/chunks/libs/bezier-js.mjs +1003 -0
  22. package/__app__/src/chunks/libs/d3.mjs +2842 -0
  23. package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
  24. package/__app__/src/chunks/libs/framer.mjs +5872 -0
  25. package/__app__/src/chunks/libs/remeda.mjs +642 -0
  26. package/__app__/src/chunks/libs/zod.mjs +3170 -0
  27. package/__app__/src/chunks/rolldown-runtime.mjs +23 -0
  28. package/__app__/src/chunks/styled-system.mjs +1040 -0
  29. package/__app__/src/fonts.css +1 -1
  30. package/__app__/src/main.mjs +14847 -1
  31. package/__app__/src/style.css +1 -1
  32. package/config/schema.json +14 -41
  33. package/dist/chunks/enableServer.mjs +1 -0
  34. package/dist/chunks/filenames.mjs +2 -2
  35. package/dist/chunks/index2.d.mts +2057 -722
  36. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  37. package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
  38. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  39. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  40. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  41. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  42. package/dist/chunks/libs/chevrotain.mjs +26 -26
  43. package/dist/chunks/libs/langium.d.mts +5 -5
  44. package/dist/chunks/libs/langium.mjs +10 -10
  45. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  46. package/dist/chunks/libs/pako.mjs +3 -1
  47. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  48. package/dist/chunks/libs/remeda.mjs +1 -1
  49. package/dist/chunks/libs/ufo.mjs +1 -1
  50. package/dist/chunks/libs/unstorage.mjs +1 -1
  51. package/dist/chunks/libs/which.mjs +1 -1
  52. package/dist/chunks/libs/zod.d.mts +60 -25
  53. package/dist/chunks/libs/zod.mjs +65 -0
  54. package/dist/chunks/node.mjs +84 -56
  55. package/dist/chunks/sequence-view.mjs +1 -1
  56. package/dist/chunks/vite-plugin.mjs +593 -0
  57. package/dist/cli/index.mjs +184 -141
  58. package/dist/index.d.mts +2 -131
  59. package/dist/index.mjs +1 -1
  60. package/dist/model/index.d.mts +2 -2
  61. package/dist/vite-plugin/index.d.mts +53 -2
  62. package/dist/vite-plugin/index.mjs +1 -1
  63. package/dist/vite-plugin/internal/index.d.mts +327 -4
  64. package/dist/vite-plugin/internal/index.mjs +946 -1
  65. package/package.json +85 -72
  66. package/react/index.d.mts +174 -73
  67. package/react/index.mjs +42468 -38926
  68. package/vite-plugin-modules.d.ts +4 -0
  69. package/__app__/chunks/ColorSchemeToggle.mjs +0 -1
  70. package/__app__/chunks/DiagramActorProvider.mjs +0 -10
  71. package/__app__/chunks/Fallback.mjs +0 -1
  72. package/__app__/chunks/Header.mjs +0 -13
  73. package/__app__/chunks/IconRenderer.mjs +0 -1
  74. package/__app__/chunks/LikeC4Diagram.mjs +0 -19
  75. package/__app__/chunks/LikeC4ModelContext.mjs +0 -1
  76. package/__app__/chunks/LikeC4ModelContext2.mjs +0 -1
  77. package/__app__/chunks/LikeC4Styles.mjs +0 -48
  78. package/__app__/chunks/NavigationPanel.mjs +0 -1
  79. package/__app__/chunks/StaticLikeC4Diagram.mjs +0 -1
  80. package/__app__/chunks/ViewReact.mjs +0 -1
  81. package/__app__/chunks/__root.mjs +0 -1
  82. package/__app__/chunks/adhoc-editor.mjs +0 -1
  83. package/__app__/chunks/hooks.mjs +0 -1
  84. package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
  85. package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
  86. package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
  87. package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
  88. package/__app__/chunks/libs/@mantine/core.mjs +0 -41
  89. package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
  90. package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
  91. package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
  92. package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -15
  93. package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
  94. package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
  95. package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
  96. package/__app__/chunks/libs/@xstate/react.mjs +0 -1
  97. package/__app__/chunks/libs/@xstate/store.mjs +0 -1
  98. package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
  99. package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
  100. package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
  101. package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
  102. package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
  103. package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
  104. package/__app__/chunks/libs/bezier-js.mjs +0 -1
  105. package/__app__/chunks/libs/d3-path.mjs +0 -1
  106. package/__app__/chunks/libs/d3-shape.mjs +0 -1
  107. package/__app__/chunks/libs/fast-equals.mjs +0 -1
  108. package/__app__/chunks/libs/framer-motion.mjs +0 -9
  109. package/__app__/chunks/libs/html-to-image.mjs +0 -2
  110. package/__app__/chunks/libs/motion-dom.mjs +0 -1
  111. package/__app__/chunks/libs/motion.mjs +0 -1
  112. package/__app__/chunks/libs/nanostores.mjs +0 -1
  113. package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
  114. package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
  115. package/__app__/chunks/libs/remeda.mjs +0 -1
  116. package/__app__/chunks/libs/xstate.mjs +0 -1
  117. package/__app__/chunks/libs/zod.mjs +0 -39
  118. package/__app__/chunks/rolldown-runtime.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/styles.css.mjs +0 -1
  124. package/__app__/chunks/useLikeC4Project.mjs +0 -1
  125. package/__app__/chunks/useUpdateEffect.mjs +0 -1
  126. package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
  127. package/__app__/src/pages/EmbedPage.mjs +0 -1
  128. package/__app__/src/pages/ExportPage.mjs +0 -1
  129. package/__app__/src/pages/ProjectsOverview.mjs +0 -1
  130. package/__app__/src/pages/ViewAsD2.mjs +0 -1
  131. package/__app__/src/pages/ViewAsDot.mjs +0 -1
  132. package/__app__/src/pages/ViewAsMmd.mjs +0 -1
  133. package/__app__/src/pages/ViewAsPuml.mjs +0 -1
  134. package/__app__/src/pages/ViewEditor.mjs +0 -1
  135. package/__app__/src/pages/ViewReact.mjs +0 -1
  136. package/__app__/src/routeTree.gen.mjs +0 -1
  137. package/__app__/src/routes/__root.mjs +0 -1
  138. package/__app__/src/routes/_single/adhoc.mjs +0 -1
  139. package/__app__/src/routes/_single/embed._viewId.mjs +0 -1
  140. package/__app__/src/routes/_single/export._viewId.mjs +0 -1
  141. package/__app__/src/routes/_single/route.mjs +0 -1
  142. package/__app__/src/routes/_single/single-index.mjs +0 -1
  143. package/__app__/src/routes/_single/view._viewId.d2.mjs +0 -1
  144. package/__app__/src/routes/_single/view._viewId.dot.mjs +0 -1
  145. package/__app__/src/routes/_single/view._viewId.index.mjs +0 -1
  146. package/__app__/src/routes/_single/view._viewId.mjs +0 -1
  147. package/__app__/src/routes/_single/view._viewId.mmd.mjs +0 -1
  148. package/__app__/src/routes/_single/view._viewId.puml.mjs +0 -1
  149. package/__app__/src/routes/_single/webcomponent._.mjs +0 -33
  150. package/__app__/src/routes/index.mjs +0 -1
  151. package/__app__/src/routes/project._projectId/-components.mjs +0 -1
  152. package/__app__/src/routes/project._projectId/adhoc.mjs +0 -1
  153. package/__app__/src/routes/project._projectId/embed._viewId.mjs +0 -1
  154. package/__app__/src/routes/project._projectId/export._viewId.mjs +0 -1
  155. package/__app__/src/routes/project._projectId/index.mjs +0 -1
  156. package/__app__/src/routes/project._projectId/route.mjs +0 -1
  157. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +0 -1
  158. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +0 -1
  159. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +0 -1
  160. package/__app__/src/routes/project._projectId/view._viewId.mjs +0 -1
  161. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +0 -1
  162. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +0 -1
  163. package/__app__/src/routes/projects.mjs +0 -1
  164. package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
  165. package/dist/chunks/libs/@hono/mcp.mjs +0 -45
  166. package/dist/chunks/libs/@hono/node-server.mjs +0 -1
  167. package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
  168. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  169. package/dist/chunks/libs/ajv.mjs +0 -1
  170. package/dist/chunks/libs/ansi-align.mjs +0 -2
  171. package/dist/chunks/libs/ansi-regex.mjs +0 -1
  172. package/dist/chunks/libs/ansi-styles.mjs +0 -1
  173. package/dist/chunks/libs/atomically.mjs +0 -1
  174. package/dist/chunks/libs/boxen.mjs +0 -22
  175. package/dist/chunks/libs/conf.mjs +0 -1
  176. package/dist/chunks/libs/defu.mjs +0 -1
  177. package/dist/chunks/libs/destr.mjs +0 -1
  178. package/dist/chunks/libs/find-up-simple.mjs +0 -1
  179. package/dist/chunks/libs/get-port.mjs +0 -1
  180. package/dist/chunks/libs/hono.mjs +0 -1
  181. package/dist/chunks/libs/is-docker.mjs +0 -1
  182. package/dist/chunks/libs/is-error-instance.mjs +0 -1
  183. package/dist/chunks/libs/is-inside-container.mjs +0 -1
  184. package/dist/chunks/libs/is-plain-obj.mjs +0 -1
  185. package/dist/chunks/libs/isexe.mjs +0 -1
  186. package/dist/chunks/libs/ky.mjs +0 -3
  187. package/dist/chunks/libs/p-debounce.mjs +0 -1
  188. package/dist/chunks/libs/p-limit.mjs +0 -1
  189. package/dist/chunks/libs/p-timeout.mjs +0 -1
  190. package/dist/chunks/libs/package-up.mjs +0 -1
  191. package/dist/chunks/libs/parse-ms.mjs +0 -1
  192. package/dist/chunks/libs/safe-stringify.mjs +0 -1
  193. package/dist/chunks/libs/strip-indent.mjs +0 -1
  194. package/dist/chunks/libs/tinyrainbow.mjs +0 -1
  195. package/dist/chunks/libs/ts-graphviz.d.mts +0 -12
  196. package/dist/chunks/libs/ts-graphviz.mjs +0 -4
  197. package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
  198. package/dist/chunks/libs/word-wrap.mjs +0 -12
  199. package/dist/chunks/plugin.mjs +0 -400
  200. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.d.mts +0 -269
  201. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
  202. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
  203. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
  204. package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +0 -59
  205. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
  206. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
  207. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
@@ -1,790 +1,131 @@
1
- import { LikeC4View as LikeC4View$1 } from "likec4:react";
2
- import { ComponentName } from "likec4:app-config";
3
- import { createRoot } from "react-dom/client";
4
- import { jsx } from "react/jsx-runtime";
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" });
9
- function $constructor(name, initializer, params) {
10
- function init(inst, def) {
11
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
12
- value: {
13
- def,
14
- constr: _,
15
- traits: /* @__PURE__ */ new Set()
16
- },
17
- enumerable: false
18
- });
19
- if (inst._zod.traits.has(name)) return;
20
- inst._zod.traits.add(name);
21
- initializer(inst, def);
22
- const proto = _.prototype;
23
- const keys = Object.keys(proto);
24
- for (let i = 0; i < keys.length; i++) {
25
- const k = keys[i];
26
- if (!(k in inst)) inst[k] = proto[k].bind(inst);
27
- }
28
- }
29
- const Parent = params?.Parent ?? Object;
30
- class Definition extends Parent {}
31
- Object.defineProperty(Definition, "name", { value: name });
32
- function _(def) {
33
- var _a;
34
- const inst = params?.Parent ? new Definition() : this;
35
- init(inst, def);
36
- (_a = inst._zod).deferred ?? (_a.deferred = []);
37
- for (const fn of inst._zod.deferred) fn();
38
- return inst;
39
- }
40
- Object.defineProperty(_, "init", { value: init });
41
- Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
42
- if (params?.Parent && inst instanceof params.Parent) return true;
43
- return inst?._zod?.traits?.has(name);
44
- } });
45
- Object.defineProperty(_, "name", { value: name });
46
- return _;
47
- }
48
- var $ZodAsyncError = class extends Error {
49
- constructor() {
50
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
51
- }
52
- };
53
- const globalConfig = {};
54
- function config(newConfig) {
55
- if (newConfig) Object.assign(globalConfig, newConfig);
56
- return globalConfig;
57
- }
58
-
59
- //#endregion
60
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
61
- function jsonStringifyReplacer(_, value) {
62
- if (typeof value === "bigint") return value.toString();
63
- return value;
64
- }
65
- function cached(getter) {
66
- return { get value() {
67
- {
68
- const value = getter();
69
- Object.defineProperty(this, "value", { value });
70
- return value;
71
- }
72
- throw new Error("cached value already set");
73
- } };
74
- }
75
- function cleanRegex(source) {
76
- const start = source.startsWith("^") ? 1 : 0;
77
- const end = source.endsWith("$") ? source.length - 1 : source.length;
78
- return source.slice(start, end);
79
- }
80
- const EVALUATING = Symbol("evaluating");
81
- function defineLazy(object, key, getter) {
82
- let value = void 0;
83
- Object.defineProperty(object, key, {
84
- get() {
85
- if (value === EVALUATING) return;
86
- if (value === void 0) {
87
- value = EVALUATING;
88
- value = getter();
89
- }
90
- return value;
91
- },
92
- set(v) {
93
- Object.defineProperty(object, key, { value: v });
94
- },
95
- configurable: true
96
- });
97
- }
98
- const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
99
- function isObject(data) {
100
- return typeof data === "object" && data !== null && !Array.isArray(data);
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
- function isPlainObject(o) {
112
- if (isObject(o) === false) return false;
113
- const ctor = o.constructor;
114
- if (ctor === void 0) return true;
115
- if (typeof ctor !== "function") return true;
116
- const prot = ctor.prototype;
117
- if (isObject(prot) === false) return false;
118
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
119
- return true;
120
- }
121
- function shallowClone(o) {
122
- if (isPlainObject(o)) return { ...o };
123
- if (Array.isArray(o)) return [...o];
124
- return o;
125
- }
126
- function escapeRegex(str) {
127
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
128
- }
129
- function clone(inst, def, params) {
130
- const cl = new inst._zod.constr(def ?? inst._zod.def);
131
- if (!def || params?.parent) cl._zod.parent = inst;
132
- return cl;
133
- }
134
- function normalizeParams(_params) {
135
- const params = _params;
136
- if (!params) return {};
137
- if (typeof params === "string") return { error: () => params };
138
- if (params?.message !== void 0) {
139
- if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
140
- params.error = params.message;
141
- }
142
- delete params.message;
143
- if (typeof params.error === "string") return {
144
- ...params,
145
- error: () => params.error
146
- };
147
- return params;
148
- }
149
- function optionalKeys(shape) {
150
- return Object.keys(shape).filter((k) => {
151
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
152
- });
153
- }
154
- const NUMBER_FORMAT_RANGES = {
155
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
156
- int32: [-2147483648, 2147483647],
157
- uint32: [0, 4294967295],
158
- float32: [-34028234663852886e22, 34028234663852886e22],
159
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
160
- };
161
- function aborted(x, startIndex = 0) {
162
- if (x.aborted === true) return true;
163
- for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
164
- return false;
165
- }
166
- function prefixIssues(path, issues) {
167
- return issues.map((iss) => {
168
- var _a;
169
- (_a = iss).path ?? (_a.path = []);
170
- iss.path.unshift(path);
171
- return iss;
172
- });
173
- }
174
- function unwrapMessage(message) {
175
- return typeof message === "string" ? message : message?.message;
176
- }
177
- 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;
187
- }
188
-
189
- //#endregion
190
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
191
- const initializer = (inst, def) => {
192
- inst.name = "$ZodError";
193
- Object.defineProperty(inst, "_zod", {
194
- value: inst._zod,
195
- enumerable: false
196
- });
197
- Object.defineProperty(inst, "issues", {
198
- value: def,
199
- enumerable: false
200
- });
201
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
202
- Object.defineProperty(inst, "toString", {
203
- value: () => inst.message,
204
- enumerable: false
205
- });
206
- };
207
- const $ZodError = $constructor("$ZodError", initializer);
208
- const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
209
-
210
- //#endregion
211
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
212
- const _parse = (_Err) => (schema, value, _ctx, _params) => {
213
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
214
- const result = schema._zod.run({
215
- value,
216
- issues: []
217
- }, ctx);
218
- if (result instanceof Promise) throw new $ZodAsyncError();
219
- if (result.issues.length) {
220
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
221
- captureStackTrace(e, _params?.callee);
222
- throw e;
223
- }
224
- return result.value;
225
- };
226
- const parse = /* @__PURE__ */ _parse($ZodRealError);
227
- const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
228
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
229
- let result = schema._zod.run({
230
- value,
231
- issues: []
232
- }, ctx);
233
- if (result instanceof Promise) result = await result;
234
- if (result.issues.length) {
235
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
236
- captureStackTrace(e, params?.callee);
237
- throw e;
238
- }
239
- return result.value;
240
- };
241
- const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
242
- const _safeParse = (_Err) => (schema, value, _ctx) => {
243
- const ctx = _ctx ? {
244
- ..._ctx,
245
- async: false
246
- } : { async: false };
247
- const result = schema._zod.run({
248
- value,
249
- issues: []
250
- }, ctx);
251
- if (result instanceof Promise) throw new $ZodAsyncError();
252
- return result.issues.length ? {
253
- success: false,
254
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
255
- } : {
256
- success: true,
257
- data: result.value
258
- };
259
- };
260
- const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
261
- const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
262
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
263
- let result = schema._zod.run({
264
- value,
265
- issues: []
266
- }, ctx);
267
- if (result instanceof Promise) result = await result;
268
- return result.issues.length ? {
269
- success: false,
270
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
271
- } : {
272
- success: true,
273
- data: result.value
274
- };
275
- };
276
- const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
277
-
278
- //#endregion
279
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
280
- 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
- const date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
282
- const string$1 = (params) => {
283
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
284
- return new RegExp(`^${regex}$`);
285
- };
286
- const boolean$1 = /^(?:true|false)$/i;
287
-
288
- //#endregion
289
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
290
- const version = {
291
- major: 4,
292
- minor: 3,
293
- patch: 6
294
- };
295
-
296
- //#endregion
297
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
298
- const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
299
- var _a;
300
- inst ?? (inst = {});
301
- inst._zod.def = def;
302
- inst._zod.bag = inst._zod.bag || {};
303
- inst._zod.version = version;
304
- const checks = [...inst._zod.def.checks ?? []];
305
- if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
306
- for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
307
- if (checks.length === 0) {
308
- (_a = inst._zod).deferred ?? (_a.deferred = []);
309
- inst._zod.deferred?.push(() => {
310
- inst._zod.run = inst._zod.parse;
311
- });
312
- } else {
313
- const runChecks = (payload, checks, ctx) => {
314
- let isAborted = aborted(payload);
315
- let asyncResult;
316
- for (const ch of checks) {
317
- if (ch._zod.def.when) {
318
- if (!ch._zod.def.when(payload)) continue;
319
- } else if (isAborted) continue;
320
- const currLen = payload.issues.length;
321
- const _ = ch._zod.check(payload);
322
- if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
323
- if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
324
- await _;
325
- if (payload.issues.length === currLen) return;
326
- if (!isAborted) isAborted = aborted(payload, currLen);
327
- });
328
- else {
329
- if (payload.issues.length === currLen) continue;
330
- if (!isAborted) isAborted = aborted(payload, currLen);
331
- }
332
- }
333
- if (asyncResult) return asyncResult.then(() => {
334
- return payload;
335
- });
336
- return payload;
337
- };
338
- const handleCanaryResult = (canary, payload, ctx) => {
339
- if (aborted(canary)) {
340
- canary.aborted = true;
341
- return canary;
342
- }
343
- const checkResult = runChecks(payload, checks, ctx);
344
- if (checkResult instanceof Promise) {
345
- if (ctx.async === false) throw new $ZodAsyncError();
346
- return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
347
- }
348
- return inst._zod.parse(checkResult, ctx);
349
- };
350
- inst._zod.run = (payload, ctx) => {
351
- if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
352
- if (ctx.direction === "backward") {
353
- const canary = inst._zod.parse({
354
- value: payload.value,
355
- issues: []
356
- }, {
357
- ...ctx,
358
- skipChecks: true
359
- });
360
- if (canary instanceof Promise) return canary.then((canary) => {
361
- return handleCanaryResult(canary, payload, ctx);
362
- });
363
- return handleCanaryResult(canary, payload, ctx);
364
- }
365
- const result = inst._zod.parse(payload, ctx);
366
- if (result instanceof Promise) {
367
- if (ctx.async === false) throw new $ZodAsyncError();
368
- return result.then((result) => runChecks(result, checks, ctx));
369
- }
370
- return runChecks(result, checks, ctx);
371
- };
372
- }
373
- defineLazy(inst, "~standard", () => ({
374
- validate: (value) => {
375
- try {
376
- const r = safeParse(inst, value);
377
- return r.success ? { value: r.data } : { issues: r.error?.issues };
378
- } catch (_) {
379
- return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
380
- }
381
- },
382
- vendor: "zod",
383
- version: 1
384
- }));
385
- });
386
- const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
387
- $ZodType.init(inst, def);
388
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
389
- inst._zod.parse = (payload, _) => {
390
- if (def.coerce) try {
391
- payload.value = String(payload.value);
392
- } catch (_) {}
393
- if (typeof payload.value === "string") return payload;
394
- payload.issues.push({
395
- expected: "string",
396
- code: "invalid_type",
397
- input: payload.value,
398
- inst
399
- });
400
- return payload;
401
- };
402
- });
403
- const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
404
- $ZodType.init(inst, def);
405
- inst._zod.pattern = boolean$1;
406
- inst._zod.parse = (payload, _ctx) => {
407
- if (def.coerce) try {
408
- payload.value = Boolean(payload.value);
409
- } catch (_) {}
410
- const input = payload.value;
411
- if (typeof input === "boolean") return payload;
412
- payload.issues.push({
413
- expected: "boolean",
414
- code: "invalid_type",
415
- input,
416
- inst
417
- });
418
- return payload;
419
- };
420
- });
421
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
422
- if (result.issues.length) {
423
- if (isOptionalOut && !(key in input)) return;
424
- final.issues.push(...prefixIssues(key, result.issues));
425
- }
426
- if (result.value === void 0) {
427
- if (key in input) final.value[key] = void 0;
428
- } else final.value[key] = result.value;
429
- }
430
- function normalizeDef(def) {
431
- const keys = Object.keys(def.shape);
432
- for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
433
- const okeys = optionalKeys(def.shape);
434
- return {
435
- ...def,
436
- keys,
437
- keySet: new Set(keys),
438
- numKeys: keys.length,
439
- optionalKeys: new Set(okeys)
440
- };
441
- }
442
- function handleCatchall(proms, input, payload, ctx, def, inst) {
443
- const unrecognized = [];
444
- const keySet = def.keySet;
445
- const _catchall = def.catchall._zod;
446
- const t = _catchall.def.type;
447
- const isOptionalOut = _catchall.optout === "optional";
448
- for (const key in input) {
449
- if (keySet.has(key)) continue;
450
- if (t === "never") {
451
- unrecognized.push(key);
452
- continue;
453
- }
454
- const r = _catchall.run({
455
- value: input[key],
456
- issues: []
457
- }, 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);
460
- }
461
- if (unrecognized.length) payload.issues.push({
462
- code: "unrecognized_keys",
463
- keys: unrecognized,
464
- input,
465
- inst
466
- });
467
- if (!proms.length) return payload;
468
- return Promise.all(proms).then(() => {
469
- return payload;
470
- });
471
- }
472
- const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
473
- $ZodType.init(inst, def);
474
- if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
475
- const sh = def.shape;
476
- Object.defineProperty(def, "shape", { get: () => {
477
- const newSh = { ...sh };
478
- Object.defineProperty(def, "shape", { value: newSh });
479
- return newSh;
480
- } });
481
- }
482
- const _normalized = cached(() => normalizeDef(def));
483
- defineLazy(inst._zod, "propValues", () => {
484
- const shape = def.shape;
485
- const propValues = {};
486
- for (const key in shape) {
487
- const field = shape[key]._zod;
488
- if (field.values) {
489
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
490
- for (const v of field.values) propValues[key].add(v);
491
- }
492
- }
493
- return propValues;
494
- });
495
- const isObject$2 = isObject;
496
- const catchall = def.catchall;
497
- let value;
498
- inst._zod.parse = (payload, ctx) => {
499
- value ?? (value = _normalized.value);
500
- const input = payload.value;
501
- if (!isObject$2(input)) {
502
- payload.issues.push({
503
- expected: "object",
504
- code: "invalid_type",
505
- input,
506
- inst
507
- });
508
- return payload;
509
- }
510
- payload.value = {};
511
- const proms = [];
512
- const shape = value.shape;
513
- for (const key of value.keys) {
514
- const el = shape[key];
515
- const isOptionalOut = el._zod.optout === "optional";
516
- const r = el._zod.run({
517
- value: input[key],
518
- issues: []
519
- }, 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);
522
- }
523
- if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
524
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
525
- };
526
- });
527
- const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
528
- $ZodType.init(inst, def);
529
- if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
530
- const values = new Set(def.values);
531
- inst._zod.values = values;
532
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
533
- inst._zod.parse = (payload, _ctx) => {
534
- const input = payload.value;
535
- if (values.has(input)) return payload;
536
- payload.issues.push({
537
- code: "invalid_value",
538
- values: def.values,
539
- input,
540
- inst
541
- });
542
- return payload;
543
- };
544
- });
545
- function handleOptionalResult(result, input) {
546
- if (result.issues.length && input === void 0) return {
547
- issues: [],
548
- value: void 0
549
- };
550
- return result;
551
- }
552
- const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
553
- $ZodType.init(inst, def);
554
- inst._zod.optin = "optional";
555
- inst._zod.optout = "optional";
556
- defineLazy(inst._zod, "values", () => {
557
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
558
- });
559
- defineLazy(inst._zod, "pattern", () => {
560
- const pattern = def.innerType._zod.pattern;
561
- return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
562
- });
563
- inst._zod.parse = (payload, ctx) => {
564
- if (def.innerType._zod.optin === "optional") {
565
- 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);
568
- }
569
- if (payload.value === void 0) return payload;
570
- return def.innerType._zod.run(payload, ctx);
571
- };
572
- });
573
- const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
574
- $ZodType.init(inst, def);
575
- inst._zod.optin = "optional";
576
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
577
- inst._zod.parse = (payload, ctx) => {
578
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
579
- if (payload.value === void 0) {
580
- payload.value = def.defaultValue;
581
- /**
582
- * $ZodDefault returns the default value immediately in forward direction.
583
- * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
584
- return payload;
585
- }
586
- const result = def.innerType._zod.run(payload, ctx);
587
- if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
588
- return handleDefaultResult(result, def);
589
- };
590
- });
591
- function handleDefaultResult(payload, def) {
592
- if (payload.value === void 0) payload.value = def.defaultValue;
593
- return payload;
594
- }
595
-
596
- //#endregion
597
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
598
- /* @__NO_SIDE_EFFECTS__ */
599
- function _string(Class, params) {
600
- return new Class({
601
- type: "string",
602
- ...normalizeParams(params)
603
- });
604
- }
605
- /* @__NO_SIDE_EFFECTS__ */
606
- function _boolean(Class, params) {
607
- return new Class({
608
- type: "boolean",
609
- ...normalizeParams(params)
610
- });
611
- }
612
-
613
- //#endregion
614
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js
615
- const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
616
- if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
617
- $ZodType.init(inst, def);
618
- inst.def = def;
619
- inst.type = def.type;
620
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
621
- inst.safeParse = (data, params) => safeParse(inst, data, params);
622
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
623
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
624
- inst.check = (...checks) => {
625
- return inst.clone({
626
- ...def,
627
- checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
628
- check: ch,
629
- def: { check: "custom" },
630
- onattach: []
631
- } } : ch)]
632
- }, { parent: true });
633
- };
634
- inst.with = inst.check;
635
- inst.clone = (_def, params) => clone(inst, _def, params);
636
- inst.brand = () => inst;
637
- inst.register = ((reg, meta) => {
638
- reg.add(inst, meta);
639
- return inst;
640
- });
641
- inst.apply = (fn) => fn(inst);
642
- });
643
- const ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
644
- $ZodString.init(inst, def);
645
- ZodMiniType.init(inst, def);
646
- });
647
- /* @__NO_SIDE_EFFECTS__ */
648
- function string(params) {
649
- return _string(ZodMiniString, params);
650
- }
651
- const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
652
- $ZodBoolean.init(inst, def);
653
- ZodMiniType.init(inst, def);
1
+ import "../src/chunks/rolldown-runtime.mjs";
2
+ import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, b as s, d as c, f as l, g as u, h as d, l as f, m as p, p as m, u as h, v as g, w as _, x as v, y } from "../src/chunks/libs/zod.mjs";
3
+ import { createRoot as b } from "react-dom/client";
4
+ import { jsx as x } from "react/jsx-runtime";
5
+ import { ComponentName as S } from "likec4:app-config";
6
+ import { LikeC4View as C } from "likec4:react";
7
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
8
+ var w = /* @__PURE__ */ r("ZodMiniType", (t, n) => {
9
+ if (!t._zod) throw Error("Uninitialized schema in ZodMiniType.");
10
+ y.init(t, n), t.def = n, t.type = n.type, t.parse = (e, n) => s(t, e, n, { callee: t.parse }), t.safeParse = (e, n) => i(t, e, n), t.parseAsync = async (e, n) => v(t, e, n, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => e(t, n, r), t.check = (...e) => t.clone({
11
+ ...n,
12
+ checks: [...n.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
13
+ check: e,
14
+ def: { check: "custom" },
15
+ onattach: []
16
+ } } : e)]
17
+ }, { parent: !0 }), t.with = t.check, t.clone = (e, n) => _(t, e, n), t.brand = () => t, t.register = ((e, n) => (e.add(t, n), t)), t.apply = (e) => e(t);
18
+ }), T = /* @__PURE__ */ r("ZodMiniString", (e, t) => {
19
+ g.init(e, t), w.init(e, t);
654
20
  });
655
21
  /* @__NO_SIDE_EFFECTS__ */
656
- function boolean(params) {
657
- return _boolean(ZodMiniBoolean, params);
22
+ function string(e) {
23
+ return f(T, e);
658
24
  }
659
- const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
660
- $ZodObject.init(inst, def);
661
- ZodMiniType.init(inst, def);
662
- defineLazy(inst, "shape", () => def.shape);
25
+ var E = /* @__PURE__ */ r("ZodMiniBoolean", (e, t) => {
26
+ c.init(e, t), w.init(e, t);
27
+ }), D = /* @__PURE__ */ r("ZodMiniObject", (e, t) => {
28
+ d.init(e, t), w.init(e, t), a(e, "shape", () => t.shape);
663
29
  });
664
30
  /* @__NO_SIDE_EFFECTS__ */
665
- function object(shape, params) {
666
- return new ZodMiniObject({
31
+ function object(e, t) {
32
+ return new D({
667
33
  type: "object",
668
- shape: shape ?? {},
669
- ...normalizeParams(params)
34
+ shape: e ?? {},
35
+ ...n(t)
670
36
  });
671
37
  }
672
- const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
673
- $ZodLiteral.init(inst, def);
674
- ZodMiniType.init(inst, def);
38
+ var O = /* @__PURE__ */ r("ZodMiniLiteral", (e, t) => {
39
+ p.init(e, t), w.init(e, t);
675
40
  });
676
41
  /* @__NO_SIDE_EFFECTS__ */
677
- function literal(value, params) {
678
- return new ZodMiniLiteral({
42
+ function literal(e, t) {
43
+ return new O({
679
44
  type: "literal",
680
- values: Array.isArray(value) ? value : [value],
681
- ...normalizeParams(params)
45
+ values: Array.isArray(e) ? e : [e],
46
+ ...n(t)
682
47
  });
683
48
  }
684
- const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
685
- $ZodOptional.init(inst, def);
686
- ZodMiniType.init(inst, def);
49
+ var k = /* @__PURE__ */ r("ZodMiniOptional", (e, t) => {
50
+ u.init(e, t), w.init(e, t);
687
51
  });
688
52
  /* @__NO_SIDE_EFFECTS__ */
689
- function optional(innerType) {
690
- return new ZodMiniOptional({
53
+ function optional(e) {
54
+ return new k({
691
55
  type: "optional",
692
- innerType
56
+ innerType: e
693
57
  });
694
58
  }
695
- const ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
696
- $ZodDefault.init(inst, def);
697
- ZodMiniType.init(inst, def);
59
+ var A = /* @__PURE__ */ r("ZodMiniDefault", (e, t) => {
60
+ m.init(e, t), w.init(e, t);
698
61
  });
699
62
  /* @__NO_SIDE_EFFECTS__ */
700
- function _default(innerType, defaultValue) {
701
- return new ZodMiniDefault({
63
+ function _default(e, n) {
64
+ return new A({
702
65
  type: "default",
703
- innerType,
66
+ innerType: e,
704
67
  get defaultValue() {
705
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
68
+ return typeof n == "function" ? n() : t(n);
706
69
  }
707
70
  });
708
71
  }
709
-
710
- //#endregion
711
- //#region codegen/webcomponent.tsx
712
- const propsSchema = /* @__PURE__ */ object({
72
+ var j = /* @__PURE__ */ r("ZodMiniPipe", (e, t) => {
73
+ o.init(e, t), w.init(e, t);
74
+ }), M = /* @__PURE__ */ r("ZodMiniCodec", (e, t) => {
75
+ j.init(e, t), l.init(e, t);
76
+ }), stringbool = (...e) => h({
77
+ Codec: M,
78
+ Boolean: E,
79
+ String: T
80
+ }, ...e), N = /* @__PURE__ */ object({
713
81
  viewId: /* @__PURE__ */ _default(/* @__PURE__ */ string(), "index"),
714
- browser: /* @__PURE__ */ _default(/* @__PURE__ */ boolean(), true),
715
- dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"]))
716
- });
717
- var LikeC4View = class extends HTMLElement {
82
+ browser: /* @__PURE__ */ _default(stringbool(), !0),
83
+ dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"])),
84
+ colorScheme: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["light", "dark"]))
85
+ }), LikeC4View = class extends HTMLElement {
718
86
  shadow;
719
87
  root;
720
88
  hostCss;
721
89
  lastHostCss = "";
722
90
  constructor() {
723
- super();
724
- this.shadow = this.attachShadow({
91
+ super(), this.shadow = this.attachShadow({
725
92
  mode: "open",
726
- delegatesFocus: true
93
+ delegatesFocus: !0
727
94
  });
728
95
  }
729
96
  updateHostCss() {
730
- const hostCss = `
731
- :host {
732
- display: block;
733
- position: relative;
734
- background-color: transparent;
735
- width: 100%;
736
- height: 100%;
737
- box-sizing: border-box;
738
- overflow: hidden;
739
- border: 0px solid transparent;
740
- padding: 0;
741
- }`;
742
- if (hostCss !== this.lastHostCss) {
743
- this.hostCss?.replaceSync(hostCss);
744
- this.lastHostCss = hostCss;
745
- }
97
+ let e = "\n :host {\n display: contents;\n background-color: transparent;\n margin: 0;\n padding: 0;\n }";
98
+ e !== this.lastHostCss && (this.hostCss?.replaceSync(e), this.lastHostCss = e);
746
99
  }
747
100
  connectedCallback() {
748
- this.lastHostCss = "";
749
- this.hostCss = new CSSStyleSheet();
750
- this.updateHostCss();
751
- this.shadow.adoptedStyleSheets = [this.hostCss];
752
- this.render();
101
+ this.lastHostCss = "", this.hostCss = new CSSStyleSheet(), this.updateHostCss(), this.shadow.adoptedStyleSheets = [this.hostCss], this.render();
753
102
  }
754
103
  disconnectedCallback() {
755
- this.root?.unmount();
756
- this.root = void 0;
757
- this.shadow.adoptedStyleSheets.length = 0;
758
- this.hostCss = void 0;
104
+ this.root?.unmount(), this.root = void 0, this.shadow.adoptedStyleSheets.length = 0, this.hostCss = void 0;
759
105
  }
760
106
  static observedAttributes = [
761
107
  "view-id",
762
108
  "browser",
763
- "dynamic-variant"
109
+ "dynamic-variant",
110
+ "color-scheme"
764
111
  ];
765
112
  getProps() {
766
- const props = propsSchema.safeParse({
113
+ let e = N.safeParse({
767
114
  viewId: this.getAttribute("view-id"),
768
115
  browser: this.getAttribute("browser") ?? void 0,
769
- dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0
116
+ dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0,
117
+ colorScheme: this.getAttribute("color-scheme") ?? void 0
770
118
  });
771
- if (!props.success) {
772
- console.error("Invalid props", props.error);
773
- return { viewId: "index" };
774
- }
775
- return props.data;
119
+ return e.success ? e.data : (console.error("Invalid props", e.error), { viewId: "index" });
776
120
  }
777
121
  render() {
778
- const props = this.getProps();
779
- this.updateHostCss();
780
- this.root ??= createRoot(this.shadow);
781
- this.root.render(/* @__PURE__ */ jsx(LikeC4View$1, { ...props }));
122
+ let e = this.getProps();
123
+ this.updateHostCss(), this.root ??= b(this.shadow), this.root.render(/* @__PURE__ */ x(C, { ...e }));
782
124
  }
783
- attributeChangedCallback(_name) {
784
- if (this.root) this.render();
125
+ attributeChangedCallback(e) {
126
+ this.root && this.render();
785
127
  }
786
128
  };
787
- customElements.define(ComponentName.View, LikeC4View);
788
-
129
+ customElements.define(S.View, LikeC4View);
789
130
  //#endregion
790
- export { LikeC4View };
131
+ export { LikeC4View };