@elurjs/core 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +5 -5
  2. package/dist/lib/component.cjs +1 -1
  3. package/dist/lib/component.js +1 -1
  4. package/dist/lib/devtools.cjs +1 -1
  5. package/dist/lib/devtools.js +1 -1
  6. package/dist/lib/elur/component.cjs +1 -1
  7. package/dist/lib/elur/component.cjs.map +1 -1
  8. package/dist/lib/elur/component.d.cts +1 -1
  9. package/dist/lib/elur/component.d.ts +1 -1
  10. package/dist/lib/elur/component.js +1 -1
  11. package/dist/lib/elur/component.js.map +1 -1
  12. package/dist/lib/elur/devtools.cjs +1 -1
  13. package/dist/lib/elur/devtools.cjs.map +1 -1
  14. package/dist/lib/elur/devtools.js +1 -1
  15. package/dist/lib/elur/devtools.js.map +1 -1
  16. package/dist/lib/elur/lifecycle.cjs +1 -1
  17. package/dist/lib/elur/lifecycle.cjs.map +1 -1
  18. package/dist/lib/elur/lifecycle.d.cts +6 -0
  19. package/dist/lib/elur/lifecycle.d.ts +6 -0
  20. package/dist/lib/elur/lifecycle.js +40 -7
  21. package/dist/lib/elur/lifecycle.js.map +1 -1
  22. package/dist/lib/elur/reactivity.cjs +1 -1
  23. package/dist/lib/elur/reactivity.cjs.map +1 -1
  24. package/dist/lib/elur/reactivity.d.cts +7 -0
  25. package/dist/lib/elur/reactivity.d.ts +7 -0
  26. package/dist/lib/elur/reactivity.js +53 -23
  27. package/dist/lib/elur/reactivity.js.map +1 -1
  28. package/dist/lib/elur/router-registry.cjs +2 -0
  29. package/dist/lib/elur/router-registry.cjs.map +1 -0
  30. package/dist/lib/elur/router-registry.d.cts +14 -0
  31. package/dist/lib/elur/router-registry.d.ts +14 -0
  32. package/dist/lib/elur/router-registry.js +15 -0
  33. package/dist/lib/elur/router-registry.js.map +1 -0
  34. package/dist/lib/elur/router.cjs +3 -3
  35. package/dist/lib/elur/router.cjs.map +1 -1
  36. package/dist/lib/elur/router.d.cts +2 -5
  37. package/dist/lib/elur/router.d.ts +2 -5
  38. package/dist/lib/elur/router.js +159 -166
  39. package/dist/lib/elur/router.js.map +1 -1
  40. package/dist/lib/elur/template/html.cjs +1 -1
  41. package/dist/lib/elur/template/html.cjs.map +1 -1
  42. package/dist/lib/elur/template/html.js +1 -1
  43. package/dist/lib/elur/template/html.js.map +1 -1
  44. package/dist/lib/elur/template/types.cjs +1 -1
  45. package/dist/lib/elur/template/types.cjs.map +1 -1
  46. package/dist/lib/elur/template/types.js +1 -1
  47. package/dist/lib/elur/template/types.js.map +1 -1
  48. package/dist/lib/elur.cjs +1 -1
  49. package/dist/lib/elur.js +6 -5
  50. package/dist/lib/index.cjs +1 -1
  51. package/dist/lib/index.js +6 -5
  52. package/dist/lib/lifecycle.cjs +1 -1
  53. package/dist/lib/lifecycle.js +40 -7
  54. package/dist/lib/router.cjs +3 -3
  55. package/dist/lib/router.js +159 -166
  56. package/dist/lib/signals.cjs +1 -1
  57. package/dist/lib/signals.js +53 -23
  58. package/package.json +1 -1
package/README.md CHANGED
@@ -19,7 +19,7 @@ A lightweight, fully reactive framework for building modern web UIs — no virtu
19
19
  ## Installation
20
20
 
21
21
  ```bash
22
- npm install elur
22
+ npm install @elurjs/core
23
23
  ```
24
24
 
25
25
  ## Subpath Imports (Tree-Shaking)
@@ -39,12 +39,12 @@ import { provide, inject, createInjectionKey } from "elur/context";
39
39
  import { enableDevTools } from "elur/devtools";
40
40
  ```
41
41
 
42
- This is optional: `import { ... } from "elur"` remains fully supported.
42
+ This is optional: `import { ... } from "@elurjs/core"` remains fully supported.
43
43
 
44
44
  ## Quick Start
45
45
 
46
46
  ```typescript
47
- import { signal, html, ElurTemplate, ElurComponent, mount, createRouter, RouterView, Link, elurRouter } from "elur";
47
+ import { signal, html, ElurTemplate, ElurComponent, mount, createRouter, RouterView, Link, elurRouter } from "@elurjs/core";
48
48
 
49
49
  // --- Pages as function components (ElurTemplate) ---
50
50
  // Plain functions returning html`` are recommended for pages and
@@ -121,13 +121,13 @@ Everything ships in a single zero-dependency import:
121
121
  ## Server-side rendering & hydration (v3)
122
122
 
123
123
  ```bash
124
- npm install elur
124
+ npm install @elurjs/core
125
125
  ```
126
126
 
127
127
  ```typescript
128
128
  import { renderToString, renderToChunks, createServerRenderScope } from "elur/server";
129
129
  import { hydrate } from "elur/hydrate";
130
- import { raw } from "elur";
130
+ import { raw } from "@elurjs/core";
131
131
  ```
132
132
 
133
133
  - DOM-free SSR (`renderToString`), incremental streaming (`renderToChunks`) and
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./lifecycle.cjs`),t=require(`./context.cjs`),n=require(`./router.cjs`);function r(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`[elur] mount: container not found: ${e}`);return t}function i(i,a,o){if(e.isElurComponent(i)){let s=r(a);e._debugComponentMountStart(i),t._pushComponentContext();let c=()=>{},l=!1;try{o?.router&&(t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router));try{i.onInit?.()}catch(e){if(i.onError)i.onError(e);else throw e}try{c=i.render()._render(s,null)}catch(e){if(i.onError)i.onError(e),c=()=>{},l=!0;else throw e}}finally{e._debugComponentMountEnd(i),t._popComponentContext()}let u;if(!l)try{let e=i.onMount?.();typeof e==`function`&&(u=e)}catch(e){if(i.onError)i.onError(e);else throw e}return{unmount(){try{i.onUnmount?.()}catch{}try{u?.()}catch{}c(),o?.router&&n._debugUnregisterRouter(o.router),e._debugComponentUnmount(i)}}}if(!o?.router)return i.mount(a);let s=r(a);t._pushComponentContext();let c;try{t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router),c=i._render(s,null)}finally{t._popComponentContext()}return{unmount(){c(),n._debugUnregisterRouter(o.router)}}}exports.mount=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./lifecycle.cjs`),t=require(`./context.cjs`),n=require(`./elur/router-registry.cjs`);function r(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`[elur] mount: container not found: ${e}`);return t}function i(i,a,o){if(e.isElurComponent(i)){let s=r(a);e._debugComponentMountStart(i),t._pushComponentContext();let c=()=>{},l=!1;try{o?.router&&(t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router));try{i.onInit?.()}catch(e){if(i.onError)i.onError(e);else throw e}try{c=i.render()._render(s,null)}catch(e){if(i.onError)i.onError(e),c=()=>{},l=!0;else throw e}}finally{e._debugComponentMountEnd(i),t._popComponentContext()}let u;if(!l)try{let e=i.onMount?.();typeof e==`function`&&(u=e)}catch(e){if(i.onError)i.onError(e);else throw e}return{unmount(){try{i.onUnmount?.()}catch{}try{u?.()}catch{}c(),o?.router&&n._debugUnregisterRouter(o.router),e._debugComponentUnmount(i)}}}if(!o?.router)return i.mount(a);let s=r(a);t._pushComponentContext();let c;try{t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router),c=i._render(s,null)}finally{t._popComponentContext()}return{unmount(){c(),n._debugUnregisterRouter(o.router)}}}exports.mount=i;
2
2
  //# sourceMappingURL=component.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { _debugComponentMountEnd as e, _debugComponentMountStart as t, _debugComponentUnmount as n, isElurComponent as r } from "./lifecycle.js";
2
2
  import { _popComponentContext as i, _pushComponentContext as a, provide as o } from "./context.js";
3
- import { RouterKey as s, _debugRegisterRouter as c, _debugUnregisterRouter as l } from "./router.js";
3
+ import { RouterKey as s, _debugRegisterRouter as c, _debugUnregisterRouter as l } from "./elur/router-registry.js";
4
4
  //#region src/elur/component.ts
5
5
  function u(e) {
6
6
  let t = typeof e == "string" ? document.querySelector(e) : e;
@@ -42,7 +42,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
42
42
  </div>
43
43
  `}function M(e){let t=n._debugGetRouterInternal(),i=t?`${t.mode}|${t.base}|${t.currentPath}|${JSON.stringify(t.params)}|${JSON.stringify(t.query)}|${t.matchedPath}|${t.activeGuards.names.join(`,`)}`:`none`;if(r.renderedTab===`router`&&r.renderKeys.router===i)return;if(r.renderKeys.router=i,r.renderedTab=`router`,!t){e.innerHTML=`
44
44
  <strong>Router State</strong>
45
- <div style="margin-top:8px;opacity:.75">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>
45
+ <div style="margin-top:8px;opacity:.75">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>
46
46
  `;return}let a=b(t.matchedPath);e.innerHTML=`
47
47
  <strong>Router State</strong>
48
48
  <div data-elur-devtools-scroll="router" style="margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;">
@@ -248,7 +248,7 @@ function M(e) {
248
248
  let t = n(), i = t ? `${t.mode}|${t.base}|${t.currentPath}|${JSON.stringify(t.params)}|${JSON.stringify(t.query)}|${t.matchedPath}|${t.activeGuards.names.join(",")}` : "none";
249
249
  if (r.renderedTab === "router" && r.renderKeys.router === i) return;
250
250
  if (r.renderKeys.router = i, r.renderedTab = "router", !t) {
251
- e.innerHTML = "\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>\n ";
251
+ e.innerHTML = "\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>\n ";
252
252
  return;
253
253
  }
254
254
  let a = b(t.matchedPath);
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./lifecycle.cjs`),t=require(`./context.cjs`),n=require(`./router.cjs`);function r(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`[elur] mount: container not found: ${e}`);return t}function i(i,a,o){if(e.isElurComponent(i)){let s=r(a);e._debugComponentMountStart(i),t._pushComponentContext();let c=()=>{},l=!1;try{o?.router&&(t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router));try{i.onInit?.()}catch(e){if(i.onError)i.onError(e);else throw e}try{c=i.render()._render(s,null)}catch(e){if(i.onError)i.onError(e),c=()=>{},l=!0;else throw e}}finally{e._debugComponentMountEnd(i),t._popComponentContext()}let u;if(!l)try{let e=i.onMount?.();typeof e==`function`&&(u=e)}catch(e){if(i.onError)i.onError(e);else throw e}return{unmount(){try{i.onUnmount?.()}catch{}try{u?.()}catch{}c(),o?.router&&n._debugUnregisterRouter(o.router),e._debugComponentUnmount(i)}}}if(!o?.router)return i.mount(a);let s=r(a);t._pushComponentContext();let c;try{t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router),c=i._render(s,null)}finally{t._popComponentContext()}return{unmount(){c(),n._debugUnregisterRouter(o.router)}}}exports.mount=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./lifecycle.cjs`),t=require(`./context.cjs`),n=require(`./elur/router-registry.cjs`);function r(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`[elur] mount: container not found: ${e}`);return t}function i(i,a,o){if(e.isElurComponent(i)){let s=r(a);e._debugComponentMountStart(i),t._pushComponentContext();let c=()=>{},l=!1;try{o?.router&&(t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router));try{i.onInit?.()}catch(e){if(i.onError)i.onError(e);else throw e}try{c=i.render()._render(s,null)}catch(e){if(i.onError)i.onError(e),c=()=>{},l=!0;else throw e}}finally{e._debugComponentMountEnd(i),t._popComponentContext()}let u;if(!l)try{let e=i.onMount?.();typeof e==`function`&&(u=e)}catch(e){if(i.onError)i.onError(e);else throw e}return{unmount(){try{i.onUnmount?.()}catch{}try{u?.()}catch{}c(),o?.router&&n._debugUnregisterRouter(o.router),e._debugComponentUnmount(i)}}}if(!o?.router)return i.mount(a);let s=r(a);t._pushComponentContext();let c;try{t.provide(n.RouterKey,o.router),n._debugRegisterRouter(o.router),c=i._render(s,null)}finally{t._popComponentContext()}return{unmount(){c(),n._debugUnregisterRouter(o.router)}}}exports.mount=i;
2
2
  //# sourceMappingURL=component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.cjs","names":[],"sources":["../../src/elur/component.ts"],"sourcesContent":["import type { ElurTemplate, ElurMountHandle } from \"./template/index.js\";\nimport {\n isElurComponent,\n _debugComponentMountStart,\n _debugComponentMountEnd,\n _debugComponentUnmount,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport { _pushComponentContext, _popComponentContext, provide } from \"./context.js\";\nimport { RouterKey, type Router, _debugRegisterRouter, _debugUnregisterRouter } from \"./router.js\";\n\nexport interface MountOptions {\n router?: Router;\n}\n\nfunction _resolveContainer(container: Element | string): Element {\n const el =\n typeof container === \"string\"\n ? (document.querySelector(container) as Element)\n : container;\n if (!el) {\n throw new Error(`[elur] mount: container not found: ${container}`);\n }\n return el;\n}\n\n/**\n * Mounts a ElurTemplate or ElurComponent into the DOM.\n *\n * mount(Counter(), \"#app\"); // ElurTemplate (function component)\n * mount(new Timer(), \"#app\"); // ElurComponent (class with lifecycle)\n *\n * @param component ElurTemplate (result of html``) or a ElurComponent instance.\n * @param container CSS selector or HTMLElement to mount into.\n * @returns { unmount() } — disposes effects and removes DOM.\n */\nexport function mount(\n component: ElurTemplate | ElurComponent,\n container: Element | string,\n options?: MountOptions\n): ElurMountHandle {\n if (isElurComponent(component)) {\n const el = _resolveContainer(container);\n\n _debugComponentMountStart(component);\n _pushComponentContext();\n let cleanup: () => void = () => { };\n let renderFailed = false;\n try {\n if (options?.router) {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n }\n try { component.onInit?.(); } catch (e) { if (component.onError) component.onError(e); else throw e; }\n try {\n cleanup = component.render()._render(el, null);\n } catch (e) {\n if (component.onError) {\n component.onError(e);\n cleanup = () => { };\n renderFailed = true;\n } else {\n throw e;\n }\n }\n } finally {\n _debugComponentMountEnd(component);\n _popComponentContext();\n }\n\n let mountCleanup: (() => void) | undefined;\n if (!renderFailed) {\n try {\n const ret = component.onMount?.();\n if (typeof ret === \"function\") mountCleanup = ret;\n } catch (e) {\n if (component.onError) component.onError(e);\n else throw e;\n }\n }\n\n return {\n unmount() {\n try { component.onUnmount?.(); } catch { /* ignore */ }\n try { mountCleanup?.(); } catch { /* ignore */ }\n cleanup();\n if (options?.router) _debugUnregisterRouter(options.router);\n _debugComponentUnmount(component);\n },\n };\n }\n\n if (!options?.router) {\n // ElurTemplate: delegar al método .mount() interno\n return (component as ElurTemplate).mount(container);\n }\n\n // For template roots, create a context frame so elurRouter()/inject() can resolve.\n const el = _resolveContainer(container);\n _pushComponentContext();\n let cleanup: () => void;\n try {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n cleanup = (component as ElurTemplate)._render(el, null);\n } finally {\n _popComponentContext();\n }\n\n return {\n unmount() {\n cleanup();\n _debugUnregisterRouter(options.router!);\n },\n };\n}\n"],"mappings":"2JAeA,SAAS,EAAkB,EAAsC,CAC7D,IAAM,EACF,OAAO,GAAc,SACd,SAAS,cAAc,EAAU,CAClC,EACV,GAAI,CAAC,EACD,MAAU,MAAM,sCAAsC,IAAY,CAEtE,OAAO,EAaX,SAAgB,EACZ,EACA,EACA,EACe,CACf,GAAI,EAAA,gBAAgB,EAAU,CAAE,CAC5B,IAAM,EAAK,EAAkB,EAAU,CAEvC,EAAA,0BAA0B,EAAU,CACpC,EAAA,uBAAuB,CACvB,IAAI,MAA4B,GAC5B,EAAe,GACnB,GAAI,CACI,GAAS,SACT,EAAA,QAAQ,EAAA,UAAW,EAAQ,OAAO,CAClC,EAAA,qBAAqB,EAAQ,OAAO,EAExC,GAAI,CAAE,EAAU,UAAU,OAAW,EAAG,CAAE,GAAI,EAAU,QAAS,EAAU,QAAQ,EAAE,MAAO,MAAM,EAClG,GAAI,CACA,EAAU,EAAU,QAAQ,CAAC,QAAQ,EAAI,KAAK,OACzC,EAAG,CACR,GAAI,EAAU,QACV,EAAU,QAAQ,EAAE,CACpB,MAAgB,GAChB,EAAe,QAEf,MAAM,UAGR,CACN,EAAA,wBAAwB,EAAU,CAClC,EAAA,sBAAsB,CAG1B,IAAI,EACJ,GAAI,CAAC,EACD,GAAI,CACA,IAAM,EAAM,EAAU,WAAW,CAC7B,OAAO,GAAQ,aAAY,EAAe,SACzC,EAAG,CACR,GAAI,EAAU,QAAS,EAAU,QAAQ,EAAE,MACtC,MAAM,EAInB,MAAO,CACH,SAAU,CACN,GAAI,CAAE,EAAU,aAAa,MAAU,EACvC,GAAI,CAAE,KAAgB,MAAU,EAChC,GAAS,CACL,GAAS,QAAQ,EAAA,uBAAuB,EAAQ,OAAO,CAC3D,EAAA,uBAAuB,EAAU,EAExC,CAGL,GAAI,CAAC,GAAS,OAEV,OAAQ,EAA2B,MAAM,EAAU,CAIvD,IAAM,EAAK,EAAkB,EAAU,CACvC,EAAA,uBAAuB,CACvB,IAAI,EACJ,GAAI,CACA,EAAA,QAAQ,EAAA,UAAW,EAAQ,OAAO,CAClC,EAAA,qBAAqB,EAAQ,OAAO,CACpC,EAAW,EAA2B,QAAQ,EAAI,KAAK,QACjD,CACN,EAAA,sBAAsB,CAG1B,MAAO,CACH,SAAU,CACN,GAAS,CACT,EAAA,uBAAuB,EAAQ,OAAQ,EAE9C"}
