@wireweave/core 4.0.0-beta.14 → 4.0.0-beta.16

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 (39) hide show
  1. package/dist/app.cjs +13 -13
  2. package/dist/app.d.cts +2 -2
  3. package/dist/app.d.ts +2 -2
  4. package/dist/app.js +2 -2
  5. package/dist/{chunk-TQSOLTMZ.js → chunk-6EMG345O.js} +251 -41
  6. package/dist/{chunk-NV6UV5ID.cjs → chunk-7ZRMSFWZ.cjs} +286 -75
  7. package/dist/{chunk-ZPHNXJRY.cjs → chunk-CGTYVLPA.cjs} +4 -4
  8. package/dist/{chunk-IMUVIIJR.cjs → chunk-EWCLLW6P.cjs} +11 -3
  9. package/dist/{chunk-SAN6CJEE.cjs → chunk-J5WEVZIX.cjs} +134 -493
  10. package/dist/chunk-KEQRLZQP.js +3066 -0
  11. package/dist/{chunk-XYACLXXF.js → chunk-LBJTNQXU.js} +1 -1
  12. package/dist/{chunk-4DDV6Z2X.js → chunk-MLCJ6NIB.js} +3 -3
  13. package/dist/{chunk-2Y3GKARZ.js → chunk-NMIPMOEJ.js} +73 -432
  14. package/dist/chunk-WCCYK5WK.cjs +3077 -0
  15. package/dist/{chunk-LA5LKIEL.cjs → chunk-XZL42ZQ2.cjs} +28 -28
  16. package/dist/{chunk-3RWGG5EC.js → chunk-YAANMWP2.js} +11 -4
  17. package/dist/{index-BD_4rXH-.d.cts → index-CIfur9e3.d.cts} +1 -1
  18. package/dist/{index-YSIzfhOd.d.cts → index-DdQv4Bu5.d.cts} +7 -1
  19. package/dist/{index-g9yV20xb.d.ts → index-DwGsnD0n.d.ts} +1 -1
  20. package/dist/{index-BEnsO2kE.d.ts → index-c4FTW7XA.d.ts} +7 -1
  21. package/dist/index.cjs +238 -222
  22. package/dist/index.d.cts +5 -5
  23. package/dist/index.d.ts +5 -5
  24. package/dist/index.js +11 -11
  25. package/dist/interaction.cjs +6 -6
  26. package/dist/interaction.js +1 -1
  27. package/dist/parser.cjs +9 -9
  28. package/dist/parser.js +1 -1
  29. package/dist/renderer.cjs +32 -32
  30. package/dist/renderer.d.cts +2 -2
  31. package/dist/renderer.d.ts +2 -2
  32. package/dist/renderer.js +3 -3
  33. package/dist/spec.cjs +39 -23
  34. package/dist/spec.d.cts +45 -1
  35. package/dist/spec.d.ts +45 -1
  36. package/dist/spec.js +1 -1
  37. package/package.json +19 -13
  38. package/dist/chunk-MD6MNOEQ.cjs +0 -2884
  39. package/dist/chunk-V3HVWC7C.js +0 -2874
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkIMUVIIJR_cjs = require('./chunk-IMUVIIJR.cjs');
4
- var chunkZPHNXJRY_cjs = require('./chunk-ZPHNXJRY.cjs');
3
+ var chunkEWCLLW6P_cjs = require('./chunk-EWCLLW6P.cjs');
4
+ var chunkCGTYVLPA_cjs = require('./chunk-CGTYVLPA.cjs');
5
5
  var chunkETV4XYOV_cjs = require('./chunk-ETV4XYOV.cjs');
6
6
 
7
7
  // src/ast/expand-variants.ts
@@ -33,14 +33,14 @@ function hasVariants(document) {
33
33
  return document.children.some((child) => child.type === "Page" && variantNames(child).length > 0);
34
34
  }
