@servlyadmin/runtime-core 0.1.9 → 0.1.10

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/dist/index.js CHANGED
@@ -1,522 +1,25 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
- };
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
-
32
- // packages/runtime-core/src/tailwind.ts
33
- var tailwind_exports = {};
34
- __export(tailwind_exports, {
35
- DEFAULT_SERVLY_TAILWIND_CONFIG: () => DEFAULT_SERVLY_TAILWIND_CONFIG,
36
- addCustomStyles: () => addCustomStyles,
37
- default: () => tailwind_default,
38
- getTailwind: () => getTailwind,
39
- initServlyTailwind: () => initServlyTailwind,
40
- injectTailwind: () => injectTailwind,
41
- isTailwindLoaded: () => isTailwindLoaded,
42
- removeCustomStyles: () => removeCustomStyles,
43
- removeTailwind: () => removeTailwind,
44
- updateTailwindConfig: () => updateTailwindConfig
45
- });
46
- function injectTailwind(config = {}) {
47
- return new Promise((resolve, reject) => {
48
- if (tailwindInjected && tailwindScript) {
49
- resolve();
50
- return;
51
- }
52
- if (typeof document === "undefined") {
53
- resolve();
54
- return;
55
- }
56
- if (window.tailwind) {
57
- tailwindInjected = true;
58
- config.onReady?.();
59
- resolve();
60
- return;
61
- }
62
- const {
63
- cdnUrl = DEFAULT_TAILWIND_CDN,
64
- config: tailwindConfig,
65
- plugins = [],
66
- usePlayCdn = false,
67
- onReady,
68
- onError
69
- } = config;
70
- const script = document.createElement("script");
71
- script.src = usePlayCdn ? `${cdnUrl}?plugins=forms,typography,aspect-ratio` : cdnUrl;
72
- script.async = true;
73
- script.onload = () => {
74
- tailwindInjected = true;
75
- tailwindScript = script;
76
- if (tailwindConfig && window.tailwind) {
77
- window.tailwind.config = tailwindConfig;
78
- }
79
- onReady?.();
80
- resolve();
81
- };
82
- script.onerror = (event) => {
83
- const error = new Error(`Failed to load Tailwind CSS from ${cdnUrl}`);
84
- onError?.(error);
85
- reject(error);
86
- };
87
- document.head.appendChild(script);
88
- });
89
- }
90
- function removeTailwind() {
91
- if (tailwindScript && tailwindScript.parentNode) {
92
- tailwindScript.parentNode.removeChild(tailwindScript);
93
- tailwindScript = null;
94
- tailwindInjected = false;
95
- delete window.tailwind;
96
- }
97
- }
98
- function isTailwindLoaded() {
99
- return tailwindInjected || !!window.tailwind;
100
- }
101
- function getTailwind() {
102
- return window.tailwind;
103
- }
104
- function updateTailwindConfig(config) {
105
- if (window.tailwind) {
106
- window.tailwind.config = {
107
- ...window.tailwind.config,
108
- ...config
109
- };
110
- }
111
- }
112
- function addCustomStyles(css, id) {
113
- if (typeof document === "undefined") {
114
- throw new Error("addCustomStyles can only be used in browser environment");
115
- }
116
- const styleId = id || `servly-custom-styles-${Date.now()}`;
117
- let existingStyle = document.getElementById(styleId);
118
- if (existingStyle) {
119
- existingStyle.textContent = css;
120
- return existingStyle;
121
- }
122
- const style = document.createElement("style");
123
- style.id = styleId;
124
- style.textContent = css;
125
- document.head.appendChild(style);
126
- return style;
127
- }
128
- function removeCustomStyles(id) {
129
- if (typeof document === "undefined") return;
130
- const style = document.getElementById(id);
131
- if (style && style.parentNode) {
132
- style.parentNode.removeChild(style);
133
- }
134
- }
135
- async function initServlyTailwind(customConfig) {
136
- const config = customConfig ? { ...DEFAULT_SERVLY_TAILWIND_CONFIG, ...customConfig } : DEFAULT_SERVLY_TAILWIND_CONFIG;
137
- await injectTailwind({
138
- config,
139
- usePlayCdn: true
140
- });
141
- }
142
- var DEFAULT_TAILWIND_CDN, tailwindInjected, tailwindScript, DEFAULT_SERVLY_TAILWIND_CONFIG, tailwind_default;
143
- var init_tailwind = __esm({
144
- "packages/runtime-core/src/tailwind.ts"() {
145
- DEFAULT_TAILWIND_CDN = "https://cdn.tailwindcss.com";
146
- tailwindInjected = false;
147
- tailwindScript = null;
148
- DEFAULT_SERVLY_TAILWIND_CONFIG = {
149
- theme: {
150
- extend: {
151
- // Add any Servly-specific theme extensions here
152
- }
153
- },
154
- // Safelist common dynamic classes
155
- safelist: [
156
- // Spacing
157
- { pattern: /^(p|m|gap)-/ },
158
- // Sizing
159
- { pattern: /^(w|h|min-w|min-h|max-w|max-h)-/ },
160
- // Flexbox
161
- { pattern: /^(flex|justify|items|self)-/ },
162
- // Grid
163
- { pattern: /^(grid|col|row)-/ },
164
- // Colors
165
- { pattern: /^(bg|text|border|ring)-/ },
166
- // Typography
167
- { pattern: /^(font|text|leading|tracking)-/ },
168
- // Borders
169
- { pattern: /^(rounded|border)-/ },
170
- // Effects
171
- { pattern: /^(shadow|opacity|blur)-/ },
172
- // Transforms
173
- { pattern: /^(scale|rotate|translate|skew)-/ },
174
- // Transitions
175
- { pattern: /^(transition|duration|ease|delay)-/ }
176
- ]
177
- };
178
- tailwind_default = {
179
- injectTailwind,
180
- removeTailwind,
181
- isTailwindLoaded,
182
- getTailwind,
183
- updateTailwindConfig,
184
- addCustomStyles,
185
- removeCustomStyles,
186
- initServlyTailwind,
187
- DEFAULT_SERVLY_TAILWIND_CONFIG
188
- };
189
- }
190
- });
191
-
192
- // packages/runtime-core/src/registry.ts
193
- var registry_exports = {};
194
- __export(registry_exports, {
195
- buildRegistryFromBundle: () => buildRegistryFromBundle,
196
- collectAllDependencies: () => collectAllDependencies,
197
- createRegistry: () => createRegistry,
198
- detectCircularDependencies: () => detectCircularDependencies,
199
- extractDependencies: () => extractDependencies,
200
- extractDependenciesFromCode: () => extractDependenciesFromCode
201
- });
202
- function createRegistry() {
203
- const components = /* @__PURE__ */ new Map();
204
- return {
205
- get(id, version) {
206
- if (version) {
207
- const key = `${id}@${version}`;
208
- if (components.has(key)) {
209
- return components.get(key);
210
- }
211
- }
212
- for (const [key, component] of components) {
213
- if (key.startsWith(`${id}@`)) {
214
- return component;
215
- }
216
- }
217
- return components.get(id);
218
- },
219
- has(id, version) {
220
- if (version) {
221
- return components.has(`${id}@${version}`);
222
- }
223
- for (const key of components.keys()) {
224
- if (key.startsWith(`${id}@`) || key === id) {
225
- return true;
226
- }
227
- }
228
- return false;
229
- },
230
- set(id, version, component) {
231
- components.set(`${id}@${version}`, component);
232
- }
233
- };
234
- }
235
- function buildRegistryFromBundle(data) {
236
- const registry = createRegistry();
237
- registry.set(data.id, data.version, {
238
- layout: data.layout,
239
- propsInterface: data.propsInterface
240
- });
241
- if (data.bundle) {
242
- for (const [key, component] of Object.entries(data.bundle)) {
243
- const [id, version] = key.split("@");
244
- if (id && version) {
245
- registry.set(id, version, component);
246
- }
247
- }
248
- }
249
- return registry;
250
- }
251
- function extractDependencies(elements) {
252
- const dependencies = [];
253
- for (const element of elements) {
254
- const config = element.configuration;
255
- if (!config) continue;
256
- if (config.componentViewRef) {
257
- dependencies.push({
258
- id: config.componentViewRef,
259
- version: config.componentViewVersion,
260
- type: "viewRef",
261
- elementId: element.i
262
- });
263
- }
264
- if (config.blueprint) {
265
- dependencies.push({
266
- id: config.blueprint,
267
- version: config.blueprintVersion,
268
- type: "blueprint",
269
- elementId: element.i
270
- });
271
- }
272
- }
273
- return dependencies;
274
- }
275
- function extractDependenciesFromCode(code) {
276
- const dependencies = [];
277
- const pattern = /renderDynamicList\s*\(\s*\{[^}]*blueprint\s*:\s*["']([^"']+)["']/g;
278
- let match;
279
- while ((match = pattern.exec(code)) !== null) {
280
- dependencies.push({
281
- id: match[1],
282
- type: "blueprint"
283
- });
284
- }
285
- return dependencies;
286
- }
287
- async function collectAllDependencies(rootId, rootVersion, fetchComponent2, maxDepth = 10) {
288
- const manifest = {};
289
- const visited = /* @__PURE__ */ new Set();
290
- async function collect(id, version, via, depth) {
291
- if (depth > maxDepth) {
292
- console.warn(`Max dependency depth (${maxDepth}) reached for ${id}`);
293
- return;
294
- }
295
- const key = `${id}@${version || "latest"}`;
296
- if (visited.has(key)) {
297
- return;
298
- }
299
- visited.add(key);
300
- try {
301
- const component = await fetchComponent2(id, version);
302
- if (!component) {
303
- console.warn(`Dependency not found: ${id}@${version || "latest"}`);
304
- return;
305
- }
306
- manifest[id] = {
307
- version: version || "latest",
308
- resolved: component.version,
309
- type: via ? "viewRef" : "viewRef",
310
- // Will be set by caller
311
- via
312
- };
313
- const nestedDeps = extractDependencies(component.layout);
314
- for (const dep of nestedDeps) {
315
- await collect(dep.id, dep.version, id, depth + 1);
316
- }
317
- } catch (error) {
318
- console.error(`Failed to fetch dependency ${id}:`, error);
319
- }
320
- }
321
- const rootComponent = await fetchComponent2(rootId, rootVersion);
322
- if (rootComponent) {
323
- const rootDeps = extractDependencies(rootComponent.layout);
324
- for (const dep of rootDeps) {
325
- manifest[dep.id] = {
326
- version: dep.version || "latest",
327
- resolved: "",
328
- // Will be filled when fetched
329
- type: dep.type
330
- };
331
- await collect(dep.id, dep.version, void 0, 1);
332
- }
333
- }
334
- return manifest;
335
- }
336
- function detectCircularDependencies(manifest) {
337
- const graph = /* @__PURE__ */ new Map();
338
- for (const [id, entry] of Object.entries(manifest)) {
339
- if (entry.via) {
340
- const deps = graph.get(entry.via) || [];
341
- deps.push(id);
342
- graph.set(entry.via, deps);
343
- }
344
- }
345
- const visited = /* @__PURE__ */ new Set();
346
- const stack = /* @__PURE__ */ new Set();
347
- const path = [];
348
- function dfs(node) {
349
- if (stack.has(node)) {
350
- const cycleStart = path.indexOf(node);
351
- return [...path.slice(cycleStart), node];
352
- }
353
- if (visited.has(node)) {
354
- return null;
355
- }
356
- visited.add(node);
357
- stack.add(node);
358
- path.push(node);
359
- const neighbors = graph.get(node) || [];
360
- for (const neighbor of neighbors) {
361
- const cycle = dfs(neighbor);
362
- if (cycle) return cycle;
363
- }
364
- stack.delete(node);
365
- path.pop();
366
- return null;
367
- }
368
- for (const node of graph.keys()) {
369
- const cycle = dfs(node);
370
- if (cycle) return cycle;
371
- }
372
- return null;
373
- }
374
- var init_registry = __esm({
375
- "packages/runtime-core/src/registry.ts"() {
376
- }
377
- });
378
-
379
- // packages/runtime-core/src/index.ts
380
- var index_exports = {};
381
- __export(index_exports, {
382
- AnalyticsCollector: () => AnalyticsCollector,
383
- DEFAULT_CACHE_CONFIG: () => DEFAULT_CACHE_CONFIG,
384
- DEFAULT_RETRY_CONFIG: () => DEFAULT_RETRY_CONFIG,
385
- DEFAULT_SERVLY_TAILWIND_CONFIG: () => DEFAULT_SERVLY_TAILWIND_CONFIG,
386
- EVENT_HANDLERS: () => EVENT_HANDLERS,
387
- EventSystem: () => EventSystem,
388
- LongTaskObserver: () => LongTaskObserver,
389
- MemorySampler: () => MemorySampler,
390
- OverrideSystem: () => OverrideSystem,
391
- SessionManager: () => SessionManager,
392
- StateManager: () => StateManager,
393
- addClass: () => addClass,
394
- addCustomStyles: () => addCustomStyles,
395
- analytics: () => analytics,
396
- applyStyles: () => applyStyles,
397
- batchFetchComponents: () => batchFetchComponents,
398
- buildClassName: () => buildClassName,
399
- buildElementStyles: () => buildElementStyles,
400
- buildRegistryFromBundle: () => buildRegistryFromBundle,
401
- bumpVersion: () => bumpVersion,
402
- camelToKebab: () => camelToKebab,
403
- clearAllCaches: () => clearAllCaches,
404
- clearIconCache: () => clearIconCache,
405
- clearLocalStorageCache: () => clearLocalStorageCache,
406
- clearMemoryCache: () => clearMemoryCache,
407
- clearStyles: () => clearStyles,
408
- collectAllDependencies: () => collectAllDependencies,
409
- collectAllViewDependencies: () => collectAllViewDependencies,
410
- compareVersions: () => compareVersions,
411
- configureAnalytics: () => configureAnalytics,
412
- createIconSVG: () => createIconSVG,
413
- createPlaceholderIcon: () => createPlaceholderIcon,
414
- createRegistry: () => createRegistry,
415
- createServlyRenderer: () => createServlyRenderer,
416
- createViewsMap: () => createViewsMap,
417
- deepMerge: () => deepMerge,
418
- deleteValueByPath: () => deleteValueByPath,
419
- detectCircularDependencies: () => detectCircularDependencies,
420
- extractBindingKeys: () => extractBindingKeys,
421
- extractDependencies: () => extractDependencies,
422
- extractDependenciesFromCode: () => extractDependenciesFromCode,
423
- extractIconFromReactIcons: () => extractIconFromReactIcons,
424
- extractIconsForLayout: () => extractIconsForLayout,
425
- extractOverrideDependencies: () => extractOverrideDependencies,
426
- extractReferencedViewIds: () => extractReferencedViewIds,
427
- fetchComponent: () => fetchComponent,
428
- fetchComponentWithDependencies: () => fetchComponentWithDependencies,
429
- findIconsInLayout: () => findIconsInLayout,
430
- formatStyleValue: () => formatStyleValue,
431
- formatVersion: () => formatVersion,
432
- generateIconBundle: () => generateIconBundle,
433
- generateTestCases: () => generateTestCases,
434
- getAnalytics: () => getAnalytics,
435
- getCacheKey: () => getCacheKey,
436
- getCleanupOverrides: () => getCleanupOverrides,
437
- getDependencyTree: () => getDependencyTree,
438
- getEventSystem: () => getEventSystem,
439
- getFromCache: () => getFromCache,
440
- getIconData: () => getIconData,
441
- getIconDataSync: () => getIconDataSync,
442
- getIconifyCollection: () => getIconifyCollection,
443
- getLocalStorage: () => getLocalStorage,
444
- getLongTaskObserver: () => getLongTaskObserver,
445
- getMemoryCacheSize: () => getMemoryCacheSize,
446
- getMemorySampler: () => getMemorySampler,
447
- getMountOverrides: () => getMountOverrides,
448
- getOverrideSystem: () => getOverrideSystem,
449
- getRegisteredIconKeys: () => getRegisteredIconKeys,
450
- getRegistryUrl: () => getRegistryUrl,
451
- getSessionManager: () => getSessionManager,
452
- getSessionStorage: () => getSessionStorage,
453
- getSupportedIconSets: () => getSupportedIconSets,
454
- getTailwind: () => getTailwind,
455
- getUrlInfo: () => getUrlInfo,
456
- getValueByPath: () => getValueByPath,
457
- goBack: () => goBack,
458
- goForward: () => goForward,
459
- hasClass: () => hasClass,
460
- hasDependencyOverrides: () => hasDependencyOverrides,
461
- hasOverrides: () => hasOverrides,
462
- hasTemplateSyntax: () => hasTemplateSyntax,
463
- initServlyTailwind: () => initServlyTailwind,
464
- injectTailwind: () => injectTailwind,
465
- invalidateCache: () => invalidateCache,
466
- isComponentAvailable: () => isComponentAvailable,
467
- isIconCdnEnabled: () => isIconCdnEnabled,
468
- isIconRegistered: () => isIconRegistered,
469
- isIconSetSupported: () => isIconSetSupported,
470
- isTailwindLoaded: () => isTailwindLoaded,
471
- isValidSpecifier: () => isValidSpecifier,
472
- navigateTo: () => navigateTo,
473
- parseVersion: () => parseVersion,
474
- prefetchComponents: () => prefetchComponents,
475
- preloadIcons: () => preloadIcons,
476
- processStyles: () => processStyles,
477
- registerIcon: () => registerIcon,
478
- registerIcons: () => registerIcons,
479
- removeClass: () => removeClass,
480
- removeCustomStyles: () => removeCustomStyles,
481
- removeLocalStorage: () => removeLocalStorage,
482
- removeSessionStorage: () => removeSessionStorage,
483
- removeTailwind: () => removeTailwind,
484
- render: () => render,
485
- renderDynamicList: () => renderDynamicList,
486
- renderIcon: () => renderIcon,
487
- renderInShadow: () => renderInShadow,
488
- renderNode: () => renderNode,
489
- resetAnalytics: () => resetAnalytics,
490
- resetEventSystem: () => resetEventSystem,
491
- resetLongTaskObserver: () => resetLongTaskObserver,
492
- resetMemorySampler: () => resetMemorySampler,
493
- resetOverrideSystem: () => resetOverrideSystem,
494
- resetSessionManager: () => resetSessionManager,
495
- resolveBindingPath: () => resolveBindingPath,
496
- resolveTemplate: () => resolveTemplate,
497
- resolveTemplateValue: () => resolveTemplateValue,
498
- resolveTemplatesDeep: () => resolveTemplatesDeep,
499
- resolveVersion: () => resolveVersion,
500
- runAllTests: () => runAllTests,
501
- runTestCase: () => runTestCase,
502
- satisfiesVersion: () => satisfiesVersion,
503
- setIconCdnEnabled: () => setIconCdnEnabled,
504
- setInCache: () => setInCache,
505
- setLocalStorage: () => setLocalStorage,
506
- setRegistryUrl: () => setRegistryUrl,
507
- setSessionStorage: () => setSessionStorage,
508
- setValueByPath: () => setValueByPath,
509
- toDomEventName: () => toDomEventName,
510
- toReactEventName: () => toReactEventName,
511
- toggleClass: () => toggleClass,
512
- updateStyles: () => updateStyles,
513
- updateTailwindConfig: () => updateTailwindConfig,
514
- validateAssertion: () => validateAssertion,
515
- validateProps: () => validateProps
516
- });
517
- module.exports = __toCommonJS(index_exports);
1
+ import {
2
+ DEFAULT_SERVLY_TAILWIND_CONFIG,
3
+ addCustomStyles,
4
+ getTailwind,
5
+ initServlyTailwind,
6
+ injectTailwind,
7
+ isTailwindLoaded,
8
+ removeCustomStyles,
9
+ removeTailwind,
10
+ updateTailwindConfig
11
+ } from "./chunk-IWFVKY5N.js";
12
+ import {
13
+ buildRegistryFromBundle,
14
+ collectAllDependencies,
15
+ createRegistry,
16
+ detectCircularDependencies,
17
+ extractDependencies,
18
+ extractDependenciesFromCode
19
+ } from "./chunk-CIUQK4GA.js";
20
+ import "./chunk-MCKGQKYU.js";
518
21
 
519
- // packages/runtime-core/src/analyticsTypes.ts
22
+ // src/analyticsTypes.ts
520
23
  var DEFAULT_ANALYTICS_CONFIG = {
521
24
  enabled: true,
522
25
  endpoint: "/api/v1/analytics/events",
@@ -534,7 +37,7 @@ var MAX_RETRY_ATTEMPTS = 3;
534
37
  var SESSION_TIMEOUT_MS = 30 * 60 * 1e3;
535
38
  var SDK_VERSION = "1.0.0";
536
39
 
537
- // packages/runtime-core/src/sessionManager.ts
40
+ // src/sessionManager.ts
538
41
  var SESSION_STORAGE_KEY = "servly_analytics_session";
539
42
  function generateUUID() {
540
43
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
@@ -596,8 +99,8 @@ function isSessionExpired(session) {
596
99
  return now - session.lastActivityAt > SESSION_TIMEOUT_MS;
597
100
  }
598
101
  var SessionManager = class {
599
- session = null;
600
102
  constructor() {
103
+ this.session = null;
601
104
  this.initialize();
602
105
  }
603
106
  /**
@@ -677,15 +180,13 @@ function resetSessionManager() {
677
180
  sessionManagerInstance = null;
678
181
  }
679
182
 
680
- // packages/runtime-core/src/analytics.ts
183
+ // src/analytics.ts
681
184
  var AnalyticsCollector = class {
682
- config;
683
- eventQueue = [];
684
- flushTimer = null;
685
- isEnabled;
686
- isFlushing = false;
687
- retryDelay = 1e3;
688
185
  constructor(config) {
186
+ this.eventQueue = [];
187
+ this.flushTimer = null;
188
+ this.isFlushing = false;
189
+ this.retryDelay = 1e3;
689
190
  this.config = { ...DEFAULT_ANALYTICS_CONFIG, ...config };
690
191
  this.isEnabled = this.config.enabled;
691
192
  this.startFlushTimer();
@@ -1028,7 +529,7 @@ var analytics = {
1028
529
  enable: () => getAnalytics().enable()
1029
530
  };
1030
531
 
1031
- // packages/runtime-core/src/bindings.ts
532
+ // src/bindings.ts
1032
533
  var BINDING_SOURCES = [
1033
534
  "props",
1034
535
  "state",
@@ -1412,7 +913,7 @@ function extractBindingKeys(template) {
1412
913
  return Array.from(keys);
1413
914
  }
1414
915
 
1415
- // packages/runtime-core/src/styles.ts
916
+ // src/styles.ts
1416
917
  var UNITLESS_PROPERTIES = /* @__PURE__ */ new Set([
1417
918
  "animationIterationCount",
1418
919
  "borderImageOutset",
@@ -1586,9 +1087,8 @@ function updateStyles(element, oldStyles, newStyles) {
1586
1087
  }
1587
1088
  }
1588
1089
 
1589
- // packages/runtime-core/src/memorySampler.ts
1090
+ // src/memorySampler.ts
1590
1091
  var MemorySampler = class {
1591
- isSupported;
1592
1092
  constructor() {
1593
1093
  this.isSupported = this.checkSupport();
1594
1094
  }
@@ -1648,13 +1148,12 @@ function resetMemorySampler() {
1648
1148
  memorySamplerInstance = null;
1649
1149
  }
1650
1150
 
1651
- // packages/runtime-core/src/longTaskObserver.ts
1151
+ // src/longTaskObserver.ts
1652
1152
  var LongTaskObserver = class {
1653
- observer = null;
1654
- longTaskCount = 0;
1655
- isSupported;
1656
- isObserving = false;
1657
1153
  constructor() {
1154
+ this.observer = null;
1155
+ this.longTaskCount = 0;
1156
+ this.isObserving = false;
1658
1157
  this.isSupported = this.checkSupport();
1659
1158
  }
1660
1159
  /**
@@ -1744,12 +1243,11 @@ function resetLongTaskObserver() {
1744
1243
  longTaskObserverInstance = null;
1745
1244
  }
1746
1245
 
1747
- // packages/runtime-core/src/stateManager.ts
1246
+ // src/stateManager.ts
1748
1247
  var StateManager = class {
1749
- state = {};
1750
- listeners = /* @__PURE__ */ new Set();
1751
- config;
1752
1248
  constructor(config = {}) {
1249
+ this.state = {};
1250
+ this.listeners = /* @__PURE__ */ new Set();
1753
1251
  this.config = config;
1754
1252
  this.state = config.initialState || {};
1755
1253
  if (config.persistToLocalStorage && typeof localStorage !== "undefined") {
@@ -2135,7 +1633,7 @@ function getUrlInfo() {
2135
1633
  };
2136
1634
  }
2137
1635
 
2138
- // packages/runtime-core/src/eventSystem.ts
1636
+ // src/eventSystem.ts
2139
1637
  var builtInPlugins = {
2140
1638
  /**
2141
1639
  * Set state value
@@ -2401,11 +1899,9 @@ var builtInPlugins = {
2401
1899
  }
2402
1900
  };
2403
1901
  var EventSystem = class {
2404
- config;
2405
- pluginExecutors;
2406
- debounceTimers = /* @__PURE__ */ new Map();
2407
- throttleTimers = /* @__PURE__ */ new Map();
2408
1902
  constructor(config = {}) {
1903
+ this.debounceTimers = /* @__PURE__ */ new Map();
1904
+ this.throttleTimers = /* @__PURE__ */ new Map();
2409
1905
  this.config = config;
2410
1906
  this.pluginExecutors = {
2411
1907
  ...builtInPlugins,
@@ -2575,12 +2071,11 @@ function resetEventSystem() {
2575
2071
  }
2576
2072
  }
2577
2073
 
2578
- // packages/runtime-core/src/overrides.ts
2074
+ // src/overrides.ts
2579
2075
  var OverrideSystem = class {
2580
- config;
2581
- elementStates = /* @__PURE__ */ new Map();
2582
- watchIntervals = /* @__PURE__ */ new Map();
2583
2076
  constructor(config = {}) {
2077
+ this.elementStates = /* @__PURE__ */ new Map();
2078
+ this.watchIntervals = /* @__PURE__ */ new Map();
2584
2079
  this.config = config;
2585
2080
  }
2586
2081
  /**
@@ -2797,7 +2292,7 @@ function resetOverrideSystem() {
2797
2292
  }
2798
2293
  }
2799
2294
 
2800
- // packages/runtime-core/src/icons.ts
2295
+ // src/icons.ts
2801
2296
  var cdnEnabled = false;
2802
2297
  function setIconCdnEnabled(enabled) {
2803
2298
  cdnEnabled = enabled;
@@ -3107,7 +2602,7 @@ function getIconifyCollection(set) {
3107
2602
  return ICONIFY_COLLECTIONS[set];
3108
2603
  }
3109
2604
 
3110
- // packages/runtime-core/src/renderer.ts
2605
+ // src/renderer.ts
3111
2606
  var COMPONENT_TO_TAG = {
3112
2607
  container: "div",
3113
2608
  text: "span",
@@ -4029,7 +3524,7 @@ async function createServlyRenderer(options) {
4029
3524
  container = containerOption;
4030
3525
  }
4031
3526
  if (shouldInjectTailwind) {
4032
- const { initServlyTailwind: initServlyTailwind2 } = await Promise.resolve().then(() => (init_tailwind(), tailwind_exports));
3527
+ const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-3FTT56ZG.js");
4033
3528
  await initServlyTailwind2(tailwindConfig);
4034
3529
  }
4035
3530
  const activeRenders = [];
@@ -4127,7 +3622,7 @@ function collectAllViewDependencies(views, startViewId) {
4127
3622
  return collected;
4128
3623
  }
4129
3624
 
4130
- // packages/runtime-core/src/cache.ts
3625
+ // src/cache.ts
4131
3626
  var DEFAULT_CACHE_CONFIG = {
4132
3627
  maxEntries: 50,
4133
3628
  ttl: 5 * 60 * 1e3,
@@ -4371,8 +3866,7 @@ function invalidateCache(id, version, config = DEFAULT_CACHE_CONFIG) {
4371
3866
  }
4372
3867
  }
4373
3868
 
4374
- // packages/runtime-core/src/fetcher.ts
4375
- init_registry();
3869
+ // src/fetcher.ts
4376
3870
  var DEFAULT_RETRY_CONFIG = {
4377
3871
  maxRetries: 3,
4378
3872
  initialDelay: 1e3,
@@ -4400,17 +3894,33 @@ function calculateBackoffDelay(retryCount, config) {
4400
3894
  function sleep(ms) {
4401
3895
  return new Promise((resolve) => setTimeout(resolve, ms));
4402
3896
  }
4403
- function buildViewsMap(views) {
4404
- if (!views || views.length === 0) return void 0;
3897
+ function buildViewsMap(views, bundle) {
4405
3898
  const viewsMap = /* @__PURE__ */ new Map();
4406
- for (const view of views) {
4407
- viewsMap.set(view.id, {
4408
- id: view.id,
4409
- layout: view.layout,
4410
- props: view.props
4411
- });
3899
+ if (views && views.length > 0) {
3900
+ for (const view of views) {
3901
+ if (view && view.id) {
3902
+ viewsMap.set(view.id, {
3903
+ id: view.id,
3904
+ layout: view.layout,
3905
+ props: view.props
3906
+ });
3907
+ }
3908
+ }
4412
3909
  }
4413
- return viewsMap;
3910
+ if (bundle) {
3911
+ for (const [key, component] of Object.entries(bundle)) {
3912
+ const atIndex = key.lastIndexOf("@");
3913
+ const viewId = atIndex > 0 ? key.substring(0, atIndex) : key;
3914
+ if (!viewsMap.has(viewId) && component && component.layout) {
3915
+ viewsMap.set(viewId, {
3916
+ id: viewId,
3917
+ layout: component.layout,
3918
+ props: void 0
3919
+ });
3920
+ }
3921
+ }
3922
+ }
3923
+ return viewsMap.size > 0 ? viewsMap : void 0;
4414
3924
  }
4415
3925
  async function resolveVersionFromApi(id, specifier, apiKey) {
4416
3926
  if (/^\d+\.\d+\.\d+$/.test(specifier)) {
@@ -4512,7 +4022,7 @@ async function fetchComponent(id, options = {}) {
4512
4022
  if (cached.bundle) {
4513
4023
  registry = buildRegistryFromBundle(cached);
4514
4024
  }
4515
- const views = buildViewsMap(cached.views);
4025
+ const views = buildViewsMap(cached.views, cached.bundle);
4516
4026
  const duration = performance.now() - startTime;
4517
4027
  analytics.trackFetch(id, cached.version, duration, true, {
4518
4028
  cacheHit: true,
@@ -4535,7 +4045,7 @@ async function fetchComponent(id, options = {}) {
4535
4045
  if (cached.bundle) {
4536
4046
  registry = buildRegistryFromBundle(cached);
4537
4047
  }
4538
- const views = buildViewsMap(cached.views);
4048
+ const views = buildViewsMap(cached.views, cached.bundle);
4539
4049
  return {
4540
4050
  data: cached,
4541
4051
  fromCache: true,
@@ -4567,7 +4077,7 @@ async function fetchComponent(id, options = {}) {
4567
4077
  version: entry.resolved || entry.version
4568
4078
  }));
4569
4079
  }
4570
- const views = buildViewsMap(data.views);
4080
+ const views = buildViewsMap(data.views, data.bundle);
4571
4081
  const duration = performance.now() - startTime;
4572
4082
  analytics.trackFetch(id, resolvedVersion, duration, false, {
4573
4083
  cacheHit: false,
@@ -4602,7 +4112,7 @@ async function fetchComponent(id, options = {}) {
4602
4112
  async function fetchComponentWithDependencies(id, options = {}) {
4603
4113
  const result = await fetchComponent(id, { ...options, includeBundle: true });
4604
4114
  if (result.pendingDependencies && result.pendingDependencies.length > 0) {
4605
- const { createRegistry: createRegistry2 } = await Promise.resolve().then(() => (init_registry(), registry_exports));
4115
+ const { createRegistry: createRegistry2 } = await import("./registry-7UL42655.js");
4606
4116
  const registry = result.registry || createRegistry2();
4607
4117
  await Promise.all(
4608
4118
  result.pendingDependencies.map(async (dep) => {
@@ -4708,7 +4218,7 @@ async function getDependencyTree(id, options = {}) {
4708
4218
  return data.data;
4709
4219
  }
4710
4220
 
4711
- // packages/runtime-core/src/version.ts
4221
+ // src/version.ts
4712
4222
  function parseVersion(version) {
4713
4223
  const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
4714
4224
  if (!match) return null;
@@ -4820,7 +4330,7 @@ function formatVersion(version) {
4820
4330
  return `v${parsed.major}.${parsed.minor}.${parsed.patch}`;
4821
4331
  }
4822
4332
 
4823
- // packages/runtime-core/src/testRunner.ts
4333
+ // src/testRunner.ts
4824
4334
  function runTestCase(elements, testCase, container) {
4825
4335
  const startTime = performance.now();
4826
4336
  const assertionResults = [];
@@ -5075,11 +4585,7 @@ function getSampleValue(def) {
5075
4585
  }
5076
4586
  }
5077
4587
 
5078
- // packages/runtime-core/src/index.ts
5079
- init_registry();
5080
- init_tailwind();
5081
-
5082
- // packages/runtime-core/src/iconExtractor.ts
4588
+ // src/iconExtractor.ts
5083
4589
  var REACT_ICONS_PACKAGES = {
5084
4590
  Ai: "react-icons/ai",
5085
4591
  Bi: "react-icons/bi",
@@ -5123,8 +4629,8 @@ async function extractIconFromReactIcons(iconName, iconSet) {
5123
4629
  console.warn(`Icon not found: ${iconName} in ${packagePath}`);
5124
4630
  return null;
5125
4631
  }
5126
- const React = await import("react");
5127
- const { renderToStaticMarkup } = await import("react-dom/server");
4632
+ const React = await import("./react-EKMBDYIU.js");
4633
+ const { renderToStaticMarkup } = await import("./server.node-CQL3CG75.js");
5128
4634
  const svgString = renderToStaticMarkup(React.createElement(IconComponent, { size: 24 }));
5129
4635
  return parseSvgString(svgString);
5130
4636
  } catch (error) {
@@ -5214,8 +4720,7 @@ function generateIconBundle(icons) {
5214
4720
  lines.push("export { BUNDLED_ICONS };");
5215
4721
  return lines.join("\n");
5216
4722
  }
5217
- // Annotate the CommonJS export names for ESM import in node:
5218
- 0 && (module.exports = {
4723
+ export {
5219
4724
  AnalyticsCollector,
5220
4725
  DEFAULT_CACHE_CONFIG,
5221
4726
  DEFAULT_RETRY_CONFIG,
@@ -5350,4 +4855,4 @@ function generateIconBundle(icons) {
5350
4855
  updateTailwindConfig,
5351
4856
  validateAssertion,
5352
4857
  validateProps
5353
- });
4858
+ };