1
+ {"version":3,"file":"component.cjs","names":[],"sources":["../../src/elur/component.ts"],"sourcesContent":["import type { ElurTemplate, ElurMountHandle } from \"./template/index.js\";\nimport {\n isElurComponent,\n _debugComponentMountStart,\n _debugComponentMountEnd,\n _debugComponentUnmount,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport { _pushComponentContext, _popComponentContext, provide } from \"./context.js\";\nimport { RouterKey, _debugRegisterRouter, _debugUnregisterRouter } from \"./router-registry.js\";\nimport type { Router } from \"./router.js\";\n\nexport interface MountOptions {\n router?: Router;\n}\n\nfunction _resolveContainer(container: Element | string): Element {\n const el =\n typeof container === \"string\"\n ? (document.querySelector(container) as Element)\n : container;\n if (!el) {\n throw new Error(`[elur] mount: container not found: ${container}`);\n }\n return el;\n}\n\n/**\n * Mounts a ElurTemplate or ElurComponent into the DOM.\n *\n * mount(Counter(), \"#app\"); // ElurTemplate (function component)\n * mount(new Timer(), \"#app\"); // ElurComponent (class with lifecycle)\n *\n * @param component ElurTemplate (result of html``) or a ElurComponent instance.\n * @param container CSS selector or HTMLElement to mount into.\n * @returns { unmount() } — disposes effects and removes DOM.\n */\nexport function mount(\n component: ElurTemplate | ElurComponent,\n container: Element | string,\n options?: MountOptions\n): ElurMountHandle {\n if (isElurComponent(component)) {\n const el = _resolveContainer(container);\n\n _debugComponentMountStart(component);\n _pushComponentContext();\n let cleanup: () => void = () => { };\n let renderFailed = false;\n try {\n if (options?.router) {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n }\n try { component.onInit?.(); } catch (e) { if (component.onError) component.onError(e); else throw e; }\n try {\n cleanup = component.render()._render(el, null);\n } catch (e) {\n if (component.onError) {\n component.onError(e);\n cleanup = () => { };\n renderFailed = true;\n } else {\n throw e;\n }\n }\n } finally {\n _debugComponentMountEnd(component);\n _popComponentContext();\n }\n\n let mountCleanup: (() => void) | undefined;\n if (!renderFailed) {\n try {\n const ret = component.onMount?.();\n if (typeof ret === \"function\") mountCleanup = ret;\n } catch (e) {\n if (component.onError) component.onError(e);\n else throw e;\n }\n }\n\n return {\n unmount() {\n try { component.onUnmount?.(); } catch { /* ignore */ }\n try { mountCleanup?.(); } catch { /* ignore */ }\n cleanup();\n if (options?.router) _debugUnregisterRouter(options.router);\n _debugComponentUnmount(component);\n },\n };\n }\n\n if (!options?.router) {\n // ElurTemplate: delegar al método .mount() interno\n return (component as ElurTemplate).mount(container);\n }\n\n // For template roots, create a context frame so elurRouter()/inject() can resolve.\n const el = _resolveContainer(container);\n _pushComponentContext();\n let cleanup: () => void;\n try {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n cleanup = (component as ElurTemplate)._render(el, null);\n } finally {\n _popComponentContext();\n }\n\n return {\n unmount() {\n clean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,uBAAuB,CACvB,IAAI,EACJ,GAAI,CACA,EAAA,QAAQ,EAAA,UAAW,EAAQ,OAAO,CAClC,EAAA,qBAAqB,EAAQ,OAAO,CACpC,EAAW,EAA2B,QAAQ,EAAI,KAAK,QACjD,CACN,EAAA,sBAAsB,CAG1B,MAAO,CACH,SAAU,CACN,GAAS,CACT,EAAA,uBAAuB,EAAQ,OAAQ,EAE9C"}
@@ -1,6 +1,6 @@
1
1
  import type { ElurTemplate, ElurMountHandle } from "./template/index.js";
2
2
  import { type ElurComponent } from "./lifecycle.js";
3
- import { type Router } from "./router.js";
3
+ import type { Router } from "./router.js";
4
4
  export interface MountOptions {
5
5
  router?: Router;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import type { ElurTemplate, ElurMountHandle } from "./template/index.js";
2
2
  import { type ElurComponent } from "./lifecycle.js";
3
- import { type Router } from "./router.js";
3
+ import type { Router } from "./router.js";
4
4
  export interface MountOptions {
5
5
  router?: Router;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { _debugComponentMountEnd as e, _debugComponentMountStart as t, _debugComponentUnmount as n, isElurComponent as r } from "./lifecycle.js";
2
2
  import { _popComponentContext as i, _pushComponentContext as a, provide as o } from "./context.js";
3
- import { RouterKey as s, _debugRegisterRouter as c, _debugUnregisterRouter as l } from "./router.js";
3
+ import { RouterKey as s, _debugRegisterRouter as c, _debugUnregisterRouter as l } from "./elur/router-registry.js";
4
4
  //#region src/elur/component.ts
5
5
  function u(e) {
6
6
  let t = typeof e == "string" ? document.querySelector(e) : e;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","names":[],"sources":["../../src/elur/component.ts"],"sourcesContent":["import type { ElurTemplate, ElurMountHandle } from \"./template/index.js\";\nimport {\n isElurComponent,\n _debugComponentMountStart,\n _debugComponentMountEnd,\n _debugComponentUnmount,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport { _pushComponentContext, _popComponentContext, provide } from \"./context.js\";\nimport { RouterKey, type Router, _debugRegisterRouter, _debugUnregisterRouter } from \"./router.js\";\n\nexport interface MountOptions {\n router?: Router;\n}\n\nfunction _resolveContainer(container: Element | string): Element {\n const el =\n typeof container === \"string\"\n ? (document.querySelector(container) as Element)\n : container;\n if (!el) {\n throw new Error(`[elur] mount: container not found: ${container}`);\n }\n return el;\n}\n\n/**\n * Mounts a ElurTemplate or ElurComponent into the DOM.\n *\n * mount(Counter(), \"#app\"); // ElurTemplate (function component)\n * mount(new Timer(), \"#app\"); // ElurComponent (class with lifecycle)\n *\n * @param component ElurTemplate (result of html``) or a ElurComponent instance.\n * @param container CSS selector or HTMLElement to mount into.\n * @returns { unmount() } — disposes effects and removes DOM.\n */\nexport function mount(\n component: ElurTemplate | ElurComponent,\n container: Element | string,\n options?: MountOptions\n): ElurMountHandle {\n if (isElurComponent(component)) {\n const el = _resolveContainer(container);\n\n _debugComponentMountStart(component);\n _pushComponentContext();\n let cleanup: () => void = () => { };\n let renderFailed = false;\n try {\n if (options?.router) {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n }\n try { component.onInit?.(); } catch (e) { if (component.onError) component.onError(e); else throw e; }\n try {\n cleanup = component.render()._render(el, null);\n } catch (e) {\n if (component.onError) {\n component.onError(e);\n cleanup = () => { };\n renderFailed = true;\n } else {\n throw e;\n }\n }\n } finally {\n _debugComponentMountEnd(component);\n _popComponentContext();\n }\n\n let mountCleanup: (() => void) | undefined;\n if (!renderFailed) {\n try {\n const ret = component.onMount?.();\n if (typeof ret === \"function\") mountCleanup = ret;\n } catch (e) {\n if (component.onError) component.onError(e);\n else throw e;\n }\n }\n\n return {\n unmount() {\n try { component.onUnmount?.(); } catch { /* ignore */ }\n try { mountCleanup?.(); } catch { /* ignore */ }\n cleanup();\n if (options?.router) _debugUnregisterRouter(options.router);\n _debugComponentUnmount(component);\n },\n };\n }\n\n if (!options?.router) {\n // ElurTemplate: delegar al método .mount() interno\n return (component as ElurTemplate).mount(container);\n }\n\n // For template roots, create a context frame so elurRouter()/inject() can resolve.\n const el = _resolveContainer(container);\n _pushComponentContext();\n let cleanup: () => void;\n try {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n cleanup = (component as ElurTemplate)._render(el, null);\n } finally {\n _popComponentContext();\n }\n\n return {\n unmount() {\n cleanup();\n _debugUnregisterRouter(options.router!);\n },\n };\n}\n"],"mappings":";;;;AAeA,SAAS,EAAkB,GAAsC;CAC7D,IAAM,IACF,OAAO,KAAc,WACd,SAAS,cAAc,EAAU,GAClC;AACV,KAAI,CAAC,EACD,OAAU,MAAM,sCAAsC,IAAY;AAEtE,QAAO;;AAaX,SAAgB,EACZ,GACA,GACA,GACe;AACf,KAAI,EAAgB,EAAU,EAAE;EAC5B,IAAM,IAAK,EAAkB,EAAU;AAGvC,EADA,EAA0B,EAAU,EACpC,GAAuB;EACvB,IAAI,UAA4B,IAC5B,IAAe;AACnB,MAAI;AACA,GAAI,GAAS,WACT,EAAQ,GAAW,EAAQ,OAAO,EAClC,EAAqB,EAAQ,OAAO;AAExC,OAAI;AAAE,MAAU,UAAU;YAAW,GAAG;AAAE,QAAI,EAAU,QAAS,GAAU,QAAQ,EAAE;QAAO,OAAM;;AAClG,OAAI;AACA,QAAU,EAAU,QAAQ,CAAC,QAAQ,GAAI,KAAK;YACzC,GAAG;AACR,QAAI,EAAU,QAGV,CAFA,EAAU,QAAQ,EAAE,EACpB,UAAgB,IAChB,IAAe;QAEf,OAAM;;YAGR;AAEN,GADA,EAAwB,EAAU,EAClC,GAAsB;;EAG1B,IAAI;AACJ,MAAI,CAAC,EACD,KAAI;GACA,IAAM,IAAM,EAAU,WAAW;AACjC,GAAI,OAAO,KAAQ,eAAY,IAAe;WACzC,GAAG;AACR,OAAI,EAAU,QAAS,GAAU,QAAQ,EAAE;OACtC,OAAM;;AAInB,SAAO,EACH,UAAU;AACN,OAAI;AAAE,MAAU,aAAa;WAAU;AACvC,OAAI;AAAE,SAAgB;WAAU;AAGhC,GAFA,GAAS,EACL,GAAS,UAAQ,EAAuB,EAAQ,OAAO,EAC3D,EAAuB,EAAU;KAExC;;AAGL,KAAI,CAAC,GAAS,OAEV,QAAQ,EAA2B,MAAM,EAAU;CAIvD,IAAM,IAAK,EAAkB,EAAU;AACvC,IAAuB;CACvB,IAAI;AACJ,KAAI;AAGA,EAFA,EAAQ,GAAW,EAAQ,OAAO,EAClC,EAAqB,EAAQ,OAAO,EACpC,IAAW,EAA2B,QAAQ,GAAI,KAAK;WACjD;AACN,KAAsB;;AAG1B,QAAO,EACH,UAAU;AAEN,EADA,GAAS,EACT,EAAuB,EAAQ,OAAQ;IAE9C"}
1
+ {"version":3,"file":"component.js","names":[],"sources":["../../src/elur/component.ts"],"sourcesContent":["import type { ElurTemplate, ElurMountHandle } from \"./template/index.js\";\nimport {\n isElurComponent,\n _debugComponentMountStart,\n _debugComponentMountEnd,\n _debugComponentUnmount,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport { _pushComponentContext, _popComponentContext, provide } from \"./context.js\";\nimport { RouterKey, _debugRegisterRouter, _debugUnregisterRouter } from \"./router-registry.js\";\nimport type { Router } from \"./router.js\";\n\nexport interface MountOptions {\n router?: Router;\n}\n\nfunction _resolveContainer(container: Element | string): Element {\n const el =\n typeof container === \"string\"\n ? (document.querySelector(container) as Element)\n : container;\n if (!el) {\n throw new Error(`[elur] mount: container not found: ${container}`);\n }\n return el;\n}\n\n/**\n * Mounts a ElurTemplate or ElurComponent into the DOM.\n *\n * mount(Counter(), \"#app\"); // ElurTemplate (function component)\n * mount(new Timer(), \"#app\"); // ElurComponent (class with lifecycle)\n *\n * @param component ElurTemplate (result of html``) or a ElurComponent instance.\n * @param container CSS selector or HTMLElement to mount into.\n * @returns { unmount() } — disposes effects and removes DOM.\n */\nexport function mount(\n component: ElurTemplate | ElurComponent,\n container: Element | string,\n options?: MountOptions\n): ElurMountHandle {\n if (isElurComponent(component)) {\n const el = _resolveContainer(container);\n\n _debugComponentMountStart(component);\n _pushComponentContext();\n let cleanup: () => void = () => { };\n let renderFailed = false;\n try {\n if (options?.router) {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n }\n try { component.onInit?.(); } catch (e) { if (component.onError) component.onError(e); else throw e; }\n try {\n cleanup = component.render()._render(el, null);\n } catch (e) {\n if (component.onError) {\n component.onError(e);\n cleanup = () => { };\n renderFailed = true;\n } else {\n throw e;\n }\n }\n } finally {\n _debugComponentMountEnd(component);\n _popComponentContext();\n }\n\n let mountCleanup: (() => void) | undefined;\n if (!renderFailed) {\n try {\n const ret = component.onMount?.();\n if (typeof ret === \"function\") mountCleanup = ret;\n } catch (e) {\n if (component.onError) component.onError(e);\n else throw e;\n }\n }\n\n return {\n unmount() {\n try { component.onUnmount?.(); } catch { /* ignore */ }\n try { mountCleanup?.(); } catch { /* ignore */ }\n cleanup();\n if (options?.router) _debugUnregisterRouter(options.router);\n _debugComponentUnmount(component);\n },\n };\n }\n\n if (!options?.router) {\n // ElurTemplate: delegar al método .mount() interno\n return (component as ElurTemplate).mount(container);\n }\n\n // For template roots, create a context frame so elurRouter()/inject() can resolve.\n const el = _resolveContainer(container);\n _pushComponentContext();\n let cleanup: () => void;\n try {\n provide(RouterKey, options.router);\n _debugRegisterRouter(options.router);\n cleanup = (component as ElurTemplate)._render(el, null);\n } finally {\n _popComponentContext();\n }\n\n return {\n unmount() {\n cleanup();\n _debugUnregisterRouter(options.router!);\n },\n };\n}\n"],"mappings":";;;;AAgBA,SAAS,EAAkB,GAAsC;CAC7D,IAAM,IACF,OAAO,KAAc,WACd,SAAS,cAAc,EAAU,GAClC;AACV,KAAI,CAAC,EACD,OAAU,MAAM,sCAAsC,IAAY;AAEtE,QAAO;;AAaX,SAAgB,EACZ,GACA,GACA,GACe;AACf,KAAI,EAAgB,EAAU,EAAE;EAC5B,IAAM,IAAK,EAAkB,EAAU;AAGvC,EADA,EAA0B,EAAU,EACpC,GAAuB;EACvB,IAAI,UAA4B,IAC5B,IAAe;AACnB,MAAI;AACA,GAAI,GAAS,WACT,EAAQ,GAAW,EAAQ,OAAO,EAClC,EAAqB,EAAQ,OAAO;AAExC,OAAI;AAAE,MAAU,UAAU;YAAW,GAAG;AAAE,QAAI,EAAU,QAAS,GAAU,QAAQ,EAAE;QAAO,OAAM;;AAClG,OAAI;AACA,QAAU,EAAU,QAAQ,CAAC,QAAQ,GAAI,KAAK;YACzC,GAAG;AACR,QAAI,EAAU,QAGV,CAFA,EAAU,QAAQ,EAAE,EACpB,UAAgB,IAChB,IAAe;QAEf,OAAM;;YAGR;AAEN,GADA,EAAwB,EAAU,EAClC,GAAsB;;EAG1B,IAAI;AACJ,MAAI,CAAC,EACD,KAAI;GACA,IAAM,IAAM,EAAU,WAAW;AACjC,GAAI,OAAO,KAAQ,eAAY,IAAe;WACzC,GAAG;AACR,OAAI,EAAU,QAAS,GAAU,QAAQ,EAAE;OACtC,OAAM;;AAInB,SAAO,EACH,UAAU;AACN,OAAI;AAAE,MAAU,aAAa;WAAU;AACvC,OAAI;AAAE,SAAgB;WAAU;AAGhC,GAFA,GAAS,EACL,GAAS,UAAQ,EAAuB,EAAQ,OAAO,EAC3D,EAAuB,EAAU;KAExC;;AAGL,KAAI,CAAC,GAAS,OAEV,QAAQ,EAA2B,MAAM,EAAU;CAIvD,IAAM,IAAK,EAAkB,EAAU;AACvC,IAAuB;CACvB,IAAI;AACJ,KAAI;AAGA,EAFA,EAAQ,GAAW,EAAQ,OAAO,EAClC,EAAqB,EAAQ,OAAO,EACpC,IAAW,EAA2B,QAAQ,GAAI,KAAK;WACjD;AACN,KAAsB;;AAG1B,QAAO,EACH,UAAU;AAEN,EADA,GAAS,EACT,EAAuB,EAAQ,OAAQ;IAE9C"}
@@ -42,7 +42,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
42
42
  </div>
43
43
  `}function M(e){let t=n._debugGetRouterInternal(),i=t?`${t.mode}|${t.base}|${t.currentPath}|${JSON.stringify(t.params)}|${JSON.stringify(t.query)}|${t.matchedPath}|${t.activeGuards.names.join(`,`)}`:`none`;if(r.renderedTab===`router`&&r.renderKeys.router===i)return;if(r.renderKeys.router=i,r.renderedTab=`router`,!t){e.innerHTML=`
44
44
  <strong>Router State</strong>
45
- <div style="margin-top:8px;opacity:.75">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>
45
+ <div style="margin-top:8px;opacity:.75">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>
46
46
  `;return}let a=b(t.matchedPath);e.innerHTML=`
47
47
  <strong>Router State</strong>
48
48
  <div data-elur-devtools-scroll="router" style="margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;">
@@ -1 +1 @@
1
- {"version":3,"file":"devtools.cjs","names":[],"sources":["../../src/elur/devtools.ts"],"sourcesContent":["import { _debugGetRouterInternal } from \"./router.js\";\nimport {\n _setComponentDebugHooks,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport {\n _setSignalDebugHooks,\n type Signal,\n} from \"./reactivity.js\";\n\nexport interface DevToolsOptions {\n refreshMs?: number;\n historyLimit?: number;\n initiallyOpen?: boolean;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\ntype _DevToolsTab = \"signals\" | \"components\" | \"router\";\n\ninterface _DevToolsState {\n enabled: boolean;\n activeTab: _DevToolsTab;\n renderedTab: _DevToolsTab | null;\n refreshId: ReturnType<typeof setInterval> | null;\n root: HTMLDivElement | null;\n panel: HTMLDivElement | null;\n content: HTMLDivElement | null;\n dispose: (() => void) | null;\n renderKeys: Record<_DevToolsTab, string>;\n scrollMemo: Record<_DevToolsTab, { top: number; left: number }>;\n}\n\nconst _state: _DevToolsState = {\n enabled: false,\n activeTab: \"signals\",\n renderedTab: null,\n refreshId: null,\n root: null,\n panel: null,\n content: null,\n dispose: null,\n renderKeys: { signals: \"\", components: \"\", router: \"\" },\n scrollMemo: {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n },\n};\n\ntype _SignalRef = { deref(): Signal<any> | undefined };\n\ninterface _SignalMeta {\n id: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _SignalSnapshot {\n id: number;\n value: unknown;\n subscriberCount: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _ComponentSnapshot {\n id: number;\n parentId: number | null;\n debugName: string;\n mountedAt: number;\n hasDefaultSlot: boolean;\n slotNames: string[];\n props: Record<string, unknown>;\n}\n\ninterface _ComponentRecord extends _ComponentSnapshot {\n ref: _ComponentRef;\n}\n\ntype _ComponentRef = { deref(): ElurComponent | undefined };\n\nconst _signalRefs = new Set<_SignalRef>();\nlet _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\nlet _signalSeq = 1;\nlet _signalHistoryLimit = 50;\n\nlet _componentIds = new WeakMap<ElurComponent, number>();\nconst _componentMounted = new Map<number, _ComponentRecord>();\nconst _componentMountStack: number[] = [];\nlet _componentSeq = 1;\n\nfunction _makeSignalRef<T>(s: Signal<T>): _SignalRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(s) as _SignalRef;\n return { deref: () => s };\n}\n\nfunction _makeComponentRef(inst: ElurComponent): _ComponentRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(inst) as _ComponentRef;\n return { deref: () => inst };\n}\n\nfunction _trimSignalHistory(meta: _SignalMeta): void {\n if (meta.history.length > _signalHistoryLimit) {\n meta.history.splice(0, meta.history.length - _signalHistoryLimit);\n }\n}\n\nfunction _ensureSignalMeta<T>(s: Signal<T>, initialValue: T): _SignalMeta {\n const existing = _signalMeta.get(s);\n if (existing) {\n _trimSignalHistory(existing);\n return existing;\n }\n\n const now = Date.now();\n const meta: _SignalMeta = {\n id: _signalSeq++,\n createdAt: now,\n lastUpdated: now,\n history: [{ at: now, value: initialValue }],\n };\n _signalMeta.set(s, meta);\n _signalRefs.add(_makeSignalRef(s));\n return meta;\n}\n\n/** @internal Exported for testing. */\nexport function _listSignals(): _SignalSnapshot[] {\n const out: _SignalSnapshot[] = [];\n\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n\n const meta = _signalMeta.get(s);\n if (!meta) continue;\n\n const subCount = (s as unknown as { _subs?: Set<() => void> })._subs?.size ?? 0;\n\n out.push({\n id: meta.id,\n value: s.peek(),\n subscriberCount: subCount,\n createdAt: meta.createdAt,\n lastUpdated: meta.lastUpdated,\n history: meta.history.slice(),\n });\n }\n\n out.sort((a, b) => b.lastUpdated - a.lastUpdated);\n return out;\n}\n\nfunction _componentName(inst: ElurComponent): string {\n const maybeDebugName = (inst as { _debugName?: string })._debugName;\n if (maybeDebugName && maybeDebugName.trim()) return maybeDebugName;\n const ctor = (inst as { constructor?: { name?: string } }).constructor;\n return ctor?.name && ctor.name.trim() ? ctor.name : \"AnonymousComponent\";\n}\n\nfunction _componentSlotNames(inst: ElurComponent): string[] {\n const slots = (inst as unknown as { _slots?: unknown })._slots;\n if (!(slots instanceof Map)) return [];\n return Array.from(slots.keys()).map((k) => String(k));\n}\n\nfunction _componentProps(inst: ElurComponent): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(inst as unknown as Record<string, unknown>)) {\n if (\n key === \"__isElurComponent\" ||\n key === \"children\" ||\n key === \"_debugName\" ||\n key.startsWith(\"_\")\n ) {\n continue;\n }\n const value = (inst as unknown as Record<string, unknown>)[key];\n if (typeof value === \"function\") continue;\n out[key] = value;\n }\n return out;\n}\n\nfunction _mountPathChain(fullPath: string | null): string[] {\n if (!fullPath) return [];\n if (fullPath === \"*\") return [\"*\"];\n\n const parts = fullPath.split(\"/\").filter(Boolean);\n const out: string[] = [];\n let cur = \"\";\n for (const part of parts) {\n cur += \"/\" + part;\n out.push(cur);\n }\n return out.length > 0 ? out : [\"/\"];\n}\n\nfunction _listMountedComponents(): _ComponentSnapshot[] {\n const out: _ComponentSnapshot[] = [];\n\n for (const [id, item] of _componentMounted) {\n const inst = item.ref.deref();\n if (!inst) {\n _componentMounted.delete(id);\n continue;\n }\n\n // Keep rows fresh while panel is open (debug name/props can change after mount).\n item.debugName = _componentName(inst);\n item.hasDefaultSlot = inst.children != null;\n item.slotNames = _componentSlotNames(inst);\n item.props = _componentProps(inst);\n\n out.push({\n id: item.id,\n parentId: item.parentId,\n debugName: item.debugName,\n mountedAt: item.mountedAt,\n hasDefaultSlot: item.hasDefaultSlot,\n slotNames: [...item.slotNames],\n props: { ...item.props },\n });\n }\n\n out.sort((a, b) => a.id - b.id);\n return out;\n}\n\nfunction _removeMountedComponentSubtree(rootId: number): void {\n const pending = [rootId];\n while (pending.length > 0) {\n const current = pending.pop()!;\n for (const [id, record] of _componentMounted) {\n if (record.parentId === current) pending.push(id);\n }\n _componentMounted.delete(current);\n }\n}\n\nfunction _resetDevtoolsStores(): void {\n _signalRefs.clear();\n _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\n _signalSeq = 1;\n\n _componentIds = new WeakMap<ElurComponent, number>();\n _componentMounted.clear();\n _componentMountStack.length = 0;\n _componentSeq = 1;\n}\n\nfunction _safeStringify(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\nfunction _escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\\\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n\nfunction _valuePreview(value: unknown, max = 90): string {\n const raw = _safeStringify(value);\n if (raw.length <= max) return raw;\n return raw.slice(0, max - 1) + \"…\";\n}\n\nfunction _relativeTime(ts: number): string {\n if (!ts) return \"-\";\n const diff = Date.now() - ts;\n if (diff < 1000) return `${diff}ms ago`;\n if (diff < 60_000) return `${Math.floor(diff / 1000)}s ago`;\n return `${Math.floor(diff / 60_000)}m ago`;\n}\n\nfunction _renderSignals(target: HTMLDivElement): void {\n const signals = _listSignals();\n const key = `${signals.length}:${signals.map((s) => `${s.id}-${s.lastUpdated}-${s.subscriberCount}`).join(\"|\")}`;\n if (_state.renderedTab === \"signals\" && _state.renderKeys.signals === key) return;\n _state.renderKeys.signals = key;\n _state.renderedTab = \"signals\";\n\n const rows = signals\n .map((s) => {\n const fullValue = _safeStringify(s.value);\n const preview = _valuePreview(s.value, 120);\n return `<tr data-elur-devtools-signal-id=\"${s.id}\">\n <td style=\"padding:6px 8px;white-space:nowrap;\">${s.id}</td>\n <td style=\"padding:6px 8px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;\" title=\"${_escapeHtml(fullValue)}\">${_escapeHtml(preview)}</td>\n <td>${s.subscriberCount}</td>\n <td data-elur-devtools-history-count=\"${s.history.length}\">${s.history.length}</td>\n <td>${_relativeTime(s.lastUpdated)}</td>\n </tr>`;\n })\n .join(\"\");\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Signals</strong>\n <span style=\"opacity:.8\">${signals.length} active</span>\n </div>\n <div data-elur-devtools-scroll=\"signals\" style=\"max-height:260px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n <table style=\"width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;\">\n <thead>\n <tr style=\"background:#1f1f24;\">\n <th style=\"text-align:left;padding:6px 8px;width:42px;\">ID</th>\n <th style=\"text-align:left;padding:6px 8px;\">Value</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">Subs</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">History</th>\n <th style=\"text-align:left;padding:6px 8px;width:84px;\">Updated</th>\n </tr>\n </thead>\n <tbody>${rows}</tbody>\n </table>\n </div>\n <p style=\"margin:8px 0 0 0;font-size:11px;opacity:.75;\">Click a row to log full history in console.</p>\n `;\n\n for (const row of target.querySelectorAll<HTMLTableRowElement>(\"tr[data-elur-devtools-signal-id]\")) {\n row.style.cursor = \"pointer\";\n row.addEventListener(\"click\", () => {\n const id = Number(row.dataset.elurDevtoolsSignalId);\n const signal = signals.find((s) => s.id === id);\n if (!signal) return;\n console.group(`[Elur DevTools] Signal #${signal.id}`);\n console.log(\"Current value:\", signal.value);\n console.log(\"Subscribers:\", signal.subscriberCount);\n console.table(signal.history.map((h) => ({ at: new Date(h.at).toISOString(), value: h.value })));\n console.groupEnd();\n });\n }\n}\n\ninterface _TreeNode extends _ComponentSnapshot {\n children: _TreeNode[];\n}\n\nfunction _buildComponentTree(rows: _ComponentSnapshot[]): _TreeNode[] {\n const byId = new Map<number, _TreeNode>();\n const roots: _TreeNode[] = [];\n\n for (const row of rows) {\n byId.set(row.id, { ...row, children: [] });\n }\n\n for (const node of byId.values()) {\n if (node.parentId == null) {\n roots.push(node);\n continue;\n }\n const parent = byId.get(node.parentId);\n if (!parent) {\n roots.push(node);\n continue;\n }\n parent.children.push(node);\n }\n\n return roots;\n}\n\nfunction _renderTreeNode(node: _TreeNode, depth: number): string {\n const pad = 10 + depth * 14;\n const props = Object.keys(node.props).length > 0 ? _safeStringify(node.props) : \"{}\";\n const slots = node.slotNames.length > 0 ? node.slotNames.join(\", \") : \"none\";\n\n const header = `<div style=\"padding:6px 8px 6px ${pad}px;border-bottom:1px solid #24242b;\">\n <div><strong>${_escapeHtml(node.debugName)}</strong> <span style=\"opacity:.7\">#${node.id}</span></div>\n <div style=\"font-size:11px;opacity:.8;\">slots: ${slots} | default-slot: ${node.hasDefaultSlot ? \"yes\" : \"no\"}</div>\n <div style=\"font-size:11px;opacity:.8;\">props: ${_escapeHtml(_valuePreview(props, 180))}</div>\n </div>`;\n\n return header + node.children.map((c) => _renderTreeNode(c, depth + 1)).join(\"\");\n}\n\nfunction _renderComponents(target: HTMLDivElement): void {\n const rows = _listMountedComponents();\n const router = _debugGetRouterInternal();\n const routeKey = router ? `${router.currentPath}|${router.matchedPath ?? \"\"}` : \"no-router\";\n const key = `${routeKey}:${rows.length}:${rows.map((r) => `${r.id}-${r.parentId}-${r.debugName}-${r.hasDefaultSlot}-${r.slotNames.join(\",\")}-${_safeStringify(r.props)}`).join(\"|\")}`;\n if (_state.renderedTab === \"components\" && _state.renderKeys.components === key) return;\n _state.renderKeys.components = key;\n _state.renderedTab = \"components\";\n\n const roots = _buildComponentTree(rows);\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Component Tree</strong>\n <span style=\"opacity:.8\">${rows.length} mounted</span>\n </div>\n <div style=\"font-size:11px;opacity:.82;margin-bottom:8px;display:flex;gap:8px;flex-wrap:wrap;\">\n <span><b>current:</b> ${_escapeHtml(router?.currentPath ?? \"-\")}</span>\n <span><b>matched:</b> ${_escapeHtml(router?.matchedPath ?? \"none\")}</span>\n </div>\n <div data-elur-devtools-scroll=\"components\" style=\"max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n ${roots.length > 0\n ? roots.map((r) => _renderTreeNode(r, 0)).join(\"\")\n : \"<div style='padding:10px;opacity:.75'>No mounted components tracked. Enable devtools before your first mount() to capture initial tree.</div>\"}\n </div>\n `;\n}\n\nfunction _renderRouter(target: HTMLDivElement): void {\n const router = _debugGetRouterInternal();\n const key = router\n ? `${router.mode}|${router.base}|${router.currentPath}|${JSON.stringify(router.params)}|${JSON.stringify(router.query)}|${router.matchedPath}|${router.activeGuards.names.join(\",\")}`\n : \"none\";\n if (_state.renderedTab === \"router\" && _state.renderKeys.router === key) return;\n _state.renderKeys.router = key;\n _state.renderedTab = \"router\";\n\n if (!router) {\n target.innerHTML = `\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>\n `;\n return;\n }\n\n const chain = _mountPathChain(router.matchedPath);\n target.innerHTML = `\n <strong>Router State</strong>\n <div data-elur-devtools-scroll=\"router\" style=\"margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;\">\n <div><b>mode</b>: ${router.mode}</div>\n <div><b>base</b>: ${router.base}</div>\n <div><b>current</b>: ${_escapeHtml(router.currentPath)}</div>\n <div><b>params</b>: ${_escapeHtml(_safeStringify(router.params))}</div>\n <div><b>query</b>: ${_escapeHtml(_safeStringify(router.query))}</div>\n <div><b>matched</b>: ${_escapeHtml(router.matchedPath ?? \"none\")}</div>\n <div><b>matched chain</b>: ${chain.length > 0 ? _escapeHtml(chain.join(\" -> \")) : \"none\"}</div>\n <div><b>guards</b>: ${router.activeGuards.names.length > 0 ? _escapeHtml(router.activeGuards.names.join(\", \")) : \"none\"}</div>\n </div>\n `;\n}\n\nfunction _rememberScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n}\n\nfunction _restoreScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n const memo = _state.scrollMemo[tab];\n box.scrollTop = memo.top;\n box.scrollLeft = memo.left;\n if (box.dataset.elurDevtoolsScrollBound !== \"1\") {\n box.addEventListener(\"scroll\", () => {\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n }, { passive: true });\n box.dataset.elurDevtoolsScrollBound = \"1\";\n }\n}\n\nfunction _refreshPanel(force = false): void {\n if (!_state.content) return;\n\n const tab = _state.activeTab;\n if (!force) _rememberScroll(tab);\n\n if (_state.activeTab === \"signals\") {\n _renderSignals(_state.content);\n _restoreScroll(\"signals\");\n return;\n }\n if (_state.activeTab === \"components\") {\n _renderComponents(_state.content);\n _restoreScroll(\"components\");\n return;\n }\n _renderRouter(_state.content);\n _restoreScroll(\"router\");\n}\n\nfunction _syncTabButtons(): void {\n if (!_state.panel) return;\n for (const btn of _state.panel.querySelectorAll<HTMLButtonElement>(\"button[data-elur-devtools-tab]\")) {\n const isActive = btn.dataset.elurDevtoolsTab === _state.activeTab;\n btn.style.background = isActive ? \"#2d4c7a\" : \"#1f1f24\";\n }\n}\n\nfunction _createOverlay(options: Required<Pick<DevToolsOptions, \"position\">>): void {\n const root = document.createElement(\"div\");\n root.setAttribute(\"data-elur-devtools-root\", \"\");\n root.style.position = \"fixed\";\n root.style.zIndex = \"2147483647\";\n root.style.bottom = \"16px\";\n root.style.right = options.position === \"bottom-right\" ? \"16px\" : \"auto\";\n root.style.left = options.position === \"bottom-left\" ? \"16px\" : \"auto\";\n root.style.fontFamily = \"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif\";\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = \"Elur DevTools\";\n button.setAttribute(\"data-elur-devtools-button\", \"\");\n button.style.background = \"#111827\";\n button.style.color = \"#f9fafb\";\n button.style.border = \"1px solid #374151\";\n button.style.borderRadius = \"999px\";\n button.style.padding = \"8px 12px\";\n button.style.cursor = \"pointer\";\n button.style.boxShadow = \"0 6px 18px rgba(0,0,0,.3)\";\n\n const panel = document.createElement(\"div\");\n panel.setAttribute(\"data-elur-devtools-panel\", \"\");\n panel.style.marginTop = \"8px\";\n panel.style.width = \"460px\";\n panel.style.maxWidth = \"min(92vw, 460px)\";\n panel.style.background = \"#15151b\";\n panel.style.color = \"#e5e7eb\";\n panel.style.border = \"1px solid #2f2f35\";\n panel.style.borderRadius = \"12px\";\n panel.style.padding = \"10px\";\n panel.style.display = \"none\";\n panel.style.boxShadow = \"0 14px 28px rgba(0,0,0,.35)\";\n\n const tabs = document.createElement(\"div\");\n tabs.style.display = \"flex\";\n tabs.style.gap = \"6px\";\n tabs.style.marginBottom = \"10px\";\n\n const content = document.createElement(\"div\");\n content.setAttribute(\"data-elur-devtools-content\", \"\");\n\n const makeTab = (name: _DevToolsTab, label: string): HTMLButtonElement => {\n const t = document.createElement(\"button\");\n t.type = \"button\";\n t.textContent = label;\n t.setAttribute(\"data-elur-devtools-tab\", name);\n t.style.border = \"1px solid #353543\";\n t.style.borderRadius = \"8px\";\n t.style.padding = \"6px 9px\";\n t.style.background = \"#1f1f24\";\n t.style.color = \"#d1d5db\";\n t.style.cursor = \"pointer\";\n t.addEventListener(\"click\", () => {\n _state.activeTab = name;\n _syncTabButtons();\n _refreshPanel(true);\n });\n return t;\n };\n\n tabs.appendChild(makeTab(\"signals\", \"Signals\"));\n tabs.appendChild(makeTab(\"components\", \"Components\"));\n tabs.appendChild(makeTab(\"router\", \"Router\"));\n\n button.addEventListener(\"click\", () => {\n panel.style.display = panel.style.display === \"none\" ? \"block\" : \"none\";\n if (panel.style.display === \"block\") {\n _syncTabButtons();\n _refreshPanel(true);\n }\n });\n\n panel.appendChild(tabs);\n panel.appendChild(content);\n root.appendChild(button);\n root.appendChild(panel);\n document.body.appendChild(root);\n\n _state.root = root;\n _state.panel = panel;\n _state.content = content;\n}\n\nexport function disableDevTools(): void {\n if (!_state.enabled) return;\n _state.enabled = false;\n\n if (_state.refreshId != null) {\n clearInterval(_state.refreshId);\n _state.refreshId = null;\n }\n\n _setSignalDebugHooks(null);\n _setComponentDebugHooks(null);\n _resetDevtoolsStores();\n\n if (_state.root?.parentNode) {\n _state.root.parentNode.removeChild(_state.root);\n }\n\n _state.root = null;\n _state.panel = null;\n _state.content = null;\n _state.dispose = null;\n _state.renderedTab = null;\n _state.renderKeys = { signals: \"\", components: \"\", router: \"\" };\n _state.scrollMemo = {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n };\n}\n\nexport function enableDevTools(options: DevToolsOptions = {}): { disable: () => void } {\n if (typeof document === \"undefined\") {\n return { disable: () => undefined };\n }\n\n if (_state.enabled && _state.dispose) {\n return { disable: _state.dispose };\n }\n\n const refreshMs = Math.max(100, options.refreshMs ?? 350);\n _signalHistoryLimit = Math.max(1, options.historyLimit ?? 50);\n const position = options.position ?? \"bottom-right\";\n\n _state.enabled = true;\n _state.activeTab = \"signals\";\n\n // Apply the new limit to histories that were already created before enableDevTools.\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n const meta = _signalMeta.get(s);\n if (meta) _trimSignalHistory(meta);\n }\n\n _setSignalDebugHooks({\n onCreate(signal, initialValue) {\n _ensureSignalMeta(signal, initialValue);\n },\n onWrite(signal, value) {\n const meta = _ensureSignalMeta(signal, value);\n const now = Date.now();\n meta.lastUpdated = now;\n meta.history.push({ at: now, value });\n _trimSignalHistory(meta);\n },\n });\n\n _setComponentDebugHooks({\n onMountStart(inst) {\n let id = _componentIds.get(inst);\n if (id == null) {\n id = _componentSeq++;\n _componentIds.set(inst, id);\n }\n\n const parentId = _componentMountStack.length > 0\n ? _componentMountStack[_componentMountStack.length - 1]\n : null;\n\n _componentMounted.set(id, {\n id,\n parentId,\n debugName: _componentName(inst),\n mountedAt: Date.now(),\n hasDefaultSlot: inst.children != null,\n slotNames: _componentSlotNames(inst),\n props: _componentProps(inst),\n ref: _makeComponentRef(inst),\n });\n\n _componentMountStack.push(id);\n },\n onMountEnd(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n const entry = _componentMounted.get(id);\n if (entry) {\n entry.debugName = _componentName(inst);\n entry.hasDefaultSlot = inst.children != null;\n entry.slotNames = _componentSlotNames(inst);\n entry.props = _componentProps(inst);\n }\n\n if (_componentMountStack[_componentMountStack.length - 1] === id) {\n _componentMountStack.pop();\n return;\n }\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n onUnmount(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n _removeMountedComponentSubtree(id);\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n });\n\n _createOverlay({ position });\n\n _state.refreshId = setInterval(() => {\n if (_state.panel?.style.display === \"block\") {\n _refreshPanel();\n }\n }, refreshMs);\n\n if (options.initiallyOpen && _state.panel) {\n _state.panel.style.display = \"block\";\n _syncTabButtons();\n _refreshPanel(true);\n }\n\n const dispose = () => disableDevTools();\n _state.dispose = dispose;\n return { disable: dispose };\n}\n"],"mappings":"2JAgCA,IAAM,EAAyB,CAC3B,QAAS,GACT,UAAW,UACX,YAAa,KACb,UAAW,KACX,KAAM,KACN,MAAO,KACP,QAAS,KACT,QAAS,KACT,WAAY,CAAE,QAAS,GAAI,WAAY,GAAI,OAAQ,GAAI,CACvD,WAAY,CACR,QAAS,CAAE,IAAK,EAAG,KAAM,EAAG,CAC5B,WAAY,CAAE,IAAK,EAAG,KAAM,EAAG,CAC/B,OAAQ,CAAE,IAAK,EAAG,KAAM,EAAG,CAC9B,CACJ,CAoCK,EAAc,IAAI,IACpB,EAAc,IAAI,QAClB,EAAa,EACb,EAAsB,GAEtB,EAAgB,IAAI,QAClB,EAAoB,IAAI,IACxB,EAAiC,EAAE,CACrC,EAAgB,EAEpB,SAAS,EAAkB,EAA0B,CAEjD,OADI,OAAO,QAAY,IAAoB,IAAI,QAAQ,EAAE,CAClD,CAAE,UAAa,EAAG,CAG7B,SAAS,EAAkB,EAAoC,CAE3D,OADI,OAAO,QAAY,IAAoB,IAAI,QAAQ,EAAK,CACrD,CAAE,UAAa,EAAM,CAGhC,SAAS,EAAmB,EAAyB,CAC7C,EAAK,QAAQ,OAAS,GACtB,EAAK,QAAQ,OAAO,EAAG,EAAK,QAAQ,OAAS,EAAoB,CAIzE,SAAS,EAAqB,EAAc,EAA8B,CACtE,IAAM,EAAW,EAAY,IAAI,EAAE,CACnC,GAAI,EAEA,OADA,EAAmB,EAAS,CACrB,EAGX,IAAM,EAAM,KAAK,KAAK,CAChB,EAAoB,CACtB,GAA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C,GAAe,EAEpB,EAAU,CAET,EAAQ,eAAiB,EAAO,QAChC,EAAO,MAAM,MAAM,QAAU,QAC7B,GAAiB,CACjB,EAAc,GAAK,EAGvB,IAAM,MAAgB,GAAiB,CAEvC,MADA,GAAO,QAAU,EACV,CAAE,QAAS,EAAS"}
1
+ {"version":3,"file":"devtools.cjs","names":[],"sources":["../../src/elur/devtools.ts"],"sourcesContent":["import { _debugGetRouterInternal } from \"./router.js\";\nimport {\n _setComponentDebugHooks,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport {\n _setSignalDebugHooks,\n type Signal,\n} from \"./reactivity.js\";\n\nexport interface DevToolsOptions {\n refreshMs?: number;\n historyLimit?: number;\n initiallyOpen?: boolean;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\ntype _DevToolsTab = \"signals\" | \"components\" | \"router\";\n\ninterface _DevToolsState {\n enabled: boolean;\n activeTab: _DevToolsTab;\n renderedTab: _DevToolsTab | null;\n refreshId: ReturnType<typeof setInterval> | null;\n root: HTMLDivElement | null;\n panel: HTMLDivElement | null;\n content: HTMLDivElement | null;\n dispose: (() => void) | null;\n renderKeys: Record<_DevToolsTab, string>;\n scrollMemo: Record<_DevToolsTab, { top: number; left: number }>;\n}\n\nconst _state: _DevToolsState = {\n enabled: false,\n activeTab: \"signals\",\n renderedTab: null,\n refreshId: null,\n root: null,\n panel: null,\n content: null,\n dispose: null,\n renderKeys: { signals: \"\", components: \"\", router: \"\" },\n scrollMemo: {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n },\n};\n\ntype _SignalRef = { deref(): Signal<any> | undefined };\n\ninterface _SignalMeta {\n id: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _SignalSnapshot {\n id: number;\n value: unknown;\n subscriberCount: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _ComponentSnapshot {\n id: number;\n parentId: number | null;\n debugName: string;\n mountedAt: number;\n hasDefaultSlot: boolean;\n slotNames: string[];\n props: Record<string, unknown>;\n}\n\ninterface _ComponentRecord extends _ComponentSnapshot {\n ref: _ComponentRef;\n}\n\ntype _ComponentRef = { deref(): ElurComponent | undefined };\n\nconst _signalRefs = new Set<_SignalRef>();\nlet _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\nlet _signalSeq = 1;\nlet _signalHistoryLimit = 50;\n\nlet _componentIds = new WeakMap<ElurComponent, number>();\nconst _componentMounted = new Map<number, _ComponentRecord>();\nconst _componentMountStack: number[] = [];\nlet _componentSeq = 1;\n\nfunction _makeSignalRef<T>(s: Signal<T>): _SignalRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(s) as _SignalRef;\n return { deref: () => s };\n}\n\nfunction _makeComponentRef(inst: ElurComponent): _ComponentRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(inst) as _ComponentRef;\n return { deref: () => inst };\n}\n\nfunction _trimSignalHistory(meta: _SignalMeta): void {\n if (meta.history.length > _signalHistoryLimit) {\n meta.history.splice(0, meta.history.length - _signalHistoryLimit);\n }\n}\n\nfunction _ensureSignalMeta<T>(s: Signal<T>, initialValue: T): _SignalMeta {\n const existing = _signalMeta.get(s);\n if (existing) {\n _trimSignalHistory(existing);\n return existing;\n }\n\n const now = Date.now();\n const meta: _SignalMeta = {\n id: _signalSeq++,\n createdAt: now,\n lastUpdated: now,\n history: [{ at: now, value: initialValue }],\n };\n _signalMeta.set(s, meta);\n _signalRefs.add(_makeSignalRef(s));\n return meta;\n}\n\n/** @internal Exported for testing. */\nexport function _listSignals(): _SignalSnapshot[] {\n const out: _SignalSnapshot[] = [];\n\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n\n const meta = _signalMeta.get(s);\n if (!meta) continue;\n\n const subCount = (s as unknown as { _subs?: Set<() => void> })._subs?.size ?? 0;\n\n out.push({\n id: meta.id,\n value: s.peek(),\n subscriberCount: subCount,\n createdAt: meta.createdAt,\n lastUpdated: meta.lastUpdated,\n history: meta.history.slice(),\n });\n }\n\n out.sort((a, b) => b.lastUpdated - a.lastUpdated);\n return out;\n}\n\nfunction _componentName(inst: ElurComponent): string {\n const maybeDebugName = (inst as { _debugName?: string })._debugName;\n if (maybeDebugName && maybeDebugName.trim()) return maybeDebugName;\n const ctor = (inst as { constructor?: { name?: string } }).constructor;\n return ctor?.name && ctor.name.trim() ? ctor.name : \"AnonymousComponent\";\n}\n\nfunction _componentSlotNames(inst: ElurComponent): string[] {\n const slots = (inst as unknown as { _slots?: unknown })._slots;\n if (!(slots instanceof Map)) return [];\n return Array.from(slots.keys()).map((k) => String(k));\n}\n\nfunction _componentProps(inst: ElurComponent): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(inst as unknown as Record<string, unknown>)) {\n if (\n key === \"__isElurComponent\" ||\n key === \"children\" ||\n key === \"_debugName\" ||\n key.startsWith(\"_\")\n ) {\n continue;\n }\n const value = (inst as unknown as Record<string, unknown>)[key];\n if (typeof value === \"function\") continue;\n out[key] = value;\n }\n return out;\n}\n\nfunction _mountPathChain(fullPath: string | null): string[] {\n if (!fullPath) return [];\n if (fullPath === \"*\") return [\"*\"];\n\n const parts = fullPath.split(\"/\").filter(Boolean);\n const out: string[] = [];\n let cur = \"\";\n for (const part of parts) {\n cur += \"/\" + part;\n out.push(cur);\n }\n return out.length > 0 ? out : [\"/\"];\n}\n\nfunction _listMountedComponents(): _ComponentSnapshot[] {\n const out: _ComponentSnapshot[] = [];\n\n for (const [id, item] of _componentMounted) {\n const inst = item.ref.deref();\n if (!inst) {\n _componentMounted.delete(id);\n continue;\n }\n\n // Keep rows fresh while panel is open (debug name/props can change after mount).\n item.debugName = _componentName(inst);\n item.hasDefaultSlot = inst.children != null;\n item.slotNames = _componentSlotNames(inst);\n item.props = _componentProps(inst);\n\n out.push({\n id: item.id,\n parentId: item.parentId,\n debugName: item.debugName,\n mountedAt: item.mountedAt,\n hasDefaultSlot: item.hasDefaultSlot,\n slotNames: [...item.slotNames],\n props: { ...item.props },\n });\n }\n\n out.sort((a, b) => a.id - b.id);\n return out;\n}\n\nfunction _removeMountedComponentSubtree(rootId: number): void {\n const pending = [rootId];\n while (pending.length > 0) {\n const current = pending.pop()!;\n for (const [id, record] of _componentMounted) {\n if (record.parentId === current) pending.push(id);\n }\n _componentMounted.delete(current);\n }\n}\n\nfunction _resetDevtoolsStores(): void {\n _signalRefs.clear();\n _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\n _signalSeq = 1;\n\n _componentIds = new WeakMap<ElurComponent, number>();\n _componentMounted.clear();\n _componentMountStack.length = 0;\n _componentSeq = 1;\n}\n\nfunction _safeStringify(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\nfunction _escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\\\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n\nfunction _valuePreview(value: unknown, max = 90): string {\n const raw = _safeStringify(value);\n if (raw.length <= max) return raw;\n return raw.slice(0, max - 1) + \"…\";\n}\n\nfunction _relativeTime(ts: number): string {\n if (!ts) return \"-\";\n const diff = Date.now() - ts;\n if (diff < 1000) return `${diff}ms ago`;\n if (diff < 60_000) return `${Math.floor(diff / 1000)}s ago`;\n return `${Math.floor(diff / 60_000)}m ago`;\n}\n\nfunction _renderSignals(target: HTMLDivElement): void {\n const signals = _listSignals();\n const key = `${signals.length}:${signals.map((s) => `${s.id}-${s.lastUpdated}-${s.subscriberCount}`).join(\"|\")}`;\n if (_state.renderedTab === \"signals\" && _state.renderKeys.signals === key) return;\n _state.renderKeys.signals = key;\n _state.renderedTab = \"signals\";\n\n const rows = signals\n .map((s) => {\n const fullValue = _safeStringify(s.value);\n const preview = _valuePreview(s.value, 120);\n return `<tr data-elur-devtools-signal-id=\"${s.id}\">\n <td style=\"padding:6px 8px;white-space:nowrap;\">${s.id}</td>\n <td style=\"padding:6px 8px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;\" title=\"${_escapeHtml(fullValue)}\">${_escapeHtml(preview)}</td>\n <td>${s.subscriberCount}</td>\n <td data-elur-devtools-history-count=\"${s.history.length}\">${s.history.length}</td>\n <td>${_relativeTime(s.lastUpdated)}</td>\n </tr>`;\n })\n .join(\"\");\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Signals</strong>\n <span style=\"opacity:.8\">${signals.length} active</span>\n </div>\n <div data-elur-devtools-scroll=\"signals\" style=\"max-height:260px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n <table style=\"width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;\">\n <thead>\n <tr style=\"background:#1f1f24;\">\n <th style=\"text-align:left;padding:6px 8px;width:42px;\">ID</th>\n <th style=\"text-align:left;padding:6px 8px;\">Value</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">Subs</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">History</th>\n <th style=\"text-align:left;padding:6px 8px;width:84px;\">Updated</th>\n </tr>\n </thead>\n <tbody>${rows}</tbody>\n </table>\n </div>\n <p style=\"margin:8px 0 0 0;font-size:11px;opacity:.75;\">Click a row to log full history in console.</p>\n `;\n\n for (const row of target.querySelectorAll<HTMLTableRowElement>(\"tr[data-elur-devtools-signal-id]\")) {\n row.style.cursor = \"pointer\";\n row.addEventListener(\"click\", () => {\n const id = Number(row.dataset.elurDevtoolsSignalId);\n const signal = signals.find((s) => s.id === id);\n if (!signal) return;\n console.group(`[Elur DevTools] Signal #${signal.id}`);\n console.log(\"Current value:\", signal.value);\n console.log(\"Subscribers:\", signal.subscriberCount);\n console.table(signal.history.map((h) => ({ at: new Date(h.at).toISOString(), value: h.value })));\n console.groupEnd();\n });\n }\n}\n\ninterface _TreeNode extends _ComponentSnapshot {\n children: _TreeNode[];\n}\n\nfunction _buildComponentTree(rows: _ComponentSnapshot[]): _TreeNode[] {\n const byId = new Map<number, _TreeNode>();\n const roots: _TreeNode[] = [];\n\n for (const row of rows) {\n byId.set(row.id, { ...row, children: [] });\n }\n\n for (const node of byId.values()) {\n if (node.parentId == null) {\n roots.push(node);\n continue;\n }\n const parent = byId.get(node.parentId);\n if (!parent) {\n roots.push(node);\n continue;\n }\n parent.children.push(node);\n }\n\n return roots;\n}\n\nfunction _renderTreeNode(node: _TreeNode, depth: number): string {\n const pad = 10 + depth * 14;\n const props = Object.keys(node.props).length > 0 ? _safeStringify(node.props) : \"{}\";\n const slots = node.slotNames.length > 0 ? node.slotNames.join(\", \") : \"none\";\n\n const header = `<div style=\"padding:6px 8px 6px ${pad}px;border-bottom:1px solid #24242b;\">\n <div><strong>${_escapeHtml(node.debugName)}</strong> <span style=\"opacity:.7\">#${node.id}</span></div>\n <div style=\"font-size:11px;opacity:.8;\">slots: ${slots} | default-slot: ${node.hasDefaultSlot ? \"yes\" : \"no\"}</div>\n <div style=\"font-size:11px;opacity:.8;\">props: ${_escapeHtml(_valuePreview(props, 180))}</div>\n </div>`;\n\n return header + node.children.map((c) => _renderTreeNode(c, depth + 1)).join(\"\");\n}\n\nfunction _renderComponents(target: HTMLDivElement): void {\n const rows = _listMountedComponents();\n const router = _debugGetRouterInternal();\n const routeKey = router ? `${router.currentPath}|${router.matchedPath ?? \"\"}` : \"no-router\";\n const key = `${routeKey}:${rows.length}:${rows.map((r) => `${r.id}-${r.parentId}-${r.debugName}-${r.hasDefaultSlot}-${r.slotNames.join(\",\")}-${_safeStringify(r.props)}`).join(\"|\")}`;\n if (_state.renderedTab === \"components\" && _state.renderKeys.components === key) return;\n _state.renderKeys.components = key;\n _state.renderedTab = \"components\";\n\n const roots = _buildComponentTree(rows);\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Component Tree</strong>\n <span style=\"opacity:.8\">${rows.length} mounted</span>\n </div>\n <div style=\"font-size:11px;opacity:.82;margin-bottom:8px;display:flex;gap:8px;flex-wrap:wrap;\">\n <span><b>current:</b> ${_escapeHtml(router?.currentPath ?? \"-\")}</span>\n <span><b>matched:</b> ${_escapeHtml(router?.matchedPath ?? \"none\")}</span>\n </div>\n <div data-elur-devtools-scroll=\"components\" style=\"max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n ${roots.length > 0\n ? roots.map((r) => _renderTreeNode(r, 0)).join(\"\")\n : \"<div style='padding:10px;opacity:.75'>No mounted components tracked. Enable devtools before your first mount() to capture initial tree.</div>\"}\n </div>\n `;\n}\n\nfunction _renderRouter(target: HTMLDivElement): void {\n const router = _debugGetRouterInternal();\n const key = router\n ? `${router.mode}|${router.base}|${router.currentPath}|${JSON.stringify(router.params)}|${JSON.stringify(router.query)}|${router.matchedPath}|${router.activeGuards.names.join(\",\")}`\n : \"none\";\n if (_state.renderedTab === \"router\" && _state.renderKeys.router === key) return;\n _state.renderKeys.router = key;\n _state.renderedTab = \"router\";\n\n if (!router) {\n target.innerHTML = `\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>\n `;\n return;\n }\n\n const chain = _mountPathChain(router.matchedPath);\n target.innerHTML = `\n <strong>Router State</strong>\n <div data-elur-devtools-scroll=\"router\" style=\"margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;\">\n <div><b>mode</b>: ${router.mode}</div>\n <div><b>base</b>: ${router.base}</div>\n <div><b>current</b>: ${_escapeHtml(router.currentPath)}</div>\n <div><b>params</b>: ${_escapeHtml(_safeStringify(router.params))}</div>\n <div><b>query</b>: ${_escapeHtml(_safeStringify(router.query))}</div>\n <div><b>matched</b>: ${_escapeHtml(router.matchedPath ?? \"none\")}</div>\n <div><b>matched chain</b>: ${chain.length > 0 ? _escapeHtml(chain.join(\" -> \")) : \"none\"}</div>\n <div><b>guards</b>: ${router.activeGuards.names.length > 0 ? _escapeHtml(router.activeGuards.names.join(\", \")) : \"none\"}</div>\n </div>\n `;\n}\n\nfunction _rememberScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n}\n\nfunction _restoreScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n const memo = _state.scrollMemo[tab];\n box.scrollTop = memo.top;\n box.scrollLeft = memo.left;\n if (box.dataset.elurDevtoolsScrollBound !== \"1\") {\n box.addEventListener(\"scroll\", () => {\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n }, { passive: true });\n box.dataset.elurDevtoolsScrollBound = \"1\";\n }\n}\n\nfunction _refreshPanel(force = false): void {\n if (!_state.content) return;\n\n const tab = _state.activeTab;\n if (!force) _rememberScroll(tab);\n\n if (_state.activeTab === \"signals\") {\n _renderSignals(_state.content);\n _restoreScroll(\"signals\");\n return;\n }\n if (_state.activeTab === \"components\") {\n _renderComponents(_state.content);\n _restoreScroll(\"components\");\n return;\n }\n _renderRouter(_state.content);\n _restoreScroll(\"router\");\n}\n\nfunction _syncTabButtons(): void {\n if (!_state.panel) return;\n for (const btn of _state.panel.querySelectorAll<HTMLButtonElement>(\"button[data-elur-devtools-tab]\")) {\n const isActive = btn.dataset.elurDevtoolsTab === _state.activeTab;\n btn.style.background = isActive ? \"#2d4c7a\" : \"#1f1f24\";\n }\n}\n\nfunction _createOverlay(options: Required<Pick<DevToolsOptions, \"position\">>): void {\n const root = document.createElement(\"div\");\n root.setAttribute(\"data-elur-devtools-root\", \"\");\n root.style.position = \"fixed\";\n root.style.zIndex = \"2147483647\";\n root.style.bottom = \"16px\";\n root.style.right = options.position === \"bottom-right\" ? \"16px\" : \"auto\";\n root.style.left = options.position === \"bottom-left\" ? \"16px\" : \"auto\";\n root.style.fontFamily = \"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif\";\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = \"Elur DevTools\";\n button.setAttribute(\"data-elur-devtools-button\", \"\");\n button.style.background = \"#111827\";\n button.style.color = \"#f9fafb\";\n button.style.border = \"1px solid #374151\";\n button.style.borderRadius = \"999px\";\n button.style.padding = \"8px 12px\";\n button.style.cursor = \"pointer\";\n button.style.boxShadow = \"0 6px 18px rgba(0,0,0,.3)\";\n\n const panel = document.createElement(\"div\");\n panel.setAttribute(\"data-elur-devtools-panel\", \"\");\n panel.style.marginTop = \"8px\";\n panel.style.width = \"460px\";\n panel.style.maxWidth = \"min(92vw, 460px)\";\n panel.style.background = \"#15151b\";\n panel.style.color = \"#e5e7eb\";\n panel.style.border = \"1px solid #2f2f35\";\n panel.style.borderRadius = \"12px\";\n panel.style.padding = \"10px\";\n panel.style.display = \"none\";\n panel.style.boxShadow = \"0 14px 28px rgba(0,0,0,.35)\";\n\n const tabs = document.createElement(\"div\");\n tabs.style.display = \"flex\";\n tabs.style.gap = \"6px\";\n tabs.style.marginBottom = \"10px\";\n\n const content = document.createElement(\"div\");\n content.setAttribute(\"data-elur-devtools-content\", \"\");\n\n const makeTab = (name: _DevToolsTab, label: string): HTMLButtonElement => {\n const t = document.createElement(\"button\");\n t.type = \"button\";\n t.textContent = label;\n t.setAttribute(\"data-elur-devtools-tab\", name);\n t.style.border = \"1px solid #353543\";\n t.style.borderRadius = \"8px\";\n t.style.padding = \"6px 9px\";\n t.style.background = \"#1f1f24\";\n t.style.color = \"#d1d5db\";\n t.style.cursor = \"pointer\";\n t.addEventListener(\"click\", () => {\n _state.activeTab = name;\n _syncTabButtons();\n _refreshPanel(true);\n });\n return t;\n };\n\n tabs.appendChild(makeTab(\"signals\", \"Signals\"));\n tabs.appendChild(makeTab(\"components\", \"Components\"));\n tabs.appendChild(makeTab(\"router\", \"Router\"));\n\n button.addEventListener(\"click\", () => {\n panel.style.display = panel.style.display === \"none\" ? \"block\" : \"none\";\n if (panel.style.display === \"block\") {\n _syncTabButtons();\n _refreshPanel(true);\n }\n });\n\n panel.appendChild(tabs);\n panel.appendChild(content);\n root.appendChild(button);\n root.appendChild(panel);\n document.body.appendChild(root);\n\n _state.root = root;\n _state.panel = panel;\n _state.content = content;\n}\n\nexport function disableDevTools(): void {\n if (!_state.enabled) return;\n _state.enabled = false;\n\n if (_state.refreshId != null) {\n clearInterval(_state.refreshId);\n _state.refreshId = null;\n }\n\n _setSignalDebugHooks(null);\n _setComponentDebugHooks(null);\n _resetDevtoolsStores();\n\n if (_state.root?.parentNode) {\n _state.root.parentNode.removeChild(_state.root);\n }\n\n _state.root = null;\n _state.panel = null;\n _state.content = null;\n _state.dispose = null;\n _state.renderedTab = null;\n _state.renderKeys = { signals: \"\", components: \"\", router: \"\" };\n _state.scrollMemo = {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n };\n}\n\nexport function enableDevTools(options: DevToolsOptions = {}): { disable: () => void } {\n if (typeof document === \"undefined\") {\n return { disable: () => undefined };\n }\n\n if (_state.enabled && _state.dispose) {\n return { disable: _state.dispose };\n }\n\n const refreshMs = Math.max(100, options.refreshMs ?? 350);\n _signalHistoryLimit = Math.max(1, options.historyLimit ?? 50);\n const position = options.position ?? \"bottom-right\";\n\n _state.enabled = true;\n _state.activeTab = \"signals\";\n\n // Apply the new limit to histories that were already created before enableDevTools.\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n const meta = _signalMeta.get(s);\n if (meta) _trimSignalHistory(meta);\n }\n\n _setSignalDebugHooks({\n onCreate(signal, initialValue) {\n _ensureSignalMeta(signal, initialValue);\n },\n onWrite(signal, value) {\n const meta = _ensureSignalMeta(signal, value);\n const now = Date.now();\n meta.lastUpdated = now;\n meta.history.push({ at: now, value });\n _trimSignalHistory(meta);\n },\n });\n\n _setComponentDebugHooks({\n onMountStart(inst) {\n let id = _componentIds.get(inst);\n if (id == null) {\n id = _componentSeq++;\n _componentIds.set(inst, id);\n }\n\n const parentId = _componentMountStack.length > 0\n ? _componentMountStack[_componentMountStack.length - 1]\n : null;\n\n _componentMounted.set(id, {\n id,\n parentId,\n debugName: _componentName(inst),\n mountedAt: Date.now(),\n hasDefaultSlot: inst.children != null,\n slotNames: _componentSlotNames(inst),\n props: _componentProps(inst),\n ref: _makeComponentRef(inst),\n });\n\n _componentMountStack.push(id);\n },\n onMountEnd(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n const entry = _componentMounted.get(id);\n if (entry) {\n entry.debugName = _componentName(inst);\n entry.hasDefaultSlot = inst.children != null;\n entry.slotNames = _componentSlotNames(inst);\n entry.props = _componentProps(inst);\n }\n\n if (_componentMountStack[_componentMountStack.length - 1] === id) {\n _componentMountStack.pop();\n return;\n }\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n onUnmount(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n _removeMountedComponentSubtree(id);\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n });\n\n _createOverlay({ position });\n\n _state.refreshId = setInterval(() => {\n if (_state.panel?.style.display === \"block\") {\n _refreshPanel();\n }\n }, refreshMs);\n\n if (options.initiallyOpen && _state.panel) {\n _state.panel.style.display = \"block\";\n _syncTabButtons();\n _refreshPanel(true);\n }\n\n const dispose = () => disableDevT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t.currentPath}|${JSON.stringify(t.params)}|${JSON.stringify(t.query)}|${t.matchedPath}|${t.activeGuards.names.join(",")}` : "none";
249
249
  if (r.renderedTab === "router" && r.renderKeys.router === i) return;
250
250
  if (r.renderKeys.router = i, r.renderedTab = "router", !t) {
251
- e.innerHTML = "\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>\n ";
251
+ e.innerHTML = "\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>\n ";
252
252
  return;
253
253
  }
254
254
  let a = b(t.matchedPath);
@@ -1 +1 @@
1
- {"version":3,"file":"devtools.js","names":[],"sources":["../../src/elur/devtools.ts"],"sourcesContent":["import { _debugGetRouterInternal } from \"./router.js\";\nimport {\n _setComponentDebugHooks,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport {\n _setSignalDebugHooks,\n type Signal,\n} from \"./reactivity.js\";\n\nexport interface DevToolsOptions {\n refreshMs?: number;\n historyLimit?: number;\n initiallyOpen?: boolean;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\ntype _DevToolsTab = \"signals\" | \"components\" | \"router\";\n\ninterface _DevToolsState {\n enabled: boolean;\n activeTab: _DevToolsTab;\n renderedTab: _DevToolsTab | null;\n refreshId: ReturnType<typeof setInterval> | null;\n root: HTMLDivElement | null;\n panel: HTMLDivElement | null;\n content: HTMLDivElement | null;\n dispose: (() => void) | null;\n renderKeys: Record<_DevToolsTab, string>;\n scrollMemo: Record<_DevToolsTab, { top: number; left: number }>;\n}\n\nconst _state: _DevToolsState = {\n enabled: false,\n activeTab: \"signals\",\n renderedTab: null,\n refreshId: null,\n root: null,\n panel: null,\n content: null,\n dispose: null,\n renderKeys: { signals: \"\", components: \"\", router: \"\" },\n scrollMemo: {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n },\n};\n\ntype _SignalRef = { deref(): Signal<any> | undefined };\n\ninterface _SignalMeta {\n id: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _SignalSnapshot {\n id: number;\n value: unknown;\n subscriberCount: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _ComponentSnapshot {\n id: number;\n parentId: number | null;\n debugName: string;\n mountedAt: number;\n hasDefaultSlot: boolean;\n slotNames: string[];\n props: Record<string, unknown>;\n}\n\ninterface _ComponentRecord extends _ComponentSnapshot {\n ref: _ComponentRef;\n}\n\ntype _ComponentRef = { deref(): ElurComponent | undefined };\n\nconst _signalRefs = new Set<_SignalRef>();\nlet _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\nlet _signalSeq = 1;\nlet _signalHistoryLimit = 50;\n\nlet _componentIds = new WeakMap<ElurComponent, number>();\nconst _componentMounted = new Map<number, _ComponentRecord>();\nconst _componentMountStack: number[] = [];\nlet _componentSeq = 1;\n\nfunction _makeSignalRef<T>(s: Signal<T>): _SignalRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(s) as _SignalRef;\n return { deref: () => s };\n}\n\nfunction _makeComponentRef(inst: ElurComponent): _ComponentRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(inst) as _ComponentRef;\n return { deref: () => inst };\n}\n\nfunction _trimSignalHistory(meta: _SignalMeta): void {\n if (meta.history.length > _signalHistoryLimit) {\n meta.history.splice(0, meta.history.length - _signalHistoryLimit);\n }\n}\n\nfunction _ensureSignalMeta<T>(s: Signal<T>, initialValue: T): _SignalMeta {\n const existing = _signalMeta.get(s);\n if (existing) {\n _trimSignalHistory(existing);\n return existing;\n }\n\n const now = Date.now();\n const meta: _SignalMeta = {\n id: _signalSeq++,\n createdAt: now,\n lastUpdated: now,\n history: [{ at: now, value: initialValue }],\n };\n _signalMeta.set(s, meta);\n _signalRefs.add(_makeSignalRef(s));\n return meta;\n}\n\n/** @internal Exported for testing. */\nexport function _listSignals(): _SignalSnapshot[] {\n const out: _SignalSnapshot[] = [];\n\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n\n const meta = _signalMeta.get(s);\n if (!meta) continue;\n\n const subCount = (s as unknown as { _subs?: Set<() => void> })._subs?.size ?? 0;\n\n out.push({\n id: meta.id,\n value: s.peek(),\n subscriberCount: subCount,\n createdAt: meta.createdAt,\n lastUpdated: meta.lastUpdated,\n history: meta.history.slice(),\n });\n }\n\n out.sort((a, b) => b.lastUpdated - a.lastUpdated);\n return out;\n}\n\nfunction _componentName(inst: ElurComponent): string {\n const maybeDebugName = (inst as { _debugName?: string })._debugName;\n if (maybeDebugName && maybeDebugName.trim()) return maybeDebugName;\n const ctor = (inst as { constructor?: { name?: string } }).constructor;\n return ctor?.name && ctor.name.trim() ? ctor.name : \"AnonymousComponent\";\n}\n\nfunction _componentSlotNames(inst: ElurComponent): string[] {\n const slots = (inst as unknown as { _slots?: unknown })._slots;\n if (!(slots instanceof Map)) return [];\n return Array.from(slots.keys()).map((k) => String(k));\n}\n\nfunction _componentProps(inst: ElurComponent): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(inst as unknown as Record<string, unknown>)) {\n if (\n key === \"__isElurComponent\" ||\n key === \"children\" ||\n key === \"_debugName\" ||\n key.startsWith(\"_\")\n ) {\n continue;\n }\n const value = (inst as unknown as Record<string, unknown>)[key];\n if (typeof value === \"function\") continue;\n out[key] = value;\n }\n return out;\n}\n\nfunction _mountPathChain(fullPath: string | null): string[] {\n if (!fullPath) return [];\n if (fullPath === \"*\") return [\"*\"];\n\n const parts = fullPath.split(\"/\").filter(Boolean);\n const out: string[] = [];\n let cur = \"\";\n for (const part of parts) {\n cur += \"/\" + part;\n out.push(cur);\n }\n return out.length > 0 ? out : [\"/\"];\n}\n\nfunction _listMountedComponents(): _ComponentSnapshot[] {\n const out: _ComponentSnapshot[] = [];\n\n for (const [id, item] of _componentMounted) {\n const inst = item.ref.deref();\n if (!inst) {\n _componentMounted.delete(id);\n continue;\n }\n\n // Keep rows fresh while panel is open (debug name/props can change after mount).\n item.debugName = _componentName(inst);\n item.hasDefaultSlot = inst.children != null;\n item.slotNames = _componentSlotNames(inst);\n item.props = _componentProps(inst);\n\n out.push({\n id: item.id,\n parentId: item.parentId,\n debugName: item.debugName,\n mountedAt: item.mountedAt,\n hasDefaultSlot: item.hasDefaultSlot,\n slotNames: [...item.slotNames],\n props: { ...item.props },\n });\n }\n\n out.sort((a, b) => a.id - b.id);\n return out;\n}\n\nfunction _removeMountedComponentSubtree(rootId: number): void {\n const pending = [rootId];\n while (pending.length > 0) {\n const current = pending.pop()!;\n for (const [id, record] of _componentMounted) {\n if (record.parentId === current) pending.push(id);\n }\n _componentMounted.delete(current);\n }\n}\n\nfunction _resetDevtoolsStores(): void {\n _signalRefs.clear();\n _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\n _signalSeq = 1;\n\n _componentIds = new WeakMap<ElurComponent, number>();\n _componentMounted.clear();\n _componentMountStack.length = 0;\n _componentSeq = 1;\n}\n\nfunction _safeStringify(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\nfunction _escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\\\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n\nfunction _valuePreview(value: unknown, max = 90): string {\n const raw = _safeStringify(value);\n if (raw.length <= max) return raw;\n return raw.slice(0, max - 1) + \"…\";\n}\n\nfunction _relativeTime(ts: number): string {\n if (!ts) return \"-\";\n const diff = Date.now() - ts;\n if (diff < 1000) return `${diff}ms ago`;\n if (diff < 60_000) return `${Math.floor(diff / 1000)}s ago`;\n return `${Math.floor(diff / 60_000)}m ago`;\n}\n\nfunction _renderSignals(target: HTMLDivElement): void {\n const signals = _listSignals();\n const key = `${signals.length}:${signals.map((s) => `${s.id}-${s.lastUpdated}-${s.subscriberCount}`).join(\"|\")}`;\n if (_state.renderedTab === \"signals\" && _state.renderKeys.signals === key) return;\n _state.renderKeys.signals = key;\n _state.renderedTab = \"signals\";\n\n const rows = signals\n .map((s) => {\n const fullValue = _safeStringify(s.value);\n const preview = _valuePreview(s.value, 120);\n return `<tr data-elur-devtools-signal-id=\"${s.id}\">\n <td style=\"padding:6px 8px;white-space:nowrap;\">${s.id}</td>\n <td style=\"padding:6px 8px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;\" title=\"${_escapeHtml(fullValue)}\">${_escapeHtml(preview)}</td>\n <td>${s.subscriberCount}</td>\n <td data-elur-devtools-history-count=\"${s.history.length}\">${s.history.length}</td>\n <td>${_relativeTime(s.lastUpdated)}</td>\n </tr>`;\n })\n .join(\"\");\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Signals</strong>\n <span style=\"opacity:.8\">${signals.length} active</span>\n </div>\n <div data-elur-devtools-scroll=\"signals\" style=\"max-height:260px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n <table style=\"width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;\">\n <thead>\n <tr style=\"background:#1f1f24;\">\n <th style=\"text-align:left;padding:6px 8px;width:42px;\">ID</th>\n <th style=\"text-align:left;padding:6px 8px;\">Value</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">Subs</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">History</th>\n <th style=\"text-align:left;padding:6px 8px;width:84px;\">Updated</th>\n </tr>\n </thead>\n <tbody>${rows}</tbody>\n </table>\n </div>\n <p style=\"margin:8px 0 0 0;font-size:11px;opacity:.75;\">Click a row to log full history in console.</p>\n `;\n\n for (const row of target.querySelectorAll<HTMLTableRowElement>(\"tr[data-elur-devtools-signal-id]\")) {\n row.style.cursor = \"pointer\";\n row.addEventListener(\"click\", () => {\n const id = Number(row.dataset.elurDevtoolsSignalId);\n const signal = signals.find((s) => s.id === id);\n if (!signal) return;\n console.group(`[Elur DevTools] Signal #${signal.id}`);\n console.log(\"Current value:\", signal.value);\n console.log(\"Subscribers:\", signal.subscriberCount);\n console.table(signal.history.map((h) => ({ at: new Date(h.at).toISOString(), value: h.value })));\n console.groupEnd();\n });\n }\n}\n\ninterface _TreeNode extends _ComponentSnapshot {\n children: _TreeNode[];\n}\n\nfunction _buildComponentTree(rows: _ComponentSnapshot[]): _TreeNode[] {\n const byId = new Map<number, _TreeNode>();\n const roots: _TreeNode[] = [];\n\n for (const row of rows) {\n byId.set(row.id, { ...row, children: [] });\n }\n\n for (const node of byId.values()) {\n if (node.parentId == null) {\n roots.push(node);\n continue;\n }\n const parent = byId.get(node.parentId);\n if (!parent) {\n roots.push(node);\n continue;\n }\n parent.children.push(node);\n }\n\n return roots;\n}\n\nfunction _renderTreeNode(node: _TreeNode, depth: number): string {\n const pad = 10 + depth * 14;\n const props = Object.keys(node.props).length > 0 ? _safeStringify(node.props) : \"{}\";\n const slots = node.slotNames.length > 0 ? node.slotNames.join(\", \") : \"none\";\n\n const header = `<div style=\"padding:6px 8px 6px ${pad}px;border-bottom:1px solid #24242b;\">\n <div><strong>${_escapeHtml(node.debugName)}</strong> <span style=\"opacity:.7\">#${node.id}</span></div>\n <div style=\"font-size:11px;opacity:.8;\">slots: ${slots} | default-slot: ${node.hasDefaultSlot ? \"yes\" : \"no\"}</div>\n <div style=\"font-size:11px;opacity:.8;\">props: ${_escapeHtml(_valuePreview(props, 180))}</div>\n </div>`;\n\n return header + node.children.map((c) => _renderTreeNode(c, depth + 1)).join(\"\");\n}\n\nfunction _renderComponents(target: HTMLDivElement): void {\n const rows = _listMountedComponents();\n const router = _debugGetRouterInternal();\n const routeKey = router ? `${router.currentPath}|${router.matchedPath ?? \"\"}` : \"no-router\";\n const key = `${routeKey}:${rows.length}:${rows.map((r) => `${r.id}-${r.parentId}-${r.debugName}-${r.hasDefaultSlot}-${r.slotNames.join(\",\")}-${_safeStringify(r.props)}`).join(\"|\")}`;\n if (_state.renderedTab === \"components\" && _state.renderKeys.components === key) return;\n _state.renderKeys.components = key;\n _state.renderedTab = \"components\";\n\n const roots = _buildComponentTree(rows);\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Component Tree</strong>\n <span style=\"opacity:.8\">${rows.length} mounted</span>\n </div>\n <div style=\"font-size:11px;opacity:.82;margin-bottom:8px;display:flex;gap:8px;flex-wrap:wrap;\">\n <span><b>current:</b> ${_escapeHtml(router?.currentPath ?? \"-\")}</span>\n <span><b>matched:</b> ${_escapeHtml(router?.matchedPath ?? \"none\")}</span>\n </div>\n <div data-elur-devtools-scroll=\"components\" style=\"max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n ${roots.length > 0\n ? roots.map((r) => _renderTreeNode(r, 0)).join(\"\")\n : \"<div style='padding:10px;opacity:.75'>No mounted components tracked. Enable devtools before your first mount() to capture initial tree.</div>\"}\n </div>\n `;\n}\n\nfunction _renderRouter(target: HTMLDivElement): void {\n const router = _debugGetRouterInternal();\n const key = router\n ? `${router.mode}|${router.base}|${router.currentPath}|${JSON.stringify(router.params)}|${JSON.stringify(router.query)}|${router.matchedPath}|${router.activeGuards.names.join(\",\")}`\n : \"none\";\n if (_state.renderedTab === \"router\" && _state.renderKeys.router === key) return;\n _state.renderKeys.router = key;\n _state.renderedTab = \"router\";\n\n if (!router) {\n target.innerHTML = `\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from elur/router.</div>\n `;\n return;\n }\n\n const chain = _mountPathChain(router.matchedPath);\n target.innerHTML = `\n <strong>Router State</strong>\n <div data-elur-devtools-scroll=\"router\" style=\"margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;\">\n <div><b>mode</b>: ${router.mode}</div>\n <div><b>base</b>: ${router.base}</div>\n <div><b>current</b>: ${_escapeHtml(router.currentPath)}</div>\n <div><b>params</b>: ${_escapeHtml(_safeStringify(router.params))}</div>\n <div><b>query</b>: ${_escapeHtml(_safeStringify(router.query))}</div>\n <div><b>matched</b>: ${_escapeHtml(router.matchedPath ?? \"none\")}</div>\n <div><b>matched chain</b>: ${chain.length > 0 ? _escapeHtml(chain.join(\" -> \")) : \"none\"}</div>\n <div><b>guards</b>: ${router.activeGuards.names.length > 0 ? _escapeHtml(router.activeGuards.names.join(\", \")) : \"none\"}</div>\n </div>\n `;\n}\n\nfunction _rememberScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n}\n\nfunction _restoreScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n const memo = _state.scrollMemo[tab];\n box.scrollTop = memo.top;\n box.scrollLeft = memo.left;\n if (box.dataset.elurDevtoolsScrollBound !== \"1\") {\n box.addEventListener(\"scroll\", () => {\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n }, { passive: true });\n box.dataset.elurDevtoolsScrollBound = \"1\";\n }\n}\n\nfunction _refreshPanel(force = false): void {\n if (!_state.content) return;\n\n const tab = _state.activeTab;\n if (!force) _rememberScroll(tab);\n\n if (_state.activeTab === \"signals\") {\n _renderSignals(_state.content);\n _restoreScroll(\"signals\");\n return;\n }\n if (_state.activeTab === \"components\") {\n _renderComponents(_state.content);\n _restoreScroll(\"components\");\n return;\n }\n _renderRouter(_state.content);\n _restoreScroll(\"router\");\n}\n\nfunction _syncTabButtons(): void {\n if (!_state.panel) return;\n for (const btn of _state.panel.querySelectorAll<HTMLButtonElement>(\"button[data-elur-devtools-tab]\")) {\n const isActive = btn.dataset.elurDevtoolsTab === _state.activeTab;\n btn.style.background = isActive ? \"#2d4c7a\" : \"#1f1f24\";\n }\n}\n\nfunction _createOverlay(options: Required<Pick<DevToolsOptions, \"position\">>): void {\n const root = document.createElement(\"div\");\n root.setAttribute(\"data-elur-devtools-root\", \"\");\n root.style.position = \"fixed\";\n root.style.zIndex = \"2147483647\";\n root.style.bottom = \"16px\";\n root.style.right = options.position === \"bottom-right\" ? \"16px\" : \"auto\";\n root.style.left = options.position === \"bottom-left\" ? \"16px\" : \"auto\";\n root.style.fontFamily = \"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif\";\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = \"Elur DevTools\";\n button.setAttribute(\"data-elur-devtools-button\", \"\");\n button.style.background = \"#111827\";\n button.style.color = \"#f9fafb\";\n button.style.border = \"1px solid #374151\";\n button.style.borderRadius = \"999px\";\n button.style.padding = \"8px 12px\";\n button.style.cursor = \"pointer\";\n button.style.boxShadow = \"0 6px 18px rgba(0,0,0,.3)\";\n\n const panel = document.createElement(\"div\");\n panel.setAttribute(\"data-elur-devtools-panel\", \"\");\n panel.style.marginTop = \"8px\";\n panel.style.width = \"460px\";\n panel.style.maxWidth = \"min(92vw, 460px)\";\n panel.style.background = \"#15151b\";\n panel.style.color = \"#e5e7eb\";\n panel.style.border = \"1px solid #2f2f35\";\n panel.style.borderRadius = \"12px\";\n panel.style.padding = \"10px\";\n panel.style.display = \"none\";\n panel.style.boxShadow = \"0 14px 28px rgba(0,0,0,.35)\";\n\n const tabs = document.createElement(\"div\");\n tabs.style.display = \"flex\";\n tabs.style.gap = \"6px\";\n tabs.style.marginBottom = \"10px\";\n\n const content = document.createElement(\"div\");\n content.setAttribute(\"data-elur-devtools-content\", \"\");\n\n const makeTab = (name: _DevToolsTab, label: string): HTMLButtonElement => {\n const t = document.createElement(\"button\");\n t.type = \"button\";\n t.textContent = label;\n t.setAttribute(\"data-elur-devtools-tab\", name);\n t.style.border = \"1px solid #353543\";\n t.style.borderRadius = \"8px\";\n t.style.padding = \"6px 9px\";\n t.style.background = \"#1f1f24\";\n t.style.color = \"#d1d5db\";\n t.style.cursor = \"pointer\";\n t.addEventListener(\"click\", () => {\n _state.activeTab = name;\n _syncTabButtons();\n _refreshPanel(true);\n });\n return t;\n };\n\n tabs.appendChild(makeTab(\"signals\", \"Signals\"));\n tabs.appendChild(makeTab(\"components\", \"Components\"));\n tabs.appendChild(makeTab(\"router\", \"Router\"));\n\n button.addEventListener(\"click\", () => {\n panel.style.display = panel.style.display === \"none\" ? \"block\" : \"none\";\n if (panel.style.display === \"block\") {\n _syncTabButtons();\n _refreshPanel(true);\n }\n });\n\n panel.appendChild(tabs);\n panel.appendChild(content);\n root.appendChild(button);\n root.appendChild(panel);\n document.body.appendChild(root);\n\n _state.root = root;\n _state.panel = panel;\n _state.content = content;\n}\n\nexport function disableDevTools(): void {\n if (!_state.enabled) return;\n _state.enabled = false;\n\n if (_state.refreshId != null) {\n clearInterval(_state.refreshId);\n _state.refreshId = null;\n }\n\n _setSignalDebugHooks(null);\n _setComponentDebugHooks(null);\n _resetDevtoolsStores();\n\n if (_state.root?.parentNode) {\n _state.root.parentNode.removeChild(_state.root);\n }\n\n _state.root = null;\n _state.panel = null;\n _state.content = null;\n _state.dispose = null;\n _state.renderedTab = null;\n _state.renderKeys = { signals: \"\", components: \"\", router: \"\" };\n _state.scrollMemo = {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n };\n}\n\nexport function enableDevTools(options: DevToolsOptions = {}): { disable: () => void } {\n if (typeof document === \"undefined\") {\n return { disable: () => undefined };\n }\n\n if (_state.enabled && _state.dispose) {\n return { disable: _state.dispose };\n }\n\n const refreshMs = Math.max(100, options.refreshMs ?? 350);\n _signalHistoryLimit = Math.max(1, options.historyLimit ?? 50);\n const position = options.position ?? \"bottom-right\";\n\n _state.enabled = true;\n _state.activeTab = \"signals\";\n\n // Apply the new limit to histories that were already created before enableDevTools.\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n const meta = _signalMeta.get(s);\n if (meta) _trimSignalHistory(meta);\n }\n\n _setSignalDebugHooks({\n onCreate(signal, initialValue) {\n _ensureSignalMeta(signal, initialValue);\n },\n onWrite(signal, value) {\n const meta = _ensureSignalMeta(signal, value);\n const now = Date.now();\n meta.lastUpdated = now;\n meta.history.push({ at: now, value });\n _trimSignalHistory(meta);\n },\n });\n\n _setComponentDebugHooks({\n onMountStart(inst) {\n let id = _componentIds.get(inst);\n if (id == null) {\n id = _componentSeq++;\n _componentIds.set(inst, id);\n }\n\n const parentId = _componentMountStack.length > 0\n ? _componentMountStack[_componentMountStack.length - 1]\n : null;\n\n _componentMounted.set(id, {\n id,\n parentId,\n debugName: _componentName(inst),\n mountedAt: Date.now(),\n hasDefaultSlot: inst.children != null,\n slotNames: _componentSlotNames(inst),\n props: _componentProps(inst),\n ref: _makeComponentRef(inst),\n });\n\n _componentMountStack.push(id);\n },\n onMountEnd(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n const entry = _componentMounted.get(id);\n if (entry) {\n entry.debugName = _componentName(inst);\n entry.hasDefaultSlot = inst.children != null;\n entry.slotNames = _componentSlotNames(inst);\n entry.props = _componentProps(inst);\n }\n\n if (_componentMountStack[_componentMountStack.length - 1] === id) {\n _componentMountStack.pop();\n return;\n }\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n onUnmount(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n _removeMountedComponentSubtree(id);\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n });\n\n _createOverlay({ position });\n\n _state.refreshId = setInterval(() => {\n if (_state.panel?.style.display === \"block\") {\n _refreshPanel();\n }\n }, refreshMs);\n\n if (options.initiallyOpen && _state.panel) {\n _state.panel.style.display = \"block\";\n _syncTabButtons();\n _refreshPanel(true);\n }\n\n const dispose = () => disableDevTools();\n _state.dispose = dispose;\n return { disable: dispose };\n}\n"],"mappings":";;;;AAgCA,IAAM,IAAyB;CAC3B,SAAS;CACT,WAAW;CACX,aAAa;CACb,WAAW;CACX,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,YAAY;EAAE,SAAS;EAAI,YAAY;EAAI,QAAQ;EAAI;CACvD,YAAY;EACR,SAAS;GAAE,KAAK;GAAG,MAAM;GAAG;EAC5B,YAAY;GAAE,KAAK;GAAG,MAAM;GAAG;EAC/B,QAAQ;GAAE,KAAK;GAAG,MAAM;GAAG;EAC9B;CACJ,EAoCK,oBAAc,IAAI,KAAiB,EACrC,oBAAc,IAAI,SAAmC,EACrD,IAAa,GACb,IAAsB,IAEtB,oBAAgB,IAAI,SAAgC,EAClD,oBAAoB,IAAI,KAA+B,EACvD,IAAiC,EAAE,EACrC,IAAgB;AAEpB,SAAS,EAAkB,GAA0B;AAEjD,QADI,OAAO,UAAY,MAAoB,IAAI,QAAQ,EAAE,GAClD,EAAE,aAAa,GAAG;;AAG7B,SAAS,EAAkB,GAAoC;AAE3D,QADI,OAAO,UAAY,MAAoB,IAAI,QAAQ,EAAK,GACrD,EAAE,aAAa,GAAM;;AAGhC,SAAS,EAAmB,GAAyB;AACjD,CAAI,EAAK,QAAQ,SAAS,KACtB,EAAK,QAAQ,OAAO,GAAG,EAAK,QAAQ,SAAS,EAAoB;;AAIzE,SAAS,EAAqB,GAAc,GAA8B;CACtE,IAAM,IAAW,EAAY,IAAI,EAAE;AACnC,KAAI,EAEA,QADA,EAAmB,EAAS,EACrB;CAGX,IAA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AAI,EAAK;AAClC,OAAI,KAAM,KAAM;AAEhB,KAA+B,EAAG;GAElC,IAAM,IAAM,EAAqB,YAAY,EAAG;AAChD,GAAI,KAAO,KAAG,EAAqB,OAAO,GAAK,EAAE;;EAExD,CAAC,EAEF,EAAe,EAAE,aAAU,CAAC,EAE5B,EAAO,YAAY,kBAAkB;AACjC,EAAI,EAAO,OAAO,MAAM,YAAY,WAChC,GAAe;IAEpB,EAAU,EAET,EAAQ,iBAAiB,EAAO,UAChC,EAAO,MAAM,MAAM,UAAU,SAC7B,GAAiB,EACjB,EAAc,GAAK;CAGvB,IAAM,UAAgB,GAAiB;AAEvC,QADA,EAAO,UAAU,GACV,EAAE,SAAS,GAAS"}
1
+ {"version":3,"file":"devtools.js","names":[],"sources":["../../src/elur/devtools.ts"],"sourcesContent":["import { _debugGetRouterInternal } from \"./router.js\";\nimport {\n _setComponentDebugHooks,\n type ElurComponent,\n} from \"./lifecycle.js\";\nimport {\n _setSignalDebugHooks,\n type Signal,\n} from \"./reactivity.js\";\n\nexport interface DevToolsOptions {\n refreshMs?: number;\n historyLimit?: number;\n initiallyOpen?: boolean;\n position?: \"bottom-right\" | \"bottom-left\";\n}\n\ntype _DevToolsTab = \"signals\" | \"components\" | \"router\";\n\ninterface _DevToolsState {\n enabled: boolean;\n activeTab: _DevToolsTab;\n renderedTab: _DevToolsTab | null;\n refreshId: ReturnType<typeof setInterval> | null;\n root: HTMLDivElement | null;\n panel: HTMLDivElement | null;\n content: HTMLDivElement | null;\n dispose: (() => void) | null;\n renderKeys: Record<_DevToolsTab, string>;\n scrollMemo: Record<_DevToolsTab, { top: number; left: number }>;\n}\n\nconst _state: _DevToolsState = {\n enabled: false,\n activeTab: \"signals\",\n renderedTab: null,\n refreshId: null,\n root: null,\n panel: null,\n content: null,\n dispose: null,\n renderKeys: { signals: \"\", components: \"\", router: \"\" },\n scrollMemo: {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n },\n};\n\ntype _SignalRef = { deref(): Signal<any> | undefined };\n\ninterface _SignalMeta {\n id: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _SignalSnapshot {\n id: number;\n value: unknown;\n subscriberCount: number;\n createdAt: number;\n lastUpdated: number;\n history: Array<{ at: number; value: unknown }>;\n}\n\ninterface _ComponentSnapshot {\n id: number;\n parentId: number | null;\n debugName: string;\n mountedAt: number;\n hasDefaultSlot: boolean;\n slotNames: string[];\n props: Record<string, unknown>;\n}\n\ninterface _ComponentRecord extends _ComponentSnapshot {\n ref: _ComponentRef;\n}\n\ntype _ComponentRef = { deref(): ElurComponent | undefined };\n\nconst _signalRefs = new Set<_SignalRef>();\nlet _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\nlet _signalSeq = 1;\nlet _signalHistoryLimit = 50;\n\nlet _componentIds = new WeakMap<ElurComponent, number>();\nconst _componentMounted = new Map<number, _ComponentRecord>();\nconst _componentMountStack: number[] = [];\nlet _componentSeq = 1;\n\nfunction _makeSignalRef<T>(s: Signal<T>): _SignalRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(s) as _SignalRef;\n return { deref: () => s };\n}\n\nfunction _makeComponentRef(inst: ElurComponent): _ComponentRef {\n if (typeof WeakRef !== \"undefined\") return new WeakRef(inst) as _ComponentRef;\n return { deref: () => inst };\n}\n\nfunction _trimSignalHistory(meta: _SignalMeta): void {\n if (meta.history.length > _signalHistoryLimit) {\n meta.history.splice(0, meta.history.length - _signalHistoryLimit);\n }\n}\n\nfunction _ensureSignalMeta<T>(s: Signal<T>, initialValue: T): _SignalMeta {\n const existing = _signalMeta.get(s);\n if (existing) {\n _trimSignalHistory(existing);\n return existing;\n }\n\n const now = Date.now();\n const meta: _SignalMeta = {\n id: _signalSeq++,\n createdAt: now,\n lastUpdated: now,\n history: [{ at: now, value: initialValue }],\n };\n _signalMeta.set(s, meta);\n _signalRefs.add(_makeSignalRef(s));\n return meta;\n}\n\n/** @internal Exported for testing. */\nexport function _listSignals(): _SignalSnapshot[] {\n const out: _SignalSnapshot[] = [];\n\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n\n const meta = _signalMeta.get(s);\n if (!meta) continue;\n\n const subCount = (s as unknown as { _subs?: Set<() => void> })._subs?.size ?? 0;\n\n out.push({\n id: meta.id,\n value: s.peek(),\n subscriberCount: subCount,\n createdAt: meta.createdAt,\n lastUpdated: meta.lastUpdated,\n history: meta.history.slice(),\n });\n }\n\n out.sort((a, b) => b.lastUpdated - a.lastUpdated);\n return out;\n}\n\nfunction _componentName(inst: ElurComponent): string {\n const maybeDebugName = (inst as { _debugName?: string })._debugName;\n if (maybeDebugName && maybeDebugName.trim()) return maybeDebugName;\n const ctor = (inst as { constructor?: { name?: string } }).constructor;\n return ctor?.name && ctor.name.trim() ? ctor.name : \"AnonymousComponent\";\n}\n\nfunction _componentSlotNames(inst: ElurComponent): string[] {\n const slots = (inst as unknown as { _slots?: unknown })._slots;\n if (!(slots instanceof Map)) return [];\n return Array.from(slots.keys()).map((k) => String(k));\n}\n\nfunction _componentProps(inst: ElurComponent): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(inst as unknown as Record<string, unknown>)) {\n if (\n key === \"__isElurComponent\" ||\n key === \"children\" ||\n key === \"_debugName\" ||\n key.startsWith(\"_\")\n ) {\n continue;\n }\n const value = (inst as unknown as Record<string, unknown>)[key];\n if (typeof value === \"function\") continue;\n out[key] = value;\n }\n return out;\n}\n\nfunction _mountPathChain(fullPath: string | null): string[] {\n if (!fullPath) return [];\n if (fullPath === \"*\") return [\"*\"];\n\n const parts = fullPath.split(\"/\").filter(Boolean);\n const out: string[] = [];\n let cur = \"\";\n for (const part of parts) {\n cur += \"/\" + part;\n out.push(cur);\n }\n return out.length > 0 ? out : [\"/\"];\n}\n\nfunction _listMountedComponents(): _ComponentSnapshot[] {\n const out: _ComponentSnapshot[] = [];\n\n for (const [id, item] of _componentMounted) {\n const inst = item.ref.deref();\n if (!inst) {\n _componentMounted.delete(id);\n continue;\n }\n\n // Keep rows fresh while panel is open (debug name/props can change after mount).\n item.debugName = _componentName(inst);\n item.hasDefaultSlot = inst.children != null;\n item.slotNames = _componentSlotNames(inst);\n item.props = _componentProps(inst);\n\n out.push({\n id: item.id,\n parentId: item.parentId,\n debugName: item.debugName,\n mountedAt: item.mountedAt,\n hasDefaultSlot: item.hasDefaultSlot,\n slotNames: [...item.slotNames],\n props: { ...item.props },\n });\n }\n\n out.sort((a, b) => a.id - b.id);\n return out;\n}\n\nfunction _removeMountedComponentSubtree(rootId: number): void {\n const pending = [rootId];\n while (pending.length > 0) {\n const current = pending.pop()!;\n for (const [id, record] of _componentMounted) {\n if (record.parentId === current) pending.push(id);\n }\n _componentMounted.delete(current);\n }\n}\n\nfunction _resetDevtoolsStores(): void {\n _signalRefs.clear();\n _signalMeta = new WeakMap<Signal<any>, _SignalMeta>();\n _signalSeq = 1;\n\n _componentIds = new WeakMap<ElurComponent, number>();\n _componentMounted.clear();\n _componentMountStack.length = 0;\n _componentSeq = 1;\n}\n\nfunction _safeStringify(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n}\n\nfunction _escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\\\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n\nfunction _valuePreview(value: unknown, max = 90): string {\n const raw = _safeStringify(value);\n if (raw.length <= max) return raw;\n return raw.slice(0, max - 1) + \"…\";\n}\n\nfunction _relativeTime(ts: number): string {\n if (!ts) return \"-\";\n const diff = Date.now() - ts;\n if (diff < 1000) return `${diff}ms ago`;\n if (diff < 60_000) return `${Math.floor(diff / 1000)}s ago`;\n return `${Math.floor(diff / 60_000)}m ago`;\n}\n\nfunction _renderSignals(target: HTMLDivElement): void {\n const signals = _listSignals();\n const key = `${signals.length}:${signals.map((s) => `${s.id}-${s.lastUpdated}-${s.subscriberCount}`).join(\"|\")}`;\n if (_state.renderedTab === \"signals\" && _state.renderKeys.signals === key) return;\n _state.renderKeys.signals = key;\n _state.renderedTab = \"signals\";\n\n const rows = signals\n .map((s) => {\n const fullValue = _safeStringify(s.value);\n const preview = _valuePreview(s.value, 120);\n return `<tr data-elur-devtools-signal-id=\"${s.id}\">\n <td style=\"padding:6px 8px;white-space:nowrap;\">${s.id}</td>\n <td style=\"padding:6px 8px;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;\" title=\"${_escapeHtml(fullValue)}\">${_escapeHtml(preview)}</td>\n <td>${s.subscriberCount}</td>\n <td data-elur-devtools-history-count=\"${s.history.length}\">${s.history.length}</td>\n <td>${_relativeTime(s.lastUpdated)}</td>\n </tr>`;\n })\n .join(\"\");\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Signals</strong>\n <span style=\"opacity:.8\">${signals.length} active</span>\n </div>\n <div data-elur-devtools-scroll=\"signals\" style=\"max-height:260px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n <table style=\"width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;\">\n <thead>\n <tr style=\"background:#1f1f24;\">\n <th style=\"text-align:left;padding:6px 8px;width:42px;\">ID</th>\n <th style=\"text-align:left;padding:6px 8px;\">Value</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">Subs</th>\n <th style=\"text-align:left;padding:6px 8px;width:50px;\">History</th>\n <th style=\"text-align:left;padding:6px 8px;width:84px;\">Updated</th>\n </tr>\n </thead>\n <tbody>${rows}</tbody>\n </table>\n </div>\n <p style=\"margin:8px 0 0 0;font-size:11px;opacity:.75;\">Click a row to log full history in console.</p>\n `;\n\n for (const row of target.querySelectorAll<HTMLTableRowElement>(\"tr[data-elur-devtools-signal-id]\")) {\n row.style.cursor = \"pointer\";\n row.addEventListener(\"click\", () => {\n const id = Number(row.dataset.elurDevtoolsSignalId);\n const signal = signals.find((s) => s.id === id);\n if (!signal) return;\n console.group(`[Elur DevTools] Signal #${signal.id}`);\n console.log(\"Current value:\", signal.value);\n console.log(\"Subscribers:\", signal.subscriberCount);\n console.table(signal.history.map((h) => ({ at: new Date(h.at).toISOString(), value: h.value })));\n console.groupEnd();\n });\n }\n}\n\ninterface _TreeNode extends _ComponentSnapshot {\n children: _TreeNode[];\n}\n\nfunction _buildComponentTree(rows: _ComponentSnapshot[]): _TreeNode[] {\n const byId = new Map<number, _TreeNode>();\n const roots: _TreeNode[] = [];\n\n for (const row of rows) {\n byId.set(row.id, { ...row, children: [] });\n }\n\n for (const node of byId.values()) {\n if (node.parentId == null) {\n roots.push(node);\n continue;\n }\n const parent = byId.get(node.parentId);\n if (!parent) {\n roots.push(node);\n continue;\n }\n parent.children.push(node);\n }\n\n return roots;\n}\n\nfunction _renderTreeNode(node: _TreeNode, depth: number): string {\n const pad = 10 + depth * 14;\n const props = Object.keys(node.props).length > 0 ? _safeStringify(node.props) : \"{}\";\n const slots = node.slotNames.length > 0 ? node.slotNames.join(\", \") : \"none\";\n\n const header = `<div style=\"padding:6px 8px 6px ${pad}px;border-bottom:1px solid #24242b;\">\n <div><strong>${_escapeHtml(node.debugName)}</strong> <span style=\"opacity:.7\">#${node.id}</span></div>\n <div style=\"font-size:11px;opacity:.8;\">slots: ${slots} | default-slot: ${node.hasDefaultSlot ? \"yes\" : \"no\"}</div>\n <div style=\"font-size:11px;opacity:.8;\">props: ${_escapeHtml(_valuePreview(props, 180))}</div>\n </div>`;\n\n return header + node.children.map((c) => _renderTreeNode(c, depth + 1)).join(\"\");\n}\n\nfunction _renderComponents(target: HTMLDivElement): void {\n const rows = _listMountedComponents();\n const router = _debugGetRouterInternal();\n const routeKey = router ? `${router.currentPath}|${router.matchedPath ?? \"\"}` : \"no-router\";\n const key = `${routeKey}:${rows.length}:${rows.map((r) => `${r.id}-${r.parentId}-${r.debugName}-${r.hasDefaultSlot}-${r.slotNames.join(\",\")}-${_safeStringify(r.props)}`).join(\"|\")}`;\n if (_state.renderedTab === \"components\" && _state.renderKeys.components === key) return;\n _state.renderKeys.components = key;\n _state.renderedTab = \"components\";\n\n const roots = _buildComponentTree(rows);\n\n target.innerHTML = `\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;\">\n <strong>Component Tree</strong>\n <span style=\"opacity:.8\">${rows.length} mounted</span>\n </div>\n <div style=\"font-size:11px;opacity:.82;margin-bottom:8px;display:flex;gap:8px;flex-wrap:wrap;\">\n <span><b>current:</b> ${_escapeHtml(router?.currentPath ?? \"-\")}</span>\n <span><b>matched:</b> ${_escapeHtml(router?.matchedPath ?? \"none\")}</span>\n </div>\n <div data-elur-devtools-scroll=\"components\" style=\"max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;\">\n ${roots.length > 0\n ? roots.map((r) => _renderTreeNode(r, 0)).join(\"\")\n : \"<div style='padding:10px;opacity:.75'>No mounted components tracked. Enable devtools before your first mount() to capture initial tree.</div>\"}\n </div>\n `;\n}\n\nfunction _renderRouter(target: HTMLDivElement): void {\n const router = _debugGetRouterInternal();\n const key = router\n ? `${router.mode}|${router.base}|${router.currentPath}|${JSON.stringify(router.params)}|${JSON.stringify(router.query)}|${router.matchedPath}|${router.activeGuards.names.join(\",\")}`\n : \"none\";\n if (_state.renderedTab === \"router\" && _state.renderKeys.router === key) return;\n _state.renderKeys.router = key;\n _state.renderedTab = \"router\";\n\n if (!router) {\n target.innerHTML = `\n <strong>Router State</strong>\n <div style=\"margin-top:8px;opacity:.75\">No active Elur router instance. Ensure your app uses createRouter()/RouterView from @elurjs/core/router.</div>\n `;\n return;\n }\n\n const chain = _mountPathChain(router.matchedPath);\n target.innerHTML = `\n <strong>Router State</strong>\n <div data-elur-devtools-scroll=\"router\" style=\"margin-top:8px;font-size:12px;line-height:1.55;max-height:280px;overflow:auto;overscroll-behavior:contain;border:1px solid #2f2f35;border-radius:8px;padding:8px;\">\n <div><b>mode</b>: ${router.mode}</div>\n <div><b>base</b>: ${router.base}</div>\n <div><b>current</b>: ${_escapeHtml(router.currentPath)}</div>\n <div><b>params</b>: ${_escapeHtml(_safeStringify(router.params))}</div>\n <div><b>query</b>: ${_escapeHtml(_safeStringify(router.query))}</div>\n <div><b>matched</b>: ${_escapeHtml(router.matchedPath ?? \"none\")}</div>\n <div><b>matched chain</b>: ${chain.length > 0 ? _escapeHtml(chain.join(\" -> \")) : \"none\"}</div>\n <div><b>guards</b>: ${router.activeGuards.names.length > 0 ? _escapeHtml(router.activeGuards.names.join(\", \")) : \"none\"}</div>\n </div>\n `;\n}\n\nfunction _rememberScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n}\n\nfunction _restoreScroll(tab: _DevToolsTab): void {\n if (!_state.content) return;\n const box = _state.content.querySelector<HTMLElement>(`[data-elur-devtools-scroll='${tab}']`);\n if (!box) return;\n const memo = _state.scrollMemo[tab];\n box.scrollTop = memo.top;\n box.scrollLeft = memo.left;\n if (box.dataset.elurDevtoolsScrollBound !== \"1\") {\n box.addEventListener(\"scroll\", () => {\n _state.scrollMemo[tab] = { top: box.scrollTop, left: box.scrollLeft };\n }, { passive: true });\n box.dataset.elurDevtoolsScrollBound = \"1\";\n }\n}\n\nfunction _refreshPanel(force = false): void {\n if (!_state.content) return;\n\n const tab = _state.activeTab;\n if (!force) _rememberScroll(tab);\n\n if (_state.activeTab === \"signals\") {\n _renderSignals(_state.content);\n _restoreScroll(\"signals\");\n return;\n }\n if (_state.activeTab === \"components\") {\n _renderComponents(_state.content);\n _restoreScroll(\"components\");\n return;\n }\n _renderRouter(_state.content);\n _restoreScroll(\"router\");\n}\n\nfunction _syncTabButtons(): void {\n if (!_state.panel) return;\n for (const btn of _state.panel.querySelectorAll<HTMLButtonElement>(\"button[data-elur-devtools-tab]\")) {\n const isActive = btn.dataset.elurDevtoolsTab === _state.activeTab;\n btn.style.background = isActive ? \"#2d4c7a\" : \"#1f1f24\";\n }\n}\n\nfunction _createOverlay(options: Required<Pick<DevToolsOptions, \"position\">>): void {\n const root = document.createElement(\"div\");\n root.setAttribute(\"data-elur-devtools-root\", \"\");\n root.style.position = \"fixed\";\n root.style.zIndex = \"2147483647\";\n root.style.bottom = \"16px\";\n root.style.right = options.position === \"bottom-right\" ? \"16px\" : \"auto\";\n root.style.left = options.position === \"bottom-left\" ? \"16px\" : \"auto\";\n root.style.fontFamily = \"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif\";\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = \"Elur DevTools\";\n button.setAttribute(\"data-elur-devtools-button\", \"\");\n button.style.background = \"#111827\";\n button.style.color = \"#f9fafb\";\n button.style.border = \"1px solid #374151\";\n button.style.borderRadius = \"999px\";\n button.style.padding = \"8px 12px\";\n button.style.cursor = \"pointer\";\n button.style.boxShadow = \"0 6px 18px rgba(0,0,0,.3)\";\n\n const panel = document.createElement(\"div\");\n panel.setAttribute(\"data-elur-devtools-panel\", \"\");\n panel.style.marginTop = \"8px\";\n panel.style.width = \"460px\";\n panel.style.maxWidth = \"min(92vw, 460px)\";\n panel.style.background = \"#15151b\";\n panel.style.color = \"#e5e7eb\";\n panel.style.border = \"1px solid #2f2f35\";\n panel.style.borderRadius = \"12px\";\n panel.style.padding = \"10px\";\n panel.style.display = \"none\";\n panel.style.boxShadow = \"0 14px 28px rgba(0,0,0,.35)\";\n\n const tabs = document.createElement(\"div\");\n tabs.style.display = \"flex\";\n tabs.style.gap = \"6px\";\n tabs.style.marginBottom = \"10px\";\n\n const content = document.createElement(\"div\");\n content.setAttribute(\"data-elur-devtools-content\", \"\");\n\n const makeTab = (name: _DevToolsTab, label: string): HTMLButtonElement => {\n const t = document.createElement(\"button\");\n t.type = \"button\";\n t.textContent = label;\n t.setAttribute(\"data-elur-devtools-tab\", name);\n t.style.border = \"1px solid #353543\";\n t.style.borderRadius = \"8px\";\n t.style.padding = \"6px 9px\";\n t.style.background = \"#1f1f24\";\n t.style.color = \"#d1d5db\";\n t.style.cursor = \"pointer\";\n t.addEventListener(\"click\", () => {\n _state.activeTab = name;\n _syncTabButtons();\n _refreshPanel(true);\n });\n return t;\n };\n\n tabs.appendChild(makeTab(\"signals\", \"Signals\"));\n tabs.appendChild(makeTab(\"components\", \"Components\"));\n tabs.appendChild(makeTab(\"router\", \"Router\"));\n\n button.addEventListener(\"click\", () => {\n panel.style.display = panel.style.display === \"none\" ? \"block\" : \"none\";\n if (panel.style.display === \"block\") {\n _syncTabButtons();\n _refreshPanel(true);\n }\n });\n\n panel.appendChild(tabs);\n panel.appendChild(content);\n root.appendChild(button);\n root.appendChild(panel);\n document.body.appendChild(root);\n\n _state.root = root;\n _state.panel = panel;\n _state.content = content;\n}\n\nexport function disableDevTools(): void {\n if (!_state.enabled) return;\n _state.enabled = false;\n\n if (_state.refreshId != null) {\n clearInterval(_state.refreshId);\n _state.refreshId = null;\n }\n\n _setSignalDebugHooks(null);\n _setComponentDebugHooks(null);\n _resetDevtoolsStores();\n\n if (_state.root?.parentNode) {\n _state.root.parentNode.removeChild(_state.root);\n }\n\n _state.root = null;\n _state.panel = null;\n _state.content = null;\n _state.dispose = null;\n _state.renderedTab = null;\n _state.renderKeys = { signals: \"\", components: \"\", router: \"\" };\n _state.scrollMemo = {\n signals: { top: 0, left: 0 },\n components: { top: 0, left: 0 },\n router: { top: 0, left: 0 },\n };\n}\n\nexport function enableDevTools(options: DevToolsOptions = {}): { disable: () => void } {\n if (typeof document === \"undefined\") {\n return { disable: () => undefined };\n }\n\n if (_state.enabled && _state.dispose) {\n return { disable: _state.dispose };\n }\n\n const refreshMs = Math.max(100, options.refreshMs ?? 350);\n _signalHistoryLimit = Math.max(1, options.historyLimit ?? 50);\n const position = options.position ?? \"bottom-right\";\n\n _state.enabled = true;\n _state.activeTab = \"signals\";\n\n // Apply the new limit to histories that were already created before enableDevTools.\n for (const ref of Array.from(_signalRefs)) {\n const s = ref.deref();\n if (!s) {\n _signalRefs.delete(ref);\n continue;\n }\n const meta = _signalMeta.get(s);\n if (meta) _trimSignalHistory(meta);\n }\n\n _setSignalDebugHooks({\n onCreate(signal, initialValue) {\n _ensureSignalMeta(signal, initialValue);\n },\n onWrite(signal, value) {\n const meta = _ensureSignalMeta(signal, value);\n const now = Date.now();\n meta.lastUpdated = now;\n meta.history.push({ at: now, value });\n _trimSignalHistory(meta);\n },\n });\n\n _setComponentDebugHooks({\n onMountStart(inst) {\n let id = _componentIds.get(inst);\n if (id == null) {\n id = _componentSeq++;\n _componentIds.set(inst, id);\n }\n\n const parentId = _componentMountStack.length > 0\n ? _componentMountStack[_componentMountStack.length - 1]\n : null;\n\n _componentMounted.set(id, {\n id,\n parentId,\n debugName: _componentName(inst),\n mountedAt: Date.now(),\n hasDefaultSlot: inst.children != null,\n slotNames: _componentSlotNames(inst),\n props: _componentProps(inst),\n ref: _makeComponentRef(inst),\n });\n\n _componentMountStack.push(id);\n },\n onMountEnd(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n const entry = _componentMounted.get(id);\n if (entry) {\n entry.debugName = _componentName(inst);\n entry.hasDefaultSlot = inst.children != null;\n entry.slotNames = _componentSlotNames(inst);\n entry.props = _componentProps(inst);\n }\n\n if (_componentMountStack[_componentMountStack.length - 1] === id) {\n _componentMountStack.pop();\n return;\n }\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n onUnmount(inst) {\n const id = _componentIds.get(inst);\n if (id == null) return;\n\n _removeMountedComponentSubtree(id);\n\n const idx = _componentMountStack.lastIndexOf(id);\n if (idx >= 0) _componentMountStack.splice(idx, 1);\n },\n });\n\n _createOverlay({ position });\n\n _state.refreshId = setInterval(() => {\n if (_state.panel?.style.display === \"block\") {\n _refreshPanel();\n }\n }, refreshMs);\n\n if (options.initiallyOpen && _state.panel) {\n _state.panel.style.display = \"block\";\n _syncTabButtons();\n _refreshPanel(true);\n }\n\n const dispose = () => disableDevTools();\n _state.dispose = dispose;\n return { disable: dispose };\n}\n"],"mappings":";;;;AAgCA,IAAM,IAAyB;CAC3B,SAAS;CACT,WAAW;CACX,aAAa;CACb,WAAW;CACX,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,YAAY;EAAE,SAAS;EAAI,YAAY;EAAI,QAAQ;EAAI;CACvD,YAAY;EACR,SAAS;GAAE,KAAK;GAAG,MAAM;GAAG;EAC5B,YAAY;GAAE,KAAK;GAAG,MAAM;GAAG;EAC/B,QAAQ;GAAE,KAAK;GAAG,MAAM;GAAG;EAC9B;CACJ,EAoCK,oBAAc,IAAI,KAAiB,EACrC,oBAAc,IAAI,SAAmC,EACrD,IAAa,GACb,IAAsB,IAEtB,oBAAgB,IAAI,SAAgC,EAClD,oBAAoB,IAAI,KAA+B,EACvD,IAAiC,EAAE,EACrC,IAAgB;AAEpB,SAAS,EAAkB,GAA0B;AAEjD,QADI,OAAO,UAAY,MAAoB,IAAI,QAAQ,EAAE,GAClD,EAAE,aAAa,GAAG;;AAG7B,SAAS,EAAkB,GAAoC;AAE3D,QADI,OAAO,UAAY,MAAoB,IAAI,QAAQ,EAAK,GACrD,EAAE,aAAa,GAAM;;AAGhC,SAAS,EAAmB,GAAyB;AACjD,CAAI,EAAK,QAAQ,SAAS,KACtB,EAAK,QAAQ,OAAO,GAAG,EAAK,QAAQ,SAAS,EAAoB;;AAIzE,SAAS,EAAqB,GAAc,GAA8B;CACtE,IAAM,IAAW,EAAY,IAAI,EAAE;AACnC,KAAI,EAEA,QADA,EAAmB,EAAS,EACrB;CAGX,IA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