35
35
  function expandVariants(document) {
36
- if (!hasVariants(document)) return chunkZPHNXJRY_cjs.filterUnscopedPages(document);
36
+ if (!hasVariants(document)) return chunkCGTYVLPA_cjs.filterUnscopedPages(document);
37
37
  return {
38
38
  ...document,
39
39
  children: document.children.flatMap((child) => {
40
40
  if (child.type !== "Page") return [child];
41
41
  const names = variantNames(child);
42
42
  if (names.length === 0) {
43
- const filtered = chunkZPHNXJRY_cjs.filterVariantScope(child.children, void 0);
43
+ const filtered = chunkCGTYVLPA_cjs.filterVariantScope(child.children, void 0);
44
44
  return [filtered === child.children ? child : { ...child, children: filtered }];
45
45
  }
46
46
  return names.map((variant, position) => {
@@ -48,13 +48,195 @@ function expandVariants(document) {
48
48
  delete clone.variants;
49
49
  clone.variant = variant;
50
50
  if (position > 0) delete clone.states;
51
- clone.children = chunkZPHNXJRY_cjs.filterVariantScope(clone.children, variant);
51
+ clone.children = chunkCGTYVLPA_cjs.filterVariantScope(clone.children, variant);
52
52
  return clone;
53
53
  });
54
54
  })
55
55
  };
56
56
  }
57
57
 
58
+ // src/app/assets.ts
59
+ var assetId = /^[A-Za-z_][A-Za-z0-9_-]{0,127}$/;
60
+ var digest = /^sha256:[0-9a-f]{64}$/;
61
+ var base64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
62
+ var mediaTypes = /* @__PURE__ */ new Set([
63
+ "image/png",
64
+ "image/jpeg",
65
+ "image/webp",
66
+ "image/svg+xml",
67
+ "font/woff2"
68
+ ]);
69
+ var MAX_ASSET_BYTES = 16 * 1024 * 1024;
70
+ var MAX_TOTAL_ASSET_BYTES = 32 * 1024 * 1024;
71
+ function object(value) {
72
+ return value !== null && typeof value === "object" && !Array.isArray(value);
73
+ }
74
+ function string(value) {
75
+ return typeof value === "string";
76
+ }
77
+ function bytesEqual(bytes, expected) {
78
+ return bytes.length >= expected.length && expected.every((value, index) => bytes[index] === value);
79
+ }
80
+ function uint16(bytes, offset) {
81
+ var _a, _b;
82
+ return ((_a = bytes[offset]) != null ? _a : 0) << 8 | ((_b = bytes[offset + 1]) != null ? _b : 0);
83
+ }
84
+ function uint32(bytes, offset) {
85
+ var _a, _b, _c, _d;
86
+ return ((_a = bytes[offset]) != null ? _a : 0) * 16777216 + (((_b = bytes[offset + 1]) != null ? _b : 0) << 16) + (((_c = bytes[offset + 2]) != null ? _c : 0) << 8) + ((_d = bytes[offset + 3]) != null ? _d : 0);
87
+ }
88
+ function uint32Le(bytes, offset) {
89
+ var _a, _b, _c, _d;
90
+ return ((_a = bytes[offset]) != null ? _a : 0) + (((_b = bytes[offset + 1]) != null ? _b : 0) << 8) + (((_c = bytes[offset + 2]) != null ? _c : 0) << 16) + ((_d = bytes[offset + 3]) != null ? _d : 0) * 16777216;
91
+ }
92
+ function decodeBase64(value) {
93
+ var _a, _b, _c, _d;
94
+ if (!base64.test(value) || value.length % 4 !== 0) return void 0;
95
+ const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
96
+ const bytes = new Uint8Array(value.length / 4 * 3 - padding);
97
+ let output = 0;
98
+ for (let index = 0; index < value.length; index += 4) {
99
+ const quartet = value.slice(index, index + 4);
100
+ const values = [...quartet].map(
101
+ (character) => character === "=" ? 0 : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(character)
102
+ );
103
+ if (values.some((item) => item < 0)) return void 0;
104
+ const packed = ((_a = values[0]) != null ? _a : 0) << 18 | ((_b = values[1]) != null ? _b : 0) << 12 | ((_c = values[2]) != null ? _c : 0) << 6 | ((_d = values[3]) != null ? _d : 0);
105
+ if (output < bytes.length) bytes[output++] = packed >>> 16 & 255;
106
+ if (output < bytes.length) bytes[output++] = packed >>> 8 & 255;
107
+ if (output < bytes.length) bytes[output++] = packed & 255;
108
+ }
109
+ return bytes;
110
+ }
111
+ function validSvg(bytes) {
112
+ var _a, _b;
113
+ let source;
114
+ try {
115
+ source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
116
+ } catch {
117
+ return false;
118
+ }
119
+ const trimmed = source.trim();
120
+ if (!/^(?:<\?xml\b[^>]*>\s*)?<svg(?:\s|>)/i.test(trimmed) || !/<\/svg\s*>\s*$/i.test(trimmed))
121
+ return false;
122
+ if (/<(?:script|foreignObject|iframe|object|embed)(?:\s|>)/i.test(source)) return false;
123
+ if (/<!DOCTYPE|<!ENTITY|\b(?:on[a-z][a-z0-9:_-]*)\s*=/i.test(source)) return false;
124
+ if (/@import\b/i.test(source)) return false;
125
+ const hrefs = /(?:xlink:)?(?:href|src)\s*=\s*(['"])(.*?)\1/gi;
126
+ for (const match of source.matchAll(hrefs))
127
+ if (!((_a = match[2]) != null ? _a : "").trim().startsWith("#")) return false;
128
+ const urls = /url\(\s*(['"]?)(.*?)\1\s*\)/gi;
129
+ for (const match of source.matchAll(urls))
130
+ if (!((_b = match[2]) != null ? _b : "").trim().startsWith("#")) return false;
131
+ return true;
132
+ }
133
+ function validMediaType(bytes, mediaType) {
134
+ if (mediaType === "image/png")
135
+ return bytes.length >= 24 && bytesEqual(bytes, [137, 80, 78, 71, 13, 10, 26, 10]) && uint32(bytes, 8) === 13 && bytesEqual(bytes.slice(12), [73, 72, 68, 82]) && uint32(bytes, 16) > 0 && uint32(bytes, 20) > 0;
136
+ if (mediaType === "image/jpeg") return bytesEqual(bytes, [255, 216, 255]);
137
+ if (mediaType === "image/webp")
138
+ return bytes.length >= 12 && bytesEqual(bytes, [82, 73, 70, 70]) && uint32Le(bytes, 4) === bytes.length - 8 && bytesEqual(bytes.slice(8), [87, 69, 66, 80]);
139
+ if (mediaType === "font/woff2")
140
+ return (() => {
141
+ if (bytes.length < 48 || !bytesEqual(bytes, [119, 79, 70, 50]) || uint32(bytes, 8) !== bytes.length || uint16(bytes, 12) === 0 || uint16(bytes, 14) !== 0 || uint32(bytes, 16) === 0)
142
+ return false;
143
+ const range = (offset, length) => length === 0 ? offset === 0 : offset >= 48 && offset + length <= bytes.length;
144
+ return range(uint32(bytes, 28), uint32(bytes, 32)) && range(uint32(bytes, 40), uint32(bytes, 44));
145
+ })();
146
+ return validSvg(bytes);
147
+ }
148
+ function issue(key, index, extra = {}) {
149
+ return { key, details: { index, ...extra } };
150
+ }
151
+ function validateAppAssets(profile) {
152
+ const assets = /* @__PURE__ */ new Map();
153
+ const seenIds = /* @__PURE__ */ new Set();
154
+ const issues = [];
155
+ const raw = profile.assets;
156
+ if (raw !== void 0 && !Array.isArray(raw)) {
157
+ issues.push({ key: "app.assets-shape", details: {} });
158
+ }
159
+ const entries = Array.isArray(raw) ? raw : [];
160
+ if (entries.length > 1e4)
161
+ issues.push({ key: "app.assets-count", details: { count: entries.length } });
162
+ let totalBytes = 0;
163
+ for (const [index, value] of entries.entries()) {
164
+ if (!object(value)) {
165
+ issues.push(issue("app.asset-shape", index));
166
+ continue;
167
+ }
168
+ const id = value.id;
169
+ const mediaType = value.mediaType;
170
+ const expectedDigest = value.digest;
171
+ const byteLength = value.byteLength;
172
+ const encoded = value.base64;
173
+ if (!string(id) || !assetId.test(id)) {
174
+ issues.push(issue("app.asset-id", index));
175
+ continue;
176
+ }
177
+ if (seenIds.has(id)) {
178
+ issues.push(issue("app.asset-duplicate", index, { id }));
179
+ continue;
180
+ }
181
+ seenIds.add(id);
182
+ if (!string(mediaType) || !mediaTypes.has(mediaType)) {
183
+ issues.push(issue("app.asset-media-type", index, { id }));
184
+ continue;
185
+ }
186
+ if (!string(expectedDigest) || !digest.test(expectedDigest)) {
187
+ issues.push(issue("app.asset-digest", index, { id }));
188
+ continue;
189
+ }
190
+ if (typeof byteLength !== "number" || !Number.isInteger(byteLength) || byteLength < 0 || byteLength > MAX_ASSET_BYTES) {
191
+ issues.push(issue("app.asset-byte-length", index, { id }));
192
+ continue;
193
+ }
194
+ if (!string(encoded)) {
195
+ issues.push(issue("app.asset-base64", index, { id }));
196
+ continue;
197
+ }
198
+ const bytes = decodeBase64(encoded);
199
+ if (bytes === void 0) {
200
+ issues.push(issue("app.asset-base64", index, { id }));
201
+ continue;
202
+ }
203
+ if (bytes.byteLength !== byteLength) {
204
+ issues.push(issue("app.asset-byte-length-mismatch", index, { id }));
205
+ continue;
206
+ }
207
+ if (chunkEWCLLW6P_cjs.digestBytesV4(bytes) !== expectedDigest) {
208
+ issues.push(issue("app.asset-digest-mismatch", index, { id }));
209
+ continue;
210
+ }
211
+ if (!validMediaType(bytes, mediaType)) {
212
+ issues.push(issue("app.asset-content", index, { id, mediaType }));
213
+ continue;
214
+ }
215
+ totalBytes += bytes.byteLength;
216
+ if (totalBytes > MAX_TOTAL_ASSET_BYTES) {
217
+ issues.push({ key: "app.asset-total-byte-limit", details: { limit: MAX_TOTAL_ASSET_BYTES } });
218
+ break;
219
+ }
220
+ assets.set(id, {
221
+ id,
222
+ mediaType,
223
+ digest: expectedDigest,
224
+ byteLength,
225
+ base64: encoded
226
+ });
227
+ }
228
+ if (profile.fontAssetId !== void 0) {
229
+ if (!string(profile.fontAssetId) || !assetId.test(profile.fontAssetId)) {
230
+ issues.push({ key: "app.font-asset-id", details: {} });
231
+ } else {
232
+ const font = assets.get(profile.fontAssetId);
233
+ if (font === void 0 || font.mediaType !== "font/woff2")
234
+ issues.push({ key: "app.font-asset-missing", details: { id: profile.fontAssetId } });
235
+ }
236
+ }
237
+ return { assets, issues };
238
+ }
239
+
58
240
  // src/app/v4.ts
59
241
  var bundleBrand = /* @__PURE__ */ Symbol("AppBundle");
60
242
  var linkedBrand = /* @__PURE__ */ Symbol("LinkedApp");
@@ -72,7 +254,7 @@ function textValue(value) {
72
254
  if (typeof value === "number" || typeof value === "boolean") return String(value);
73
255
  return value === void 0 || value === null ? "" : jcs(value);
74
256
  }
75
- function object(value) {
257
+ function object2(value) {
76
258
  return value !== null && typeof value === "object" && !Array.isArray(value);
77
259
  }
78
260
  function isArray(value) {
@@ -93,10 +275,21 @@ function diagnostic(code, messageKey, source, details = {}, phase = "link", path
93
275
  related: []
94
276
  };
95
277
  }
96
- function failed(diagnostics) {
97
- const sorted = diagnostics.slice().sort(
98
- (a, b) => (a.sourceId < b.sourceId ? -1 : a.sourceId > b.sourceId ? 1 : 0) || a.start - b.start || (a.phase < b.phase ? -1 : a.phase > b.phase ? 1 : 0) || (a.code < b.code ? -1 : a.code > b.code ? 1 : 0)
99
- );
278
+ var diagnosticPhaseOrder = {
279
+ parse: 0,
280
+ schema: 1,
281
+ link: 2,
282
+ semantic: 3,
283
+ compile: 4,
284
+ runtime: 5
285
+ };
286
+ function failed(diagnostics, sourceOrder = /* @__PURE__ */ new Map()) {
287
+ const sorted = diagnostics.slice().sort((a, b) => {
288
+ var _a, _b;
289
+ const aModule = (_a = sourceOrder.get(a.sourceId)) != null ? _a : Number.MAX_SAFE_INTEGER;
290
+ const bModule = (_b = sourceOrder.get(b.sourceId)) != null ? _b : Number.MAX_SAFE_INTEGER;
291
+ return (aModule < bModule ? -1 : aModule > bModule ? 1 : 0) || a.start - b.start || diagnosticPhaseOrder[a.phase] - diagnosticPhaseOrder[b.phase] || (a.code < b.code ? -1 : a.code > b.code ? 1 : 0) || a.end - b.end || (a.sourceId < b.sourceId ? -1 : a.sourceId > b.sourceId ? 1 : 0) || (a.path < b.path ? -1 : a.path > b.path ? 1 : 0) || (a.messageKey < b.messageKey ? -1 : a.messageKey > b.messageKey ? 1 : 0);
292
+ });
100
293
  if (sorted.length > 1e3) {
101
294
  const omitted = sorted.length - 999;
102
295
  sorted.length = 999;
@@ -140,7 +333,7 @@ function freeze(value) {
140
333
  }
141
334
  function dsl(value) {
142
335
  if (Array.isArray(value)) return `[${value.map(dsl).join(",")}]`;
143
- if (object(value))
336
+ if (object2(value))
144
337
  return `{${Object.entries(value).map(([key, item]) => `${JSON.stringify(key)}=${dsl(item)}`).join(",")}}`;
145
338
  return JSON.stringify(value);
146
339
  }
@@ -153,20 +346,21 @@ function sourceId(value) {
153
346
  }
154
347
  function sourceOf(value, fallback) {
155
348
  var _a;
156
- const found = (_a = chunkIMUVIIJR_cjs.getV4SourceSpan(value)) != null ? _a : fallback;
349
+ const found = (_a = chunkEWCLLW6P_cjs.getV4SourceSpan(value)) != null ? _a : fallback;
157
350
  return found === void 0 ? { sourceId: "app", start: 0, end: 0, startLine: 1, startColumn: 1, endLine: 1, endColumn: 1 } : { ...found, sourceId: sourceId(found.sourceId) };
158
351
  }
159
352
  function createAppBundle(documents, options) {
160
- if (!isArray(documents) || !object(options) || !object(options.moduleSources))
353
+ if (!isArray(documents) || !object2(options) || !object2(options.moduleSources))
161
354
  throw new TypeError("Parsed documents and explicit bundle options are required");
162
355
  const diagnostics = [];
163
356
  const modules = [];
357
+ const sourceOrder = /* @__PURE__ */ new Map();
164
358
  const sourceByPath = /* @__PURE__ */ new Map();
165
359
  try {
166
360
  jcs(options);
167
361
  if (!identifiers.test(options.id))
168
362
  return failed([diagnostic("WW_SCHEMA", "app.invalid-id", void 0, {}, "schema")]);
169
- const configuration = chunkIMUVIIJR_cjs.parseV4(
363
+ const configuration = chunkEWCLLW6P_cjs.parseV4(
170
364
  `app ${options.id} entry=${dsl(options.entry)} profile=${dsl(options.profile)} states=${dsl(options.states)} registry=${dsl(options.registry)} fixtures=${dsl(options.fixtures)} {}`,
171
365
  { languageVersion: "4.0.0", sourceId: "app" }
172
366
  );
@@ -178,6 +372,8 @@ function createAppBundle(documents, options) {
178
372
  continue;
179
373
  }
180
374
  for (const module of document.modules) {
375
+ const moduleSourceId = sourceOf(module).sourceId;
376
+ if (!sourceOrder.has(moduleSourceId)) sourceOrder.set(moduleSourceId, sourceOrder.size);
181
377
  const bytes = options.moduleSources[module.id];
182
378
  if (modules.some((prior) => prior.id === module.id)) {
183
379
  diagnostics.push(
@@ -194,20 +390,20 @@ function createAppBundle(documents, options) {
194
390
  "app.missing-source-bytes",
195
391
  sourceOf(module),
196
392
  { id: module.id },
197
- "import"
393
+ "link"
198
394
  )
199
395
  );
200
396
  continue;
201
397
  }
202
- const reparsed = chunkIMUVIIJR_cjs.parseV4(bytes, { languageVersion: "4.0.0", sourceId: `${module.id}.wf` });
203
- if (chunkIMUVIIJR_cjs.digestV4(bytes) !== module.sourceDigest || reparsed.modules.length !== 1 || jcs(reparsed.modules[0]) !== jcs(module)) {
398
+ const reparsed = chunkEWCLLW6P_cjs.parseV4(bytes, { languageVersion: "4.0.0", sourceId: `${module.id}.wf` });
399
+ if (chunkEWCLLW6P_cjs.digestV4(bytes) !== module.sourceDigest || reparsed.modules.length !== 1 || jcs(reparsed.modules[0]) !== jcs(module)) {
204
400
  diagnostics.push(
205
401
  diagnostic(
206
402
  "WW_IMPORT",
207
403
  "app.source-content-mismatch",
208
404
  sourceOf(module),
209
405
  { id: module.id },
210
- "import"
406
+ "link"
211
407
  )
212
408
  );
213
409
  continue;
@@ -232,10 +428,10 @@ function createAppBundle(documents, options) {
232
428
  for (const id of Object.keys(options.moduleSources))
233
429
  if (!modules.some((module) => module.id === id)) {
234
430
  diagnostics.push(
235
- diagnostic("WW_IMPORT", "app.unselected-source", void 0, { id }, "import")
431
+ diagnostic("WW_IMPORT", "app.unselected-source", void 0, { id }, "link")
236
432
  );
237
433
  }
238
- if (diagnostics.length > 0) return failed(diagnostics);
434
+ if (diagnostics.length > 0) return failed(diagnostics, sourceOrder);
239
435
  const candidate = {
240
436
  [bundleBrand]: true,
241
437
  schemaVersion: "1.0.0",
@@ -254,8 +450,8 @@ function createAppBundle(documents, options) {
254
450
  bundles.set(bundle, { sourceByPath });
255
451
  return { ok: true, value: bundle, diagnostics: [] };
256
452
  } catch (error) {
257
- if (error instanceof chunkIMUVIIJR_cjs.V4ParseError)
258
- return failed(error.diagnostics.map((item) => ({ ...item, phase: "schema" })));
453
+ if (error instanceof chunkEWCLLW6P_cjs.V4ParseError)
454
+ return failed(error.diagnostics.map((item) => ({ ...item, phase: item.phase })));
259
455
  if (error instanceof TypeError)
260
456
  return failed([diagnostic("WW_SCHEMA", "app.invalid-json", void 0, {}, "schema")]);
261
457
  throw error;
@@ -278,6 +474,7 @@ var Linker = class {
278
474
  chunkETV4XYOV_cjs.__publicField(this, "registry", /* @__PURE__ */ new Map());
279
475
  chunkETV4XYOV_cjs.__publicField(this, "expandedCount", 0);
280
476
  chunkETV4XYOV_cjs.__publicField(this, "domIds", /* @__PURE__ */ new Set());
477
+ chunkETV4XYOV_cjs.__publicField(this, "semanticPhase", false);
281
478
  }
282
479
  source(node) {
283
480
  var _a, _b;
@@ -291,7 +488,7 @@ var Linker = class {
291
488
  key,
292
489
  node === void 0 ? void 0 : this.source(node),
293
490
  details,
294
- code === "WW_IMPORT" ? "import" : "link",
491
+ code === "WW_SCHEMA" ? "schema" : this.semanticPhase ? "semantic" : "link",
295
492
  node === void 0 ? "" : (_a = this.pathByNode.get(node)) != null ? _a : ""
296
493
  )
297
494
  );
@@ -491,7 +688,7 @@ var Linker = class {
491
688
  const right = `${textValue(b.kind)}\0${textValue(b.namespace)}\0${textValue(b.id)}`;
492
689
  return left < right ? -1 : left > right ? 1 : 0;
493
690
  });
494
- if (jcs(entries) !== jcs(sorted) || chunkIMUVIIJR_cjs.digestV4(jcs(entries)) !== this.bundle.registry.digest)
691
+ if (jcs(entries) !== jcs(sorted) || chunkEWCLLW6P_cjs.digestV4(jcs(entries)) !== this.bundle.registry.digest)
495
692
  this.error("WW_REGISTRY", "app.registry-digest");
496
693
  for (const entry of entries) {
497
694
  if (typeof entry.id !== "string" || !uuids.test(entry.id) || typeof entry.namespace !== "string" || !["Requirement", "ImplementationObligation"].includes(textValue(entry.kind))) {
@@ -517,7 +714,7 @@ var Linker = class {
517
714
  field
518
715
  });
519
716
  for (const field of ["request", "response"])
520
- if (!object(entry[field]) || !["schema", "not-applicable"].includes(textValue(entry[field].mode)))
717
+ if (!object2(entry[field]) || !["schema", "not-applicable"].includes(textValue(entry[field].mode)))
521
718
  this.error("WW_REGISTRY", "app.incomplete-obligation", void 0, {
522
719
  id: entry.id,
523
720
  field
@@ -526,8 +723,8 @@ var Linker = class {
526
723
  }
527
724
  for (const entry of entries) {
528
725
  for (const ref of Array.isArray(entry.requirementRefs) ? entry.requirementRefs : []) {
529
- const target = object(ref) ? this.registry.get(textValue(ref.id)) : void 0;
530
- if ((target == null ? void 0 : target.kind) !== "Requirement" || !object(ref) || ref.namespace !== target.namespace || ref.kind !== "Requirement")
726
+ const target = object2(ref) ? this.registry.get(textValue(ref.id)) : void 0;
727
+ if ((target == null ? void 0 : target.kind) !== "Requirement" || !object2(ref) || ref.namespace !== target.namespace || ref.kind !== "Requirement")
531
728
  this.error("WW_REGISTRY", "app.obligation-requirement-reference");
532
729
  }
533
730
  }
@@ -557,11 +754,11 @@ var Linker = class {
557
754
  }
558
755
  }
559
756
  binding(value) {
560
- if (!object(value)) {
757
+ if (!object2(value)) {
561
758
  this.error("WW_REGISTRY", "app.invalid-source-binding");
562
759
  return;
563
760
  }
564
- if (value.scope === "instance" && (!object(value.instanceRoot) || !Array.isArray(value.instancePath))) {
761
+ if (value.scope === "instance" && (!object2(value.instanceRoot) || !Array.isArray(value.instancePath))) {
565
762
  this.error("WW_REGISTRY", "app.invalid-instance-binding");
566
763
  return;
567
764
  }
@@ -683,7 +880,7 @@ var Linker = class {
683
880
  kind: "shell",
684
881
  namespace: layout.module.namespace,
685
882
  id: layout.definition.id,
686
- profileDigest: chunkIMUVIIJR_cjs.digestV4(jcs(this.bundle.profile))
883
+ profileDigest: chunkEWCLLW6P_cjs.digestV4(jcs(this.bundle.profile))
687
884
  };
688
885
  const children = this.expandChildren([layout.definition], {
689
886
  owner: layout,
@@ -827,9 +1024,9 @@ var Linker = class {
827
1024
  definitionId: context.owner.definition.id,
828
1025
  instanceRoot: context.root,
829
1026
  instancePath: context.path,
830
- localId: (_e = primitive.id) != null ? _e : slot ? "_slot" : `_node_${chunkIMUVIIJR_cjs.digestV4((_d = this.pathByNode.get(node)) != null ? _d : textValue(source.start)).slice(7)}`
1027
+ localId: (_e = primitive.id) != null ? _e : slot ? "_slot" : `_node_${chunkEWCLLW6P_cjs.digestV4((_d = this.pathByNode.get(node)) != null ? _d : textValue(source.start)).slice(7)}`
831
1028
  };
832
- const renderedId = `wf-${chunkIMUVIIJR_cjs.digestV4(jcs({ identity, projectionId: this.bundle.profile.id })).slice(7)}`;
1029
+ const renderedId = `wf-${chunkEWCLLW6P_cjs.digestV4(jcs({ identity, projectionId: this.bundle.profile.id })).slice(7)}`;
833
1030
  if (this.domIds.has(renderedId))
834
1031
  this.error("WW_DUPLICATE_ID", "app.rendered-identity-collision", node);
835
1032
  this.domIds.add(renderedId);
@@ -873,9 +1070,9 @@ var Linker = class {
873
1070
  }[node.kind];
874
1071
  if (parent !== void 0) snippet = `${parent} { ${snippet} }`;
875
1072
  try {
876
- chunkIMUVIIJR_cjs.parseV4(`page { ${snippet} }`, { languageVersion: "4.0.0" });
1073
+ chunkEWCLLW6P_cjs.parseV4(`page { ${snippet} }`, { languageVersion: "4.0.0" });
877
1074
  } catch (error) {
878
- if (error instanceof chunkIMUVIIJR_cjs.V4ParseError)
1075
+ if (error instanceof chunkEWCLLW6P_cjs.V4ParseError)
879
1076
  this.error("WW_PARAMETER", "app.substituted-attribute-domain", source);
880
1077
  else throw error;
881
1078
  }
@@ -923,11 +1120,13 @@ var Linker = class {
923
1120
  }
924
1121
  semantics() {
925
1122
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
1123
+ this.semanticPhase = true;
926
1124
  for (const entry of this.bundle.registry.entries)
927
1125
  for (const binding of Array.isArray(entry.bindings) ? entry.bindings : [])
928
1126
  this.binding(binding);
929
- if (asObjects(this.bundle.profile.assets).length > 0 || this.bundle.profile.fontAssetId !== void 0)
930
- this.error("WW_ASSET", "app.asset-decoder-unavailable");
1127
+ const validatedAssets = validateAppAssets(this.bundle.profile);
1128
+ for (const item of validatedAssets.issues)
1129
+ this.error("WW_ASSET", item.key, void 0, item.details);
931
1130
  const scopes = [
932
1131
  { node: void 0, states: this.bundle.states, app: true },
933
1132
  ...[...this.owners.values()].map((owner) => ({
@@ -961,8 +1160,13 @@ var Linker = class {
961
1160
  const strict = this.bundle.profile.id === "neutral-app";
962
1161
  if (["row", "col", "stack"].includes(node.kind) && ["left", "right", "justify"].includes(textValue(attrs2.align)))
963
1162
  this.error("WW_LAYOUT", "app.container-alignment", node);
964
- if (attrs2.src !== void 0 && attrs2.src !== true)
965
- this.error("WW_ASSET", "app.unresolved-asset", node);
1163
+ if (attrs2.src !== void 0) {
1164
+ if (attrs2.src === true) {
1165
+ if (node.kind !== "avatar") this.error("WW_ASSET", "app.avatar-placeholder-only", node);
1166
+ } else if (node.kind !== "image" && node.kind !== "avatar" || !validatedAssets.assets.has(textValue(attrs2.src))) {
1167
+ this.error("WW_ASSET", "app.unresolved-asset", node, { id: textValue(attrs2.src) });
1168
+ }
1169
+ }
966
1170
  const interactive = [
967
1171
  "input",
968
1172
  "textarea",
@@ -1028,7 +1232,7 @@ var Linker = class {
1028
1232
  if (attrs2.order !== void 0 && attrs2.order !== 0 && (interactive.includes(node.kind) || descend.some((child) => interactive.includes(child.node.kind))))
1029
1233
  this.error("WW_ACCESSIBILITY", "app.visual-focus-order", node);
1030
1234
  for (const key of ["p", "px", "py", "pt", "pr", "pb", "pl", "gap"])
1031
- if (attrs2[key] === "auto" || (typeof attrs2[key] === "number" ? Number(attrs2[key]) < 0 : object(attrs2[key]) && Number(attrs2[key].value) < 0))
1235
+ if (attrs2[key] === "auto" || (typeof attrs2[key] === "number" ? Number(attrs2[key]) < 0 : object2(attrs2[key]) && Number(attrs2[key].value) < 0))
1032
1236
  this.error("WW_LAYOUT", "app.invalid-spacing", node, { key });
1033
1237
  for (const key of ["m", "my", "mt", "mr", "mb", "ml"])
1034
1238
  if (attrs2[key] === "auto") this.error("WW_LAYOUT", "app.invalid-spacing", node, { key });
@@ -1052,7 +1256,7 @@ var Linker = class {
1052
1256
  while (parent && parent.node.kind !== "relative") parent = parent.parent;
1053
1257
  if (!parent) this.error("WW_LAYOUT", "app.missing-relative-container", node);
1054
1258
  }
1055
- if (object(attrs2.h) && attrs2.h.unit === "%") {
1259
+ if (object2(attrs2.h) && attrs2.h.unit === "%") {
1056
1260
  const height = (_h = (_f = expanded.parent) == null ? void 0 : _f.node.attributes.h) != null ? _h : (_g = expanded.parent) == null ? void 0 : _g.node.attributes.height;
1057
1261
  if (((_i = expanded.parent) == null ? void 0 : _i.node.kind) !== "page" && (height === void 0 || height === "auto"))
1058
1262
  this.error("WW_LAYOUT", "app.indefinite-percentage-height", node);
@@ -1159,30 +1363,30 @@ var Linker = class {
1159
1363
  for (const item of value) stack.push(item);
1160
1364
  continue;
1161
1365
  }
1162
- if (!object(value)) continue;
1366
+ if (!object2(value)) continue;
1163
1367
  if (typeof value.state === "string") this.state(value.state, expanded);
1164
1368
  for (const key of ["resultState", "statusState", "errorState", "source", "target"])
1165
1369
  if (typeof value[key] === "string" && /^(app|shell|screen|component):/.test(value[key]))
1166
1370
  this.state(value[key], expanded);
1167
- if (object(value.read) && Array.isArray(value.read.path) && value.read.path.some(
1371
+ if (object2(value.read) && Array.isArray(value.read.path) && value.read.path.some(
1168
1372
  (part) => ["__proto__", "constructor", "prototype"].includes(textValue(part))
1169
1373
  ))
1170
1374
  this.error("WW_EFFECT", "app.unsafe-read-path", node);
1171
1375
  for (const [key, child] of Object.entries(value))
1172
1376
  if (!["literal", "initial", "states", "options"].includes(key)) stack.push(child);
1173
1377
  }
1174
- if (object(attrs2.bind)) {
1378
+ if (object2(attrs2.bind)) {
1175
1379
  const state = this.state(textValue(attrs2.bind.state), expanded);
1176
1380
  if (state !== void 0 && (attrs2.bind.property === "checked" && state.type !== "boolean" || attrs2.bind.property === "value" && !["number", "string", "boolean"].includes(textValue(state.type))))
1177
1381
  this.error("WW_STATE", "app.binding-type", node);
1178
1382
  }
1179
- if (object(attrs2.data) && typeof attrs2.data.state === "string") {
1383
+ if (object2(attrs2.data) && typeof attrs2.data.state === "string") {
1180
1384
  const state = this.state(attrs2.data.state, expanded);
1181
1385
  if (state !== void 0) {
1182
1386
  const rows = state.initial;
1183
1387
  const columns = Array.isArray(attrs2.columns) ? attrs2.columns : [];
1184
1388
  if (!Array.isArray(rows) || node.kind === "table" && rows.some(
1185
- (row) => !object(row) || columns.some(
1389
+ (row) => !object2(row) || columns.some(
1186
1390
  (column) => typeof column !== "string" || !Object.hasOwn(row, column) || row[column] !== null && !["string", "number", "boolean"].includes(typeof row[column])
1187
1391
  )
1188
1392
  ))
@@ -1208,8 +1412,8 @@ var Linker = class {
1208
1412
  if (!previous.has(textValue(dependency)))
1209
1413
  this.error("WW_EFFECT", "app.operation-dependency", node, { id });
1210
1414
  previous.add(id);
1211
- const effect = object(operation.effect) ? operation.effect : {};
1212
- if (object(effect.target) && ["open", "close", "toggleOverlay", "focus", "validate"].includes(textValue(effect.kind))) {
1415
+ const effect = object2(operation.effect) ? operation.effect : {};
1416
+ if (object2(effect.target) && ["open", "close", "toggleOverlay", "focus", "validate"].includes(textValue(effect.kind))) {
1213
1417
  const target = this.element(effect.target, expanded);
1214
1418
  if (target === void 0 || effect.kind === "validate" && target.node.kind !== "form" || ["open", "close", "toggleOverlay"].includes(textValue(effect.kind)) && !["modal", "drawer", "popover", "dropdown", "tooltip"].includes(target.node.kind))
1215
1419
  this.error("WW_REFERENCE", "app.invalid-effect-target", node);
@@ -1234,8 +1438,8 @@ var Linker = class {
1234
1438
  ))
1235
1439
  this.error("WW_EFFECT", "app.fixture-result-type", node);
1236
1440
  }
1237
- if (effect.kind === "navigate" && object(effect.target)) {
1238
- if (effect.target.kind === "screen" && object(effect.target.screen))
1441
+ if (effect.kind === "navigate" && object2(effect.target)) {
1442
+ if (effect.target.kind === "screen" && object2(effect.target.screen))
1239
1443
  this.route(effect.target.screen, node);
1240
1444
  if (effect.target.kind === "url" && !safeUrl(textValue(effect.target.url)))
1241
1445
  this.error("WW_REFERENCE", "app.unsafe-url", node);
@@ -1267,7 +1471,7 @@ var Linker = class {
1267
1471
  }
1268
1472
  };
1269
1473
  function matchesType(value, type) {
1270
- return type === "record" ? object(value) : type === "list" ? Array.isArray(value) : typeof value === type;
1474
+ return type === "record" ? object2(value) : type === "list" ? Array.isArray(value) : typeof value === type;
1271
1475
  }
1272
1476
  function componentPath(path) {
1273
1477
  for (let index = path.length - 1; index >= 0; index--)
@@ -1286,7 +1490,7 @@ function substitute(value, bindings, missing) {
1286
1490
  return bindings[match[1]];
1287
1491
  }
1288
1492
  if (Array.isArray(value)) return value.map((item) => substitute(item, bindings, missing));
1289
- if (object(value)) {
1493
+ if (object2(value)) {
1290
1494
  if (typeof value.param === "string" && Object.keys(value).length === 1) {
1291
1495
  if (!Object.hasOwn(bindings, value.param)) {
1292
1496
  missing(value.param);
@@ -1314,20 +1518,26 @@ function safeUrl(value) {
1314
1518
  }
1315
1519
  }
1316
1520
  function asObjects(value) {
1317
- return Array.isArray(value) ? value.filter(object) : [];
1521
+ return Array.isArray(value) ? value.filter(object2) : [];
1318
1522
  }
1319
1523
  function linkAppV4(bundle) {
1524
+ var _a;
1320
1525
  const data = typeof bundle === "object" && bundle !== null ? bundles.get(bundle) : void 0;
1321
1526
  if (data === void 0) return failed([diagnostic("WW_SCHEMA", "app.untrusted-bundle")]);
1527
+ const sourceOrder = /* @__PURE__ */ new Map();
1528
+ for (const [index, module] of bundle.modules.entries()) {
1529
+ const source = (_a = data.sourceByPath.get(module.id)) != null ? _a : sourceOf(module);
1530
+ if (!sourceOrder.has(source.sourceId)) sourceOrder.set(source.sourceId, index);
1531
+ }
1322
1532
  const linker = new Linker(bundle, data);
1323
1533
  linker.index();
1324
1534
  linker.imports();
1325
1535
  linker.references();
1326
1536
  linker.registryChecks();
1327
- if (linker.diagnostics.length > 0) return failed(linker.diagnostics);
1537
+ if (linker.diagnostics.length > 0) return failed(linker.diagnostics, sourceOrder);
1328
1538
  linker.expandAll();
1329
1539
  linker.semantics();
1330
- if (linker.diagnostics.length > 0) return failed(linker.diagnostics);
1540
+ if (linker.diagnostics.length > 0) return failed(linker.diagnostics, sourceOrder);
1331
1541
  const sourceMap = linker.expanded.map((entry) => ({
1332
1542
  renderedId: entry.renderedId,
1333
1543
  identity: entry.identity,
@@ -1345,7 +1555,7 @@ function linkAppV4(bundle) {
1345
1555
  kind: "LinkedApp",
1346
1556
  languageVersion: "4.0.0",
1347
1557
  id: bundle.id,
1348
- digest: chunkIMUVIIJR_cjs.digestV4(jcs(bundle)),
1558
+ digest: chunkEWCLLW6P_cjs.digestV4(jcs(bundle)),
1349
1559
  sourceMap
1350
1560
  });
1351
1561
  links.set(linked, {
@@ -1460,7 +1670,7 @@ function generateSiteStyles(prefix) {
1460
1670
 
1461
1671
  // src/renderer/site/runtime.ts
1462
1672
  var ID_SCOPE_ATTR = "data-id-scope";
1463
- var [NAVIGATE_ATTR, OPENS_ATTR, TOGGLES_ATTR, ACTION_ATTR] = chunkZPHNXJRY_cjs.INTERACTIVE_ATTR_NAMES;
1673
+ var [NAVIGATE_ATTR, OPENS_ATTR, TOGGLES_ATTR, ACTION_ATTR] = chunkCGTYVLPA_cjs.INTERACTIVE_ATTR_NAMES;
1464
1674
  function embedJson(value) {
1465
1675
  return JSON.stringify(value).replace(/</g, "\\u003C");
1466
1676
  }
@@ -1687,16 +1897,16 @@ function siteRuntime(registry, prefix) {
1687
1897
  }
1688
1898
 
1689
1899
  function applyOutcomes() {
1690
- var visible = site.querySelectorAll('[' + ${embedJson(chunkZPHNXJRY_cjs.VISIBLE_GUARD_ATTR)} + ']');
1900
+ var visible = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.VISIBLE_GUARD_ATTR)} + ']');
1691
1901
  for (var i = 0; i < visible.length; i++) {
1692
- var visibleGuard = parseJson(visible[i].getAttribute(${embedJson(chunkZPHNXJRY_cjs.VISIBLE_GUARD_ATTR)}), null);
1902
+ var visibleGuard = parseJson(visible[i].getAttribute(${embedJson(chunkCGTYVLPA_cjs.VISIBLE_GUARD_ATTR)}), null);
1693
1903
  if (guardPasses(visibleGuard)) visible[i].removeAttribute('hidden');
1694
1904
  else visible[i].setAttribute('hidden', 'hidden');
1695
1905
  }
1696
1906
 
1697
- var enabled = site.querySelectorAll('[' + ${embedJson(chunkZPHNXJRY_cjs.ENABLED_GUARD_ATTR)} + ']');
1907
+ var enabled = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.ENABLED_GUARD_ATTR)} + ']');
1698
1908
  for (var j = 0; j < enabled.length; j++) {
1699
- var enabledGuard = parseJson(enabled[j].getAttribute(${embedJson(chunkZPHNXJRY_cjs.ENABLED_GUARD_ATTR)}), null);
1909
+ var enabledGuard = parseJson(enabled[j].getAttribute(${embedJson(chunkCGTYVLPA_cjs.ENABLED_GUARD_ATTR)}), null);
1700
1910
  if (guardPasses(enabledGuard)) {
1701
1911
  enabled[j].removeAttribute('disabled');
1702
1912
  enabled[j].removeAttribute('aria-disabled');
@@ -1710,9 +1920,9 @@ function siteRuntime(registry, prefix) {
1710
1920
  function applyVariantScopes() {
1711
1921
  var screen = current === null ? null : screens[current];
1712
1922
  var variant = screen ? screen.getAttribute('data-wf-variant') : null;
1713
- var scoped = site.querySelectorAll('[' + ${embedJson(chunkZPHNXJRY_cjs.VARIANT_SCOPE_ATTR)} + ']');
1923
+ var scoped = site.querySelectorAll('[' + ${embedJson(chunkCGTYVLPA_cjs.VARIANT_SCOPE_ATTR)} + ']');
1714
1924
  for (var i = 0; i < scoped.length; i++) {
1715
- var names = parseJson(scoped[i].getAttribute(${embedJson(chunkZPHNXJRY_cjs.VARIANT_SCOPE_ATTR)}), []);
1925
+ var names = parseJson(scoped[i].getAttribute(${embedJson(chunkCGTYVLPA_cjs.VARIANT_SCOPE_ATTR)}), []);
1716
1926
  var visible = variant !== null && names.indexOf(variant) >= 0;
1717
1927
  if (visible) scoped[i].removeAttribute('hidden');
1718
1928
  else scoped[i].setAttribute('hidden', 'hidden');
@@ -1770,7 +1980,7 @@ function siteRuntime(registry, prefix) {
1770
1980
  if (!isChrome(links[j])) continue;
1771
1981
  // An external target names no screen, so it can never be the current
1772
1982
  // one. Same marker, same skip: the registry is not consulted.
1773
- if (links[j].hasAttribute(${embedJson(chunkZPHNXJRY_cjs.EXTERNAL_NAVIGATE_ATTR)})) continue;
1983
+ if (links[j].hasAttribute(${embedJson(chunkCGTYVLPA_cjs.EXTERNAL_NAVIGATE_ATTR)})) continue;
1774
1984
  var target = resolve(links[j].getAttribute(${embedJson(NAVIGATE_ATTR)}));
1775
1985
  if (target === key) links[j].classList.add(NAV_ACTIVE);
1776
1986
  else links[j].classList.remove(NAV_ACTIVE);
@@ -1827,9 +2037,9 @@ function siteRuntime(registry, prefix) {
1827
2037
  }
1828
2038
 
1829
2039
  document.addEventListener('click', function (event) {
1830
- var typed = event.target.closest ? event.target.closest('[' + ${embedJson(chunkZPHNXJRY_cjs.TYPED_INTERACTION_ATTR)} + ']') : null;
2040
+ var typed = event.target.closest ? event.target.closest('[' + ${embedJson(chunkCGTYVLPA_cjs.TYPED_INTERACTION_ATTR)} + ']') : null;
1831
2041
  if (typed) {
1832
- var signatures = parseJson(typed.getAttribute(${embedJson(chunkZPHNXJRY_cjs.TYPED_INTERACTION_ATTR)}), []);
2042
+ var signatures = parseJson(typed.getAttribute(${embedJson(chunkCGTYVLPA_cjs.TYPED_INTERACTION_ATTR)}), []);
1833
2043
  var matched = false;
1834
2044
  for (var typedIndex = 0; typedIndex < signatures.length; typedIndex++) {
1835
2045
  var normalized = interactionFor(current, typed, signatures[typedIndex]);
@@ -1850,7 +2060,7 @@ function siteRuntime(registry, prefix) {
1850
2060
  // drift surface, and the two disagreeing is how a runtime ends up hunting
1851
2061
  // for a screen named "https://\u2026". Marked elements skip the registry
1852
2062
  // entirely: the lookup is not attempted, not merely discarded.
1853
- if (mover && !mover.hasAttribute(${embedJson(chunkZPHNXJRY_cjs.EXTERNAL_NAVIGATE_ATTR)})) {
2063
+ if (mover && !mover.hasAttribute(${embedJson(chunkCGTYVLPA_cjs.EXTERNAL_NAVIGATE_ATTR)})) {
1854
2064
  var navigateTarget = mover.getAttribute(${embedJson(NAVIGATE_ATTR)});
1855
2065
  var key = routeAllowed(current, navigateTarget) ? resolve(navigateTarget) : null;
1856
2066
  if (key !== null) {
@@ -1916,7 +2126,7 @@ function siteRuntime(registry, prefix) {
1916
2126
  // authored fragment link is left alone too \u2014 the hashchange handler below is
1917
2127
  // how that is supposed to work.
1918
2128
  var link = event.target.closest ? event.target.closest('a[href]') : null;
1919
- if (link && link.getAttribute('href') === ${embedJson(chunkZPHNXJRY_cjs.INERT_HREF)}) event.preventDefault();
2129
+ if (link && link.getAttribute('href') === ${embedJson(chunkCGTYVLPA_cjs.INERT_HREF)}) event.preventDefault();
1920
2130
  });
1921
2131
 
1922
2132
  document.addEventListener('keydown', function (event) {
@@ -1949,7 +2159,7 @@ function attrs(pairs) {
1949
2159
  return pairs.filter((pair) => pair[1] !== void 0).map(([name, value]) => ` ${name}="${escapeAttr(value)}"`).join("");
1950
2160
  }
1951
2161
  function renderHostedScreen(screen, shell, make, prefix) {
1952
- const { width, height } = chunkZPHNXJRY_cjs.resolvePageDimensions(screen.page);
2162
+ const { width, height } = chunkCGTYVLPA_cjs.resolvePageDimensions(screen.page);
1953
2163
  const conflict = width !== shell.width || height !== shell.height ? `${width}x${height}` : void 0;
1954
2164
  const scope = screenScope(screen.index);
1955
2165
  const marks = attrs([
@@ -2044,10 +2254,10 @@ function compactRuntimeInteractions(model, interactions) {
2044
2254
  function renderSite(document, options = {}) {
2045
2255
  var _a;
2046
2256
  const prefix = (_a = options.classPrefix) != null ? _a : DEFAULT_PREFIX;
2047
- document = chunkZPHNXJRY_cjs.expandRepeats(expandVariants(document));
2048
- const model = chunkZPHNXJRY_cjs.buildSiteModel(document);
2049
- const interactionModel = chunkZPHNXJRY_cjs.collectInteractions(document);
2050
- const make = (idScope) => new chunkZPHNXJRY_cjs.HtmlRenderer({
2257
+ document = chunkCGTYVLPA_cjs.expandRepeats(expandVariants(document));
2258
+ const model = chunkCGTYVLPA_cjs.buildSiteModel(document);
2259
+ const interactionModel = chunkCGTYVLPA_cjs.collectInteractions(document);
2260
+ const make = (idScope) => new chunkCGTYVLPA_cjs.HtmlRenderer({
2051
2261
  theme: options.theme,
2052
2262
  classPrefix: prefix,
2053
2263
  background: options.background,
@@ -2057,8 +2267,8 @@ function renderSite(document, options = {}) {
2057
2267
  });
2058
2268
  const shells = model.shells.map((shell, index) => renderShell(shell, index, make, prefix)).join("\n");
2059
2269
  const standalone = model.screens.filter((screen) => screen.shell === void 0).map((screen) => renderStandaloneScreen(screen, make, prefix)).join("\n");
2060
- const theme = options.theme === "dark" ? chunkZPHNXJRY_cjs.darkTheme : chunkZPHNXJRY_cjs.defaultTheme;
2061
- const css = chunkZPHNXJRY_cjs.generateStyles(theme, prefix, options.annotationStyle) + generateSiteStyles(prefix);
2270
+ const theme = options.theme === "dark" ? chunkCGTYVLPA_cjs.darkTheme : chunkCGTYVLPA_cjs.defaultTheme;
2271
+ const css = chunkCGTYVLPA_cjs.generateStyles(theme, prefix, options.annotationStyle) + generateSiteStyles(prefix);
2062
2272
  const entry = resolveEntry(model, options);
2063
2273
  const fragments = model.screens.map((screen) => {
2064
2274
  var _a2;
@@ -2140,6 +2350,7 @@ exports.freeze = freeze;
2140
2350
  exports.getLinkedAppData = getLinkedAppData;
2141
2351
  exports.jcs = jcs;
2142
2352
  exports.linkAppV4 = linkAppV4;
2143
- exports.object = object;
2353
+ exports.object = object2;
2144
2354
  exports.renderSite = renderSite;
2145
2355
  exports.textValue = textValue;
2356
+ exports.validateAppAssets = validateAppAssets;