likec4 1.55.1 → 1.56.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.
- package/__app__/chunks/ColorSchemeToggle.mjs +1 -0
- package/__app__/chunks/DiagramActorProvider.mjs +10 -0
- package/__app__/chunks/Fallback.mjs +1 -0
- package/__app__/chunks/Header.mjs +13 -0
- package/__app__/chunks/IconRenderer.mjs +1 -0
- package/__app__/chunks/LikeC4Diagram.mjs +19 -0
- package/__app__/chunks/LikeC4ModelContext.mjs +1 -0
- package/__app__/chunks/LikeC4ModelContext2.mjs +1 -0
- package/__app__/chunks/LikeC4Styles.mjs +48 -0
- package/__app__/chunks/NavigationPanel.mjs +1 -0
- package/__app__/chunks/StaticLikeC4Diagram.mjs +1 -0
- package/__app__/chunks/ViewReact.mjs +1 -0
- package/__app__/chunks/__root.mjs +1 -0
- package/__app__/chunks/adhoc-editor.mjs +1 -0
- package/__app__/chunks/hooks.mjs +1 -0
- package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/core.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -0
- package/__app__/chunks/libs/@floating-ui/react.mjs +1 -0
- package/__app__/chunks/libs/@mantine/core.mjs +41 -0
- package/__app__/chunks/libs/@mantine/hooks.mjs +1 -0
- package/__app__/chunks/libs/@nanostores/react.mjs +1 -0
- package/__app__/chunks/libs/@react-hookz/web.mjs +1 -0
- package/__app__/chunks/libs/@tabler/icons-react.mjs +15 -0
- package/__app__/chunks/libs/@tanstack/history.mjs +1 -0
- package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -0
- package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -0
- package/__app__/chunks/libs/@xstate/react.mjs +1 -0
- package/__app__/chunks/libs/@xstate/store.mjs +1 -0
- package/__app__/chunks/libs/@xyflow/react.mjs +7 -0
- package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/collection.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/core.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/react.mjs +1 -0
- package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -0
- package/__app__/chunks/libs/bezier-js.mjs +1 -0
- package/__app__/chunks/libs/d3-path.mjs +1 -0
- package/__app__/chunks/libs/d3-shape.mjs +1 -0
- package/__app__/chunks/libs/fast-equals.mjs +1 -0
- package/__app__/chunks/libs/framer-motion.mjs +9 -0
- package/__app__/chunks/libs/html-to-image.mjs +2 -0
- package/__app__/chunks/libs/motion-dom.mjs +1 -0
- package/__app__/chunks/libs/motion.mjs +1 -0
- package/__app__/chunks/libs/nanostores.mjs +1 -0
- package/__app__/chunks/libs/react-error-boundary.mjs +1 -0
- package/__app__/chunks/libs/react-resizable-panels.mjs +1 -0
- package/__app__/chunks/libs/remeda.mjs +1 -0
- package/__app__/chunks/libs/xstate.mjs +1 -0
- package/__app__/chunks/libs/zod.mjs +39 -0
- package/__app__/chunks/rolldown-runtime.mjs +1 -0
- package/__app__/chunks/safeCtx.mjs +1 -0
- package/__app__/chunks/searchParams.mjs +1 -0
- package/__app__/chunks/single-index.mjs +1 -0
- package/__app__/chunks/styled-system.mjs +1 -0
- package/__app__/chunks/styles.css.mjs +1 -0
- package/__app__/chunks/useLikeC4Project.mjs +1 -0
- package/__app__/chunks/useUpdateEffect.mjs +1 -0
- package/__app__/codegen/react.mjs +11 -0
- package/__app__/codegen/webcomponent.mjs +790 -0
- package/__app__/src/fonts.css +1 -1
- package/__app__/src/main.mjs +1 -0
- package/__app__/src/pages/AdHocViewEditor.mjs +1 -0
- package/__app__/src/pages/EmbedPage.mjs +1 -0
- package/__app__/src/pages/ExportPage.mjs +1 -0
- package/__app__/src/pages/ProjectsOverview.mjs +1 -0
- package/__app__/src/pages/ViewAsD2.mjs +1 -0
- package/__app__/src/pages/ViewAsDot.mjs +1 -0
- package/__app__/src/pages/ViewAsMmd.mjs +1 -0
- package/__app__/src/pages/ViewAsPuml.mjs +1 -0
- package/__app__/src/pages/ViewEditor.mjs +1 -0
- package/__app__/src/pages/ViewReact.mjs +1 -0
- package/__app__/src/routeTree.gen.mjs +1 -0
- package/__app__/src/routes/__root.mjs +1 -0
- package/__app__/src/routes/_single/adhoc.mjs +1 -0
- package/__app__/src/routes/_single/embed._viewId.mjs +1 -0
- package/__app__/src/routes/_single/export._viewId.mjs +1 -0
- package/__app__/src/routes/_single/route.mjs +1 -0
- package/__app__/src/routes/_single/single-index.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.d2.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.dot.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.index.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.mmd.mjs +1 -0
- package/__app__/src/routes/_single/view._viewId.puml.mjs +1 -0
- package/__app__/src/routes/_single/webcomponent._.mjs +33 -0
- package/__app__/src/routes/index.mjs +1 -0
- package/__app__/src/routes/project._projectId/-components.mjs +1 -0
- package/__app__/src/routes/project._projectId/adhoc.mjs +1 -0
- package/__app__/src/routes/project._projectId/embed._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/export._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/index.mjs +1 -0
- package/__app__/src/routes/project._projectId/route.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.index.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +1 -0
- package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +1 -0
- package/__app__/src/routes/projects.mjs +1 -0
- package/__app__/src/style.css +1 -1
- package/dist/chunks/filenames.mjs +17 -0
- package/dist/{_chunks → chunks}/index.d.mts +2 -1
- package/dist/{_chunks → chunks}/index2.d.mts +70 -11
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
- package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
- package/dist/chunks/libs/@hono/mcp.mjs +45 -0
- package/dist/chunks/libs/@hono/node-server.mjs +1 -0
- package/dist/{_chunks → chunks}/libs/@logtape/logtape.d.mts +2 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
- package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
- package/dist/chunks/libs/ajv.mjs +1 -0
- package/dist/chunks/libs/ansi-align.mjs +2 -0
- package/dist/chunks/libs/ansi-regex.mjs +1 -0
- package/dist/chunks/libs/ansi-styles.mjs +1 -0
- package/dist/chunks/libs/atomically.mjs +1 -0
- package/dist/chunks/libs/birpc.mjs +1 -0
- package/dist/chunks/libs/boxen.mjs +22 -0
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
- package/dist/chunks/libs/chevrotain.mjs +58 -0
- package/dist/chunks/libs/conf.mjs +1 -0
- package/dist/chunks/libs/defu.mjs +1 -0
- package/dist/chunks/libs/destr.mjs +1 -0
- package/dist/chunks/libs/eventemitter3.mjs +1 -0
- package/dist/chunks/libs/find-up-simple.mjs +1 -0
- package/dist/chunks/libs/get-port.mjs +1 -0
- package/dist/chunks/libs/hono.mjs +1 -0
- package/dist/chunks/libs/is-docker.mjs +1 -0
- package/dist/chunks/libs/is-error-instance.mjs +1 -0
- package/dist/chunks/libs/is-inside-container.mjs +1 -0
- package/dist/chunks/libs/is-plain-obj.mjs +1 -0
- package/dist/chunks/libs/isexe.mjs +1 -0
- package/dist/chunks/libs/json5.mjs +14 -0
- package/dist/chunks/libs/khroma.mjs +1 -0
- package/dist/chunks/libs/ky.mjs +3 -0
- package/dist/{_chunks → chunks}/libs/langium.d.mts +4 -4
- package/dist/chunks/libs/langium.mjs +32 -0
- package/dist/chunks/libs/merge-error-cause.mjs +2 -0
- package/dist/chunks/libs/p-debounce.mjs +1 -0
- package/dist/chunks/libs/p-limit.mjs +1 -0
- package/dist/chunks/libs/p-queue.mjs +1 -0
- package/dist/chunks/libs/p-timeout.mjs +1 -0
- package/dist/chunks/libs/package-manager-detector.mjs +1 -0
- package/dist/chunks/libs/package-up.mjs +1 -0
- package/dist/chunks/libs/pako.mjs +1 -0
- package/dist/chunks/libs/parse-ms.mjs +1 -0
- package/dist/chunks/libs/pathe.mjs +1 -0
- package/dist/chunks/libs/picomatch.mjs +1 -0
- package/dist/chunks/libs/pretty-ms.mjs +1 -0
- package/dist/chunks/libs/remeda.mjs +1 -0
- package/dist/chunks/libs/safe-stringify.mjs +1 -0
- package/dist/chunks/libs/strip-indent.mjs +1 -0
- package/dist/chunks/libs/tinyrainbow.mjs +1 -0
- package/dist/{_chunks → chunks}/libs/ts-graphviz.d.mts +2 -0
- package/dist/chunks/libs/ts-graphviz.mjs +4 -0
- package/dist/chunks/libs/ufo.mjs +1 -0
- package/dist/chunks/libs/unstorage.mjs +1 -0
- package/dist/chunks/libs/which.mjs +1 -0
- package/dist/chunks/libs/word-wrap.mjs +12 -0
- package/dist/{_chunks → chunks}/libs/zod.d.mts +2 -0
- package/dist/chunks/node.mjs +76 -0
- package/dist/chunks/plugin.mjs +400 -0
- package/dist/chunks/rolldown-runtime.mjs +1 -0
- package/dist/chunks/sequence-view.mjs +1 -0
- package/dist/cli/index.mjs +262 -136
- package/dist/config/index.d.mts +1 -2
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +4 -8
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +2 -1
- package/dist/model/index.mjs +1 -1
- package/dist/vite-plugin/index.d.mts +38 -8
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/{_chunks → vite-plugin/internal/chunks}/libs/@nanostores/react.d.mts +2 -56
- package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +59 -0
- package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +1 -0
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -0
- package/dist/vite-plugin/{internal.d.mts → internal/index.d.mts} +12 -3
- package/dist/vite-plugin/internal/index.mjs +1 -0
- package/package.json +35 -55
- package/react/index.d.mts +2 -28
- package/react/index.mjs +50520 -53863
- package/vite-plugin/internal/package.json +2 -2
- package/vite-plugin-modules.d.ts +14 -0
- package/__app__/react/likec4.tsx +0 -25
- package/__app__/src/ProjectsOverview.js +0 -16
- package/__app__/src/const.js +0 -19
- package/__app__/src/likec4.js +0 -21254
- package/__app__/src/main.js +0 -7
- package/__app__/src/routes/index.js +0 -324
- package/__app__/src/routes/projects.js +0 -193
- package/__app__/src/routes/single.js +0 -1983
- package/__app__/src/vendors.js +0 -52683
- package/__app__/src/webcomponent.js +0 -68
- package/dist/THIRD-PARTY-LICENSES.md +0 -1609
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
- package/dist/_chunks/libs/@chevrotain/types.d.mts +0 -1
- package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
- package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
- package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
- package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
- package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
- package/dist/_chunks/libs/@nanostores/react.mjs +0 -1
- package/dist/_chunks/libs/ajv.mjs +0 -1
- package/dist/_chunks/libs/ansi-align.mjs +0 -2
- package/dist/_chunks/libs/ansi-regex.mjs +0 -1
- package/dist/_chunks/libs/ansi-styles.mjs +0 -1
- package/dist/_chunks/libs/atomically.mjs +0 -1
- package/dist/_chunks/libs/birpc.mjs +0 -1
- package/dist/_chunks/libs/boxen.mjs +0 -22
- package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
- package/dist/_chunks/libs/chevrotain.mjs +0 -58
- package/dist/_chunks/libs/conf.mjs +0 -1
- package/dist/_chunks/libs/defu.mjs +0 -1
- package/dist/_chunks/libs/destr.mjs +0 -1
- package/dist/_chunks/libs/esm-env.mjs +0 -1
- package/dist/_chunks/libs/eventemitter3.mjs +0 -1
- package/dist/_chunks/libs/fast-equals.mjs +0 -1
- package/dist/_chunks/libs/find-up-simple.mjs +0 -1
- package/dist/_chunks/libs/get-port.mjs +0 -1
- package/dist/_chunks/libs/is-docker.mjs +0 -1
- package/dist/_chunks/libs/is-error-instance.mjs +0 -1
- package/dist/_chunks/libs/is-inside-container.mjs +0 -1
- package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
- package/dist/_chunks/libs/isexe.mjs +0 -1
- package/dist/_chunks/libs/json5.mjs +0 -14
- package/dist/_chunks/libs/khroma.mjs +0 -1
- package/dist/_chunks/libs/ky.mjs +0 -3
- package/dist/_chunks/libs/langium.mjs +0 -33
- package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
- package/dist/_chunks/libs/p-limit.mjs +0 -1
- package/dist/_chunks/libs/p-queue.mjs +0 -1
- package/dist/_chunks/libs/p-timeout.mjs +0 -1
- package/dist/_chunks/libs/package-manager-detector.mjs +0 -1
- package/dist/_chunks/libs/package-up.mjs +0 -1
- package/dist/_chunks/libs/pako.mjs +0 -1
- package/dist/_chunks/libs/parse-ms.mjs +0 -1
- package/dist/_chunks/libs/pathe.mjs +0 -1
- package/dist/_chunks/libs/picomatch.mjs +0 -1
- package/dist/_chunks/libs/pretty-ms.mjs +0 -1
- package/dist/_chunks/libs/remeda.mjs +0 -2
- package/dist/_chunks/libs/safe-stringify.mjs +0 -1
- package/dist/_chunks/libs/strip-indent.mjs +0 -1
- package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
- package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
- package/dist/_chunks/libs/ufo.mjs +0 -1
- package/dist/_chunks/libs/unstorage.mjs +0 -1
- package/dist/_chunks/libs/which.mjs +0 -1
- package/dist/_chunks/libs/word-wrap.mjs +0 -12
- package/dist/_chunks/node.mjs +0 -76
- package/dist/_chunks/rolldown-runtime.mjs +0 -1
- package/dist/_chunks/sequence.mjs +0 -1
- package/dist/_chunks/src.mjs +0 -17
- package/dist/_chunks/src2.mjs +0 -499
- package/dist/vite-plugin/internal.mjs +0 -1
- /package/dist/{_chunks → chunks}/libs/vscode-languageserver.mjs +0 -0
|
@@ -0,0 +1,790 @@
|
|
|
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);
|
|
654
|
+
});
|
|
655
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
656
|
+
function boolean(params) {
|
|
657
|
+
return _boolean(ZodMiniBoolean, params);
|
|
658
|
+
}
|
|
659
|
+
const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
660
|
+
$ZodObject.init(inst, def);
|
|
661
|
+
ZodMiniType.init(inst, def);
|
|
662
|
+
defineLazy(inst, "shape", () => def.shape);
|
|
663
|
+
});
|
|
664
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
665
|
+
function object(shape, params) {
|
|
666
|
+
return new ZodMiniObject({
|
|
667
|
+
type: "object",
|
|
668
|
+
shape: shape ?? {},
|
|
669
|
+
...normalizeParams(params)
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
673
|
+
$ZodLiteral.init(inst, def);
|
|
674
|
+
ZodMiniType.init(inst, def);
|
|
675
|
+
});
|
|
676
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
677
|
+
function literal(value, params) {
|
|
678
|
+
return new ZodMiniLiteral({
|
|
679
|
+
type: "literal",
|
|
680
|
+
values: Array.isArray(value) ? value : [value],
|
|
681
|
+
...normalizeParams(params)
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
685
|
+
$ZodOptional.init(inst, def);
|
|
686
|
+
ZodMiniType.init(inst, def);
|
|
687
|
+
});
|
|
688
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
689
|
+
function optional(innerType) {
|
|
690
|
+
return new ZodMiniOptional({
|
|
691
|
+
type: "optional",
|
|
692
|
+
innerType
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
const ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
|
|
696
|
+
$ZodDefault.init(inst, def);
|
|
697
|
+
ZodMiniType.init(inst, def);
|
|
698
|
+
});
|
|
699
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
700
|
+
function _default(innerType, defaultValue) {
|
|
701
|
+
return new ZodMiniDefault({
|
|
702
|
+
type: "default",
|
|
703
|
+
innerType,
|
|
704
|
+
get defaultValue() {
|
|
705
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region codegen/webcomponent.tsx
|
|
712
|
+
const propsSchema = /* @__PURE__ */ object({
|
|
713
|
+
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 {
|
|
718
|
+
shadow;
|
|
719
|
+
root;
|
|
720
|
+
hostCss;
|
|
721
|
+
lastHostCss = "";
|
|
722
|
+
constructor() {
|
|
723
|
+
super();
|
|
724
|
+
this.shadow = this.attachShadow({
|
|
725
|
+
mode: "open",
|
|
726
|
+
delegatesFocus: true
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
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
|
+
}
|
|
746
|
+
}
|
|
747
|
+
connectedCallback() {
|
|
748
|
+
this.lastHostCss = "";
|
|
749
|
+
this.hostCss = new CSSStyleSheet();
|
|
750
|
+
this.updateHostCss();
|
|
751
|
+
this.shadow.adoptedStyleSheets = [this.hostCss];
|
|
752
|
+
this.render();
|
|
753
|
+
}
|
|
754
|
+
disconnectedCallback() {
|
|
755
|
+
this.root?.unmount();
|
|
756
|
+
this.root = void 0;
|
|
757
|
+
this.shadow.adoptedStyleSheets.length = 0;
|
|
758
|
+
this.hostCss = void 0;
|
|
759
|
+
}
|
|
760
|
+
static observedAttributes = [
|
|
761
|
+
"view-id",
|
|
762
|
+
"browser",
|
|
763
|
+
"dynamic-variant"
|
|
764
|
+
];
|
|
765
|
+
getProps() {
|
|
766
|
+
const props = propsSchema.safeParse({
|
|
767
|
+
viewId: this.getAttribute("view-id"),
|
|
768
|
+
browser: this.getAttribute("browser") ?? void 0,
|
|
769
|
+
dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0
|
|
770
|
+
});
|
|
771
|
+
if (!props.success) {
|
|
772
|
+
console.error("Invalid props", props.error);
|
|
773
|
+
return { viewId: "index" };
|
|
774
|
+
}
|
|
775
|
+
return props.data;
|
|
776
|
+
}
|
|
777
|
+
render() {
|
|
778
|
+
const props = this.getProps();
|
|
779
|
+
this.updateHostCss();
|
|
780
|
+
this.root ??= createRoot(this.shadow);
|
|
781
|
+
this.root.render(/* @__PURE__ */ jsx(LikeC4View$1, { ...props }));
|
|
782
|
+
}
|
|
783
|
+
attributeChangedCallback(_name) {
|
|
784
|
+
if (this.root) this.render();
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
customElements.define(ComponentName.View, LikeC4View);
|
|
788
|
+
|
|
789
|
+
//#endregion
|
|
790
|
+
export { LikeC4View };
|